Skip to content

Commit ca9b77e

Browse files
author
Tristan Glatard
committed
Merge branch 'master' of github.com:nipy/nipype
2 parents 1cf212a + b1013d9 commit ca9b77e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4524
-4
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ install:
2626
- source activate testenv
2727
- if [ ${TRAVIS_PYTHON_VERSION:0:1} == "2" ]; then pip install ordereddict; fi
2828
- conda install --yes numpy scipy nose traits networkx dateutil
29-
- pip install nibabel --use-mirrors
30-
- pip install python-coveralls --use-mirrors
31-
- pip install nose-cov --use-mirrors
29+
- pip install nibabel
30+
- pip install python-coveralls
31+
- pip install nose-cov
3232
- pip install https://github.com/RDFLib/rdflib/archive/master.zip
3333
- pip install https://github.com/trungdong/prov/archive/rdf.zip
3434
- python setup.py install

nipype/interfaces/fsl/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
ImageStats, FilterRegressor, Overlay, Slicer,
1717
PlotTimeSeries, PlotMotionParams, ConvertXFM,
1818
SwapDimensions, PowerSpectrum, Reorient2Std,
19-
Complex, InvWarp, WarpUtils, ConvertWarp, WarpPoints, WarpPointsToStd)
19+
Complex, InvWarp, WarpUtils, ConvertWarp, WarpPoints,
20+
WarpPointsToStd, RobustFOV)
2021

2122
from .epi import (PrepareFieldmap, TOPUP, ApplyTOPUP, Eddy, EPIDeWarp,
2223
SigLoss, EddyCorrect, EpiReg)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.interfaces.fsl.utils import RobustFOV
4+
5+
def test_RobustFOV_inputs():
6+
input_map = dict(args=dict(argstr='%s',
7+
),
8+
environ=dict(nohash=True,
9+
usedefault=True,
10+
),
11+
ignore_exception=dict(nohash=True,
12+
usedefault=True,
13+
),
14+
in_file=dict(argstr='-i %s',
15+
mandatory=True,
16+
position=0,
17+
),
18+
out_roi=dict(argstr='-r %s',
19+
hash_files=False,
20+
name_source=['in_file'],
21+
name_template='%s_ROI',
22+
),
23+
output_type=dict(),
24+
terminal_output=dict(nohash=True,
25+
),
26+
)
27+
inputs = RobustFOV.input_spec()
28+
29+
for key, metadata in input_map.items():
30+
for metakey, value in metadata.items():
31+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
32+
33+
def test_RobustFOV_outputs():
34+
output_map = dict(out_roi=dict(),
35+
)
36+
outputs = RobustFOV.output_spec()
37+
38+
for key, metadata in output_map.items():
39+
for metakey, value in metadata.items():
40+
yield assert_equal, getattr(outputs.traits()[key], metakey), value
41+

nipype/interfaces/fsl/utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,24 @@
3131
warn = warnings.warn
3232
warnings.filterwarnings('always', category=UserWarning)
3333

34+
class RobustFOVInputSpec(FSLCommandInputSpec):
35+
in_file = File(exists=True,
36+
desc='input filename',
37+
argstr='-i %s', position=0, mandatory=True)
38+
out_roi = File(desc="ROI volume output name", argstr="-r %s",
39+
name_source=['in_file'], hash_files=False,
40+
name_template='%s_ROI')
41+
42+
43+
class RobustFOVOutputSpec(TraitedSpec):
44+
out_roi = File(exists=True, desc="ROI volume output name")
45+
46+
47+
class RobustFOV(FSLCommand):
48+
_cmd = 'robustfov'
49+
input_spec = RobustFOVInputSpec
50+
output_spec = RobustFOVOutputSpec
51+
3452

