Skip to content

Commit 79ff663

Browse files
author
Oscar Esteban
committed
Merge branch 'master' into enh/NewDipyInterfaces
2 parents 9318609 + ccbbe56 commit 79ff663

File tree

11 files changed

+491
-28
lines changed

11 files changed

+491
-28
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Next release
33

44
* ENH: New interfaces in dipy: RESTORE, EstimateResponseSH, CSD and StreamlineTractography
55
(https://github.com/nipy/nipype/pull/1090)
6+
* ENH: Added interfaces of AFNI (https://github.com/nipy/nipype/pull/1360,
7+
https://github.com/nipy/nipype/pull/1361)
68
* ENH: Added support for PETPVC (https://github.com/nipy/nipype/pull/1335)
79
* ENH: Merge S3DataSink into DataSink, added AWS documentation (https://github.com/nipy/nipype/pull/1316)
810
* TST: Cache APT in CircleCI (https://github.com/nipy/nipype/pull/1333)

nipype/interfaces/afni/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
Fourier, Allineate, Maskave, SkullStrip, TCat, Fim,
1313
BlurInMask, Autobox, TCorrMap, Bandpass, Retroicor,
1414
TCorrelate, TCorr1D, BrickStat, ROIStats, AutoTcorrelate,
15-
AFNItoNIFTI, Eval, Means)
15+
AFNItoNIFTI, Eval, Means, Hist, FWHMx)
1616
from .svm import (SVMTest, SVMTrain)

nipype/interfaces/afni/base.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@
22
# vi: set ft=python sts=4 ts=4 sw=4 et:
33
"""Provide interface to AFNI commands."""
44

5-
from builtins import object
6-
7-
85
import os
6+
from sys import platform
7+
from builtins import object
98

109
from ... import logging
1110
from ...utils.filemanip import split_filename
1211
from ..base import (
1312
CommandLine, traits, CommandLineInputSpec, isdefined, File, TraitedSpec)
1413

1514
# Use nipype's logging system
16-
iflogger = logging.getLogger('interface')
15+
IFLOGGER = logging.getLogger('interface')
1716

1817

1918
class Info(object):
@@ -46,14 +45,14 @@ def version():
4645
currv = clout.runtime.stdout.split('\n')[1].split('=', 1)[1].strip()
4746
except IOError:
4847
# If afni_vcheck is not present, return None
49-
iflogger.warn('afni_vcheck executable not found.')
48+
IFLOGGER.warn('afni_vcheck executable not found.')
5049
return None
5150
except RuntimeError as e:
5251
# If AFNI is outdated, afni_vcheck throws error.
5352
# Show new version, but parse current anyways.
5453
currv = str(e).split('\n')[4].split('=', 1)[1].strip()
5554
nextv = str(e).split('\n')[6].split('=', 1)[1].strip()
56-
iflogger.warn(
55+
IFLOGGER.warn(
5756
'AFNI is outdated, detected version %s and %s is available.' % (currv, nextv))
5857

5958
if currv.startswith('AFNI_'):
@@ -117,6 +116,17 @@ def standard_image(img_name):
117116
return os.path.join(basedir, img_name)
118117

119118

119+
class AFNICommandBase(CommandLine):
120+
"""
121+
A base class to fix a linking problem in OSX and afni.
122+
See http://afni.nimh.nih.gov/afni/community/board/read.php?1,145346,145347#msg-145347
123+
"""
124+
def _run_interface(self, runtime):
125+
if platform == 'darwin':
126+
runtime.environ['DYLD_FALLBACK_LIBRARY_PATH'] = '/usr/local/afni/'
127+
return super(AFNICommandBase, self)._run_interface(runtime)
128+
129+
120130
class AFNICommandInputSpec(CommandLineInputSpec):
121131
outputtype = traits.Enum('AFNI', list(Info.ftypes.keys()),
122132
desc='AFNI output filetype')
@@ -130,8 +140,8 @@ class AFNICommandOutputSpec(TraitedSpec):
130140
exists=True)
131141

132142

133-
class AFNICommand(CommandLine):
134-
143+
class AFNICommand(AFNICommandBase):
144+
"""Shared options for several AFNI commands """
135145
input_spec = AFNICommandInputSpec
136146
_outputtype = None
137147

0 commit comments

Comments
 (0)