NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkThresholdImageWithRespectToPlane.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkThresholdImageWithRespectToPlane_h
16 #define itkThresholdImageWithRespectToPlane_h
17 
18 #include <itkImageToImageFilter.h>
19 
20 namespace itk {
21 
28 template<class TInputImage, class TOutputImage>
30  public ImageToImageFilter< TInputImage, TOutputImage >
31 {
32 public:
35  typedef ImageToImageFilter< TInputImage,TOutputImage > Superclass;
36  typedef SmartPointer< Self > Pointer;
37  typedef SmartPointer< const Self > ConstPointer;
38 
40  itkTypeMacro( ThresholdImageWithRespectToPlane, ImageToImageFilter );
41 
43  itkNewMacro(Self);
44 
46  itkStaticConstMacro(ImageDimension, unsigned int,
47  TInputImage::ImageDimension);
48 
50  typedef TInputImage InputImageType;
51  typedef typename InputImageType::Pointer InputImagePointer;
52  typedef typename InputImageType::ConstPointer InputImageConstPointer;
55  typedef typename InputImageType::SpacingType InputImageSpacingType;
57  typedef typename InputImageType::PointType InputImagePointType;
58 
60  typedef TOutputImage OutputImageType;
61  typedef typename OutputImageType::Pointer OutputImagePointer;
65  typedef typename OutputImageType::PointType OutputImagePointType;
66 
67  // Set the value to set voxels on the opposite side of the plane to the normal to
68  itkSetMacro( ThresholdValue, OutputImagePixelType );
69  // Get the value to set voxels on the opposite side of the plane to the normal to
70  itkGetMacro( ThresholdValue, OutputImagePixelType );
71 
73  void SetPlanePosition( double px, double py, double pz );
75  void SetPlaneNormal( double nx, double ny, double nz );
76 
77 #ifdef ITK_USE_CONCEPT_CHECKING
78 
79  itkConceptMacro(InputHasNumericTraitsCheck,
80  (Concept::HasNumericTraits<InputImagePixelType>));
81  itkConceptMacro(OutputHasPixelTraitsCheck,
82  (Concept::HasPixelTraits<OutputImagePixelType>));
84 #endif
85 
86 protected:
89  void PrintSelf(std::ostream& os, Indent indent) const;
90 
91 
102  virtual void BeforeThreadedGenerateData(void);
103 
114  virtual void AfterThreadedGenerateData(void);
115 
126  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
127  ThreadIdType threadId );
128 
129  // The value to set voxels on the opposite side of the plane to the normal to
130  OutputImagePixelType m_ThresholdValue;
131 
133  Vector< double, 3 > m_PlanePosition;
135  Vector< double, 3 > m_PlaneNormal;
136 
137 private:
138  ThresholdImageWithRespectToPlane(const Self&); //purposely not implemented
139  void operator=(const Self&); //purposely not implemented
140 };
141 
142 } // end namespace itk
143 
144 #ifndef ITK_MANUAL_INSTANTIATION
145 #include "itkThresholdImageWithRespectToPlane.txx"
146 #endif
147 
148 #endif
ImageToImageFilter< TInputImage, TOutputImage > Superclass
Definition: itkThresholdImageWithRespectToPlane.h:35
TInputImage InputImageType
Definition: itkThresholdImageWithRespectToPlane.h:50
InputImageType::IndexType InputImageIndexType
Definition: itkThresholdImageWithRespectToPlane.h:56
InputImageType::SpacingType InputImageSpacingType
Definition: itkThresholdImageWithRespectToPlane.h:55
virtual ~ThresholdImageWithRespectToPlane()
Definition: itkThresholdImageWithRespectToPlane.h:88
InputImageType::RegionType InputImageRegionType
Definition: itkThresholdImageWithRespectToPlane.h:53
Image filter class to set all voxels on one side of plane to a uer specified value (or zero by defaul...
Definition: itkThresholdImageWithRespectToPlane.h:29
InputImageType::PointType InputImagePointType
Definition: itkThresholdImageWithRespectToPlane.h:57
Vector< double, 3 > m_PlaneNormal
The normal of the plane.
Definition: itkThresholdImageWithRespectToPlane.h:135
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
OutputImageType::IndexType OutputImageIndexType
Definition: itkThresholdImageWithRespectToPlane.h:64
InputImageType::Pointer InputImagePointer
Definition: itkThresholdImageWithRespectToPlane.h:51
TOutputImage OutputImageType
Definition: itkThresholdImageWithRespectToPlane.h:60
OutputImageType::PixelType OutputImagePixelType
Definition: itkThresholdImageWithRespectToPlane.h:63
SmartPointer< const Self > ConstPointer
Definition: itkThresholdImageWithRespectToPlane.h:37
OutputImageType::RegionType OutputImageRegionType
Definition: itkThresholdImageWithRespectToPlane.h:62
ThresholdImageWithRespectToPlane Self
Definition: itkThresholdImageWithRespectToPlane.h:34
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
SmartPointer< Self > Pointer
Definition: itkThresholdImageWithRespectToPlane.h:36
InputImageType::ConstPointer InputImageConstPointer
Definition: itkThresholdImageWithRespectToPlane.h:52
GLfloat GLfloat GLfloat GLfloat nx
Definition: glew.h:14135
GLhalf GLhalf nz
Definition: glew.h:11437
OutputImageType::PointType OutputImagePointType
Definition: itkThresholdImageWithRespectToPlane.h:65
Vector< double, 3 > m_PlanePosition
The position of the plane.
Definition: itkThresholdImageWithRespectToPlane.h:133
GLhalf ny
Definition: glew.h:11437
OutputImagePixelType m_ThresholdValue
Definition: itkThresholdImageWithRespectToPlane.h:130
OutputImageType::Pointer OutputImagePointer
Definition: itkThresholdImageWithRespectToPlane.h:61
InputImageType::PixelType InputImagePixelType
Definition: itkThresholdImageWithRespectToPlane.h:54