Skip to content

Commit ec87379

Browse files
committed
Merge branch 'master' of git://github.com/nipy/nipype into fix_afni_allineate
2 parents 83c2952 + 32e724c commit ec87379

25 files changed

+1525
-43
lines changed

.zenodo.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,11 @@
518518
"affiliation": "MIT, HMS",
519519
"name": "Ghosh, Satrajit",
520520
"orcid": "0000-0002-5312-6729"
521+
},
522+
{
523+
"affiliation": "University of Amsterdam",
524+
"name": "Lukas Snoek",
525+
"orcid": "0000-0001-8972-204X"
521526
}
522527
],
523528
"keywords": [

nipype/algorithms/confounds.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,11 @@ def _run_interface(self, runtime):
489489
header = ['{}{:02d}'.format(ftype, i) for i in range(ncols)]
490490
if skip_vols:
491491
old_basis = filter_basis
492-
nrows = filter_basis.shape[0] if filter_basis.size > 0 else 0
493-
filter_basis = np.zeros((nrows + skip_vols, ncols + skip_vols),
492+
# nrows defined above
493+
filter_basis = np.zeros((nrows, ncols + skip_vols),
494494
dtype=filter_basis.dtype)
495-
filter_basis[skip_vols:, :ncols] = old_basis
495+
if old_basis.size > 0:
496+
filter_basis[skip_vols:, :ncols] = old_basis
496497
filter_basis[:skip_vols, -skip_vols:] = np.eye(skip_vols)
497498
header.extend(['NonSteadyStateOutlier{:02d}'.format(i)
498499
for i in range(skip_vols)])

nipype/interfaces/afni/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,21 @@
88
"""
99

1010
from .base import Info
11-
from .preprocess import (Allineate, Automask, AutoTcorrelate,
11+
from .preprocess import (AlignEpiAnatPy, Allineate, Automask,
12+
AutoTcorrelate, AutoTLRC,
1213
Bandpass, BlurInMask, BlurToFWHM,
1314
ClipLevel, DegreeCentrality, Despike,
1415
Detrend, ECM, Fim, Fourier, Hist, LFCD,
1516
Maskave, Means, OutlierCount,
1617
QualityIndex, ROIStats, Retroicor,
1718
Seg, SkullStrip, TCorr1D, TCorrMap, TCorrelate,
19+
TNorm,
1820
TShift, Volreg, Warp, QwarpPlusMinus, Qwarp)
1921
from .svm import (SVMTest, SVMTrain)
20-
from .utils import (AFNItoNIFTI, Autobox, Axialize, BrickStat, Calc, Cat, Copy,
22+
from .utils import (ABoverlap, AFNItoNIFTI, Autobox, Axialize, BrickStat,
23+
Bucket, Calc, Cat, CatMatvec, Copy, Dot,
2124
Edge3, Eval, FWHMx, MaskTool, Merge, Notes, NwarpApply,
22-
Refit, Resample, TCat, TStat, To3D, Unifize, ZCutUp, GCOR,
25+
OneDToolPy,
26+
Refit, Resample, TCat, TCatSubBrick, TStat, To3D, Unifize, ZCutUp, GCOR,
2327
Zcat, Zeropad)
2428
from .model import (Deconvolve, Remlfit)

nipype/interfaces/afni/base.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import os
1010
from sys import platform
11+
from distutils import spawn
1112

1213
from ... import logging
1314
from ...utils.filemanip import split_filename, fname_presuffix
@@ -144,7 +145,6 @@ class AFNICommandOutputSpec(TraitedSpec):
144145
out_file = File(desc='output file',
145146
exists=True)
146147

147-
148148
class AFNICommand(AFNICommandBase):
149149
"""Shared options for several AFNI commands """
150150
input_spec = AFNICommandInputSpec
@@ -283,3 +283,23 @@ def no_afni():
283283
if Info.version() is None:
284284
return True
285285
return False
286+
287+
288+
class AFNIPythonCommandInputSpec(CommandLineInputSpec):
289+
outputtype = traits.Enum('AFNI', list(Info.ftypes.keys()),
290+
desc='AFNI output filetype')
291+
py27_path = traits.Either('python2', File(exists=True),
292+
usedefault=True,
293+
default='python2')
294+
295+
class AFNIPythonCommand(AFNICommand):
296+
@property
297+
def cmd(self):
298+
if spawn.find_executable(super(AFNIPythonCommand, self).cmd) is not None:
299+
return spawn.find_executable(super(AFNIPythonCommand, self).cmd)
300+
else:
301+
return super(AFNIPythonCommand, self).cmd
302+
303+
@property
304+
def cmdline(self):
305+
return "{} {}".format(self.inputs.py27_path, super(AFNIPythonCommand, self).cmdline)

0 commit comments

Comments
 (0)