interfaces.diffusion_toolkit.postproc

SplineFilter

Link to code

Wraps the executable command spline_filter.

Smoothes TrackVis track files with a B-Spline filter.

Helps remove redundant track points and segments (thus reducing the size of the track file) and also make tracks nicely smoothed. It will NOT change the quality of the tracks or lose any original information.

Example

>>> import nipype.interfaces.diffusion_toolkit as dtk
>>> filt = dtk.SplineFilter()
>>> filt.inputs.track_file = 'tracks.trk'
>>> filt.inputs.step_length = 0.5
>>> filt.run()                                 # doctest: +SKIP

Inputs:

[Mandatory]
track_file: (a pathlike object or string representing an existing
          file)
        file containing tracks to be filtered
        argument: ``%s``, position: 0
step_length: (a float)
        in the unit of minimum voxel size
        argument: ``%f``, position: 1

[Optional]
output_file: (a pathlike object or string representing a file, nipype
          default value: spline_tracks.trk)
        target file for smoothed tracks
        argument: ``%s``, position: 2
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

smoothed_track_file: (a pathlike object or string representing an
          existing file)

TrackMerge

Link to code

Wraps the executable command track_merge.

Merges several TrackVis track files into a single track file.

An id type property tag is added to each track in the newly merged file, with each unique id representing where the track was originally from. When the merged file is loaded in TrackVis, a property filter will show up in Track Property panel. Users can adjust that to distinguish and sub-group tracks by its id (origin).

Example

>>> import nipype.interfaces.diffusion_toolkit as dtk
>>> mrg = dtk.TrackMerge()
>>> mrg.inputs.track_files = ['track1.trk','track2.trk']
>>> mrg.run()                                 # doctest: +SKIP

Inputs:

[Mandatory]
track_files: (a list of items which are a pathlike object or string
          representing an existing file)
        file containing tracks to be filtered
        argument: ``%s...``, position: 0

[Optional]
output_file: (a pathlike object or string representing a file, nipype
          default value: merged_tracks.trk)
        target file for merged tracks
        argument: ``%s``, position: -1
args: (a unicode string)
        Additional parameters to the command
        argument: ``%s``
environ: (a dictionary with keys which are a bytes or None or a value
          of class 'str' and with values which are a bytes or None or a
          value of class 'str', nipype default value: {})
        Environment variables

Outputs:

track_file: (a pathlike object or string representing an existing
          file)