Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP]: Use hamming window function #51

Merged
merged 11 commits into from Feb 10, 2016
Merged

[WIP]: Use hamming window function #51

merged 11 commits into from Feb 10, 2016

Conversation

dmsurti
Copy link
Contributor

@dmsurti dmsurti commented Feb 8, 2016

This provides the hamming windowed sinc interpolation method for image data

TBD

  • Refactor

@dmsurti
Copy link
Contributor Author

dmsurti commented Feb 8, 2016

The test fails as Travis uses VTK 5.8 which does not have the `ImageSincInterpolator'.

@jwiggins
Copy link
Member

jwiggins commented Feb 8, 2016

Aside from the test failure, LGTM

@dmsurti dmsurti force-pushed the add-hamming-function branch 3 times, most recently from d435a0c to 793bc5d Compare February 9, 2016 09:05
@dmsurti
Copy link
Contributor Author

dmsurti commented Feb 9, 2016

@jwiggins Thanks for reviewing. But I had misunderstood the requirement (might be 🎱 effect), which was to change the gaussian function in gaussian_function_component.GaussianOpacityNode.

@dmsurti dmsurti changed the title Use hamming window function intepolator [WIP]: Use hamming window function intepolator Feb 9, 2016
@dmsurti dmsurti changed the title [WIP]: Use hamming window function intepolator [WIP]: Use hamming window function Feb 9, 2016
@jwiggins
Copy link
Member

jwiggins commented Feb 9, 2016

Oh... Yes, that's something else entirely. I'm happy to review that change when it comes. I'm the guilty party that wrote it 😅

@@ -18,7 +18,7 @@
POINTER_MAP = {'move': 'hand', 'resize': 'size left'}
MIN_GAUSSIAN_STD = 2.0
GAUSSIAN_RADIUS_STD_SCALE = 50.0
MAX_GAUSSIAN_NUM_SAMPLES = 256
MAX_NUM_SAMPLES = 256
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like MIN_GAUSSIAN_STD and GAUSSIAN_RADIUS_STD_SCALE can be removed now, no?

@jwiggins
Copy link
Member

jwiggins commented Feb 9, 2016

Just noticed that you pushed those changes to this PR... Other than the orphaned constants, LGTM!

MIN_GAUSSIAN_STD = 2.0
GAUSSIAN_RADIUS_STD_SCALE = 50.0
MAX_GAUSSIAN_NUM_SAMPLES = 256
MAX_NUM_SAMPLES = 256
GAUSSIAN_MINIMUM_RADIUS = 0.03
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a smaller minimum radius. If the radius is too small I get weird behavior. Making this 0.005 seems to work fine

@noraderam
Copy link
Contributor

@dmsurti As you mentioned in the discussion elsewhere, the naming needs an update. Gaussian is obviously no longer applicable. Because it's so easy to swap out different window functions, I think it would be better to use a name that isn't specific to the implementation. That would also lay the groundwork for different types of windows in the future.

One piece of feedback that we got was that Add Gaussian... was not enough information for the user; when the other options are Add Color... and Add Opacity, it's not clear that the Gaussian adds both color and opacity. In light of that, perhaps we could name the action Add Color/Opacity Window and rename everything that calls itself Gaussian -> Window

@jwiggins, any opinions about the naming?

@jwiggins
Copy link
Member

jwiggins commented Feb 9, 2016

Yeah... Window is pretty good. Or maybe Block?

PS: Your patriotically-numbered private issue is leaking into this public repo 😉

@noraderam
Copy link
Contributor

😇 Nothing to see here...

@noraderam
Copy link
Contributor

Block has the advantage of being less overloaded than Window. @brendonhall, what do you think?

@brendonhall
Copy link

Both Block and Window could work. Semantically, a windows lets you see things that are behind it, whereas blocking something does the opposite.

@jwiggins
Copy link
Member

jwiggins commented Feb 9, 2016

Just go with Window before this discussion goes full 🚲 shed.

@dmsurti dmsurti changed the title [WIP]: Use hamming window function Use hamming window function Feb 10, 2016
@jwiggins
Copy link
Member

Lots of renaming... LGTM.

@noraderam
Copy link
Contributor

All of the changes look good. I did notice one strange thing when testing out the new window with the examples/ctf_demo.py script.

On master, the Gaussian window ends at 0, with the rest of the transfer function flat to the endpoints
screen shot 2016-02-10 at 7 55 44 am

It looks like the Hamming window ends at a higher value, giving an unexpected curve to the resulting transfer function.
screen shot 2016-02-10 at 7 57 05 am

I imagine that this is inherent to the choice of window. Any objections to switching to a hanning window, instead? That was the other initially proposed option and it does not exhibit this behavior.

@brendonhall
Copy link

No objections here - I agree that the localized behaviour (having the window go to zero) makes more sense.

@dmsurti dmsurti changed the title Use hamming window function [WIP]: Use hamming window function Feb 10, 2016
class GaussianOpacityNode(OpacityNode):
""" An `OpacityNode` with a non-zero radius and a Gaussian shape.
class WindowOpacityNode(OpacityNode):
""" An `OpacityNode` with a non-zero radius and a Hamming shape.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hamming -> Hanning

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple other comments need updating as well

@noraderam
Copy link
Contributor

👍

A bit more work will be required to accomplish the requested task, but it's good to get the renaming work done. I expect that we'll be updating the window used again within the next couple days.

noraderam pushed a commit that referenced this pull request Feb 10, 2016
[WIP]: Use hamming window function
@noraderam noraderam merged commit cf7f220 into master Feb 10, 2016
@noraderam noraderam deleted the add-hamming-function branch February 10, 2016 22:42
@noraderam noraderam assigned eric-jones and unassigned eric-jones Feb 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants