|
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
|
|
19 | 18 | from .base import MRTrix3BaseInputSpec, MRTrix3Base
|
20 | 19 |
|
21 | 20 |
|
| 21 | +class TckSift2InputSpec(CommandLineInputSpec): |
| 22 | + in_file = File(exists=True, argstr="%s", mandatory=True, position=-3, desc="input streamlines file") |
| 23 | + in_fod = File(exists=True, argstr="%s", mandatory=True, position=-2, desc="input FOD file") |
| 24 | + out_weights = File(argstr="%s", mandatory=True, position=-1, desc="output weights file") |
| 25 | + |
| 26 | + |
| 27 | +class TckSift2OutputSpec(TraitedSpec): |
| 28 | + out_weights = File(exists=True, desc="output weights file") |
| 29 | + |
| 30 | + |
| 31 | +class TckSift2(CommandLine): |
| 32 | + """ |
| 33 | + Interface for MRTrix's tcksift2 command |
| 34 | +
|
| 35 | + Example |
| 36 | + ------- |
| 37 | +
|
| 38 | + >>> import nipype.interfaces.mrtrix3 as mrt |
| 39 | + >>> tcksift2 = mrt.TckSift2() |
| 40 | + >>> tcksift2.inputs.in_file = 'streamlines.tck' |
| 41 | + >>> tcksift2.inputs.in_fod = 'fod.mif' |
| 42 | + >>> tcksift2.inputs.out_weights = 'streamlines_weights.txt' |
| 43 | + >>> tcksift2.cmdline # doctest: +ELLIPSIS |
| 44 | + 'tcksift2 streamlines.tck fod.mif streamlines_weights.txt' |
| 45 | + >>> tcksift2.run() # doctest: +SKIP |
| 46 | + """ |
| 47 | + |
| 48 | + _cmd = 'tcksift2' |
| 49 | + input_spec = TckSift2InputSpec |
| 50 | + output_spec = TckSift2OutputSpec |
| 51 | + |
| 52 | + def _list_outputs(self): |
| 53 | + outputs = self.output_spec().get() |
| 54 | + outputs["out_weights"] = op.abspath(self.inputs.out_weights) |
| 55 | + return outputs |
| 56 | + |
| 57 | + |
22 | 58 | class BrainMaskInputSpec(MRTrix3BaseInputSpec):
|
23 | 59 | in_file = File(
|
24 | 60 | exists=True,
|
|
0 commit comments