Skip to content

changing _format_arg in WarpImageMultiTransform, should fix #2192 #2229

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

Merged
merged 3 commits into from
Oct 28, 2017

Conversation

djarecka
Copy link
Collaborator

I added a set of simple tests, mostly based on doctest, but just testing a few different scenarios.
Have 2 xfail test for wrong (i.e. out of range) invert_affine. Should this raise exception?

@codecov-io
Copy link

codecov-io commented Oct 13, 2017

Codecov Report

Merging #2229 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2229      +/-   ##
==========================================
+ Coverage   72.31%   72.34%   +0.02%     
==========================================
  Files        1181     1181              
  Lines       58939    58970      +31     
  Branches     8488     8484       -4     
==========================================
+ Hits        42622    42659      +37     
+ Misses      14934    14931       -3     
+ Partials     1383     1380       -3
Flag Coverage Δ
#smoketests 72.34% <100%> (+0.02%) ⬆️
#unittests 69.91% <100%> (+0.02%) ⬆️
Impacted Files Coverage Δ
nipype/interfaces/ants/tests/test_resampling.py 100% <100%> (ø)
nipype/interfaces/ants/resampling.py 82.06% <100%> (+3.57%) ⬆️
nipype/interfaces/ants/utils.py 85.71% <0%> (-1.42%) ⬇️
nipype/pipeline/plugins/multiproc.py 76.76% <0%> (-1.41%) ⬇️
nipype/interfaces/ants/registration.py 72.83% <0%> (-0.04%) ⬇️
...pe/interfaces/ants/tests/test_auto_Registration.py 85.71% <0%> (ø) ⬆️
...aces/ants/tests/test_auto_ComposeMultiTransform.py

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0af4d56...a8f32b6. Read the comment docs.

assert wimt.cmdline == 'WarpImageMultiTransform 3 diffusion_weighted.nii diffusion_weighted_wimt.nii -R functional.nii func2anat_coreg_Affine.txt func2anat_InverseWarp.nii.gz dwi2anat_Warp.nii.gz -i dwi2anat_coreg_Affine.txt'


@pytest.mark.xfail(reason="dj: should it fail?")
Copy link
Member

Choose a reason for hiding this comment

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

this should not fail.

Copy link
Member

Choose a reason for hiding this comment

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

how does it fail?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@satra - fails, i.e. it doesn't raise any exception.

I found it slightly confusing that i can provide wrong index in invert_affine, e.g. 0 or 3 (if you have only 2 affine files), and i don't get any errors. Was wondering if it would be useful to add an extra check.

Copy link
Member

Choose a reason for hiding this comment

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

i think the issue is that the description is not very clear.

technically, looking at the code, each affine is given a index. seems like this can cause some mishaps. so yes, raising exceptions when the values of index exceed total number of affines is good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that description of invert_affine trait is quite good. However IMO it's very hard to guess without reading description or the code that affine files are counted, they are getting another indices, and the new indices start from 1.

Unfortunately changing this concept would make old script fail, so was thinking that at least adding some error with meaningful message might save people some time in case of problems.

Copy link
Member

Choose a reason for hiding this comment

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

that sounds good, but i think it may be good to add an example to describe this situation clearly in the docstring examples.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I add a comment to an existing doctest and add a new one, please see if the new one really returns cmd that makes sense

@satra satra merged commit fc2c5b4 into nipy:master Oct 28, 2017
@satra satra added this to the 0.14.0 milestone Oct 28, 2017
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.

3 participants