Skip to content

Commit

Permalink
Merge 598ff2a into e0d54f9
Browse files Browse the repository at this point in the history
  • Loading branch information
aghayoor committed Aug 8, 2016
2 parents e0d54f9 + 598ff2a commit 64ce82f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nipype/interfaces/semtools/brains/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import absolute_import
from .segmentation import SimilarityIndex, BRAINSTalairach, BRAINSTalairachMask
from .utilities import HistogramMatchingFilter
from .utilities import HistogramMatchingFilter, GenerateEdgeMapImage, GeneratePurePlugMask
from .classify import BRAINSPosteriorToContinuousClass
66 changes: 66 additions & 0 deletions nipype/interfaces/semtools/brains/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,69 @@ class HistogramMatchingFilter(SEMLikeCommandLine):
_cmd = " HistogramMatchingFilter "
_outputs_filenames = {'outputVolume': 'outputVolume.nii'}
_redirect_x = False

class GenerateEdgeMapImageInputSpec(CommandLineInputSpec):
inputMRVolumes = InputMultiPath(File(exists=True), desc="List of input structural MR volumes to create the maximum edgemap", argstr="--inputMRVolumes %s...")
inputMask = File(desc="Input mask file name. If set, image histogram percentiles will be calculated within the mask", exists=True, argstr="--inputMask %s")
minimumOutputRange = traits.Int(desc="Map lower quantile and below to minimum output range. It should be a small number greater than zero. Default is 1", argstr="--minimumOutputRange %d")
maximumOutputRange = traits.Int(desc="Map upper quantile and above to maximum output range. Default is 255 that is the maximum range of unsigned char", argstr="--maximumOutputRange %d")
lowerPercentileMatching = traits.Float(desc="Map lower quantile and below to minOutputRange. It should be a value between zero and one", argstr="--lowerPercentileMatching %f")
upperPercentileMatching = traits.Float(desc="Map upper quantile and above to maxOutputRange. It should be a value between zero and one", argstr="--upperPercentileMatching %f")
outputEdgeMap = traits.Either(traits.Bool, File(), hash_files=False, desc="output edgemap file name", argstr="--outputEdgeMap %s")
outputMaximumGradientImage = traits.Either(traits.Bool, File(), hash_files=False, desc="output gradient image file name", argstr="--outputMaximumGradientImage %s")
numberOfThreads = traits.Int(desc="Explicitly specify the maximum number of threads to use.", argstr="--numberOfThreads %d")


class GenerateEdgeMapImageOutputSpec(TraitedSpec):
outputEdgeMap = File(desc="(required) output file name", exists=True)
outputMaximumGradientImage = File(desc="output gradient image file name", exists=True)

class GenerateEdgeMapImage(SEMLikeCommandLine):

"""title: GenerateEdgeMapImage
category: BRAINS.Utilities
description: Automatic edgemap generation for edge-guided super-resolution reconstruction
version: 1.0
contributor: Ali Ghayoor
"""

input_spec = GenerateEdgeMapImageInputSpec
output_spec = GenerateEdgeMapImageOutputSpec
_cmd = " GenerateEdgeMapImage "
_outputs_filenames = {'outputEdgeMap': 'outputEdgeMap', 'outputMaximumGradientImage': 'outputMaximumGradientImage'}
_redirect_x = False

class GeneratePurePlugMaskInputSpec(CommandLineInputSpec):
inputImageModalities = InputMultiPath(File(exists=True), desc="List of input image file names to create pure plugs mask", argstr="--inputImageModalities %s...")
threshold = traits.Float(desc="threshold value to define class membership", argstr="--threshold %f")
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")
outputMaskFile = traits.Either(traits.Bool, File(), hash_files=False, desc="Output binary mask file name", argstr="--outputMaskFile %s")


class GeneratePurePlugMaskOutputSpec(TraitedSpec):
outputMaskFile = File(desc="(required) Output binary mask file name", exists=True)

class GeneratePurePlugMask(SEMLikeCommandLine):

"""title: GeneratePurePlugMask
category: BRAINS.Utilities
description: This program gets several modality image files and returns a binary mask that defines the pure plugs
version: 1.0
contributor: Ali Ghayoor
"""

input_spec = GeneratePurePlugMaskInputSpec
output_spec = GeneratePurePlugMaskOutputSpec
_cmd = " GeneratePurePlugMask "
_outputs_filenames = {'outputMaskFile': 'outputMaskFile'}
_redirect_x = False

0 comments on commit 64ce82f

Please sign in to comment.