-
Notifications
You must be signed in to change notification settings - Fork 8
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
Img proc api #63
Open
giltis
wants to merge
35
commits into
Nikea:master
Choose a base branch
from
giltis:img_proc_api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Img proc api #63
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After review of the arithmetic tools with Eric, we decided that tools whos sole purpose is to wrap existing tools into more user friendly VisTrails modules should be located in VTTools, thereby leaving skxray to exclusively contain new analysis tools and functions, while continuing to increase the usefullness and usability of VisTrails for analysis of NSLS-II data. The file mathops.py has been moved to vttools/to_wrap and renamed as image_proc.py. The file test_img_proc.py has been copied from skxray/tests/ to vttools/tests/.
…ails As per review and comment from Eric, the arithmetic functions designed explicitly to ease image processing and data analysis in VisTrails have been moved to the VTTools repo. This commit removes the addl analysis funcs, which will remain in skxray (logical_nand, logical_nor, logical_sub). The remaining functions (arithmetic_basic, arithmetic_custom, and logic_basic) remain. All additional math functions are directly imported from either mathops or numpy. And names for mathops functions have been corrected to mimic style established in Numpy.
Simple term replacement. Replaced all references to mathops by changing import statement to: import vttools.to_wrap.image_proc as img The tests included focus on the vistrails specific functions: arithmetic_basic, logic_basic, and arithmetic_custom
Previously the docstring for arithmetic_custom included references to additional operators such as +=, -=, *= etc. which are supposed to simplify expressions like a=a+b, which is the equivalent of a+=b. However, the parsing function does not evaluate these short cuts correctly. If these additional operators become important, then I'll revisit and modify the parsing function, or write a custom one. However, at this time the additional operators are deemed to be unnecessary, since the expressions can still be evaluated without the operators.`
As per Eric's suggestion, inputs specific to data have been renamed in order to conform to typical numpy docstrings, e.g. the arg src_data1 and src_data2 have been changed to x1 and x2. The funcs requiring a string operation to be defined have also been standardized so that the input order starts with the operation or expression followed by the input data. Finally, the docstring for arithmetic_custom was incomplete, and has been flushed out.
As discussed with Eric, we decided to shorten, simplify and make the function names more explicit about their functionality. So, logic_basic has been renamed to logic, arithmetic_basic has been renamed arithmetic, and arithmetic_custom has been changed to arithmetic_expression. In Vistrails these tools are exprected to be nested in the tool tree under an "Image Arithmetic" heading, included in the "Image Processing" tool set/kit.
After review of the arithmetic tools with Eric, we decided that tools whos sole purpose is to wrap existing tools into more user friendly VisTrails modules should be located in VTTools, thereby leaving skxray to exclusively contain new analysis tools and functions, while continuing to increase the usefullness and usability of VisTrails for analysis of NSLS-II data. The file mathops.py has been moved to vttools/to_wrap and renamed as image_proc.py. The file test_img_proc.py has been copied from skxray/tests/ to vttools/tests/.
…ails As per review and comment from Eric, the arithmetic functions designed explicitly to ease image processing and data analysis in VisTrails have been moved to the VTTools repo. This commit removes the addl analysis funcs, which will remain in skxray (logical_nand, logical_nor, logical_sub). The remaining functions (arithmetic_basic, arithmetic_custom, and logic_basic) remain. All additional math functions are directly imported from either mathops or numpy. And names for mathops functions have been corrected to mimic style established in Numpy.
Simple term replacement. Replaced all references to mathops by changing import statement to: import vttools.to_wrap.image_proc as img The tests included focus on the vistrails specific functions: arithmetic_basic, logic_basic, and arithmetic_custom
Previously the docstring for arithmetic_custom included references to additional operators such as +=, -=, *= etc. which are supposed to simplify expressions like a=a+b, which is the equivalent of a+=b. However, the parsing function does not evaluate these short cuts correctly. If these additional operators become important, then I'll revisit and modify the parsing function, or write a custom one. However, at this time the additional operators are deemed to be unnecessary, since the expressions can still be evaluated without the operators.`
As per Eric's suggestion, inputs specific to data have been renamed in order to conform to typical numpy docstrings, e.g. the arg src_data1 and src_data2 have been changed to x1 and x2. The funcs requiring a string operation to be defined have also been standardized so that the input order starts with the operation or expression followed by the input data. Finally, the docstring for arithmetic_custom was incomplete, and has been flushed out.
As discussed with Eric, we decided to shorten, simplify and make the function names more explicit about their functionality. So, logic_basic has been renamed to logic, arithmetic_basic has been renamed arithmetic, and arithmetic_custom has been changed to arithmetic_expression. In Vistrails these tools are exprected to be nested in the tool tree under an "Image Arithmetic" heading, included in the "Image Processing" tool set/kit.
- This looks like a lot of changes, but there is functionally no difference between the original code and this code. It is entirely stylistic. - Doc edits moved the descriptive prose to `/doc/resource/user-guide/image.rst` and used language largely copied from numpy - content edits favored use of built in functionality over defining look-up dictionaries
Conflicts: vttools/tests/__init__.py
Conflicts: vttools/tests/test_img_proc.py vttools/to_wrap/image_proc.py
The tools designed to ease use of math functions in VisTrails are now included in vttools-->to_wrap-->image_processing-->arithmetic since these tools are explicitly designed to simplify the VisTrails user experience. As part of the growing collection of image processing functions included in skxray, the basic image arithmetic functions are compiled in skxray-->image_processing-->arithmetic for completeness.
HTML folder was accidentally added during a previous commit. This folder has now been removed in order to merge this PR finally.
As Eric mentioned, lmfit.asteval may be a cleaner and more effective parsing tool for evaluating the input expressions. Added an explicit TODO noting the parser comparision should be completed on next iteration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the image processing tools that have been compiled in the skxray API. The additions in this PR focus on image filters, morphological operations and image registration.