Skip to content

Commit ce62e1d

Browse files
author
Erik Ziegler
committed
DTK track_merge interface
1 parent 7f3cab8 commit ce62e1d

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from .base import Info
2-
from .postproc import SplineFilter
2+
from .postproc import SplineFilter, TrackMerge
33
from .dti import DTIRecon, DTITracker
44
from .odf import HARDIMat, ODFRecon, ODFTracker

nipype/interfaces/diffusion_toolkit/postproc.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
__docformat__ = 'restructuredtext'
1414

1515
from nipype.interfaces.base import (TraitedSpec, File, traits, CommandLine,
16-
CommandLineInputSpec)
16+
InputMultiPath, CommandLineInputSpec)
1717

1818
class SplineFilterInputSpec(CommandLineInputSpec):
1919
track_file = File(exists=True, desc="file containing tracks to be filtered", position=0, argstr="%s", mandatory=True)
@@ -32,4 +32,23 @@ class SplineFilter(CommandLine):
3232
def _list_outputs(self):
3333
outputs = self.output_spec().get()
3434
outputs['smoothed_track_file'] = os.path.abspath(self.inputs.output_file)
35-
return outputs
35+
return outputs
36+
37+
38+
class TrackMergeInputSpec(CommandLineInputSpec):
39+
track_files = InputMultiPath(File(exists=True), desc="file containing tracks to be filtered", position=0, argstr="%s...", mandatory=True)
40+
output_file = File("merged_tracks.trk", desc="target file for merged tracks", position=-1, argstr="%s", usedefault=True)
41+
42+
class TrackMergeOutputSpec(TraitedSpec):
43+
track_file = File(exists=True)
44+
45+
class TrackMerge(CommandLine):
46+
input_spec=TrackMergeInputSpec
47+
output_spec=TrackMergeOutputSpec
48+
49+
_cmd = "track_merge"
50+
51+
def _list_outputs(self):
52+
outputs = self.output_spec().get()
53+
outputs['track_file'] = os.path.abspath(self.inputs.output_file)
54+
return outputs

0 commit comments

Comments
 (0)