Skip to content

[ENH]: Add mrdegibbs and dwibiascorrect from mrtrix3 #2904

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 14 commits into from
Apr 3, 2019

Conversation

josephmje
Copy link
Contributor

@josephmje josephmje commented Mar 25, 2019

Summary

Addition of dwibiascorrect references #1126

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

  • output noise map from dwidenoise
  • add classes for mrdegibbs and dwibiascorrect
  • remove '.nii.gz' from eddy quad folder

Acknowledgment

I acknowledge that this contribution will be available under the Apache 2 license.

Copy link
Member

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! I left some minor comments/questions below, but overall this look good.

>>> import nipype.interfaces.mrtrix3 as mrt
>>> unring = mrt.MRDeGibbs()
>>> unring.inputs.in_file = 'dwi.mif'
>>> unring.cmdline # doctest: +ELLIPSIS
Copy link
Member

Choose a reason for hiding this comment

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

i don't think you need the ELLIPSIS option


class DWIDenoiseOutputSpec(TraitedSpec):
out_file = File(desc="the output denoised DWI image", exists=True)
out_noisemap = File(desc='the output noise map', exists=True)
Copy link
Member

Choose a reason for hiding this comment

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

is this always output?

genfile=True)

class DWIBiasCorrectOutputSpec(TraitedSpec):
out_bias = File(desc='the output estimated bias field')
Copy link
Member

Choose a reason for hiding this comment

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

is this always output?

>>> import nipype.interfaces.mrtrix3 as mrt
>>> bias_correct = mrt.DWIBiasCorrect()
>>> bias_correct.inputs.in_file = 'dwi.mif'
>>> bias_correct.cmdline # doctest: +ELLIPSIS
Copy link
Member

Choose a reason for hiding this comment

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

ellipsis not needed

@codecov-io
Copy link

codecov-io commented Mar 28, 2019

Codecov Report

Merging #2904 into master will increase coverage by <.01%.
The diff coverage is 76.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2904      +/-   ##
==========================================
+ Coverage   67.56%   67.57%   +<.01%     
==========================================
  Files         343      343              
  Lines       43604    43648      +44     
  Branches     5427     5429       +2     
==========================================
+ Hits        29461    29493      +32     
- Misses      13438    13443       +5     
- Partials      705      712       +7
Flag Coverage Δ
#smoketests 50.47% <0%> (ø) ⬆️
#unittests 65% <76.08%> (-0.02%) ⬇️
Impacted Files Coverage Δ
nipype/interfaces/mrtrix3/__init__.py 100% <ø> (ø) ⬆️
nipype/interfaces/fsl/epi.py 63.22% <0%> (ø) ⬆️
nipype/interfaces/mrtrix3/preprocess.py 79.64% <77.77%> (-1.52%) ⬇️
nipype/pipeline/plugins/legacymultiproc.py 65% <0%> (-1%) ⬇️
nipype/interfaces/io.py 55.07% <0%> (ø) ⬆️
nipype/interfaces/freesurfer/preprocess.py 66.11% <0%> (ø) ⬆️
nipype/interfaces/dynamic_slicer.py 17.47% <0%> (ø) ⬆️
nipype/interfaces/nipy/preprocess.py 45.79% <0%> (ø) ⬆️

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 fcbe28e...c08051d. Read the comment docs.

@josephmje
Copy link
Contributor Author

Thanks for your feedback @mgxd! I reverted my variable name change to dwidenoise in case it affects existing code using it. Also modified the arguments to the optional output files.

@mgxd
Copy link
Member

mgxd commented Mar 28, 2019

tests should start passing again if you merge with master

@@ -28,16 +28,17 @@ class DWIDenoiseInputSpec(MRTrix3BaseInputSpec):
desc='set the window size of the denoising filter. (default = 5,5,5)')
noise = File(
Copy link
Member

Choose a reason for hiding this comment

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

it doesn't look like this is currently being tracked as an output by the interface, but if this is set it I think dwidenoise would make it. You should :

  1. re-add it to the OutputSpec (noise = File(..., exists=True)
  2. add a _list_outputs() method that checks if self.inputs.noise is defined, and if so adds it to outputs.

Here's an example of (2) - though you won't have to generate a filename.

@mgxd mgxd added this to the 1.2.0 milestone Mar 29, 2019
@josephmje
Copy link
Contributor Author

@mgxd I finished incorporating your suggestions. Let me know if there's anything else I'm missing.

Copy link
Member

@mgxd mgxd left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for the contribution!

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