NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkBoundaryValueRescaleIntensityImageFilter.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 itkBoundaryValueRescaleIntensityImageFilter_h
16 #define itkBoundaryValueRescaleIntensityImageFilter_h
17 #include <itkImageToImageFilter.h>
18 #include <itkBinaryThresholdImageFilter.h>
19 
20 namespace itk
21 {
44 template <typename TImageType>
45 class ITK_EXPORT BoundaryValueRescaleIntensityImageFilter : public ImageToImageFilter<TImageType, TImageType>
46 {
47 public:
50  typedef ImageToImageFilter<TImageType, TImageType> Superclass;
51  typedef SmartPointer<Self> Pointer;
52  typedef SmartPointer<const Self> ConstPointer;
53  typedef typename TImageType::PixelType PixelType;
54  typedef TImageType ImageType;
55  typedef typename ImageType::Pointer ImagePointer;
57  typedef BinaryThresholdImageFilter<ImageType, ImageType> BinaryThresholdFilterType;
58  typedef typename BinaryThresholdFilterType::Pointer BinaryThresholdFilterPointer;
59  typedef typename NumericTraits<PixelType>::RealType RealType;
60 
62  itkNewMacro(Self);
63 
65  itkTypeMacro(BoundaryValueRescaleIntensityImageFilter, ImageToImageFilter);
66 
68  void PrintSelf(std::ostream& os, Indent indent) const;
69 
71  itkSetMacro(InputLowerThreshold, PixelType);
72  itkGetMacro(InputLowerThreshold, PixelType);
73 
75  itkSetMacro(InputUpperThreshold, PixelType);
76  itkGetMacro(InputUpperThreshold, PixelType);
77 
79  itkSetMacro(OutputMinimum, PixelType);
80  itkGetMacro(OutputMinimum, PixelType);
81 
83  itkSetMacro(OutputMaximum, PixelType);
84  itkGetMacro(OutputMaximum, PixelType);
85 
87  itkSetMacro(OutputBoundaryValue, PixelType);
88  itkGetMacro(OutputBoundaryValue, PixelType);
89 
90 protected:
91 
94 
95  // Check before we start.
96  virtual void BeforeThreadedGenerateData();
97 
98  // The main method to implement in derived classes, note, its threaded.
99  virtual void ThreadedGenerateData( const ImageRegionType &outputRegionForThread, ThreadIdType threadId);
100 
101 private:
102  BoundaryValueRescaleIntensityImageFilter(const Self&); // purposely not implemented
103  void operator=(const Self&); // purposely not implemented
104 
105  RealType m_Scale;
106  RealType m_Shift;
107 
108  PixelType m_InputLowerThreshold;
109  PixelType m_InputUpperThreshold;
110 
111  PixelType m_InputMinimum;
112  PixelType m_InputMaximum;
113 
114  PixelType m_OutputMinimum;
115  PixelType m_OutputMaximum;
116  PixelType m_OutputBoundaryValue;
117 
119  BinaryThresholdFilterPointer m_ThresholdFilter;
120 
121 };
122 
123 
124 
125 } // end namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkBoundaryValueRescaleIntensityImageFilter.txx"
129 #endif
130 
131 #endif
BinaryThresholdFilterType::Pointer BinaryThresholdFilterPointer
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:58
TImageType ImageType
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:54
BinaryThresholdImageFilter< ImageType, ImageType > BinaryThresholdFilterType
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:57
ImageType::Pointer ImagePointer
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:55
SmartPointer< const Self > ConstPointer
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:52
BoundaryValueRescaleIntensityImageFilter Self
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:49
Definition: niftkITKAffineResampleImage.cxx:74
TImageType::PixelType PixelType
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:53
ImageType::RegionType ImageRegionType
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:56
virtual ~BoundaryValueRescaleIntensityImageFilter()
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:93
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
Applies a linear transformation to the intensity levels of the input Image, but takes into an upper a...
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:45
SmartPointer< Self > Pointer
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:51
NumericTraits< PixelType >::RealType RealType
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:59
ImageToImageFilter< TImageType, TImageType > Superclass
Definition: itkBoundaryValueRescaleIntensityImageFilter.h:50