[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
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

ENH: Add options and outputs to fsl.Eddy interface #3034

Merged
merged 19 commits into from
Dec 17, 2019

Conversation

josephmje
Copy link
Contributor
@josephmje josephmje commented Sep 17, 2019

Summary

Updates interface for FSL's eddy command with inputs and outputs for FSL 5.0.10+

Splits #3008 into 2 PRs.

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

  • add defaults for some input parameters
  • add additional inputs and outputs pertaining to outlier replacement, intra-volume movement correction and susceptibility-by-movement correction (outlier maps necessary for eddy_quad)
  • requires fieldmap to be trait File instead of Str (would break backwards compatibility)

Acknowledgment

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

@josephmje
Copy link
Contributor Author

I just realized that slice-to-volume motion correction is only implemented when use_cuda is True. The options that are included in this are: mporder, s2v_niter, s2v_lambda, s2v_interp, slspec and json. Any ideas on how to add a check for this?

@effigies
Copy link
Member

requires=['use_cuda']?

@josephmje
Copy link
Contributor Author

use_cuda can be made to be True or False. Does requires=['use_cuda']work if use_cuda is False?

@effigies
Copy link
Member

I'd check!

@josephmje
Copy link
Contributor Author

Cool! Thanks, I'll try it out

@codecov
Copy link
codecov bot commented Sep 17, 2019

Codecov Report

Merging #3034 into master will increase coverage by 0.61%.
The diff coverage is 56%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3034      +/-   ##
==========================================
+ Coverage   67.23%   67.84%   +0.61%     
==========================================
  Files         294      295       +1     
  Lines       39245    39310      +65     
  Branches     5162     5181      +19     
==========================================
+ Hits        26386    26671     +285     
+ Misses      12185    11933     -252     
- Partials      674      706      +32
Flag Coverage Δ
#smoketests 51.23% <56%> (ø) ⬆️
#unittests 65.07% <56%> (+0.85%) ⬆️
Impacted Files Coverage Δ
nipype/interfaces/fsl/epi.py 62.15% <56%> (-0.92%) ⬇️
nipype/pipeline/plugins/legacymultiproc.py 62.81% <0%> (-0.51%) ⬇️
nipype/testing/__init__.py 88.88% <0%> (ø)
nipype/interfaces/spm/preprocess.py 56.93% <0%> (+0.32%) ⬆️
nipype/utils/filemanip.py 77.59% <0%> (+0.47%) ⬆️
nipype/interfaces/freesurfer/preprocess.py 66.04% <0%> (+0.98%) ⬆️
nipype/interfaces/freesurfer/model.py 64.19% <0%> (+1.12%) ⬆️
nipype/interfaces/spm/base.py 87% <0%> (+2%) ⬆️
nipype/interfaces/freesurfer/utils.py 62.88% <0%> (+2.13%) ⬆️
nipype/interfaces/io.py 59.67% <0%> (+6.11%) ⬆️
... and 4 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 0225a45...42d00c7. Read the comment docs.

@josephmje
Copy link
Contributor Author
josephmje commented Sep 17, 2019

requires=['use_cuda'] doesn't quite work. The doctests will still pass if I make use_cuda = False.

Actually, all of the requires might need some finessing.
requires=['repol'] actually needs repol = True
requires=['mporder'] needs mporder > 0
requires=['estimate_move_by_susceptibility'] needs estimate_move_by_susceptibility = True

Copy link
Member
@effigies effigies left a comment

Choose a reason for hiding this comment

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

Most of these comments are checking whether the defaults that are now being set are actually defaults, and most of the rest are on clarity of desc strings or trait names.

I'm a little surprised that requires for a traits.Bool doesn't require the value to be True. You could change them to traits.Enum(True), which are either True or Undefined. It's not very pleasing though...

nipype/interfaces/fsl/epi.py Outdated Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Outdated Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Outdated Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Outdated Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Outdated Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Outdated Show resolved Hide resolved
nipype/interfaces/fsl/epi.py Show resolved Hide resolved
@effigies effigies added this to the 1.3.0 milestone Sep 20, 2019
@josephmje
Copy link
Contributor Author
josephmje commented Sep 27, 2019

converting some of the former Bool traits to Enum ended up passing the doctests but fail to run in a workflow:

  File "/scratch/mjoseph/.pyenv/versions/dmriprep_venv/lib/python3.7/site-packages/nipype-1.2.3-py3.7.egg/nipype/interfaces/base/core.py", line 801, in _format_arg
    return argstr % value
TypeError: not all arguments converted during string formatting

@effigies
Copy link
Member
effigies commented Oct 7, 2019

Hmm. This is somewhat frustrating. I guess I'd revert to traits.Bool, and then just raise a warning (or an error, if you think it's worth it) in _format_arg() for those that require a Bool that's False, and then return None.

@effigies effigies modified the milestones: 1.3.0, 1.4.0 Nov 11, 2019
@effigies
Copy link
Member

Hi @josephmje, sorry to do this to you, but we just merged some pretty huge changes. Could you re-apply these changes on the latest master? You'll want to re-run make specs entirely, and we're now using the Black formatter. You can run it manually, or use pre-commit to have it automatically run every time you commit.

Please let me know if you need any help or clarifications.

@josephmje
Copy link
Contributor Author

@effigies Sorry my rebase didn't go so well. Do you know what I can do to fix this?

@effigies
Copy link
Member

I'll see what I can do.

@effigies
Copy link
Member

I rebased, selecting your changes, and running black/make specs before committing each revision. It looks like this doubled up a bunch of commits. I'm not really clear on how that happened.

To update your local branch use git fetch origin && git reset --hard origin/update_eddy.

@effigies effigies changed the title ENH: Update fsl.Eddy interface ENH: Add options and outputs to fsl.Eddy interface Dec 17, 2019
@effigies
Copy link
Member

Thanks for this.

@effigies effigies merged commit c47f889 into nipy:master Dec 17, 2019
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.

2 participants