ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkReconstructionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkReconstructionImageFilter_h
19 #define itkReconstructionImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include "itkImageRegionIterator.h"
24 #include "itkProgressReporter.h"
25 #include <queue>
26 
27 //#define BASIC
28 #define COPY
29 
30 #ifdef COPY
32 #endif
33 
34 namespace itk
35 {
54 template< typename TInputImage, typename TOutputImage, typename TCompare >
55 class ITK_TEMPLATE_EXPORT ReconstructionImageFilter:
56  public ImageToImageFilter< TInputImage, TOutputImage >
57 {
58 public:
62 
65 
67  typedef TInputImage InputImageType;
69  typedef TInputImage MarkerImageType;
70  typedef typename MarkerImageType::Pointer MarkerImagePointer;
71  typedef typename MarkerImageType::ConstPointer MarkerImageConstPointer;
72  typedef typename MarkerImageType::RegionType MarkerImageRegionType;
73  typedef typename MarkerImageType::PixelType MarkerImagePixelType;
74  typedef typename InputImageType::PixelType InputImagePixelType;
76  typedef TInputImage MaskImageType;
77  typedef typename MaskImageType::Pointer MaskImagePointer;
78  typedef typename MaskImageType::ConstPointer MaskImageConstPointer;
79  typedef typename MaskImageType::RegionType MaskImageRegionType;
80  typedef typename MaskImageType::PixelType MaskImagePixelType;
81  typedef TOutputImage OutputImageType;
82  typedef typename OutputImageType::Pointer OutputImagePointer;
83  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
84  typedef typename OutputImageType::RegionType OutputImageRegionType;
85  typedef typename OutputImageType::PixelType OutputImagePixelType;
87 
91  itkStaticConstMacro(MarkerImageDimension, unsigned int,
92  TInputImage::ImageDimension);
93  itkStaticConstMacro(MaskImageDimension, unsigned int,
94  TInputImage::ImageDimension);
95  itkStaticConstMacro(OutputImageDimension, unsigned int,
96  TOutputImage::ImageDimension);
98 
100  itkNewMacro(Self);
101 
103  itkTypeMacro(ReconstructionImageFilter,
105 
111  void SetMarkerImage(const MarkerImageType *);
112 
113  const MarkerImageType * GetMarkerImage();
114 
118  void SetMaskImage(const MaskImageType *);
119 
120  const MaskImageType * GetMaskImage();
121 
128  itkSetMacro(FullyConnected, bool);
129  itkGetConstReferenceMacro(FullyConnected, bool);
130  itkBooleanMacro(FullyConnected);
132 
138  itkSetMacro(UseInternalCopy, bool);
139  itkGetConstReferenceMacro(UseInternalCopy, bool);
140  itkBooleanMacro(UseInternalCopy);
142 
143 protected:
145  ~ReconstructionImageFilter() ITK_OVERRIDE {}
146  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
147 
151  void GenerateInputRequestedRegion() ITK_OVERRIDE;
152 
154  void EnlargeOutputRequestedRegion( DataObject *itkNotUsed(output) ) ITK_OVERRIDE;
155 
156  void GenerateData() ITK_OVERRIDE;
157 
161  typename TInputImage::PixelType m_MarkerValue;
162 
163 private:
164  ITK_DISALLOW_COPY_AND_ASSIGN(ReconstructionImageFilter);
165 
166  bool m_FullyConnected;
167  bool m_UseInternalCopy;
168 
169  typedef typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator< OutputImageType > FaceCalculatorType;
170 
171  typedef typename FaceCalculatorType::FaceListType FaceListType;
172  typedef typename FaceCalculatorType::FaceListType::iterator FaceListTypeIt;
173 
176 
181 }; // end of class
182 } // end namespace itk
183 
184 #ifndef ITK_MANUAL_INSTANTIATION
185 #include "itkReconstructionImageFilter.hxx"
186 #endif
187 
188 #endif
Const version of ShapedNeighborhoodIterator, defining iteration of a local N-dimensional neighborhood...
Performs a grayscale geodesic reconstruction – for performance comparison with GrayscaleGeodesicDilat...
OutputImageType::IndexType OutputImageIndexType
OutputImageType::RegionType OutputImageRegionType
MaskImageType::ConstPointer MaskImageConstPointer
Base class for all process objects that output image data.
A neighborhood iterator which can take on an arbitrary shape.
InputImageType::IndexType InputImageIndexType
OutputImageType::PixelType OutputImagePixelType
Splits an image into a main region and several &quot;face&quot; regions which are used to handle computations o...
MaskImageType::RegionType MaskImageRegionType
A multi-dimensional iterator templated over image type that walks a region of pixels.
MarkerImageType::PixelType MarkerImagePixelType
MarkerImageType::ConstPointer MarkerImageConstPointer
OutputImageType::ConstPointer OutputImageConstPointer
ImageToImageFilter< TInputImage, TOutputImage > Superclass
MarkerImageType::RegionType MarkerImageRegionType
Base class for filters that take an image as input and produce an image as output.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
TOutputImage OutputImageType
InputImageType::PixelType InputImagePixelType
Base class for all data objects in ITK.
A multi-dimensional iterator templated over image type that walks a region of pixels.