Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 91c8a16

Browse files
committed
feat: tcksift2
1 parent 4d1352a commit 91c8a16

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

‎nipype/interfaces/mrtrix3/utils.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
33
# -*- coding: utf-8 -*-
4-
54
import os.path as op
65

76
from ...utils.filemanip import split_filename
@@ -18,6 +17,43 @@
1817
from .base import MRTrix3BaseInputSpec, MRTrix3Base
1918

2019

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+
2157
class BrainMaskInputSpec(MRTrix3BaseInputSpec):
2258
in_file = File(
2359
exists=True,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /