Skip to content

Commit af96a0b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dtitk
2 parents 6a393ca + 557aad3 commit af96a0b

37 files changed

+857
-223
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ before_install:
3434
hash -r &&
3535
conda config --set always_yes yes --set changeps1 no &&
3636
conda update -q conda &&
37-
conda install python=${TRAVIS_PYTHON_VERSION} &&
3837
conda config --add channels conda-forge &&
39-
conda install -y nipype icu &&
40-
rm -r ${CONDA_HOME}/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/nipype*;
38+
conda install python=${TRAVIS_PYTHON_VERSION} &&
39+
conda install -y icu &&
40+
pip install -r requirements.txt &&
4141
pushd $HOME;
4242
git clone https://github.com/INCF/pybids.git;
4343
cd pybids;

CHANGES

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,46 @@
1-
Upcoming release
1+
Upcoming release (0.14.0)
22
================
33

44
* ENH: Add elapsed_time and final metric_value to ants.Registration (https://github.com/nipy/nipype/pull/1985)
55
* ENH: Improve terminal_output feature (https://github.com/nipy/nipype/pull/2209)
66
* ENH: Simple interface to FSL std2imgcoords (https://github.com/nipy/nipype/pull/2209, prev #1398)
7-
* ENH: Centralize virtual/physical $DISPLAYs (https://github.com/nipy/nipype/pull/#2203)
8-
* ENH: New ResourceMonitor - replaces resource profiler (https://github.com/nipy/nipype/pull/#2200)
7+
* ENH: Centralize virtual/physical $DISPLAYs (https://github.com/nipy/nipype/pull/2203, https://github.com/nipy/nipype/pull/2211)
8+
* ENH: New ResourceMonitor - replaces resource profiler (https://github.com/nipy/nipype/pull/2200)
9+
* ENH: Quickshear interface (https://github.com/nipy/nipype/pull/2047)
10+
* MAINT: updated deprecated HasTraits method (https://github.com/nipy/nipype/pull/2048)
11+
* ENH: CLI versioning (https://github.com/nipy/nipype/pull/2054)
12+
* ENH: Dual Regression interface (https://github.com/nipy/nipype/pull/2057)
13+
* ENH: Additional args to ANTs registration (https://github.com/nipy/nipype/pull/2062, https://github.com/nipy/nipype/pull/2078)
14+
* FIX: Mp2rage interfaces updated for new parameter names in cbstools 3 (https://github.com/nipy/nipype/pull/2065)
15+
* MAINT: Removed automatic nipype folder creation in HOME (https://github.com/nipy/nipype/pull/2076)
16+
* MAINT: Additional Windows support (https://github.com/nipy/nipype/pull/2085)
17+
* ENH: Output realignment matrices from TOPUP (https://github.com/nipy/nipype/pull/2084)
18+
* ENH: Additional AFNI interfaces: 3dZcat, 3dZeropad, 3dedge3, 3dDeconvolve, 3dQwarp, 1dCat, 3dNwarpApply, 3daxialize,
19+
3dREMLfit, 3dUndump, 3dCM, 3dSynthesize + more (https://github.com/nipy/nipype/pull/2087, https://github.com/nipy/nipype/pull/2090,
20+
https://github.com/nipy/nipype/pull/2095, https://github.com/nipy/nipype/pull/2099, https://github.com/nipy/nipype/pull/2103,
21+
https://github.com/nipy/nipype/pull/2114, https://github.com/nipy/nipype/pull/2135, https://github.com/nipy/nipype/pull/2186,
22+
https://github.com/nipy/nipype/pull/2201, https://github.com/nipy/nipype/pull/2210)
23+
* MAINT: cleanup and update AFNI's Allineate (https://github.com/nipy/nipype/pull/2098)
24+
* ENH: Add cosine-basis high-pass-filter to CompCor, allow skip of initial volumes (https://github.com/nipy/nipype/pull/2107, https://github.com/nipy/nipype/pull/#2122)
25+
* FIX: Catch more dcm2niix DTI conversions (https://github.com/nipy/nipype/pull/2110)
26+
* FIX: Retrieve aseg + wmparc stats properly (https://github.com/nipy/nipype/pull/2117)
27+
* ENH: ANTs MeasureImageSimilarity Inteface (https://github.com/nipy/nipype/pull/2128)
28+
* FIX: CompCor filter_basis of correct size, pre-filter column headers (https://github.com/nipy/nipype/pull/2136, https://github.com/nipy/nipype/pull/2138)
29+
* ENH: FreeSurfer lta_convert and mri_coreg interfaces (https://github.com/nipy/nipype/pull/2140, https://github.com/nipy/nipype/pull/2172)
30+
* ENH: Speed up S3DataGrabber (https://github.com/nipy/nipype/pull/2143)
31+
* FIX: Allow S3DataGrabber to grab single file (https://github.com/nipy/nipype/pull/2147)
32+
* FIX: Allow 4D images as inputs to buildtemplateparallel.sh and N4BiasFieldCorrection (https://github.com/nipy/nipype/pull/2151)
33+
* MAINT: Detect and warn unconnected duplicate nodes (https://github.com/nipy/nipype/pull/2163)
34+
* ENH: Calcmedian Interface (https://github.com/nipy/nipype/pull/2167)
35+
* FIX: probtrackx2 outputs (https://github.com/nipy/nipype/pull/2169)
36+
* ENH: Improve FreeSurfer registration (https://github.com/nipy/nipype/pull/2172)
37+
* ENH: BIDSDataGrabber interface (https://github.com/nipy/nipype/pull/2174)
38+
* MAINT: Set minimum numpy version to 1.9.0 (https://github.com/nipy/nipype/pull/2182)
39+
* ENH: Support for multiple intial-moving-transforms (https://github.com/nipy/nipype/pull/2187)
40+
* MAINT: Fixes for networkx and afni (https://github.com/nipy/nipype/pull/2196, https://github.com/nipy/nipype/pull/2171)
41+
* TST: Update C3D version in Docker build (https://github.com/nipy/nipype/pull/2199)
42+
* ENH: SimpleInterface interface (https://github.com/nipy/nipype/pull/2220)
43+
* ENH: Add LTA to Tkregister2 (https://github.com/nipy/nipype/pull/2217)
944

1045
0.13.1 (May 20, 2017)
1146
=====================

CODE_OF_CONDUCT.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting project leaders Satrajit Ghosh <<[email protected]>> or Chris Gorgolewski <<[email protected]>>. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project leaders is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**Are you new to open source and GitHub?** If so reading the "[How to submit a contribution](https://opensource.guide/how-to-contribute/#how-to-submit-a-contribution)" guide will provide a great introduction to contributing to Nipype and other Open Source projects. All the Nipype specific contributing instructions listed below will make much more sense after reading this guide.
2+
13
## Contributing pull-requests (PRs)
24

35
* All work is submitted via Pull Requests.
@@ -20,7 +22,7 @@
2022
* adding more information about what may have caused the error.
2123
Raise a new exception using ``raise_from(NewException("message"), oldException)`` from ``future``.
2224
Do not log this, as it creates redundant/confusing logs.
23-
* If you are new to the project don't forget to add your name and affiliation to the `.zenodo.json` file.
25+
* **If you are new to the project don't forget to add your name and affiliation to the `.zenodo.json` file.**
2426

2527
## Contributing issues
2628

README.rst

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -90,33 +90,8 @@ To participate in the Nipype development related discussions please use the foll
9090

9191
Please add *[nipype]* to the subject line when posting on the mailing list.
9292

93+
Contributing to the project
94+
---------------------------
9395

94-
Nipype structure
95-
----------------
96-
97-
Currently Nipype consists of the following files and directories:
98-
99-
INSTALL
100-
NIPYPE prerequisites, installation, development, testing, and
101-
troubleshooting.
102-
103-
README
104-
This document.
105-
106-
THANKS
107-
NIPYPE developers and contributors. Please keep it up to date!!
108-
109-
LICENSE
110-
NIPYPE license terms.
111-
112-
doc/
113-
Sphinx/reST documentation
114-
115-
examples/
116-
117-
nipype/
118-
Contains the source code.
119-
120-
setup.py
121-
Script for building and installing NIPYPE.
96+
If you'd like to contribute to the project please read our `guidelines <https://github.com/nipy/nipype/blob/master/CONTRIBUTING.md>`_. Please also read through our `code of conduct <https://github.com/nipy/nipype/blob/master/CODE_OF_CONDUCT.md>`_.
12297

doc/users/saving_workflows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ This will create a file "outputtestsave.py" with the following content:
5555
from nipype.pipeline.engine import Workflow, Node, MapNode
5656
from nipype.interfaces.utility import IdentityInterface
5757
from nipype.interfaces.utility import Function
58-
from nipype.utils.misc import getsource
58+
from nipype.utils.functions import getsource
5959
from nipype.interfaces.fsl.preprocess import BET
6060
from nipype.interfaces.fsl.utils import ImageMaths
6161
# Functions

nipype/interfaces/afni/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .utils import (ABoverlap, AFNItoNIFTI, Autobox, Axialize, BrickStat,
2323
Bucket, Calc, Cat, CatMatvec, CenterMass, Copy, Dot,
2424
Edge3, Eval, FWHMx, MaskTool, Merge, Notes, NwarpApply,
25-
OneDToolPy,
25+
NwarpCat, OneDToolPy,
2626
Refit, Resample, TCat, TCatSubBrick, TStat, To3D, Unifize,
2727
Undump, ZCutUp, GCOR,
2828
Zcat, Zeropad)

nipype/interfaces/afni/preprocess.py

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
import os
1616
import os.path as op
1717

18-
from ...utils.filemanip import (load_json, save_json, split_filename)
18+
from ...utils.filemanip import (load_json, save_json, split_filename,
19+
fname_presuffix)
1920
from ..base import (
2021
CommandLineInputSpec, CommandLine, TraitedSpec,
2122
traits, isdefined, File, InputMultiPath, Undefined, Str)
@@ -2710,6 +2711,11 @@ class WarpInputSpec(AFNICommandInputSpec):
27102711
desc='apply transformation from 3dWarpDrive',
27112712
argstr='-matparent %s',
27122713
exists=True)
2714+
oblique_parent = File(
2715+
desc='Read in the oblique transformation matrix from an oblique '
2716+
'dataset and make cardinal dataset oblique to match',
2717+
argstr='-oblique_parent %s',
2718+
exists=True)
27132719
deoblique = traits.Bool(
27142720
desc='transform dataset from oblique to cardinal',
27152721
argstr='-deoblique')
@@ -2727,6 +2733,9 @@ class WarpInputSpec(AFNICommandInputSpec):
27272733
zpad = traits.Int(
27282734
desc='pad input dataset with N planes of zero on all sides.',
27292735
argstr='-zpad %d')
2736+
verbose = traits.Bool(
2737+
desc='Print out some information along the way.',
2738+
argstr='-verb')
27302739

27312740

27322741
class Warp(AFNICommand):
@@ -2928,6 +2937,17 @@ class QwarpInputSpec(AFNICommandInputSpec):
29282937
'* You CAN use -resample with these 3dQwarp options:'
29292938
'-plusminus -inilev -iniwarp -duplo',
29302939
argstr='-resample')
2940+
allineate = traits.Bool(
2941+
desc='This option will make 3dQwarp run 3dAllineate first, to align '
2942+
'the source dataset to the base with an affine transformation. '
2943+
'It will then use that alignment as a starting point for the '
2944+
'nonlinear warping.',
2945+
argstr='-allineate')
2946+
allineate_opts = traits.Str(
2947+
desc='add extra options to the 3dAllineate command to be run by '
2948+
'3dQwarp.',
2949+
argstr='-allineate_opts %s',
2950+
xand=['allineate'])
29312951
nowarp = traits.Bool(
29322952
desc='Do not save the _WARP file.',
29332953
argstr='-nowarp')
@@ -3131,7 +3151,7 @@ class QwarpInputSpec(AFNICommandInputSpec):
31313151
'Note that the source dataset in the second run is the SAME as'
31323152
'in the first run. If you don\'t see why this is necessary,'
31333153
'then you probably need to seek help from an AFNI guru.',
3134-
argstr='-inlev %d',
3154+
argstr='-inilev %d',
31353155
xor=['duplo'])
31363156
minpatch = traits.Int(
31373157
desc='* The value of mm should be an odd integer.'
@@ -3462,42 +3482,64 @@ class Qwarp(AFNICommand):
34623482
>>> qwarp2.inputs.inilev = 7
34633483
>>> qwarp2.inputs.iniwarp = ['Q25_warp+tlrc.HEAD']
34643484
>>> qwarp2.cmdline # doctest: +ALLOW_UNICODE
3465-
'3dQwarp -base mni.nii -blur 0.0 2.0 -source structural.nii -inlev 7 -iniwarp Q25_warp+tlrc.HEAD -prefix Q11'
3485+
'3dQwarp -base mni.nii -blur 0.0 2.0 -source structural.nii -inilev 7 -iniwarp Q25_warp+tlrc.HEAD -prefix Q11'
34663486
>>> res2 = qwarp2.run() # doctest: +SKIP
3467-
"""
3487+
>>> res2 = qwarp2.run() # doctest: +SKIP
3488+
>>> qwarp3 = afni.Qwarp()
3489+
>>> qwarp3.inputs.in_file = 'structural.nii'
3490+
>>> qwarp3.inputs.base_file = 'mni.nii'
3491+
>>> qwarp3.inputs.allineate = True
3492+
>>> qwarp3.inputs.allineate_opts = '-cose lpa -verb'
3493+
>>> qwarp3.cmdline # doctest: +ALLOW_UNICODE
3494+
"3dQwarp -allineate -allineate_opts '-cose lpa -verb' -base mni.nii -source structural.nii -prefix structural_QW"
3495+
>>> res3 = qwarp3.run() # doctest: +SKIP """
34683496
_cmd = '3dQwarp'
34693497
input_spec = QwarpInputSpec
34703498
output_spec = QwarpOutputSpec
34713499

3500+
def _format_arg(self, name, spec, value):
3501+
if name == 'allineate_opts':
3502+
return spec.argstr % ("'" + value + "'")
3503+
return super(Qwarp, self)._format_arg(name, spec, value)
3504+
34723505
def _list_outputs(self):
34733506
outputs = self.output_spec().get()
34743507

34753508
if not isdefined(self.inputs.out_file):
34763509
prefix = self._gen_fname(self.inputs.in_file, suffix='_QW')
34773510
ext = '.HEAD'
3511+
suffix ='+tlrc'
34783512
else:
34793513
prefix = self.inputs.out_file
34803514
ext_ind = max([prefix.lower().rfind('.nii.gz'),
34813515
prefix.lower().rfind('.nii.')])
34823516
if ext_ind == -1:
34833517
ext = '.HEAD'
3518+
suffix = '+tlrc'
34843519
else:
34853520
ext = prefix[ext_ind:]
3521+
suffix = ''
34863522
print(ext,"ext")
3487-
outputs['warped_source'] = os.path.abspath(self._gen_fname(prefix, suffix='+tlrc')+ext)
3523+
outputs['warped_source'] = fname_presuffix(prefix, suffix=suffix,
3524+
use_ext=False) + ext
34883525
if not self.inputs.nowarp:
3489-
outputs['source_warp'] = os.path.abspath(self._gen_fname(prefix, suffix='_WARP+tlrc')+ext)
3526+
outputs['source_warp'] = fname_presuffix(prefix,
3527+
suffix='_WARP' + suffix, use_ext=False) + ext
34903528
if self.inputs.iwarp:
3491-
outputs['base_warp'] = os.path.abspath(self._gen_fname(prefix, suffix='_WARPINV+tlrc')+ext)
3529+
outputs['base_warp'] = fname_presuffix(prefix,
3530+
suffix='_WARPINV' + suffix, use_ext=False) + ext
34923531
if isdefined(self.inputs.out_weight_file):
34933532
outputs['weights'] = os.path.abspath(self.inputs.out_weight_file)
34943533

34953534
if self.inputs.plusminus:
3496-
outputs['warped_source'] = os.path.abspath(self._gen_fname(prefix, suffix='_PLUS+tlrc')+ext)
3497-
outputs['warped_base'] = os.path.abspath(self._gen_fname(prefix, suffix='_MINUS+tlrc')+ext)
3498-
outputs['source_warp'] = os.path.abspath(self._gen_fname(prefix, suffix='_PLUS_WARP+tlrc')+ext)
3499-
outputs['base_warp'] = os.path.abspath(self._gen_fname(prefix, suffix='_MINUS_WARP+tlrc',)+ext)
3500-
3535+
outputs['warped_source'] = fname_presuffix(prefix,
3536+
suffix='_PLUS' + suffix, use_ext=False) + ext
3537+
outputs['warped_base'] = fname_presuffix(prefix,
3538+
suffix='_MINUS' + suffix, use_ext=False) + ext
3539+
outputs['source_warp'] = fname_presuffix(prefix,
3540+
suffix='_PLUS_WARP' + suffix, use_ext=False) + ext
3541+
outputs['base_warp'] = fname_presuffix(prefix,
3542+
suffix='_MINUS_WARP' + suffix, use_ext=False) + ext
35013543
return outputs
35023544

35033545
def _gen_filename(self, name):
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from __future__ import unicode_literals
3+
from ..utils import NwarpCat
4+
5+
6+
def test_NwarpCat_inputs():
7+
input_map = dict(args=dict(argstr='%s',
8+
),
9+
environ=dict(nohash=True,
10+
usedefault=True,
11+
),
12+
expad=dict(argstr='-expad %d',
13+
),
14+
ignore_exception=dict(nohash=True,
15+
usedefault=True,
16+
),
17+
in_files=dict(argstr='%s',
18+
descr='list of tuples of 3D warps and associated functions',
19+
mandatory=True,
20+
position=-1,
21+
),
22+
interp=dict(argstr='-interp %s',
23+
),
24+
inv_warp=dict(argstr='-iwarp',
25+
),
26+
num_threads=dict(nohash=True,
27+
usedefault=True,
28+
),
29+
out_file=dict(argstr='-prefix %s',
30+
name_source='in_files',
31+
name_template='%s_NwarpCat',
32+
),
33+
outputtype=dict(),
34+
space=dict(argstr='-space %s',
35+
),
36+
terminal_output=dict(deprecated='1.0.0',
37+
nohash=True,
38+
),
39+
verb=dict(argstr='-verb',
40+
),
41+
)
42+
inputs = NwarpCat.input_spec()
43+
44+
for key, metadata in list(input_map.items()):
45+
for metakey, value in list(metadata.items()):
46+
assert getattr(inputs.traits()[key], metakey) == value
47+
48+
49+
def test_NwarpCat_outputs():
50+
output_map = dict(out_file=dict(),
51+
)
52+
outputs = NwarpCat.output_spec()
53+
54+
for key, metadata in list(output_map.items()):
55+
for metakey, value in list(metadata.items()):
56+
assert getattr(outputs.traits()[key], metakey) == value

0 commit comments

Comments
 (0)