|  | 
| 1 | 1 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- | 
| 2 | 2 | # vi: set ft=python sts=4 ts=4 sw=4 et: | 
| 3 | 3 | # -*- coding: utf-8 -*- | 
| 4 |  | - | 
| 5 | 4 | import os.path as op | 
| 6 | 5 | 
 | 
| 7 | 6 | from ...utils.filemanip import split_filename | 
|  | 
| 18 | 17 | from .base import MRTrix3BaseInputSpec, MRTrix3Base | 
| 19 | 18 | 
 | 
| 20 | 19 | 
 | 
|  | 20 | +class TckSift2InputSpec(CommandLineInputSpec): | 
|  | 21 | +    in_file = File(exists=True, argstr="%s", mandatory=True, position=-3, desc="input streamlines file") | 
|  | 22 | +    in_fod = File(exists=True, argstr="%s", mandatory=True, position=-2, desc="input FOD file") | 
|  | 23 | +    out_weights = File(argstr="%s", mandatory=True, position=-1, desc="output weights file") | 
|  | 24 | + | 
|  | 25 | + | 
|  | 26 | +class TckSift2OutputSpec(TraitedSpec): | 
|  | 27 | +    out_weights = File(exists=True, desc="output weights file") | 
|  | 28 | + | 
|  | 29 | + | 
|  | 30 | +class TckSift2(CommandLine): | 
|  | 31 | +    """ | 
|  | 32 | +    Interface for MRTrix's tcksift2 command | 
|  | 33 | +
 | 
|  | 34 | +    Example | 
|  | 35 | +    ------- | 
|  | 36 | +
 | 
|  | 37 | +    >>> import nipype.interfaces.mrtrix3 as mrt | 
|  | 38 | +    >>> tcksift2 = mrt.TckSift2() | 
|  | 39 | +    >>> tcksift2.inputs.in_file = 'streamlines.tck' | 
|  | 40 | +    >>> tcksift2.inputs.in_fod = 'fod.mif' | 
|  | 41 | +    >>> tcksift2.inputs.out_weights = 'streamlines_weights.txt' | 
|  | 42 | +    >>> tcksift2.cmdline                               # doctest: +ELLIPSIS | 
|  | 43 | +    'tcksift2 streamlines.tck fod.mif streamlines_weights.txt' | 
|  | 44 | +    >>> tcksift2.run()                                 # doctest: +SKIP | 
|  | 45 | +    """ | 
|  | 46 | +         | 
|  | 47 | +    _cmd = 'tcksift2' | 
|  | 48 | +    input_spec = TckSift2InputSpec | 
|  | 49 | +    output_spec = TckSift2OutputSpec | 
|  | 50 | +     | 
|  | 51 | +    def _list_outputs(self): | 
|  | 52 | +        outputs = self.output_spec().get() | 
|  | 53 | +        outputs["out_weights"] = op.abspath(self.inputs.out_weights) | 
|  | 54 | +        return outputs | 
|  | 55 | + | 
|  | 56 | + | 
| 21 | 57 | class BrainMaskInputSpec(MRTrix3BaseInputSpec): | 
| 22 | 58 |     in_file = File( | 
| 23 | 59 |         exists=True, | 
|  | 
0 commit comments