Slicer  5.1
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 
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 override;
78 
80  itkSetMacro(Seed, IndexType);
81  itkGetMacro(Seed, IndexType);
82 
84  itkGetMacro(MovedSeed, bool);
85 
86  int GetThreshold();
89 
91  ChainCodePathType *GetPathOutput() { return static_cast<ChainCodePathType*>(this->ProcessObject::GetOutput(1)); }
92 
93 protected:
95  ~LevelTracingImageFilter() override = default;
96 
98  void GenerateInputRequestedRegion() override;
99 
101  void EnlargeOutputRequestedRegion(DataObject *output) override;
102 
103  void GenerateData() 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&) = delete;
119  void operator=(const Self&) = delete;
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
void GenerateData() override
itkGetMacro(Seed, IndexType)
To control overloaded versions of ComputeThreshold.
InputImageType::ConstPointer InputImageConstPointer
DataObjectPointer MakeOutput(unsigned int output)
ChainCodePathType::Pointer ChainCodePathPointer
~LevelTracingImageFilter() override=default
SmartPointer< const Self > ConstPointer
void GenerateInputRequestedRegion() override
Override since the filter needs all the data for the algorithm.
ChainCodePath< ImageDimension > ChainCodePathType
Simplified inverse ITK transforms.
ChainCodePathType::OffsetType OffsetType
OutputImageType::PixelType OutputImagePixelType
ImageToImageFilter< TInputImage, TOutputImage > Superclass
InputImageType::Pointer InputImagePointer
Trace a level curve/surface given a seed point on the level curve/surface.
OutputImageType::RegionType OutputImageRegionType
OutputImageType::Pointer OutputImagePointer
void PrintSelf(std::ostream &os, Indent indent) const override
InputImageType::PixelType InputImagePixelType
InputImageType::IndexType IndexType
virtual void Trace(const Dispatch< 2 > &)
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.
void EnlargeOutputRequestedRegion(DataObject *output) override
Override since the filter produces the entire dataset.
InputImageType::RegionType InputImageRegionType