3553
class ImageMeantsInputSpec(FSLCommandInputSpec):
3654
in_file = File(exists=True,
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from diffusion import *
2+
from featurecreator import GenerateCsfClippedFromClassifiedImage
3+
from segmentation import *
4+
from filtering import *
5+
from brains import *
6+
from testing import *
7+
from utilities import *
8+
from legacy import *
9+
from registration import *
10+
from converters import DWISimpleCompare, DWICompare
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from segmentation import SimilarityIndex, BRAINSTalairach, BRAINSTalairachMask
2+
from utilities import HistogramMatchingFilter
3+
from classify import BRAINSPosteriorToContinuousClass
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# -*- coding: utf8 -*-
2+
"""Autogenerated file - DO NOT EDIT
3+
If you spot a bug, please report it on the mailing list and/or change the generator."""
4+
5+
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
6+
import os
7+
8+
9+
class BRAINSPosteriorToContinuousClassInputSpec(CommandLineInputSpec):
10+
inputWhiteVolume = File(desc="White Matter Posterior Volume", exists=True, argstr="--inputWhiteVolume %s")
11+
inputBasalGmVolume = File(desc="Basal Grey Matter Posterior Volume", exists=True, argstr="--inputBasalGmVolume %s")
12+
inputSurfaceGmVolume = File(desc="Surface Grey Matter Posterior Volume", exists=True, argstr="--inputSurfaceGmVolume %s")
13+
inputCsfVolume = File(desc="CSF Posterior Volume", exists=True, argstr="--inputCsfVolume %s")
14+
inputVbVolume = File(desc="Venous Blood Posterior Volume", exists=True, argstr="--inputVbVolume %s")
15+
inputCrblGmVolume = File(desc="Cerebellum Grey Matter Posterior Volume", exists=True, argstr="--inputCrblGmVolume %s")
16+
inputCrblWmVolume = File(desc="Cerebellum White Matter Posterior Volume", exists=True, argstr="--inputCrblWmVolume %s")
17+
outputVolume = traits.Either(traits.Bool, File(), hash_files=False, desc="Output Continuous Tissue Classified Image", argstr="--outputVolume %s")
18+
19+
20+
class BRAINSPosteriorToContinuousClassOutputSpec(TraitedSpec):
21+
outputVolume = File(desc="Output Continuous Tissue Classified Image", exists=True)
22+
23+
24+
class BRAINSPosteriorToContinuousClass(SEMLikeCommandLine):
25+
26+
"""title: Tissue Classification
27+
28+
category: BRAINS.Classify
29+
30+
description: This program will generate an 8-bit continuous tissue classified image based on BRAINSABC posterior images.
31+
32+
version: 3.0
33+
34+
documentation-url: http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSClassify
35+
36+
license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt
37+
38+
contributor: Vincent A. Magnotta
39+
40+
acknowledgements: Funding for this work was provided by NIH/NINDS award NS050568
41+
42+
"""
43+
44+
input_spec = BRAINSPosteriorToContinuousClassInputSpec
45+
output_spec = BRAINSPosteriorToContinuousClassOutputSpec
46+
_cmd = " BRAINSPosteriorToContinuousClass "
47+
_outputs_filenames = {'outputVolume': 'outputVolume'}
48+
_redirect_x = False
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# -*- coding: utf8 -*-
2+
"""Autogenerated file - DO NOT EDIT
3+
If you spot a bug, please report it on the mailing list and/or change the generator."""
4+
5+
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
6+
import os
7+
8+
9+
class SimilarityIndexInputSpec(CommandLineInputSpec):
10+
outputCSVFilename = File(desc="output CSV Filename", exists=True, argstr="--outputCSVFilename %s")
11+
ANNContinuousVolume = File(desc="ANN Continuous volume to be compared to the manual volume", exists=True, argstr="--ANNContinuousVolume %s")
12+
inputManualVolume = File(desc="input manual(reference) volume", exists=True, argstr="--inputManualVolume %s")
13+
thresholdInterval = traits.Float(desc="Threshold interval to compute similarity index between zero and one", argstr="--thresholdInterval %f")
14+
15+
16+
class SimilarityIndexOutputSpec(TraitedSpec):
17+
pass
18+
19+
20+
class SimilarityIndex(SEMLikeCommandLine):
21+
22+
"""title: BRAINSCut:SimilarityIndexComputation
23+
24+
category: BRAINS.Segmentation
25+
26+
description: Automatic analysis of BRAINSCut Output
27+
28+
version: 1.0
29+
30+
license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt
31+
32+
contributor: Eunyoung Regin Kim
33+
34+
"""
35+
36+
input_spec = SimilarityIndexInputSpec
37+
output_spec = SimilarityIndexOutputSpec
38+
_cmd = " SimilarityIndex "
39+
_outputs_filenames = {}
40+
_redirect_x = False
41+
42+
43+
class BRAINSTalairachInputSpec(CommandLineInputSpec):
44+
AC = InputMultiPath(traits.Float, desc="Location of AC Point ", sep=",", argstr="--AC %s")
45+
ACisIndex = traits.Bool(desc="AC Point is Index", argstr="--ACisIndex ")
46+
PC = InputMultiPath(traits.Float, desc="Location of PC Point ", sep=",", argstr="--PC %s")
47+
PCisIndex = traits.Bool(desc="PC Point is Index", argstr="--PCisIndex ")
48+
SLA = InputMultiPath(traits.Float, desc="Location of SLA Point ", sep=",", argstr="--SLA %s")
49+
SLAisIndex = traits.Bool(desc="SLA Point is Index", argstr="--SLAisIndex ")
50+
IRP = InputMultiPath(traits.Float, desc="Location of IRP Point ", sep=",", argstr="--IRP %s")
51+
IRPisIndex = traits.Bool(desc="IRP Point is Index", argstr="--IRPisIndex ")
52+
inputVolume = File(desc="Input image used to define physical space of images", exists=True, argstr="--inputVolume %s")
53+
outputBox = traits.Either(traits.Bool, File(), hash_files=False, desc="Name of the resulting Talairach Bounding Box file", argstr="--outputBox %s")
54+
outputGrid = traits.Either(traits.Bool, File(), hash_files=False, desc="Name of the resulting Talairach Grid file", argstr="--outputGrid %s")
55+
56+
57+
class BRAINSTalairachOutputSpec(TraitedSpec):
58+
outputBox = File(desc="Name of the resulting Talairach Bounding Box file", exists=True)
59+
outputGrid = File(desc="Name of the resulting Talairach Grid file", exists=True)
60+
61+
62+
class BRAINSTalairach(SEMLikeCommandLine):
63+
64+
"""title: BRAINS Talairach
65+
66+
category: BRAINS.Segmentation
67+
68+
description: This program creates a VTK structured grid defining the Talairach coordinate system based on four points: AC, PC, IRP, and SLA. The resulting structred grid can be written as either a classic VTK file or the new VTK XML file format. Two representations of the resulting grid can be written. The first is a bounding box representation that also contains the location of the AC and PC points. The second representation is the full Talairach grid representation that includes the additional rows of boxes added to the inferior allowing full coverage of the cerebellum.
69+
70+
version: 0.1
71+
72+
documentation-url: http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSTalairach
73+
74+
license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt
75+
76+
contributor: Steven Dunn and Vincent Magnotta
77+
78+
acknowledgements: Funding for this work was provided by NIH/NINDS award NS050568
79+
80+
"""
81+
82+
input_spec = BRAINSTalairachInputSpec
83+
output_spec = BRAINSTalairachOutputSpec
84+
_cmd = " BRAINSTalairach "
85+
_outputs_filenames = {'outputGrid': 'outputGrid', 'outputBox': 'outputBox'}
86+
_redirect_x = False
87+
88+
89+
class BRAINSTalairachMaskInputSpec(CommandLineInputSpec):
90+
inputVolume = File(desc="Input image used to define physical space of resulting mask", exists=True, argstr="--inputVolume %s")
91+
talairachParameters = File(desc="Name of the Talairach parameter file.", exists=True, argstr="--talairachParameters %s")
92+
talairachBox = File(desc="Name of the Talairach box file.", exists=True, argstr="--talairachBox %s")
93+
hemisphereMode = traits.Enum("left", "right", "both", desc="Mode for box creation: left, right, both", argstr="--hemisphereMode %s")
94+
expand = traits.Bool(desc="Expand exterior box to include surface CSF", argstr="--expand ")
95+
outputVolume = traits.Either(traits.Bool, File(), hash_files=False, desc="Output filename for the resulting binary image", argstr="--outputVolume %s")
96+
97+
98+
class BRAINSTalairachMaskOutputSpec(TraitedSpec):
99+
outputVolume = File(desc="Output filename for the resulting binary image", exists=True)
100+
101+
102+
class BRAINSTalairachMask(SEMLikeCommandLine):
103+
104+
"""title: Talairach Mask
105+
106+
category: BRAINS.Segmentation
107+
108+
description: This program creates a binary image representing the specified Talairach region. The input is an example image to define the physical space for the resulting image, the Talairach grid representation in VTK format, and the file containing the Talairach box definitions to be generated. These can be combined in BRAINS to create a label map using the procedure Brains::WorkupUtils::CreateLabelMapFromBinaryImages.
109+
110+
version: 0.1
111+
112+
documentation-url: http://www.nitrc.org/plugins/mwiki/index.php/brains:BRAINSTalairachMask
113+
114+
license: https://www.nitrc.org/svn/brains/BuildScripts/trunk/License.txt
115+
116+
contributor: Steven Dunn and Vincent Magnotta
117+
118+
acknowledgements: Funding for this work was provided by NIH/NINDS award NS050568
119+
120+
"""
121+
122+
input_spec = BRAINSTalairachMaskInputSpec
123+
output_spec = BRAINSTalairachMaskOutputSpec
124+
_cmd = " BRAINSTalairachMask "
125+
_outputs_filenames = {'outputVolume': 'outputVolume.nii'}
126+
_redirect_x = False
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# -*- coding: utf8 -*-
2+
"""Autogenerated file - DO NOT EDIT
3+
If you spot a bug, please report it on the mailing list and/or change the generator."""
4+
5+
from nipype.interfaces.base import CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, InputMultiPath, OutputMultiPath
6+
import os
7+
8+
9+
class HistogramMatchingFilterInputSpec(CommandLineInputSpec):
10+
inputVolume = File(desc="The Input image to be computed for statistics", exists=True, argstr="--inputVolume %s")
11+
referenceVolume = File(desc="The Input image to be computed for statistics", exists=True, argstr="--referenceVolume %s")
12+
outputVolume = traits.Either(traits.Bool, File(), hash_files=False, desc="Output Image File Name", argstr="--outputVolume %s")
13+
referenceBinaryVolume = File(desc="referenceBinaryVolume", exists=True, argstr="--referenceBinaryVolume %s")
14+
inputBinaryVolume = File(desc="inputBinaryVolume", exists=True, argstr="--inputBinaryVolume %s")
15+
numberOfMatchPoints = traits.Int(desc=" number of histogram matching points", argstr="--numberOfMatchPoints %d")
16+
numberOfHistogramBins = traits.Int(desc=" number of histogram bin", argstr="--numberOfHistogramBins %d")
17+
writeHistogram = traits.Str(desc=" decide if histogram data would be written with prefixe of the file name", argstr="--writeHistogram %s")
18+
histogramAlgorithm = traits.Enum("OtsuHistogramMatching", desc=" histogram algrithm selection", argstr="--histogramAlgorithm %s")
19+
verbose = traits.Bool(desc=" verbose mode running for debbuging", argstr="--verbose ")
20+
21+
22+
class HistogramMatchingFilterOutputSpec(TraitedSpec):
23+
outputVolume = File(desc="Output Image File Name", exists=True)
24+
25+
26+
class HistogramMatchingFilter(SEMLikeCommandLine):
27+
28+
"""title: Write Out Image Intensities
29+
30+
category: BRAINS.Utilities
31+
32+
description: For Analysis
33+
34+
version: 0.1
35+
36+
contributor: University of Iowa Department of Psychiatry, http:://www.psychiatry.uiowa.edu
37+
38+
"""
39+
40+
input_spec = HistogramMatchingFilterInputSpec
41+
output_spec = HistogramMatchingFilterOutputSpec
42+
_cmd = " HistogramMatchingFilter "
43+
_outputs_filenames = {'outputVolume': 'outputVolume.nii'}
44+
_redirect_x = False

0 commit comments

Comments
 (0)