-
Notifications
You must be signed in to change notification settings - Fork 532
[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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6a49acd
initial attempt at adding mrtrix commands
josephmje 80dc7b2
Merge remote-tracking branch 'upstream/master'
josephmje c32258c
additional changes to new mrtrix3 interfaces
josephmje 83bc6a4
add noisemap to dwidenoise and fix mrdegibbs
josephmje ef7c805
update mrdegibbs and dwibiascorrect
josephmje 51b6f15
add contribution
josephmje 6512e7a
fix typo and update docstrings
josephmje 059f3ee
add autogenerated tests
josephmje 572d2e6
missing comma
josephmje dde5c4f
revert variable name changes to dwidenoise and address code review
josephmje 348d349
Merge remote-tracking branch 'upstream/master' into mrtrix_preprocessing
josephmje 1334636
add list outputs
josephmje 7015004
removed non ASCII characters
josephmje c08051d
Merge remote-tracking branch 'upstream/master' into mrtrix_preprocessing
josephmje File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
70 changes: 70 additions & 0 deletions
70
nipype/interfaces/mrtrix3/tests/test_auto_DWIBiasCorrect.py
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT | ||
from __future__ import unicode_literals | ||
from ..preprocess import DWIBiasCorrect | ||
|
||
|
||
def test_DWIBiasCorrect_inputs(): | ||
input_map = dict( | ||
args=dict(argstr='%s', ), | ||
bias=dict(argstr='-bias %s', ), | ||
bval_scale=dict(argstr='-bvalue_scaling %s', ), | ||
environ=dict( | ||
nohash=True, | ||
usedefault=True, | ||
), | ||
fsl_grad=dict( | ||
argstr='-fslgrad %s %s', | ||
xor=('mrtrix_grad', 'fsl_grad'), | ||
), | ||
grad_file=dict(argstr='-grad %s', ), | ||
grad_fsl=dict(argstr='-fslgrad %s %s', ), | ||
in_bval=dict(), | ||
in_bvec=dict(argstr='-fslgrad %s %s', ), | ||
in_file=dict( | ||
argstr='%s', | ||
mandatory=True, | ||
position=-2, | ||
), | ||
in_mask=dict(argstr='-mask %s', ), | ||
mrtrix_grad=dict( | ||
argstr='-grad %s', | ||
xor=('mrtrix_grad', 'fsl_grad'), | ||
), | ||
nthreads=dict( | ||
argstr='-nthreads %d', | ||
nohash=True, | ||
), | ||
out_file=dict( | ||
argstr='%s', | ||
genfile=True, | ||
keep_extension=True, | ||
name_source='in_file', | ||
name_template='%s_biascorr', | ||
position=-1, | ||
), | ||
use_ants=dict( | ||
argstr='-ants', | ||
usedefault=True, | ||
xor=('use_ants', 'use_fsl'), | ||
), | ||
use_fsl=dict( | ||
argstr='-fsl', | ||
min_ver='5.0.10', | ||
xor=('use_ants', 'use_fsl'), | ||
), | ||
) | ||
inputs = DWIBiasCorrect.input_spec() | ||
|
||
for key, metadata in list(input_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(inputs.traits()[key], metakey) == value | ||
def test_DWIBiasCorrect_outputs(): | ||
output_map = dict( | ||
bias=dict(), | ||
out_file=dict(), | ||
) | ||
outputs = DWIBiasCorrect.output_spec() | ||
|
||
for key, metadata in list(output_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(outputs.traits()[key], metakey) == value |
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT | ||
from __future__ import unicode_literals | ||
from ..preprocess import MRDeGibbs | ||
|
||
|
||
def test_MRDeGibbs_inputs(): | ||
input_map = dict( | ||
args=dict(argstr='%s', ), | ||
axes=dict( | ||
argstr='-axes %s', | ||
maxlen=2, | ||
minlen=2, | ||
sep=',', | ||
usedefault=True, | ||
), | ||
bval_scale=dict(argstr='-bvalue_scaling %s', ), | ||
environ=dict( | ||
nohash=True, | ||
usedefault=True, | ||
), | ||
grad_file=dict(argstr='-grad %s', ), | ||
grad_fsl=dict(argstr='-fslgrad %s %s', ), | ||
in_bval=dict(), | ||
in_bvec=dict(argstr='-fslgrad %s %s', ), | ||
in_file=dict( | ||
argstr='%s', | ||
mandatory=True, | ||
position=-2, | ||
), | ||
maxW=dict( | ||
argstr='-maxW %d', | ||
usedefault=True, | ||
), | ||
minW=dict( | ||
argstr='-minW %d', | ||
usedefault=True, | ||
), | ||
nshifts=dict( | ||
argstr='-nshifts %d', | ||
usedefault=True, | ||
), | ||
nthreads=dict( | ||
argstr='-nthreads %d', | ||
nohash=True, | ||
), | ||
out_file=dict( | ||
argstr='%s', | ||
genfile=True, | ||
keep_extension=True, | ||
name_source='in_file', | ||
name_template='%s_unr', | ||
position=-1, | ||
), | ||
) | ||
inputs = MRDeGibbs.input_spec() | ||
|
||
for key, metadata in list(input_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(inputs.traits()[key], metakey) == value | ||
def test_MRDeGibbs_outputs(): | ||
output_map = dict(out_file=dict(), ) | ||
outputs = MRDeGibbs.output_spec() | ||
|
||
for key, metadata in list(output_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(outputs.traits()[key], metakey) == value |
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.
There was a problem hiding this comment.
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 :noise = File(..., exists=True
)_list_outputs()
method that checks ifself.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.