NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMIDASMaskByRegionImageFilter.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 itkMIDASMaskByRegionImageFilter_h
16 #define itkMIDASMaskByRegionImageFilter_h
17 
18 #include <itkImageToImageFilter.h>
19 
20 namespace itk
21 {
22 
47 template <class TInputImage, class TOutputImage>
48 class ITK_EXPORT MIDASMaskByRegionImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
49 {
50 
51 public:
52 
55  typedef ImageToImageFilter<TInputImage, TOutputImage> SuperClass;
56  typedef SmartPointer<Self> Pointer;
57  typedef SmartPointer<const Self> ConstPointer;
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(MIDASMaskByRegionImageFilter, ImageToImageFilter);
64 
66  typedef typename TInputImage::IndexType IndexType;
67  typedef typename TInputImage::SizeType SizeType;
71 
73  RegionType GetRegion() const;
74 
76  void SetRegion(RegionType region);
77 
79  itkSetMacro(OutputBackgroundValue, OutputPixelType);
80  itkGetConstMacro(OutputBackgroundValue, OutputPixelType);
81 
83  itkSetMacro(UserSetRegion, bool);
84  itkGetConstMacro(UserSetRegion, bool);
85 
86 protected:
87 
90  void PrintSelf(std::ostream& os, Indent indent) const;
91 
92  virtual void BeforeThreadedGenerateData();
93  virtual void ThreadedGenerateData(const RegionType& outputRegionForThread, ThreadIdType threadNumber);
94 
95 private:
96  MIDASMaskByRegionImageFilter(const Self&); //purposely not implemented
97  void operator=(const Self&); //purposely not implemented
98 
99  bool m_UserSetRegion;
100  RegionType m_Region;
101  OutputPixelType m_OutputBackgroundValue;
102 
103 };
104 
105 }
106 
107 #ifndef ITK_MANUAL_INSTANTIATION
108 #include "itkMIDASMaskByRegionImageFilter.txx"
109 #endif
110 
111 #endif
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
TInputImage::PixelType InputPixelType
Definition: itkMIDASMaskByRegionImageFilter.h:69
SmartPointer< const Self > ConstPointer
Definition: itkMIDASMaskByRegionImageFilter.h:57
TInputImage::IndexType IndexType
Definition: itkMIDASMaskByRegionImageFilter.h:63
ImageToImageFilter< TInputImage, TOutputImage > SuperClass
Definition: itkMIDASMaskByRegionImageFilter.h:55
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
TOutputImage::PixelType OutputPixelType
Definition: itkMIDASMaskByRegionImageFilter.h:70
SmartPointer< Self > Pointer
Definition: itkMIDASMaskByRegionImageFilter.h:56
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
TInputImage::RegionType RegionType
Definition: itkMIDASMaskByRegionImageFilter.h:68
Class, developed for MIDAS migration, that outputs an image the same size as the input, but you can specify a region, and that region is kept, and anything outside that region, set to a single background value. Used for axial cut-off.
Definition: itkMIDASMaskByRegionImageFilter.h:48
TInputImage::SizeType SizeType
Definition: itkMIDASMaskByRegionImageFilter.h:67
MIDASMaskByRegionImageFilter Self
Definition: itkMIDASMaskByRegionImageFilter.h:54