Skip to content

Commit 8aa9aa8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into enh/dcm2nii
* upstream/master: updated changelog 0.9.2 release cleanup Added VtoMat vista interface and updated CHANGES and autogenerated tests accordingly added test for Vnifti2Image interface updated CHANGES log Created interface for vimage2nifti command from lipvia vista package fixed mcflirt mean image output
2 parents 12c03b8 + b1b7825 commit 8aa9aa8

File tree

11 files changed

+174
-7
lines changed

11 files changed

+174
-7
lines changed

CHANGES

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Future Release
2-
==============
1+
Release 0.9.2 (January 31, 2014)
2+
===========
33

44
* FIX: DataFinder was broken due to a typo
55
* FIX: Order of DataFinder outputs was not guaranteed, it's human sorted now
6+
* ENH: New interfaces: Vnifti2Image, VtoMat
67

78
Release 0.9.1 (December 25, 2013)
89
============

doc/_templates/sidebar_versions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h3>{{ _('Versions') }}</h3>
1717
<td align="left">Release</td><td align="right">Devel</td>
1818
</tr>
1919
<tr>
20-
<td align="left">0.9.1</td><td align="right">1.0-dev</td>
20+
<td align="left">0.9.2</td><td align="right">1.0-dev</td>
2121
</tr>
2222
<tr>
2323
<td align="left"><a href="{{pathto('users/install')}}">Download</a></td>

doc/users/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This page covers the necessary steps to install Nipype.
99
Download
1010
--------
1111

