15 #ifndef itkBinaryThresholdSurfaceVoxelImageFunction_h
16 #define itkBinaryThresholdSurfaceVoxelImageFunction_h
18 #include <itkImageFunction.h>
39 template <
class TInputImage,
class TCoordRep =
float>
41 public ImageFunction<TInputImage,bool,TCoordRep>
46 typedef ImageFunction<TInputImage,bool,TCoordRep>
Superclass;
63 itkStaticConstMacro(ImageDimension,
unsigned int,Superclass::ImageDimension);
86 virtual bool Evaluate(
const PointType& point )
const
89 this->ConvertPointToNearestIndex( point, index );
90 return ( this->EvaluateAtIndex( index ) );
102 const ContinuousIndexType &
index )
const
106 this->ConvertContinuousIndexToNearestIndex (index, nindex);
107 return this->EvaluateAtIndex(nindex);
120 PixelType
value = this->GetInputImage()->GetPixel(index);
122 RegionType region = this->GetInputImage()->GetBufferedRegion();
123 if ( m_Lower <= value && value <= m_Upper) {
125 IndexType indexAbove =
index;
128 if ( region.IsInside( indexAbove ) ) {
129 PixelType valueAbove = this->GetInputImage()->GetPixel(indexAbove);
131 if ( ! ( m_Lower <= valueAbove && valueAbove <= m_Upper ) )
136 for (i=-1; i<=1; i+=2) {
138 indexAbove[0] = index[0] + i;
141 if ( region.IsInside( indexAbove ) ) {
142 PixelType valueAbove = this->GetInputImage()->GetPixel(indexAbove);
144 if ( ! ( m_Lower <= valueAbove && valueAbove <= m_Upper ) )
149 for (i=-1; i<=1; i+=2) {
152 indexAbove[2] = index[2] + i;
154 if ( region.IsInside( indexAbove ) ) {
155 PixelType valueAbove = this->GetInputImage()->GetPixel(indexAbove);
157 if ( ! ( m_Lower <= valueAbove && valueAbove <= m_Upper ) )
167 itkGetConstReferenceMacro(Lower,PixelType);
170 itkGetConstReferenceMacro(Upper,PixelType);
173 void ThresholdAbove(PixelType thresh);
176 void ThresholdBelow(PixelType thresh);
179 void ThresholdBetween(PixelType lower, PixelType upper);
184 void PrintSelf(std::ostream& os, Indent indent)
const;
188 void operator=(
const Self& );
198 #define ITK_TEMPLATE_BinaryThresholdSurfaceVoxelImageFunction(_, EXPORT, x, y) namespace itk { \
199 _(2(class EXPORT BinaryThresholdSurfaceVoxelImageFunction< ITK_TEMPLATE_2 x >)) \
200 namespace Templates { typedef BinaryThresholdSurfaceVoxelImageFunction< ITK_TEMPLATE_2 x > \
201 BinaryThresholdSurfaceVoxelImageFunction##y; } \
204 #if ITK_TEMPLATE_EXPLICIT
205 # include "Templates/itkBinaryThresholdSurfaceVoxelImageFunction+-.h"
209 # include "itkBinaryThresholdSurfaceVoxelImageFunction.txx"
SmartPointer< const Self > ConstPointer
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:48
Superclass::InputImageType InputImageType
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:54
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
Superclass::PointType PointType
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:66
TInputImage::PixelType PixelType
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:60
GLsizei const GLfloat * value
Definition: glew.h:1833
SmartPointer< Self > Pointer
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:47
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
Superclass::IndexType IndexType
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:69
Returns true is the value of an image lies within a range of thresholds This ImageFunction returns tr...
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:40
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
GLuint index
Definition: glew.h:1798
virtual bool EvaluateAtContinuousIndex(const ContinuousIndexType &index) const
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:101
virtual bool EvaluateAtIndex(const IndexType &index) const
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:118
virtual bool Evaluate(const PointType &point) const
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:86
ImageFunction< TInputImage, bool, TCoordRep > Superclass
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:46
InputImageType::RegionType RegionType
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:72
BinaryThresholdSurfaceVoxelImageFunction Self
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:45
Superclass::ContinuousIndexType ContinuousIndexType
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:75
~BinaryThresholdSurfaceVoxelImageFunction()
Definition: itkBinaryThresholdSurfaceVoxelImageFunction.h:183