Skip to content

Commit 9b5eca3

Browse files
committed
ENH: Added GeneratePurePlugMask to semtools
1 parent c296dc6 commit 9b5eca3

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from __future__ import absolute_import
22
from .segmentation import SimilarityIndex, BRAINSTalairach, BRAINSTalairachMask
3-
from .utilities import HistogramMatchingFilter, GenerateEdgeMapImage
3+
from .utilities import HistogramMatchingFilter, GenerateEdgeMapImage, GeneratePurePlugMask
44
from .classify import BRAINSPosteriorToContinuousClass

nipype/interfaces/semtools/brains/utilities.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class HistogramMatchingFilter(SEMLikeCommandLine):
4646
_outputs_filenames = {'outputVolume': 'outputVolume.nii'}
4747
_redirect_x = False
4848

49-
5049
class GenerateEdgeMapImageInputSpec(CommandLineInputSpec):
5150
inputMRVolumes = InputMultiPath(File(exists=True), desc="List of input structural MR volumes to create the maximum edgemap", argstr="--inputMRVolumes %s...")
5251
inputMask = File(desc="Input mask file name. If set, image histogram percentiles will be calculated within the mask", exists=True, argstr="--inputMask %s")
@@ -82,3 +81,33 @@ class GenerateEdgeMapImage(SEMLikeCommandLine):
8281
_cmd = " GenerateEdgeMapImage "
8382
_outputs_filenames = {'outputEdgeMap': 'outputEdgeMap', 'outputMaximumGradientImage': 'outputMaximumGradientImage'}
8483
_redirect_x = False
84+
85+
class GeneratePurePlugMaskInputSpec(CommandLineInputSpec):
86+
inputImageModalities = InputMultiPath(File(exists=True), desc="List of input image file names to create pure plugs mask", argstr="--inputImageModalities %s...")
87+
threshold = traits.Float(desc="threshold value to define class membership", argstr="--threshold %f")
88+
numberOfSubSamples = InputMultiPath(traits.Int, desc="Number of continous index samples taken at each direction of lattice space for each plug volume", sep=",", argstr="--numberOfSubSamples %s")
89+
outputMaskFile = traits.Either(traits.Bool, File(), hash_files=False, desc="Output binary mask file name", argstr="--outputMaskFile %s")
90+
91+
92+
class GeneratePurePlugMaskOutputSpec(TraitedSpec):
93+
outputMaskFile = File(desc="(required) Output binary mask file name", exists=True)
94+
95+
class GeneratePurePlugMask(SEMLikeCommandLine):
96+
97+
"""title: GeneratePurePlugMask
98+
99+
category: BRAINS.Utilities
100+
101+
description: This program gets several modality image files and returns a binary mask that defines the pure plugs
102+
103+
version: 1.0
104+
105+
contributor: Ali Ghayoor
106+
107+
"""
108+
109+
input_spec = GeneratePurePlugMaskInputSpec
110+
output_spec = GeneratePurePlugMaskOutputSpec
111+
_cmd = " GeneratePurePlugMask "
112+
_outputs_filenames = {'outputMaskFile': 'outputMaskFile'}
113+
_redirect_x = False

0 commit comments

Comments
 (0)