@@ -188,7 +188,7 @@ class TensorMetricsOutputSpec(TraitedSpec):
188
188
class TensorMetrics (CommandLine ):
189
189
190
190
"""
191
- Convert a mesh surface to a partial volume estimation image
191
+ Compute metrics from tensors
192
192
193
193
194
194
Example
@@ -215,3 +215,139 @@ def _list_outputs(self):
215
215
outputs [k ] = op .abspath (getattr (self .inputs , k ))
216
216
217
217
return outputs
218
+
219
+
220
+ class ComputeTDIInputSpec (CommandLineInputSpec ):
221
+ in_file = File (exists = True , argstr = '%s' , mandatory = True , position = - 2 ,
222
+ desc = 'input tractography' )
223
+ out_file = File ('tdi.mif' , argstr = '%s' , usedefault = True , position = - 1 ,
224
+ desc = 'output TDI file' )
225
+ reference = File (
226
+ exists = True , argstr = '-template %s' , desc = 'a reference'
227
+ 'image to be used as template' )
228
+ vox_size = traits .List (traits .Int , argstr = '-vox %s' , sep = ',' ,
229
+ desc = 'voxel dimensions' )
230
+ data_type = traits .Enum ('float' , 'unsigned int' , argstr = '-datatype %s' ,
231
+ desc = 'specify output image data type' )
232
+ use_dec = traits .Bool (argstr = '-dec' , desc = 'perform mapping in DEC space' )
233
+ dixel = File ('dixels.txt' , argstr = '-dixel %s' , desc = 'map streamlines to'
234
+ 'dixels within each voxel. Directions are stored as'
235
+ 'azimuth elevation pairs.' )
236
+ max_tod = traits .Int (argstr = '-tod %d' , desc = 'generate a Track Orientation '
237
+ 'Distribution (TOD) in each voxel.' )
238
+
239
+ contrast = traits .Enum ('tdi' , 'length' , 'invlength' , 'scalar_map' ,
240
+ 'scalar_map_conut' , 'fod_amp' , 'curvature' ,
241
+ argstr = '-constrast %s' , desc = 'define the desired '
242
+ 'form of contrast for the output image' )
243
+ in_map = File (exists = True , argstr = '-image %s' , desc = 'provide the'
244
+ 'scalar image map for generating images with '
245
+ '\' scalar_map\' contrasts, or the SHs image for fod_amp' )
246
+
247
+ stat_vox = traits .Enum ('sum' , 'min' , 'mean' , 'max' , argstr = '-stat_vox %s' ,
248
+ desc = 'define the statistic for choosing the final'
249
+ 'voxel intesities for a given contrast' )
250
+ stat_tck = traits .Enum (
251
+ 'mean' , 'sum' , 'min' , 'max' , 'median' , 'mean_nonzero' , 'gaussian' ,
252
+ 'ends_min' , 'ends_mean' , 'ends_max' , 'ends_prod' ,
253
+ argstr = '-stat_tck %s' , desc = 'define the statistic for choosing '
254
+ 'the contribution to be made by each streamline as a function of'
255
+ ' the samples taken along their lengths.' )
256
+
257
+ fwhm_tck = traits .Float (
258
+ argstr = '-fwhm_tck %f' , desc = 'define the statistic for choosing the'
259
+ ' contribution to be made by each streamline as a function of the '
260
+ 'samples taken along their lengths' )
261
+
262
+ map_zero = traits .Bool (
263
+ argstr = '-map_zero' , desc = 'if a streamline has zero contribution based '
264
+ 'on the contrast & statistic, typically it is not mapped; use this '
265
+ 'option to still contribute to the map even if this is the case '
266
+ '(these non-contributing voxels can then influence the mean value in '
267
+ 'each voxel of the map)' )
268
+
269
+ upsample = traits .Int (argstr = '-upsample %d' , desc = 'upsample the tracks by'
270
+ ' some ratio using Hermite interpolation before '
271
+ 'mappping' )
272
+
273
+ precise = traits .Bool (
274
+ argstr = '-precise' , desc = 'use a more precise streamline mapping '
275
+ 'strategy, that accurately quantifies the length through each voxel '
276
+ '(these lengths are then taken into account during TWI calculation)' )
277
+ ends_only = traits .Bool (argstr = '-ends_only' , desc = 'only map the streamline'
278
+ ' endpoints to the image' )
279
+
280
+ tck_weights = File (exists = True , argstr = '-tck_weights_in %s' , desc = 'specify'
281
+ ' a text scalar file containing the streamline weights' )
282
+ nthreads = traits .Int (
283
+ argstr = '-nthreads %d' , desc = 'number of threads. if zero, the number'
284
+ ' of available cpus will be used' )
285
+
286
+
287
+ class ComputeTDIOutputSpec (TraitedSpec ):
288
+ out_file = File (desc = 'output TDI file' )
289
+
290
+
291
+ class ComputeTDI (MRTrix3Base ):
292
+
293
+ """
294
+ Use track data as a form of contrast for producing a high-resolution
295
+ image.
296
+
297
+ .. admonition:: References
298
+
299
+ * For TDI or DEC TDI: Calamante, F.; Tournier, J.-D.; Jackson, G. D. &
300
+ Connelly, A. Track-density imaging (TDI): Super-resolution white
301
+ matter imaging using whole-brain track-density mapping. NeuroImage,
302
+ 2010, 53, 1233-1243
303
+
304
+ * If using -contrast length and -stat_vox mean: Pannek, K.; Mathias,
305
+ J. L.; Bigler, E. D.; Brown, G.; Taylor, J. D. & Rose, S. E. The
306
+ average pathlength map: A diffusion MRI tractography-derived index
307
+ for studying brain pathology. NeuroImage, 2011, 55, 133-141
308
+
309
+ * If using -dixel option with TDI contrast only: Smith, R.E., Tournier,
310
+ J-D., Calamante, F., Connelly, A. A novel paradigm for automated
311
+ segmentation of very large whole-brain probabilistic tractography
312
+ data sets. In proc. ISMRM, 2011, 19, 673
313
+
314
+ * If using -dixel option with any other contrast: Pannek, K., Raffelt,
315
+ D., Salvado, O., Rose, S. Incorporating directional information in
316
+ diffusion tractography derived maps: angular track imaging (ATI).
317
+ In Proc. ISMRM, 2012, 20, 1912
318
+
319
+ * If using -tod option: Dhollander, T., Emsell, L., Van Hecke, W., Maes,
320
+ F., Sunaert, S., Suetens, P. Track Orientation Density Imaging (TODI)
321
+ and Track Orientation Distribution (TOD) based tractography.
322
+ NeuroImage, 2014, 94, 312-336
323
+
324
+ * If using other contrasts / statistics: Calamante, F.; Tournier, J.-D.;
325
+ Smith, R. E. & Connelly, A. A generalised framework for
326
+ super-resolution track-weighted imaging. NeuroImage, 2012, 59,
327
+ 2494-2503
328
+
329
+ * If using -precise mapping option: Smith, R. E.; Tournier, J.-D.;
330
+ Calamante, F. & Connelly, A. SIFT: Spherical-deconvolution informed
331
+ filtering of tractograms. NeuroImage, 2013, 67, 298-312 (Appendix 3)
332
+
333
+
334
+
335
+ Example
336
+ -------
337
+
338
+ >>> import nipype.interfaces.mrtrix3 as mrt
339
+ >>> tdi = mrt.ComputeTDI()
340
+ >>> tdi.inputs.in_file = 'dti.mif'
341
+ >>> tdi.cmdline # doctest: +ELLIPSIS
342
+ 'tckmap dti.mif tdi.mif'
343
+ >>> tdi.run() # doctest: +SKIP
344
+ """
345
+
346
+ _cmd = 'tckmap'
347
+ input_spec = ComputeTDIInputSpec
348
+ output_spec = ComputeTDIOutputSpec
349
+
350
+ def _list_outputs (self ):
351
+ outputs = self .output_spec ().get ()
352
+ outputs ['out_file' ] = op .abspath (self .inputs .out_file )
353
+ return outputs
0 commit comments