Skip to content

Commit 974ca38

Browse files
committed
touched up docs and made commands inherit from commandline instead of mrtrixbase
1 parent ac7490c commit 974ca38

File tree

2 files changed

+24
-19
lines changed

2 files changed

+24
-19
lines changed

nipype/interfaces/mrtrix3/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
MRConvert,
1414
MRResize,
1515
DWIExtract,
16+
SHConv,
17+
SH2Amp
1618
)
1719
from .preprocess import (
1820
ResponseSD,

nipype/interfaces/mrtrix3/utils.py

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,8 @@ class MRResize(MRTrix3Base):
767767
output_spec = MRResizeOutputSpec
768768

769769

770-
class SHConvInputSpec(TraitedSpec):
770+
class SHConvInputSpec(CommandLineInputSpec):
771+
771772
in_file = File(
772773
exists=True,
773774
argstr="%s",
@@ -802,20 +803,20 @@ class SHConvOutputSpec(TraitedSpec):
802803

803804
class SHConv(CommandLine):
804805
"""
805-
Convert diffusion-weighted images to tensor images
806+
Convolve spherical harmonics with a tissue response function. Useful for
807+
checking residuals of ODF estimates.
806808
807809
808810
Example
809811
-------
810812
811813
>>> import nipype.interfaces.mrtrix3 as mrt
812-
>>> tsr = mrt.SHConv()
813-
>>> tsr.inputs.in_file = 'odf.mif'
814-
>>> tsr.inputs.response = 'response.txt'
815-
>>> tsr.inputs.grad_fsl = ('bvecs', 'bvals')
816-
>>> tsr.cmdline # doctest: +ELLIPSIS
817-
'dwi2tensor -fslgrad bvecs bvals -mask mask.nii.gz dwi.mif dti.mif'
818-
>>> tsr.run() # doctest: +SKIP
814+
>>> sh = mrt.SHConv()
815+
>>> sh.inputs.in_file = 'odf.mif'
816+
>>> sh.inputs.response = 'response.txt'
817+
>>> sh.cmdline # doctest: +ELLIPSIS
818+
'shconv odf.mif response.txt sh.mif'
819+
>>> sh.run() # doctest: +SKIP
819820
"""
820821

821822
_cmd = "shconv"
@@ -829,7 +830,7 @@ def _list_outputs(self):
829830

830831

831832

832-
class SH2AmpInputSpec(MRTrix3BaseInputSpec):
833+
class SH2AmpInputSpec(CommandLineInputSpec):
833834
in_file = File(
834835
exists=True,
835836
argstr="%s",
@@ -844,7 +845,8 @@ class SH2AmpInputSpec(MRTrix3BaseInputSpec):
844845
mandatory=True,
845846
argstr="%s",
846847
position=-2,
847-
desc=("The directions along which to sample the function"),
848+
desc=("The gradient directions along which to sample the spherical "
849+
"harmonics MRtrix format"),
848850
)
849851

850852
out_file = File(
@@ -866,21 +868,22 @@ class SH2AmpOutputSpec(TraitedSpec):
866868
desc="the output convoluted spherical harmonics file")
867869

868870

869-
class SH2Amp(MRTrix3Base):
871+
class SH2Amp(CommandLine):
870872
"""
871-
Convert diffusion-weighted images to tensor images
873+
Sample spherical harmonics on a set of gradient orientations. Useful for
874+
checking residuals of ODF estimates.
872875
873876
874877
Example
875878
-------
876879
877880
>>> import nipype.interfaces.mrtrix3 as mrt
878-
>>> sha = mrt.SH2Amp()
879-
>>> sha.inputs.in_file = 'odf.mif'
880-
>>> sha.inputs.response = 'response.txt'
881-
>>> sha.cmdline # doctest: +ELLIPSIS
882-
'dwi2tensor -fslgrad bvecs bvals -mask mask.nii.gz dwi.mif dti.mif'
883-
>>> sha.run() # doctest: +SKIP
881+
>>> sh = mrt.SH2Amp()
882+
>>> sh.inputs.in_file = 'sh.mif'
883+
>>> sh.inputs.directions = 'grads.txt'
884+
>>> sh.cmdline # doctest: +ELLIPSIS
885+
'sh2amp sh.mif grads.txt amp.mif'
886+
>>> sh.run() # doctest: +SKIP
884887
"""
885888

886889
_cmd = "sh2amp"

0 commit comments

Comments
 (0)