Skip to content

WIP: Dtitk #2185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Jan 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6ea8e5d
added interface for dtitk
May 19, 2017
5232552
Added interface for DTITK command-line tools
kesshijordan May 19, 2017
ae59226
Added several docstring tests and untested interfaces
kesshijordan May 19, 2017
f1dc18b
changed relative imports to absolute, fixed docstring tests
kesshijordan May 20, 2017
8b45b9b
Merge remote-tracking branch 'upstream/master' into dtitk
Sep 7, 2017
c7122ac
added init
Sep 7, 2017
7b8b5db
changed input variable names
kesshijordan Sep 15, 2017
1127b4d
added # doctest: +SKIP
kesshijordan Sep 15, 2017
3808fee
Merge remote-tracking branch 'upstream/master' into dtitk
kesshijordan Sep 15, 2017
54d9d1d
added init file
kesshijordan Sep 19, 2017
0a4bda2
fixed variable name changes
kesshijordan Sep 19, 2017
b37f65f
added auto-generated tests
kesshijordan Sep 19, 2017
3182baa
removed .cache from git
kesshijordan Oct 3, 2017
7eaab1c
Merge branch 'master' of https://github.com/nipy/nipype into dtitk
kesshijordan Oct 13, 2017
8812dc7
fixed some changes from mgxd code review, but circle failing so testi…
kesshijordan Oct 13, 2017
6a393ca
testing file naming
kesshijordan Oct 30, 2017
af96a0b
Merge remote-tracking branch 'upstream/master' into dtitk
kesshijordan Oct 30, 2017
d240443
Rigid registration node tested and works
kesshijordan Oct 30, 2017
0807cdb
tested affine
kesshijordan Oct 30, 2017
78821e4
returned to .nii.gz; will deal with .nii later
kesshijordan Dec 2, 2017
948811f
changed output var names
kesshijordan Dec 3, 2017
89628d0
fixed typo
kesshijordan Dec 4, 2017
9c84405
fix typo
kesshijordan Dec 5, 2017
7ad09b8
regenerated tests so var names are updated
kesshijordan Dec 6, 2017
74f736e
Merge branch 'master' into dtitk
mgxd Jan 5, 2018
64f7202
Delete stderr.nipype
kesshijordan Jan 11, 2018
80a4262
Delete stdout.nipype
kesshijordan Jan 11, 2018
b567e0a
Merge remote-tracking branch 'upstream/master' into dtitk
effigies Jan 19, 2018
da31236
make specs
effigies Jan 19, 2018
f60c149
TEST: Drop extra auto test
effigies Jan 19, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions nipype/interfaces/dtitk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""The dtitk module provides classes for interfacing with the `Diffusion
Tensor Imaging Toolkit (DTI-TK)
<http://dti-tk.sourceforge.net/pmwiki/pmwiki.php>`_ command line tools.

Top-level namespace for dti-tk.
"""

# from .base import ()
from .registration import (RigidTask, AffineTask, DiffeoTask,
ComposeXfmTask, diffeoSymTensor3DVolTask,
affSymTensor3DVolTask, affScalarVolTask,
diffeoScalarVolTask)
from .utils import (TVAdjustOriginTask, TVAdjustVoxSpTask,
SVAdjustVoxSpTask, TVResampleTask, SVResampleTask,
TVtoolTask, BinThreshTask)
81 changes: 81 additions & 0 deletions nipype/interfaces/dtitk/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""The dtitk module provides classes for interfacing with the `DTITK
<http://dti-tk.sourceforge.net/pmwiki/pmwiki.php>`_ command line tools.

These are the base tools for working with DTITK.
Preprocessing tools are found in dtitk/preprocess.py
Registration tools are found in dtitk/registration.py

Currently these tools are supported:

* Rigid Tensor Registration
* Affine Tensor Registration
* Diffeomorphic Tensor Registration

Examples
--------
See the docstrings of the individual classes for examples.

"""
from __future__ import print_function, division, unicode_literals, \
absolute_import

import os

from ... import logging
from ...utils.filemanip import fname_presuffix
from ..base import CommandLine
from nipype.interfaces.fsl.base import Info

LOGGER = logging.getLogger('interface')


class CommandLineDtitk(CommandLine):

def _gen_fname(self, basename, cwd=None, suffix=None, change_ext=True,
ext=None):
"""Generate a filename based on the given parameters.

The filename will take the form: cwd/basename<suffix><ext>.
If change_ext is True, it will use the extentions specified in
<instance>intputs.output_type.

Parameters
----------
basename : str
Filename to base the new filename on.
cwd : str
Path to prefix to the new filename. (default is os.getcwd())
suffix : str
Suffix to add to the `basename`. (defaults is '' )
change_ext : bool
Flag to change the filename extension to the FSL output type.
(default True)

Returns
-------
fname : str
New filename based on given parameters.

"""

if basename == '':
msg = 'Unable to generate filename for command %s. ' % self.cmd
msg += 'basename is not set!'
raise ValueError(msg)
if cwd is None:
cwd = os.getcwd()
if ext is None:
ext = Info.output_type_to_ext(self.inputs.output_type)
if change_ext:
if suffix:
suffix = ''.join((suffix, ext))
else:
suffix = ext
if suffix is None:
suffix = ''
fname = fname_presuffix(basename, suffix=suffix,
use_ext=False, newpath=cwd)
return fname
Loading