-
Notifications
You must be signed in to change notification settings - Fork 532
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
WIP: Dtitk #2185
Changes from 12 commits
6ea8e5d
5232552
ae59226
f1dc18b
8b45b9b
c7122ac
7b8b5db
1127b4d
3808fee
54d9d1d
0a4bda2
b37f65f
3182baa
7eaab1c
8812dc7
6a393ca
af96a0b
d240443
0807cdb
78821e4
948811f
89628d0
9c84405
7ad09b8
74f736e
64f7202
80a4262
b567e0a
da31236
f60c149
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"nipype/algorithms/tests/test_tsnr.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_AffineTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_BinThreshTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_CommandLineDtitk.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_ComposeXfmTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_DiffeoTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_RigidTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_SVAdjustVoxSpTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_SVResampleTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_TVAdjustOriginTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_TVAdjustVoxSpTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_TVResampleTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_TVtoolTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_affScalarVolTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_affSymTensor3DVolTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_diffeoScalarVolTask.py": true, | ||
"nipype/interfaces/dtitk/tests/test_auto_diffeoSymTensor3DVolTask.py": true, | ||
"nipype/pipeline/plugins/tests/test_base.py": true, | ||
"nipype/testing/tests/test_utils.py": true, | ||
"nipype/workflows/rsfmri/fsl/tests/test_resting.py": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT | ||
from __future__ import unicode_literals | ||
from ..utils import TCatSubBrick | ||
|
||
|
||
def test_TCatSubBrick_inputs(): | ||
input_map = dict(args=dict(argstr='%s', | ||
), | ||
environ=dict(nohash=True, | ||
usedefault=True, | ||
), | ||
ignore_exception=dict(nohash=True, | ||
usedefault=True, | ||
), | ||
in_files=dict(argstr='%s%s ...', | ||
copyfile=False, | ||
mandatory=True, | ||
position=-1, | ||
), | ||
out_file=dict(argstr='-prefix %s', | ||
genfile=True, | ||
), | ||
outputtype=dict(), | ||
rlt=dict(argstr='-rlt%s', | ||
position=1, | ||
), | ||
terminal_output=dict(nohash=True, | ||
), | ||
) | ||
inputs = TCatSubBrick.input_spec() | ||
|
||
for key, metadata in list(input_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(inputs.traits()[key], metakey) == value | ||
|
||
|
||
def test_TCatSubBrick_outputs(): | ||
output_map = dict(out_file=dict(), | ||
) | ||
outputs = TCatSubBrick.output_spec() | ||
|
||
for key, metadata in list(output_map.items()): | ||
for metakey, value in list(metadata.items()): | ||
assert getattr(outputs.traits()[key], metakey) == value |
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 ..dtitk.registration import (RigidTask, AffineTask, DiffeoTask, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
ComposeXfmTask, diffeoSymTensor3DVolTask, | ||
affSymTensor3DVolTask, affScalarVolTask, | ||
diffeoScalarVolTask) | ||
from ..dtitk.utils import (TVAdjustOriginTask, TVAdjustVoxSpTask, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
SVAdjustVoxSpTask, TVResampleTask, SVResampleTask, | ||
TVtoolTask, BinThreshTask) |
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file isn't necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two quick questions:
Thanks again, @mgxd!
Kesshi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kesshijordan
.cache
directory is created bypytest
when running nipype's tests, and this file just serves as a reminder when retrying - you can keep this in your local clone, but it doesn't really serve a purpose on the master repo.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kesshijordan -
lastfailed
is the only one that's included in the commit. probably got added by mistake. but in general nothing in.cache
should be in the commit.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @satra. I removed the .cache file from git and have pushed the change. @mgxd is there anything else I need to address?