Fraxinus  18.10
An IGT application
itkBinaryThinningImageFilter3D.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef __itkBinaryThinningImageFilter3D_h
13 #define __itkBinaryThinningImageFilter3D_h
14 
15 #include <itkNeighborhoodIterator.h>
16 #include <itkImageToImageFilter.h>
17 #include <itkImageRegionIteratorWithIndex.h>
18 #include <itkConstantBoundaryCondition.h>
19 
20 namespace itk
21 {
56 template <class TInputImage,class TOutputImage>
58  public ImageToImageFilter<TInputImage,TOutputImage>
59 {
60 public:
63  typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
64  typedef SmartPointer<Self> Pointer;
65  typedef SmartPointer<const Self> ConstPointer;
66 
68  itkNewMacro(Self);
69 
71  itkTypeMacro( BinaryThinningImageFilter3D, ImageToImageFilter );
72 
74  typedef TInputImage InputImageType;
75 
77  typedef TOutputImage OutputImageType;
78 
80  typedef typename InputImageType::RegionType RegionType;
81 
83  typedef typename RegionType::IndexType IndexType;
84 
87 
90 
92  typedef typename RegionType::SizeType SizeType;
93 
95  typedef typename InputImageType::ConstPointer InputImagePointer;
96 
98  typedef typename OutputImageType::Pointer OutputImagePointer;
99 
101  typedef ConstantBoundaryCondition< TInputImage > ConstBoundaryConditionType;
102 
104  typedef NeighborhoodIterator<TInputImage, ConstBoundaryConditionType> NeighborhoodIteratorType;
105 
107  typedef typename NeighborhoodIteratorType::NeighborhoodType NeighborhoodType;
108 
110  OutputImageType * GetThinning(void);
111 
113  itkStaticConstMacro(InputImageDimension, unsigned int,
114  TInputImage::ImageDimension );
115  itkStaticConstMacro(OutputImageDimension, unsigned int,
116  TOutputImage::ImageDimension );
117 
118 #ifdef ITK_USE_CONCEPT_CHECKING
119 
120  itkConceptMacro(SameDimensionCheck,
121  (Concept::SameDimension<InputImageDimension, 3>));
122  itkConceptMacro(SameTypeCheck,
123  (Concept::SameType<InputImagePixelType, OutputImagePixelType>));
124  itkConceptMacro(InputAdditiveOperatorsCheck,
125  (Concept::AdditiveOperators<InputImagePixelType>));
126  itkConceptMacro(InputConvertibleToIntCheck,
127  (Concept::Convertible<InputImagePixelType, int>));
128  itkConceptMacro(IntConvertibleToInputCheck,
129  (Concept::Convertible<int, InputImagePixelType>));
130  itkConceptMacro(InputIntComparableCheck,
131  (Concept::Comparable<InputImagePixelType, int>));
133 #endif
134 
135 protected:
138  void PrintSelf(std::ostream& os, Indent indent) const;
139 
141  void GenerateData();
142 
144  void PrepareData();
145 
147  void ComputeThinImage();
148 
150  bool isEulerInvariant(NeighborhoodType neighbors, int *LUT);
151  void fillEulerLUT(int *LUT);
153  bool isSimplePoint(NeighborhoodType neighbors);
155  void Octree_labeling(int octant, int label, int *cube);
156 
157 
158 private:
159  BinaryThinningImageFilter3D(const Self&); //purposely not implemented
160  void operator=(const Self&); //purposely not implemented
161 
162 }; // end of BinaryThinningImageFilter3D class
163 
164 } //end namespace itk
165 
166 #ifndef ITK_MANUAL_INSTANTIATION
167 #include "itkBinaryThinningImageFilter3D.txx"
168 #endif
169 
170 #endif
itkTypeMacro(BinaryThinningImageFilter3D, ImageToImageFilter)
ImageToImageFilter< TInputImage, TOutputImage > Superclass
ConstantBoundaryCondition< TInputImage > ConstBoundaryConditionType
NeighborhoodIteratorType::NeighborhoodType NeighborhoodType
bool isEulerInvariant(NeighborhoodType neighbors, int *LUT)
NeighborhoodIterator< TInputImage, ConstBoundaryConditionType > NeighborhoodIteratorType
void PrintSelf(std::ostream &os, Indent indent) const
void Octree_labeling(int octant, int label, int *cube)
InputImageType::ConstPointer InputImagePointer
OutputImageType * GetThinning(void)
short PixelType
bool isSimplePoint(NeighborhoodType neighbors)
This filter computes one-pixel-wide skeleton of a 3D input image.
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension)