NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkBaseCTEFilter.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 itkBaseCTEFilter_h
16 #define itkBaseCTEFilter_h
17 
18 #include <itkImage.h>
19 #include <itkImageToImageFilter.h>
20 
21 namespace itk
22 {
35 template <class TImageType>
36 class ITK_EXPORT BaseCTEFilter :
37  public ImageToImageFilter< TImageType, TImageType >
38 {
39 public:
42  typedef ImageToImageFilter< TImageType, TImageType > Superclass;
43  typedef SmartPointer<Self> Pointer;
44  typedef SmartPointer<const Self> ConstPointer;
45 
47  itkTypeMacro(BaseCTEFilter, ImageToImageFilter);
48 
50  itkStaticConstMacro(Dimension, unsigned int, TImageType::ImageDimension);
51 
53  typedef TImageType InputImageType;
57  typedef typename InputImageType::Pointer InputImagePointer;
58  typedef typename InputImageType::ConstPointer InputImageConstPointer;
59  typedef InputPixelType OutputPixelType;
61  typedef typename OutputImageType::Pointer OutputImagePointer;
62  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
64 
66  itkGetMacro( GreyMatterLabel, InputPixelType);
67 
69  itkGetMacro( WhiteMatterLabel, InputPixelType);
70 
72  itkGetMacro( ExtraCerebralMatterLabel, InputPixelType);
73 
75  void SetLabelThresholds(InputPixelType greyMatterLabel,
76  InputPixelType whiteMatterLabel,
77  InputPixelType extraCerebralMatterLabel);
78 
80  itkGetMacro(UserHasSetTheLabelThresholds, bool);
81 
82 protected:
83 
84  BaseCTEFilter();
85  virtual ~BaseCTEFilter() {};
86 
88  virtual void PrintSelf(std::ostream&, Indent) const;
89 
91  virtual void GenerateInputRequestedRegion();
92 
94  virtual void EnlargeOutputRequestedRegion(DataObject *itkNotUsed);
95 
97  virtual void CheckInputsAndOutputsSameSize();
98 
100  virtual bool IsOnBoundary(const InputImageType *image, const InputIndexType& index, const InputPixelType boundaryValue, bool useFullyConnected);
101 
103  virtual bool IsOnCSFBoundary(const InputImageType *image, const InputIndexType& index, bool useFullyConnected)
104  { return this->IsOnBoundary(image, index, this->m_ExtraCerebralMatterLabel, useFullyConnected);}
105 
107  virtual bool IsOnWMBoundary(const InputImageType *image, const InputIndexType& index, bool useFullyConnected)
108  { return this->IsOnBoundary(image, index, this->m_WhiteMatterLabel, useFullyConnected);}
109 
111  virtual bool IsOnGMBoundary(const InputImageType *image, const InputIndexType& index, bool useFullyConnected)
112  { return this->IsOnBoundary(image, index, this->m_GreyMatterLabel, useFullyConnected);}
113 
114  InputPixelType m_GreyMatterLabel;
115 
116  InputPixelType m_WhiteMatterLabel;
117 
119 
121 
122 private:
123 
124  BaseCTEFilter(const Self&); // purposely not implemented
125  void operator=(const Self&); // purposely not implemented
126 
127 };
128 
129 } // end namespace itk
130 
131 #ifndef ITK_MANUAL_INSTANTIATION
132 #include "itkBaseCTEFilter.txx"
133 #endif
134 
135 #endif
OutputImageType::SizeType OutputSizeType
Definition: itkBaseCTEFilter.h:63
SmartPointer< const Self > ConstPointer
Definition: itkBaseCTEFilter.h:44
virtual ~BaseCTEFilter()
Definition: itkBaseCTEFilter.h:85
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
InputPixelType m_ExtraCerebralMatterLabel
Definition: itkBaseCTEFilter.h:118
OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBaseCTEFilter.h:62
InputImageType::PixelType InputPixelType
Definition: itkBaseCTEFilter.h:54
InputPixelType OutputPixelType
Definition: itkBaseCTEFilter.h:59
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
InputPixelType m_GreyMatterLabel
Definition: itkBaseCTEFilter.h:114
TImageType InputImageType
Definition: itkBaseCTEFilter.h:53
virtual bool IsOnCSFBoundary(const InputImageType *image, const InputIndexType &index, bool useFullyConnected)
Definition: itkBaseCTEFilter.h:103
Base class for methods many CTE filters will need.
Definition: itkBaseCTEFilter.h:36
InputImageType::Pointer InputImagePointer
Definition: itkBaseCTEFilter.h:57
InputImageType::ConstPointer InputImageConstPointer
Definition: itkBaseCTEFilter.h:58
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
virtual bool IsOnWMBoundary(const InputImageType *image, const InputIndexType &index, bool useFullyConnected)
Definition: itkBaseCTEFilter.h:107
InputImageType::IndexType InputIndexType
Definition: itkBaseCTEFilter.h:55
GLuint index
Definition: glew.h:1798
ImageToImageFilter< TImageType, TImageType > Superclass
Definition: itkBaseCTEFilter.h:42
Image< OutputPixelType, TImageType::ImageDimension > OutputImageType
Definition: itkBaseCTEFilter.h:60
BaseCTEFilter Self
Definition: itkBaseCTEFilter.h:41
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
OutputImageType::Pointer OutputImagePointer
Definition: itkBaseCTEFilter.h:61
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
InputImageType::SizeType InputSizeType
Definition: itkBaseCTEFilter.h:56
InputPixelType m_WhiteMatterLabel
Definition: itkBaseCTEFilter.h:116
virtual bool IsOnGMBoundary(const InputImageType *image, const InputIndexType &index, bool useFullyConnected)
Definition: itkBaseCTEFilter.h:111
SmartPointer< Self > Pointer
Definition: itkBaseCTEFilter.h:43
bool m_UserHasSetTheLabelThresholds
Definition: itkBaseCTEFilter.h:120