NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkTwinThresholdBoundaryFilter.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 itkTwinThresholdBoundaryFilter_h
16 #define itkTwinThresholdBoundaryFilter_h
17 
18 #include <itkImageToImageFilter.h>
19 
20 namespace itk {
21 
22 /*
23  * \class TwinThresholdBoundaryFilter
24  * \brief Takes two inputs, if input 1 above threshold 1 and at least one
25  * voxel in the 8 (2D), or 26 (3D) neighbourhood of image 2 is above threshold 2,
26  * then output is True, otherwise False.
27  *
28  * This filter was written to extract the grey/white interface (GWI) mentioned
29  * in Das et. al. NeuroImage 45 (2009) 867-879. So, if input 1 is a grey matter
30  * PV map, and input 2 is a white matter PV map, then we can extract a boundary
31  * where the grey matter probability is > 0.5 and the white matter probability of
32  * at least one connected voxel is greater than 0.5.
33  *
34  * We can set the thresholds that are tested eg. ThresholdForInput1 and ThresholdForInput2
35  * and also the values that are set, True=1, False=0.
36  */
37 template< class TImageType>
38 class ITK_EXPORT TwinThresholdBoundaryFilter : public ImageToImageFilter<TImageType, TImageType>
39 {
40  public:
41  // Standard ITK style typedefs.
43  typedef ImageToImageFilter<TImageType, TImageType> Superclass;
44  typedef SmartPointer<Self> Pointer;
45  typedef SmartPointer<const Self> ConstPointer;
46 
47  // Additional typedefs
48  typedef TImageType ImageType;
49  typedef typename ImageType::Pointer ImagePointer;
50  typedef typename TImageType::PixelType PixelType;
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(TwinThresholdBoundaryFilter, ImageToImageFilter);
57 
59  itkStaticConstMacro(Dimension, unsigned int, TImageType::ImageDimension);
60 
62  void SetInput1(ImagePointer image) { this->SetInput(0, image); }
63 
65  void SetInput2(ImagePointer image) { this->SetInput(1, image); }
66 
68  itkSetMacro(ThresholdForInput1, PixelType);
69  itkGetMacro(ThresholdForInput1, PixelType);
70 
72  itkSetMacro(ThresholdForInput2, PixelType);
73  itkGetMacro(ThresholdForInput2, PixelType);
74 
76  itkSetMacro(True, PixelType);
77  itkGetMacro(True, PixelType);
78 
80  itkSetMacro(False, PixelType);
81  itkGetMacro(False, PixelType);
82 
84  itkSetMacro(FullyConnected, bool);
85  itkGetMacro(FullyConnected, bool);
86 
87  protected:
88 
91  void GenerateData();
92  void PrintSelf(std::ostream& os, Indent indent) const;
93 
94  private:
95 
96  TwinThresholdBoundaryFilter(Self&); // intentionally not implemented
97  void operator=(const Self&); // intentionally not implemented
98 
99  PixelType m_ThresholdForInput1;
100  PixelType m_ThresholdForInput2;
101 
102  PixelType m_True;
103  PixelType m_False;
104 
106  bool m_FullyConnected;
107 
108 }; // end class
109 
110 } // end namespace
111 
112 #ifndef ITK_MANUAL_INSTANTIATION
113 #include "itkTwinThresholdBoundaryFilter.txx"
114 #endif
115 
116 #endif
void SetInput2(ImagePointer image)
Definition: itkTwinThresholdBoundaryFilter.h:65
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Definition: niftkITKAffineResampleImage.cxx:74
TImageType::PixelType PixelType
Definition: itkTwinThresholdBoundaryFilter.h:50
TImageType ImageType
Definition: itkTwinThresholdBoundaryFilter.h:48
SmartPointer< Self > Pointer
Definition: itkTwinThresholdBoundaryFilter.h:44
TwinThresholdBoundaryFilter Self
Definition: itkTwinThresholdBoundaryFilter.h:42
void SetInput1(ImagePointer image)
Definition: itkTwinThresholdBoundaryFilter.h:62
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
SmartPointer< const Self > ConstPointer
Definition: itkTwinThresholdBoundaryFilter.h:45
ImageType::Pointer ImagePointer
Definition: itkTwinThresholdBoundaryFilter.h:49
const unsigned int Dimension
Definition: niftkBreastDCEandADC.cxx:89
Definition: itkTwinThresholdBoundaryFilter.h:38
ImageToImageFilter< TImageType, TImageType > Superclass
Definition: itkTwinThresholdBoundaryFilter.h:43