Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
itkLevelTracingImageFilter.h
Go to the documentation of this file.
1 #ifndef itkLevelTracingImageFilter_h
2 #define itkLevelTracingImageFilter_h
3 
4 #include "itkImage.h"
5 #include "itkImageToImageFilter.h"
6 #include "itkSimpleDataObjectDecorator.h"
7 #include "itkChainCodePath.h"
8 
9 namespace itk
10 {
11 
29 template <class TInputImage, class TOutputImage>
30 class LevelTracingImageFilter: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  itkNewMacro(Self);
41 
44  ImageToImageFilter);
45 
47  itkStaticConstMacro(ImageDimension, unsigned int,
48  TInputImage::ImageDimension);
49 
50  typedef TInputImage InputImageType;
51  typedef typename InputImageType::Pointer InputImagePointer;
52  typedef typename InputImageType::ConstPointer InputImageConstPointer;
53  typedef typename InputImageType::RegionType InputImageRegionType;
54  typedef typename InputImageType::PixelType InputImagePixelType;
55  typedef typename InputImageType::IndexType IndexType;
56  typedef typename InputImageType::SizeType SizeType;
57 
58  typedef TOutputImage OutputImageType;
59  typedef typename OutputImageType::Pointer OutputImagePointer;
60  typedef typename OutputImageType::RegionType OutputImageRegionType;
61  typedef typename OutputImageType::PixelType OutputImagePixelType;
62 
63  typedef ChainCodePath<ImageDimension> ChainCodePathType;
64  typedef typename ChainCodePathType::Pointer ChainCodePathPointer;
65 
66  typedef typename ChainCodePathType::OffsetType OffsetType;
67 
69  typedef typename DataObject::Pointer DataObjectPointer;
70 
72  itkStaticConstMacro(InputImageDimension, unsigned int,
73  TInputImage::ImageDimension);
74  itkStaticConstMacro(OutputImageDimension, unsigned int,
75  TOutputImage::ImageDimension);
76 
77  void PrintSelf ( std::ostream& os, Indent indent ) const ITK_OVERRIDE;
78 
80  itkSetMacro(Seed, IndexType);
81  itkGetMacro(Seed, IndexType);
82 
84  itkGetMacro(MovedSeed, bool);
85 
86  int GetThreshold();
87  InputImagePixelType GetMaxIntensity() {return m_Max;}
88  InputImagePixelType GetMinIntensity() {return m_Min;}
89 
91  ChainCodePathType *GetPathOutput() { return static_cast<ChainCodePathType*>(this->ProcessObject::GetOutput(1)); }
92 
93 protected:
96 
98  void GenerateInputRequestedRegion() ITK_OVERRIDE;
99 
101  void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE;
102 
103  void GenerateData() ITK_OVERRIDE;
104 
105  using Superclass::MakeOutput;
106  DataObjectPointer MakeOutput(unsigned int output);
107 
109  struct DispatchBase {};
110  template<signed int VDimension>
111  struct Dispatch : DispatchBase {};
112 
114  virtual void Trace( const Dispatch<2> & );
115  virtual void Trace( const DispatchBase &);
116 
117 private:
118  LevelTracingImageFilter(const Self&); //purposely not implemented
119  void operator=(const Self&); //purposely not implemented
120 
121  IndexType m_Seed;
122  InputImagePixelType m_Max;
123  InputImagePixelType m_Min;
124  bool m_MovedSeed;
125 
126 };
127 
128 
129 //#ifdef ITK_USE_CONCEPT_CHECKING
142 //#endif
143 
144 } // end namespace itk
145 
146 #ifndef ITK_MANUAL_INSTANTIATION
147 #include "itkLevelTracingImageFilter.txx"
148 #endif
149 
150 #endif
itkGetMacro(Seed, IndexType)
To control overloaded versions of ComputeThreshold.
InputImageType::ConstPointer InputImageConstPointer
DataObjectPointer MakeOutput(unsigned int output)
ChainCodePathType::Pointer ChainCodePathPointer
void PrintSelf(std::ostream &os, Indent indent) const ITK_OVERRIDE
SmartPointer< const Self > ConstPointer
ChainCodePath< ImageDimension > ChainCodePathType
Simplified inverse ITK transforms.
ChainCodePathType::OffsetType OffsetType
OutputImageType::PixelType OutputImagePixelType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
InputImageType::Pointer InputImagePointer
void GenerateData() ITK_OVERRIDE
Trace a level curve/surface given a seed point on the level curve/surface.
OutputImageType::RegionType OutputImageRegionType
OutputImageType::Pointer OutputImagePointer
InputImageType::PixelType InputImagePixelType
InputImageType::IndexType IndexType
virtual void Trace(const Dispatch< 2 > &)
void GenerateInputRequestedRegion() ITK_OVERRIDE
Override since the filter needs all the data for the algorithm.
void EnlargeOutputRequestedRegion(DataObject *output) ITK_OVERRIDE
Override since the filter produces the entire dataset.
itkTypeMacro(LevelTracingImageFilter, ImageToImageFilter)
ChainCodePathType * GetPathOutput()
Get the output as a ChainCodePath. This output is only generated in the 2D case.
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
itkSetMacro(Seed, IndexType)
Set/Get the seed.
InputImageType::RegionType InputImageRegionType