Skip to content

enh: add PETPVC wrapper #1335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Feb 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
34c7092
COMP: Fix runtime warning from ipython
hjmjohnson Sep 22, 2015
8e23884
STYLE: Avoid warning with divide by zero
hjmjohnson Sep 29, 2015
26cc84c
Added XOR to mkmask and source_file
Nov 30, 2015
51aa4f5
Include OAR-args
Jan 15, 2016
adefb22
Undo Commit
Jan 15, 2016
d15d89c
enh: add PETPVC wrapper
alexsavio Jan 28, 2016
2ed1624
improved AFNI version parsing after publication of 16.0.01, #1328
oesteban Jan 28, 2016
460b3a4
Add empty petpvc example files
alexsavio Jan 28, 2016
995ecaf
fix: drop example_data from petpvc
alexsavio Jan 28, 2016
2602cb6
Merge pull request #1337 from oesteban/fix/AfniVersionAfter16
oesteban Jan 28, 2016
b8f8e88
Merge pull request #1284 from srothmei/freesurfer_vol2surf_mkmask_xor
chrisgorgo Jan 31, 2016
e92aaa2
Merge branch 'master' into AvoidRuntimeWarningDivideByZero
chrisgorgo Jan 31, 2016
de946d2
Merge branch 'AvoidRuntimeWarningDivideByZero'
chrisgorgo Jan 31, 2016
74f8b78
Fixed bad conflict resolution
chrisgorgo Jan 31, 2016
463708c
fixed several errors
oesteban Jan 31, 2016
6be212e
fixed several errors
oesteban Jan 31, 2016
b73ec6d
make check-before-commit
oesteban Feb 1, 2016
360584d
enhance circle CI error reporting
chrisgorgo Feb 1, 2016
b0e5e29
merge oscars fixes + fix the sloppy merge
chrisgorgo Feb 1, 2016
69d6c78
further fixes
chrisgorgo Feb 1, 2016
6ee17d4
make FSL course download slightly easier to debug
chrisgorgo Feb 1, 2016
0e195b5
fixed mkdir
chrisgorgo Feb 1, 2016
1262955
Merge pull request #1338 from oesteban/fix/ProblemsInMaster
oesteban Feb 1, 2016
c1e811e
Merge pull request #1339 from chrisfilo/fix/sloppy_merge
chrisgorgo Feb 1, 2016
333122e
enh: add PETPVC wrapper
alexsavio Jan 28, 2016
248b38f
Add empty petpvc example files
alexsavio Jan 28, 2016
dbd86a8
fix: drop example_data from petpvc
alexsavio Jan 28, 2016
a45bd50
Merge branch 'petpvc' of github.com:alexsavio/nipype into petpvc
alexsavio Feb 2, 2016
435004c
add petpvc specs file
alexsavio Feb 2, 2016
a5a857f
fix non-ascii chars in petpvc.py
alexsavio Feb 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dependencies:
- pip install -e .
- pip install matplotlib sphinx ipython boto
- gem install fakes3
- if [[ ! -d ~/examples/data ]]; then wget "http://tcpdiag.dl.sourceforge.net/project/nipy/nipype/nipype-0.2/nipype-tutorial.tar.bz2"; tar jxvf nipype-tutorial.tar.bz2; mkdir ~/examples; mv nipype-tutorial/* ~/examples/; fi
- if [[ ! -d ~/examples/fsl_course_data ]]; then wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" ; wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz"; wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz"; mkdir ~/examples/fsl_course_data; tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data; tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data; tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data; fi
- if [[ ! -d ~/examples/data ]]; then wget "http://tcpdiag.dl.sourceforge.net/project/nipy/nipype/nipype-0.2/nipype-tutorial.tar.bz2" && tar jxvf nipype-tutorial.tar.bz2 && mv nipype-tutorial/* ~/examples/; fi
- if [[ ! -d ~/examples/fsl_course_data ]]; then wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt1.tar.gz" && wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/fdt2.tar.gz" && wget -c "http://fsl.fmrib.ox.ac.uk/fslcourse/tbss.tar.gz" && mkdir ~/examples/fsl_course_data && tar zxvf fdt1.tar.gz -C ~/examples/fsl_course_data && tar zxvf fdt2.tar.gz -C ~/examples/fsl_course_data && tar zxvf tbss.tar.gz -C ~/examples/fsl_course_data; fi
- bash ~/nipype/tools/install_spm_mcr.sh
- mkdir -p ~/.nipype && echo '[logging]' > ~/.nipype/nipype.cfg && echo 'workflow_level = DEBUG' >> ~/.nipype/nipype.cfg && echo 'interface_level = DEBUG' >> ~/.nipype/nipype.cfg && echo 'filemanip_level = DEBUG' >> ~/.nipype/nipype.cfg
machine:
Expand Down
35 changes: 0 additions & 35 deletions nipype/algorithms/tests/test_auto_ErrorMap.py

This file was deleted.

47 changes: 0 additions & 47 deletions nipype/algorithms/tests/test_auto_Overlap.py

This file was deleted.

30 changes: 17 additions & 13 deletions nipype/interfaces/afni/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@


import os
import warnings

from ... import logging
from ...utils.filemanip import split_filename
from ..base import (
CommandLine, traits, CommandLineInputSpec, isdefined, File, TraitedSpec)

warn = warnings.warn
# Use nipype's logging system
iflogger = logging.getLogger('interface')


class Info(object):
Expand Down Expand Up @@ -40,26 +41,29 @@ def version():
try:
clout = CommandLine(command='afni_vcheck',
terminal_output='allatonce').run()

# Try to parse the version number
currv = clout.runtime.stdout.split('\n')[1].split('=', 1)[1].strip()
except IOError:
# If afni_vcheck is not present, return None
warn('afni_vcheck executable not found.')
iflogger.warn('afni_vcheck executable not found.')
return None
except RuntimeError as e:
# If AFNI is outdated, afni_vcheck throws error
warn('AFNI is outdated')
return str(e).split('\n')[4].split('=', 1)[1].strip()

# Try to parse the version number
out = clout.runtime.stdout.split('\n')[1].split('=', 1)[1].strip()
# If AFNI is outdated, afni_vcheck throws error.
# Show new version, but parse current anyways.
currv = str(e).split('\n')[4].split('=', 1)[1].strip()
nextv = str(e).split('\n')[6].split('=', 1)[1].strip()
iflogger.warn(
'AFNI is outdated, detected version %s and %s is available.' % (currv, nextv))

if out.startswith('AFNI_'):
out = out[5:]
if currv.startswith('AFNI_'):
currv = currv[5:]

v = out.split('.')
v = currv.split('.')
try:
v = [int(n) for n in v]
except ValueError:
return out
return currv
return tuple(v)

@classmethod
Expand Down
4 changes: 1 addition & 3 deletions nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
import warnings

import os
import re
from warnings import warn

from .base import AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec
from ..base import CommandLineInputSpec, CommandLine, OutputMultiPath
Expand All @@ -20,8 +20,6 @@
from ...utils.filemanip import (load_json, save_json, split_filename)
from ...utils.filemanip import fname_presuffix

warn = warnings.warn


class To3DInputSpec(AFNICommandInputSpec):
out_file = File(name_template="%s", desc='output image file name',
Expand Down
4 changes: 1 addition & 3 deletions nipype/interfaces/dipy/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
package_check('dipy', version='0.6.0')
except Exception as e:
have_dipy = False
else:
from dipy.align.aniso2iso import resample
from dipy.core.gradients import GradientTable


class ResampleInputSpec(TraitedSpec):
Expand Down Expand Up @@ -172,6 +169,7 @@ def resample_proxy(in_file, order=3, new_zooms=None, out_file=None):
"""
Performs regridding of an image to set isotropic voxel sizes using dipy.
"""
from dipy.align.aniso2iso import resample

if out_file is None:
fname, fext = op.splitext(op.basename(in_file))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def test_Surface2VolTransform_inputs():
usedefault=True,
),
mkmask=dict(argstr='--mkmask',
xor=['source_file'],
),
projfrac=dict(argstr='--projfrac %s',
),
Expand All @@ -26,6 +27,7 @@ def test_Surface2VolTransform_inputs():
source_file=dict(argstr='--surfval %s',
copyfile=False,
mandatory=True,
xor=['mkmask'],
),
subject_id=dict(argstr='--identity %s',
xor=['reg_file'],
Expand Down
4 changes: 2 additions & 2 deletions nipype/interfaces/freesurfer/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ def _gen_filename(self, name):

class Surface2VolTransformInputSpec(FSTraitedSpec):
source_file = File(exists=True, argstr='--surfval %s',
copyfile=False, mandatory=True,
copyfile=False, mandatory=True, xor=['mkmask'],
desc='This is the source of the surface values')
hemi = traits.Str(argstr='--hemi %s', mandatory=True,
desc='hemisphere of data')
Expand All @@ -404,7 +404,7 @@ class Surface2VolTransformInputSpec(FSTraitedSpec):
template_file = File(exists=True, argstr='--template %s',
desc='Output template volume')
mkmask = traits.Bool(desc='make a mask instead of loading surface values',
argstr='--mkmask')
argstr='--mkmask', xor=['source_file'])
vertexvol_file = File(name_template="%s_asVol_vertex.nii",
desc=('Path name of the vertex output volume, which '
'is the same as output volume except that the '
Expand Down
Loading