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 a83aef0

Browse files
shachafyeffigies
authored andcommitted
feat: tcksift2
1 parent 6ac81ca commit a83aef0

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
@@ -19,6 +18,43 @@
1918
from .base import MRTrix3BaseInputSpec, MRTrix3Base
2019

2120

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

0 commit comments

Comments
(0)

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