Skip to content

Commit 741dd1c

Browse files
committed
Merge branch 'master' into afni_nwarpcat
2 parents 988b01d + 37c9db6 commit 741dd1c

34 files changed

+968
-237
lines changed

CHANGES

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

4+
* ENH: Add elapsed_time and final metric_value to ants.Registration (https://github.com/nipy/nipype/pull/1985)
45
* ENH: Improve terminal_output feature (https://github.com/nipy/nipype/pull/2209)
56
* ENH: Simple interface to FSL std2imgcoords (https://github.com/nipy/nipype/pull/2209, prev #1398)
6-
* ENH: Centralize virtual/physical $DISPLAYs (https://github.com/nipy/nipype/pull/#2203)
7-
* 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)
844

945
0.13.1 (May 20, 2017)
1046
=====================

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 <<satra@mit.edu>> or Chris Gorgolewski <<krzysztof.gorgolewski@gmail.com>>. 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

nipype/interfaces/afni/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
Refit, Resample, TCat, TCatSubBrick, TStat, To3D, Unifize,
2727
Undump, ZCutUp, GCOR,
2828
Zcat, Zeropad)
29-
from .model import (Deconvolve, Remlfit)
29+
from .model import (Deconvolve, Remlfit, Synthesize)

nipype/interfaces/afni/model.py

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
154154
x1D_stop = traits.Bool(
155155
desc='stop running after writing .xmat.1D file',
156156
argstr='-x1D_stop')
157+
cbucket = traits.Str(
158+
desc='Name for dataset in which to save the regression '
159+
'coefficients (no statistics). This dataset '
160+
'will be used in a -xrestore run [not yet implemented] '
161+
'instead of the bucket dataset, if possible.',
162+
argstr='-cbucket %s')
157163
out_file = File(
158164
desc='output statistics file',
159165
argstr='-bucket %s')
@@ -231,6 +237,8 @@ class DeconvolveOutputSpec(TraitedSpec):
231237
desc='automatical generated script to run 3dREMLfit', exists=True)
232238
x1D = File(
233239
desc='save out X matrix', exists=True)
240+
cbucket = File(
241+
desc='output regression coefficients file (if generated)')
234242

235243

236244
class Deconvolve(AFNICommand):
@@ -588,3 +596,75 @@ def _list_outputs(self):
588596
outputs[key] = os.path.abspath(self.inputs.get()[key])
589597

590598
return outputs
599+
600+
601+
class SynthesizeInputSpec(AFNICommandInputSpec):
602+
cbucket = File(
603+
desc='Read the dataset output from '
604+
'3dDeconvolve via the \'-cbucket\' option.',
605+
argstr='-cbucket %s',
606+
copyfile=False,
607+
mandatory=True)
608+
matrix = File(
609+
desc='Read the matrix output from '
610+
'3dDeconvolve via the \'-x1D\' option.',
611+
argstr='-matrix %s',
612+
copyfile=False,
613+
mandatory=True)
614+
select = traits.List(
615+
Str(desc='selected columns to synthesize'),
616+
argstr='-select %s',
617+
desc='A list of selected columns from the matrix (and the '
618+
'corresponding coefficient sub-bricks from the '
619+
'cbucket). Valid types include \'baseline\', '
620+
' \'polort\', \'allfunc\', \'allstim\', \'all\', '
621+
'Can also provide \'something\' where something matches '
622+
'a stim_label from 3dDeconvolve, and \'digits\' where digits '
623+
'are the numbers of the select matrix columns by '
624+
'numbers (starting at 0), or number ranges of the form '
625+
'\'3..7\' and \'3-7\'.',
626+
mandatory=True)
627+
out_file = File(
628+
name_template='syn',
629+
desc='output dataset prefix name (default \'syn\')',
630+
argstr='-prefix %s')
631+
dry_run = traits.Bool(
632+
desc='Don\'t compute the output, just '
633+
'check the inputs.',
634+
argstr='-dry')
635+
TR = traits.Float(
636+
desc='TR to set in the output. The default value of '
637+
'TR is read from the header of the matrix file.',
638+
argstr='-TR %f')
639+
cenfill = traits.Enum(
640+
'zero','nbhr','none',
641+
argstr='-cenfill %s',
642+
desc='Determines how censored time points from the '
643+
'3dDeconvolve run will be filled. Valid types '
644+
'are \'zero\', \'nbhr\' and \'none\'.')
645+
646+
647+
class Synthesize(AFNICommand):
648+
"""Reads a '-cbucket' dataset and a '.xmat.1D' matrix from 3dDeconvolve,
649+
and synthesizes a fit dataset using user-selected sub-bricks and
650+
matrix columns.
651+
652+
For complete details, see the `3dSynthesize Documentation.
653+
<https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dSynthesize.html>`_
654+
655+
Examples
656+
========
657+
658+
>>> from nipype.interfaces import afni
659+
>>> synthesize = afni.Synthesize()
660+
>>> synthesize.inputs.cbucket = 'functional.nii'
661+
>>> synthesize.inputs.matrix = 'output.1D'
662+
>>> synthesize.inputs.select = ['baseline']
663+
>>> synthesize.cmdline # doctest: +ALLOW_UNICODE
664+
'3dSynthesize -cbucket functional.nii -matrix output.1D -select baseline'
665+
>>> syn = synthesize.run() # doctest: +SKIP
666+
"""
667+
668+
_cmd = '3dSynthesize'
669+
input_spec = SynthesizeInputSpec
670+
output_spec = AFNICommandOutputSpec

nipype/interfaces/afni/preprocess.py

Lines changed: 21 additions & 11 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)
@@ -3131,7 +3132,7 @@ class QwarpInputSpec(AFNICommandInputSpec):
31313132
'Note that the source dataset in the second run is the SAME as'
31323133
'in the first run. If you don\'t see why this is necessary,'
31333134
'then you probably need to seek help from an AFNI guru.',
3134-
argstr='-inlev %d',
3135+
argstr='-inilev %d',
31353136
xor=['duplo'])
31363137
minpatch = traits.Int(
31373138
desc='* The value of mm should be an odd integer.'
@@ -3462,7 +3463,7 @@ class Qwarp(AFNICommand):
34623463
>>> qwarp2.inputs.inilev = 7
34633464
>>> qwarp2.inputs.iniwarp = ['Q25_warp+tlrc.HEAD']
34643465
>>> 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'
3466+
'3dQwarp -base mni.nii -blur 0.0 2.0 -source structural.nii -inilev 7 -iniwarp Q25_warp+tlrc.HEAD -prefix Q11'
34663467
>>> res2 = qwarp2.run() # doctest: +SKIP
34673468
"""
34683469
_cmd = '3dQwarp'
@@ -3475,29 +3476,38 @@ def _list_outputs(self):
34753476
if not isdefined(self.inputs.out_file):
34763477
prefix = self._gen_fname(self.inputs.in_file, suffix='_QW')
34773478
ext = '.HEAD'
3479+
suffix ='+tlrc'
34783480
else:
34793481
prefix = self.inputs.out_file
34803482
ext_ind = max([prefix.lower().rfind('.nii.gz'),
34813483
prefix.lower().rfind('.nii.')])
34823484
if ext_ind == -1:
34833485
ext = '.HEAD'
3486+
suffix = '+tlrc'
34843487
else:
34853488
ext = prefix[ext_ind:]
3489+
suffix = ''
34863490
print(ext,"ext")
3487-
outputs['warped_source'] = os.path.abspath(self._gen_fname(prefix, suffix='+tlrc')+ext)
3491+
outputs['warped_source'] = fname_presuffix(prefix, suffix=suffix,
3492+
use_ext=False) + ext
34883493
if not self.inputs.nowarp:
3489-
outputs['source_warp'] = os.path.abspath(self._gen_fname(prefix, suffix='_WARP+tlrc')+ext)
3494+
outputs['source_warp'] = fname_presuffix(prefix,
3495+
suffix='_WARP' + suffix, use_ext=False) + ext
34903496
if self.inputs.iwarp:
3491-
outputs['base_warp'] = os.path.abspath(self._gen_fname(prefix, suffix='_WARPINV+tlrc')+ext)
3497+
outputs['base_warp'] = fname_presuffix(prefix,
3498+
suffix='_WARPINV' + suffix, use_ext=False) + ext
34923499
if isdefined(self.inputs.out_weight_file):
34933500
outputs['weights'] = os.path.abspath(self.inputs.out_weight_file)
34943501

34953502
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-
3503+
outputs['warped_source'] = fname_presuffix(prefix,
3504+
suffix='_PLUS' + suffix, use_ext=False) + ext
3505+
outputs['warped_base'] = fname_presuffix(prefix,
3506+
suffix='_MINUS' + suffix, use_ext=False) + ext
3507+
outputs['source_warp'] = fname_presuffix(prefix,
3508+
suffix='_PLUS_WARP' + suffix, use_ext=False) + ext
3509+
outputs['base_warp'] = fname_presuffix(prefix,
3510+
suffix='_MINUS_WARP' + suffix, use_ext=False) + ext
35013511
return outputs
35023512

35033513
def _gen_filename(self, name):

nipype/interfaces/afni/tests/test_auto_Deconvolve.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def test_Deconvolve_inputs():
1414
),
1515
automask=dict(argstr='-automask',
1616
),
17+
cbucket=dict(argstr='-cbucket %s',
18+
),
1719
censor=dict(argstr='-censor %s',
1820
),
1921
dmbase=dict(argstr='-dmbase',
@@ -127,7 +129,8 @@ def test_Deconvolve_inputs():
127129

128130

129131
def test_Deconvolve_outputs():
130-
output_map = dict(out_file=dict(),
132+
output_map = dict(cbucket=dict(),
133+
out_file=dict(),
131134
reml_script=dict(),
132135
x1D=dict(),
133136
)

nipype/interfaces/afni/tests/test_auto_Qwarp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_Qwarp_inputs():
5151
copyfile=False,
5252
mandatory=True,
5353
),
54-
inilev=dict(argstr='-inlev %d',
54+
inilev=dict(argstr='-inilev %d',
5555
xor=['duplo'],
5656
),
5757
iniwarp=dict(argstr='-iniwarp %s',

0 commit comments

Comments
 (0)