-
Notifications
You must be signed in to change notification settings - Fork 531
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Add new
dwifslpreproc
interface for MRtrix3 (#3278)
* added mrtrix3 dwifslpreproc as interface * use defaults added for outputs * Added dwifslpreproc interface to __init__ * edited doc string to correct order * added doctest skip * added MRtrix3 gradient empty test data * specified positions, requires for gradient exports * finalized docstring example and pytest * added entry to contribution list * simplify phase-encoding design input Moved `-rpe_` to `argstr` for simpler input. Co-authored-by: Chris Markiewicz <[email protected]> * Apply suggestions from code review Fixed typos and improved `-eddy` and `-topup` optional inputs. Co-authored-by: Chris Markiewicz <[email protected]> * Update nipype/interfaces/mrtrix3/preprocess.py Co-authored-by: Xihe Xie <[email protected]> * fixed input positions according to review * fixed doc string for new positions Co-authored-by: Chris Markiewicz <[email protected]>
- Loading branch information
Showing
5 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
ResponseSD, | ||
ACTPrepareFSL, | ||
ReplaceFSwithFIRST, | ||
DWIPreproc, | ||
DWIDenoise, | ||
MRDeGibbs, | ||
DWIBiasCorrect, | ||
|
This file contains 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 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,54 @@ | ||
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT | ||
from ..preprocess import DWIPreproc | ||
|
||
|
||
def test_DWIPreproc_inputs(): | ||
input_map = dict( | ||
align_seepi=dict(argstr="-align_seepi"), | ||
args=dict(argstr="%s"), | ||
bval_scale=dict(argstr="-bvalue_scaling %s"), | ||
eddy_options=dict(argstr='-eddy_options "%s"'), | ||
environ=dict(nohash=True, usedefault=True), | ||
export_grad_fsl=dict(argstr="-export_grad_fsl"), | ||
export_grad_mrtrix=dict(argstr="-export_grad_mrtrix"), | ||
grad_file=dict(argstr="-grad %s", extensions=None, xor=["grad_fsl"]), | ||
grad_fsl=dict(argstr="-fslgrad %s %s", xor=["grad_file"]), | ||
in_bval=dict(extensions=None), | ||
in_bvec=dict(argstr="-fslgrad %s %s", extensions=None), | ||
in_epi=dict(argstr="-se_epi %s", extensions=None), | ||
in_file=dict(argstr="%s", extensions=None, mandatory=True, position=0), | ||
nthreads=dict(argstr="-nthreads %d", nohash=True), | ||
out_file=dict( | ||
argstr="%s", extensions=None, mandatory=True, position=1, usedefault=True | ||
), | ||
out_grad_fsl=dict(argstr="%s, %s", requires=["export_grad_fsl"]), | ||
out_grad_mrtrix=dict( | ||
argstr="%s", | ||
extensions=None, | ||
requires=["export_grad_mrtrix"], | ||
usedefault=True, | ||
), | ||
pe_dir=dict(argstr="-pe_dir %s", mandatory=True), | ||
ro_time=dict(argstr="-readout_time %f"), | ||
rpe_options=dict(argstr="-rpe_%s", mandatory=True, position=2), | ||
topup_options=dict(argstr='-topup_options "%s"'), | ||
) | ||
inputs = DWIPreproc.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_DWIPreproc_outputs(): | ||
output_map = dict( | ||
out_file=dict(argstr="%s", extensions=None), | ||
out_fsl_bval=dict(argstr="%s", extensions=None, usedefault=True), | ||
out_fsl_bvec=dict(argstr="%s", extensions=None, usedefault=True), | ||
out_grad_mrtrix=dict(argstr="%s", extensions=None, usedefault=True), | ||
) | ||
outputs = DWIPreproc.output_spec() | ||
|
||
for key, metadata in list(output_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(outputs.traits()[key], metakey) == value |
Empty file.