Skip to content

Commit 906a6c2

Browse files
committed
ENH: Added GenerateEdgeMapImage to semtools
1 parent e0d54f9 commit 906a6c2

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
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
3+
from .utilities import HistogramMatchingFilter, GenerateEdgeMapImage
44
from .classify import BRAINSPosteriorToContinuousClass

nipype/interfaces/semtools/brains/utilities.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,40 @@ class HistogramMatchingFilter(SEMLikeCommandLine):
4545
_cmd = " HistogramMatchingFilter "
4646
_outputs_filenames = {'outputVolume': 'outputVolume.nii'}
4747
_redirect_x = False
48+
49+
50+
class GenerateEdgeMapImageInputSpec(CommandLineInputSpec):
51+
inputMRVolumes = InputMultiPath(File(exists=True), desc="List of input structural MR volumes to create the maximum edgemap", argstr="--inputMRVolumes %s...")
52+
inputMask = File(desc="Input mask file name. If set, image histogram percentiles will be calculated within the mask", exists=True, argstr="--inputMask %s")
53+
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")
54+
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")
55+
lowerPercentileMatching = traits.Float(desc="Map lower quantile and below to minOutputRange. It should be a value between zero and one", argstr="--lowerPercentileMatching %f")
56+
upperPercentileMatching = traits.Float(desc="Map upper quantile and above to maxOutputRange. It should be a value between zero and one", argstr="--upperPercentileMatching %f")
57+
outputEdgeMap = traits.Either(traits.Bool, File(), hash_files=False, desc="output edgemap file name", argstr="--outputEdgeMap %s")
58+
outputMaximumGradientImage = traits.Either(traits.Bool, File(), hash_files=False, desc="output gradient image file name", argstr="--outputMaximumGradientImage %s")
59+
numberOfThreads = traits.Int(desc="Explicitly specify the maximum number of threads to use.", argstr="--numberOfThreads %d")
60+
61+
62+
class GenerateEdgeMapImageOutputSpec(TraitedSpec):
63+
outputEdgeMap = File(desc="(required) output file name", exists=True)
64+
outputMaximumGradientImage = File(desc="output gradient image file name", exists=True)
65+
66+
class GenerateEdgeMapImage(SEMLikeCommandLine):
67+
68+
"""title: GenerateEdgeMapImage
69+
70+
category: BRAINS.Utilities
71+
72+
description: Automatic edgemap generation for edge-guided super-resolution reconstruction
73+
74+
version: 1.0
75+
76+
contributor: Ali Ghayoor
77+
78+
"""
79+
80+
input_spec = GenerateEdgeMapImageInputSpec
81+
output_spec = GenerateEdgeMapImageOutputSpec
82+
_cmd = " GenerateEdgeMapImage "
83+
_outputs_filenames = {'outputEdgeMap': 'outputEdgeMap', 'outputMaximumGradientImage': 'outputMaximumGradientImage'}
84+
_redirect_x = False

0 commit comments

Comments
 (0)