Skip to content

[FIX] check for existance of NULL file #2998

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

Closed
wants to merge 3 commits into from

Conversation

stilley2
Copy link
Contributor

Summary

The antsRegistration interfaces uses "NULL" to indicate no mask file. This will fail if there actually is a file named NULL. This PR checks for the existence of such a file and raises an exception if it exists.

List of changes proposed in this PR (pull-request)

  • Check whether a file named NULL exists when formatting antsRegistration call, if NULL is used to indicate no mask

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@codecov
Copy link

codecov bot commented Aug 13, 2019

Codecov Report

Merging #2998 into master will decrease coverage by 3.76%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2998      +/-   ##
==========================================
- Coverage   67.49%   63.73%   -3.77%     
==========================================
  Files         344      342       -2     
  Lines       44036    43984      -52     
  Branches     5554     5553       -1     
==========================================
- Hits        29724    28032    -1692     
- Misses      13568    14861    +1293     
- Partials      744     1091     +347
Flag Coverage Δ
#smoketests ?
#unittests 63.73% <0%> (-1.22%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/ants/registration.py 46% <0%> (-26.94%) ⬇️
nipype/interfaces/nilearn.py 40% <0%> (-56.67%) ⬇️
nipype/utils/spm_docs.py 25.92% <0%> (-44.45%) ⬇️
nipype/interfaces/freesurfer/base.py 50% <0%> (-30.51%) ⬇️
nipype/utils/logger.py 59.7% <0%> (-29.86%) ⬇️
nipype/algorithms/rapidart.py 35% <0%> (-29.42%) ⬇️
nipype/interfaces/spm/base.py 57.94% <0%> (-29.14%) ⬇️
nipype/utils/provenance.py 55.73% <0%> (-28.35%) ⬇️
nipype/interfaces/fsl/model.py 55.26% <0%> (-25.35%) ⬇️
... and 43 more

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 c14f24e...411defe. Read the comment docs.

1 similar comment
@codecov
Copy link

codecov bot commented Aug 13, 2019

Codecov Report

Merging #2998 into master will decrease coverage by 3.76%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2998      +/-   ##
==========================================
- Coverage   67.49%   63.73%   -3.77%     
==========================================
  Files         344      342       -2     
  Lines       44036    43984      -52     
  Branches     5554     5553       -1     
==========================================
- Hits        29724    28032    -1692     
- Misses      13568    14861    +1293     
- Partials      744     1091     +347
Flag Coverage Δ
#smoketests ?
#unittests 63.73% <0%> (-1.22%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/ants/registration.py 46% <0%> (-26.94%) ⬇️
nipype/interfaces/nilearn.py 40% <0%> (-56.67%) ⬇️
nipype/utils/spm_docs.py 25.92% <0%> (-44.45%) ⬇️
nipype/interfaces/freesurfer/base.py 50% <0%> (-30.51%) ⬇️
nipype/utils/logger.py 59.7% <0%> (-29.86%) ⬇️
nipype/algorithms/rapidart.py 35% <0%> (-29.42%) ⬇️
nipype/interfaces/spm/base.py 57.94% <0%> (-29.14%) ⬇️
nipype/utils/provenance.py 55.73% <0%> (-28.35%) ⬇️
nipype/interfaces/fsl/model.py 55.26% <0%> (-25.35%) ⬇️
... and 43 more

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 c14f24e...411defe. Read the comment docs.

@oesteban
Copy link
Contributor

I believe this shouldn't be a problem after #2971 was merged. Could you perhaps write a test?

@stilley2
Copy link
Contributor Author

I don't think it's related to #2971. I tried to write a test case, which led me to the conclusion that it's probably not an issue anyway. Even if a file named 'NULL' exists, ants will fail to read it because it has no suffix. While I dislike using a fake file name to indicate no mask, that's really a problem with ANTS and not nipype.

@effigies
Copy link
Member

@stilley2 I'm not sure whether to interpret your last post as saying this change is not necessary. If so please close it. Otherwise, are you ready for a review or still working on the failing tests?

@stilley2
Copy link
Contributor Author

Sorry for the ambiguity. Yes, I don't think this change is necessary.

@stilley2 stilley2 closed this Aug 16, 2019
@effigies
Copy link
Member

Great, thanks for the confirmation.

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.

4 participants