12-
Release 0.9.1: [`zip <https://github.com/nipy/nipype/archive/0.9.1.zip>`__ `tar.gz
12+
Release 0.9.2: [`zip <https://github.com/nipy/nipype/archive/0.9.2.zip>`__ `tar.gz
1313
<https://github.com/nipy/nipype/archive/0.9.1.tar.gz>`__]
1414

1515
Development: [`zip <http://github.com/nipy/nipype/zipball/master>`__ `tar.gz

nipype/info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# version
1010
_version_major = 0
1111
_version_minor = 9
12-
_version_micro = 1
13-
_version_extra = '.dev'
12+
_version_micro = 2
13+
_version_extra = ''
1414

1515
def get_nipype_gitversion():
1616
"""Nipype version as reported by the last commit in git

nipype/interfaces/fsl/preprocess.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,8 +678,17 @@ def _list_outputs(self):
678678
'_variance.ext', cwd=cwd)
679679
outputs['std_img'] = self._gen_fname(outputs['out_file'] +
680680
'_sigma.ext', cwd=cwd)
681+
682+
# The mean image created if -stats option is specified ('meanvol')
683+
# is missing the top and bottom slices. Therefore we only expose the
684+
# mean image created by -meanvol option ('mean_reg') which isn't
685+
# corrupted.
686+
# Note that the same problem holds for the std and variance image.
687+
688+
if isdefined(self.inputs.mean_vol) and self.inputs.mean_vol:
681689
outputs['mean_img'] = self._gen_fname(outputs['out_file'] +
682-
'_meanvol.ext', cwd=cwd)
690+
'_mean_reg.ext', cwd=cwd)
691+
683692
if isdefined(self.inputs.save_mats) and self.inputs.save_mats:
684693
_, filename = os.path.split(outputs['out_file'])
685694
matpathname = os.path.join(cwd, filename + '.mat')

nipype/interfaces/vista/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2+
# vi: set ft=python sts=4 ts=4 sw=4 et:
3+
from .vista import (Vnifti2Image, VtoMat)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.interfaces.vista.vista import Vnifti2Image
4+
def test_Vnifti2Image_inputs():
5+
input_map = dict(ignore_exception=dict(nohash=True,
6+
usedefault=True,
7+
),
8+
out_file=dict(hash_files=False,
9+
name_template='%s.v',
10+
name_source=['in_file'],
11+
keep_extension=False,
12+
position=-1,
13+
argstr='-out %s',
14+
),
15+
args=dict(argstr='%s',
16+
),
17+
terminal_output=dict(nohash=True,
18+
mandatory=True,
19+
),
20+
environ=dict(nohash=True,
21+
usedefault=True,
22+
),
23+
in_file=dict(position=1,
24+
mandatory=True,
25+
argstr='-in %s',
26+
),
27+
attributes=dict(position=2,
28+
mandatory=False,
29+
argstr='-attr %s',
30+
),
31+
)
32+
inputs = Vnifti2Image.input_spec()
33+
34+
for key, metadata in input_map.items():
35+
for metakey, value in metadata.items():
36+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
37+
def test_Vnifti2Image_outputs():
38+
output_map = dict(out_file=dict(),
39+
)
40+
outputs = Vnifti2Image.output_spec()
41+
42+
for key, metadata in output_map.items():
43+
for metakey, value in metadata.items():
44+
yield assert_equal, getattr(outputs.traits()[key], metakey), value
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.interfaces.vista.vista import VtoMat
4+
def test_VtoMat_inputs():
5+
input_map = dict(ignore_exception=dict(nohash=True,
6+
usedefault=True,
7+
),
8+
out_file=dict(hash_files=False,
9+
name_template='%s.mat',
10+
name_source=['in_file'],
11+
keep_extension=False,
12+
position=-1,
13+
argstr='-out %s',
14+
),
15+
args=dict(argstr='%s',
16+
),
17+
terminal_output=dict(nohash=True,
18+
mandatory=True,
19+
),
20+
environ=dict(nohash=True,
21+
usedefault=True,
22+
),
23+
in_file=dict(position=1,
24+
mandatory=True,
25+
argstr='-in %s',
26+
),
27+
)
28+
inputs = VtoMat.input_spec()
29+
30+
for key, metadata in input_map.items():
31+
for metakey, value in metadata.items():
32+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
33+
def test_VtoMat_outputs():
34+
output_map = dict(out_file=dict(),
35+
)
36+
outputs = VtoMat.output_spec()
37+
38+
for key, metadata in output_map.items():
39+
for metakey, value in metadata.items():
40+
yield assert_equal, getattr(outputs.traits()[key], metakey), value

nipype/interfaces/vista/vista.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2+
# vi: set ft=python sts=4 ts=4 sw=4 et:
3+
"""
4+
Change directory to provide relative paths for doctests
5+
>>> import os
6+
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
7+
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
8+
>>> os.chdir(datadir)
9+
10+
"""
11+
12+
from nipype.interfaces.base import CommandLineInputSpec, CommandLine, traits, TraitedSpec, File
13+
from nipype.utils.filemanip import split_filename
14+
import os, os.path as op
15+
from nipype.interfaces.traits_extension import isdefined
16+
17+
class Vnifti2ImageInputSpec(CommandLineInputSpec):
18+
in_file = File(exists=True, argstr='-in %s', mandatory=True, position=1, desc='in file')
19+
attributes = File(exists=True, argstr='-attr %s', mandatory=False, position=2, desc='attribute file')
20+
out_file = File(name_template="%s.v", keep_extension=False, argstr='-out %s', hash_files=False,
21+
position= -1, desc='output data file', name_source=["in_file"])
22+
23+
class Vnifti2ImageOutputSpec(TraitedSpec):
24+
out_file = File(exists=True, desc='Output vista file')
25+
26+
class Vnifti2Image(CommandLine):
27+
"""
28+
Convert a nifti file into a vista file.
29+
30+
Example
31+
-------
32+
33+
>>> vimage = Vnifti2Image()
34+
>>> vimage.inputs.in_file = 'image.nii'
35+
>>> vimage.cmdline
36+
'vnifti2image -in image.nii -out image.v'
37+
>>> vimage.run() # doctest: +SKIP
38+
"""
39+
40+
_cmd = 'vnifti2image'
41+
input_spec=Vnifti2ImageInputSpec
42+
output_spec=Vnifti2ImageOutputSpec
43+
44+
45+
class VtoMatInputSpec(CommandLineInputSpec):
46+
in_file = File(exists=True, argstr='-in %s', mandatory=True, position=1, desc='in file')
47+
out_file = File(name_template="%s.mat", keep_extension=False, argstr='-out %s', hash_files=False,
48+
position= -1, desc='output mat file', name_source=["in_file"])
49+
50+
class VtoMatOutputSpec(TraitedSpec):
51+
out_file = File(exists=True, desc='Output mat file')
52+
53+
class VtoMat(CommandLine):
54+
"""
55+
Convert a nifti file into a vista file.
56+
57+
Example
58+
-------
59+
60+
>>> vimage = VtoMat()
61+
>>> vimage.inputs.in_file = 'image.v'
62+
>>> vimage.cmdline
63+
'vtomat -in image.v -out image.mat'
64+
>>> vimage.run() # doctest: +SKIP
65+
"""
66+
67+
_cmd = 'vtomat'
68+
input_spec=VtoMatInputSpec
69+
output_spec=VtoMatOutputSpec
70+

nipype/testing/data/image.nii

Whitespace-only changes.

nipype/testing/data/image.v

Whitespace-only changes.

0 commit comments

Comments
 (0)