-
Notifications
You must be signed in to change notification settings - Fork 532
ENH: Add new dwifslpreproc
interface for MRtrix3
#3278
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 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
69a7493
added mrtrix3 dwifslpreproc as interface
axiezai 7544744
use defaults added for outputs
axiezai 33df5fc
Added dwifslpreproc interface to __init__
axiezai 30ab4eb
edited doc string to correct order
axiezai 8fcf5ec
added doctest skip
axiezai 2be461c
added MRtrix3 gradient empty test data
axiezai fb3f619
specified positions, requires for gradient exports
axiezai 4f4f9e5
finalized docstring example and pytest
axiezai 983840c
added entry to contribution list
axiezai 7926025
simplify phase-encoding design input
axiezai e8bddbc
Apply suggestions from code review
axiezai 4ac4e62
Update nipype/interfaces/mrtrix3/preprocess.py
effigies d33e9b4
fixed input positions according to review
axiezai a1c43ad
fixed doc string for new positions
axiezai 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
ResponseSD, | ||
ACTPrepareFSL, | ||
ReplaceFSwithFIRST, | ||
DWIPreproc, | ||
DWIDenoise, | ||
MRDeGibbs, | ||
DWIBiasCorrect, | ||
|
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,55 @@ | ||
# 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", position=-4), | ||
args=dict(argstr="%s"), | ||
bval_scale=dict(argstr="-bvalue_scaling %s"), | ||
eddy_options=dict(argstr="-eddy_options %s", position=-3), | ||
environ=dict(nohash=True, usedefault=True), | ||
export_grad_fsl=dict(argstr="-export_grad_fsl", position=-2), | ||
export_grad_mrtrix=dict(argstr="-export_grad_mrtrix", position=-2), | ||
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, position=-5), | ||
in_file=dict(argstr="%s", extensions=None, mandatory=True, position=-10), | ||
nthreads=dict(argstr="-nthreads %d", nohash=True), | ||
out_file=dict( | ||
argstr="%s", extensions=None, mandatory=True, position=-9, usedefault=True | ||
), | ||
out_grad_fsl=dict(argstr="%s, %s", position=-1, requires=["export_grad_fsl"]), | ||
out_grad_mrtrix=dict( | ||
argstr="%s", | ||
extensions=None, | ||
position=-1, | ||
requires=["export_grad_mrtrix"], | ||
usedefault=True, | ||
), | ||
pe_dir=dict(argstr="-pe_dir %s", mandatory=True, position=-7), | ||
ro_time=dict(argstr="-readout_time %f", position=-6), | ||
rpe_options=dict(argstr="%s", mandatory=True, position=-8), | ||
topup_options=dict(argstr="-topup_options %s", position=-3), | ||
) | ||
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.
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.
Are these
position
arguments really necessary for all inputs?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.
Not necessary, this was my lazy way of ensuring the interface command stayed consistent with the examples from the mrtrix documentation.
I think if position is left empty, the inputs appear right after
dwifslpreproc
? I was going for a format ofdwifslpreproc in_file out_file -rpe_options -other_options
to follow the examples here.Is there a way to achieve that without specifying positions for everything?
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.
If that's necessary, I think you could set position of 0 for
in_file
, 1 forout_file
, 2 forrpe_options
, and leave it unset for the rest. If it's not actually necessary for an option, I would personally leave it unset, because you're indicating to future maintainers that they need to be very particular about this.