@@ -108,9 +108,13 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec):
108
108
desc = "output WM ODF" ,
109
109
)
110
110
gm_txt = File (argstr = "%s" , position = - 4 , desc = "GM response text file" )
111
- gm_odf = File (argstr = "%s" , position = - 3 , desc = "output GM ODF" )
111
+ gm_odf = File (
112
+ "gm.mif" , usedefault = True , argstr = "%s" , position = - 3 , desc = "output GM ODF"
113
+ )
112
114
csf_txt = File (argstr = "%s" , position = - 2 , desc = "CSF response text file" )
113
- csf_odf = File (argstr = "%s" , position = - 1 , desc = "output CSF ODF" )
115
+ csf_odf = File (
116
+ "csf.mif" , usedefault = True , argstr = "%s" , position = - 1 , desc = "output CSF ODF"
117
+ )
114
118
mask_file = File (exists = True , argstr = "-mask %s" , desc = "mask image" )
115
119
116
120
# DW Shell selection options
@@ -122,6 +126,8 @@ class EstimateFODInputSpec(MRTrix3BaseInputSpec):
122
126
)
123
127
max_sh = InputMultiObject (
124
128
traits .Int ,
129
+ value = [8 ],
130
+ usedefault = True ,
125
131
argstr = "-lmax %s" ,
126
132
sep = "," ,
127
133
desc = (
@@ -150,18 +156,24 @@ class EstimateFOD(MRTrix3Base):
150
156
"""
151
157
Estimate fibre orientation distributions from diffusion data using spherical deconvolution
152
158
159
+ .. warning::
160
+
161
+ The CSD algorithm does not work as intended, but fixing it in this interface could break
162
+ existing workflows. This interface has been superseded by
163
+ :py:class:`.ConstrainedSphericalDecomposition`.
164
+
153
165
Example
154
166
-------
155
167
156
168
>>> import nipype.interfaces.mrtrix3 as mrt
157
169
>>> fod = mrt.EstimateFOD()
158
- >>> fod.inputs.algorithm = 'csd '
170
+ >>> fod.inputs.algorithm = 'msmt_csd '
159
171
>>> fod.inputs.in_file = 'dwi.mif'
160
172
>>> fod.inputs.wm_txt = 'wm.txt'
161
173
>>> fod.inputs.grad_fsl = ('bvecs', 'bvals')
162
- >>> fod.cmdline # doctest: +ELLIPSIS
163
- 'dwi2fod -fslgrad bvecs bvals csd dwi.mif wm.txt wm.mif'
164
- >>> fod.run() # doctest: +SKIP
174
+ >>> fod.cmdline
175
+ 'dwi2fod -fslgrad bvecs bvals -lmax 8 msmt_csd dwi.mif wm.txt wm.mif gm.mif csf .mif'
176
+ >>> fod.run() # doctest: +SKIP
165
177
"""
166
178
167
179
_cmd = "dwi2fod"
@@ -176,3 +188,46 @@ def _list_outputs(self):
176
188
if self .inputs .csf_odf != Undefined :
177
189
outputs ["csf_odf" ] = op .abspath (self .inputs .csf_odf )
178
190
return outputs
191
+
192
+
193
+ class ConstrainedSphericalDeconvolutionInputSpec (EstimateFODInputSpec ):
194
+ gm_odf = File (argstr = "%s" , position = - 3 , desc = "output GM ODF" )
195
+ csf_odf = File (argstr = "%s" , position = - 1 , desc = "output CSF ODF" )
196
+ max_sh = InputMultiObject (
197
+ traits .Int ,
198
+ argstr = "-lmax %s" ,
199
+ sep = "," ,
200
+ desc = (
201
+ "maximum harmonic degree of response function - single value for single-shell response, list for multi-shell response"
202
+ ),
203
+ )
204
+
205
+
206
+ class ConstrainedSphericalDeconvolution (EstimateFOD ):
207
+ """
208
+ Estimate fibre orientation distributions from diffusion data using spherical deconvolution
209
+
210
+ This interface supersedes :py:class:`.EstimateFOD`.
211
+ The old interface has contained a bug when using the CSD algorithm as opposed to the MSMT CSD
212
+ algorithm, but fixing it could potentially break existing workflows. The new interface works
213
+ the same, but does not populate the following inputs by default:
214
+
215
+ * ``gm_odf``
216
+ * ``csf_odf``
217
+ * ``max_sh``
218
+
219
+ Example
220
+ -------
221
+
222
+ >>> import nipype.interfaces.mrtrix3 as mrt
223
+ >>> fod = mrt.ConstrainedSphericalDeconvolution()
224
+ >>> fod.inputs.algorithm = 'csd'
225
+ >>> fod.inputs.in_file = 'dwi.mif'
226
+ >>> fod.inputs.wm_txt = 'wm.txt'
227
+ >>> fod.inputs.grad_fsl = ('bvecs', 'bvals')
228
+ >>> fod.cmdline
229
+ 'dwi2fod -fslgrad bvecs bvals csd dwi.mif wm.txt wm.mif'
230
+ >>> fod.run() # doctest: +SKIP
231
+ """
232
+
233
+ input_spec = ConstrainedSphericalDeconvolutionInputSpec
0 commit comments