ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkFastMarchingImageFilterBase.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
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 * https://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
19#ifndef itkFastMarchingImageFilterBase_h
20#define itkFastMarchingImageFilterBase_h
21
22#include "itkFastMarchingBase.h"
25#include "itkArray.h"
26#include <bitset>
27
28namespace itk
29{
72template <typename TInput, typename TOutput>
73class ITK_TEMPLATE_EXPORT FastMarchingImageFilterBase : public FastMarchingBase<TInput, TOutput>
74{
75public:
76 ITK_DISALLOW_COPY_AND_MOVE(FastMarchingImageFilterBase);
77
82 using typename Superclass::Traits;
83
85 itkNewMacro(Self);
86
88 itkOverrideGetNameOfClassMacro(FastMarchingImageFilterBase);
89
90
93 using typename Superclass::InputPixelType;
94
97 using typename Superclass::OutputPixelType;
98 using OutputSpacingType = typename OutputImageType::SpacingType;
99 using OutputSizeType = typename OutputImageType::SizeType;
100 using OutputRegionType = typename OutputImageType::RegionType;
101 using OutputPointType = typename OutputImageType::PointType;
102 using OutputDirectionType = typename OutputImageType::DirectionType;
103
104 using NodeType = typename Traits::NodeType;
105 using NodePairType = typename Traits::NodePairType;
106 using NodePairContainerType = typename Traits::NodePairContainerType;
107 using NodePairContainerPointer = typename Traits::NodePairContainerPointer;
108 using NodePairContainerConstIterator = typename Traits::NodePairContainerConstIterator;
109
110 using typename Superclass::LabelType;
111
112 static constexpr unsigned int ImageDimension = Traits::ImageDimension;
113
114
117
120
123
124 class InternalNodeStructure;
125
126
128
129 itkGetModifiableObjectMacro(LabelImage, LabelImageType);
130
138 virtual void
140 {
141 m_OutputRegion = size;
142 }
143 virtual OutputSizeType
145 {
146 return m_OutputRegion.GetSize();
147 }
148 itkSetMacro(OutputRegion, OutputRegionType);
149 itkGetConstReferenceMacro(OutputRegion, OutputRegionType);
150 itkSetMacro(OutputSpacing, OutputSpacingType);
151 itkGetConstReferenceMacro(OutputSpacing, OutputSpacingType);
152 itkSetMacro(OutputDirection, OutputDirectionType);
153 itkGetConstReferenceMacro(OutputDirection, OutputDirectionType);
154 itkSetMacro(OutputOrigin, OutputPointType);
155 itkGetConstReferenceMacro(OutputOrigin, OutputPointType);
156 itkSetMacro(OverrideOutputInformation, bool);
157 itkGetConstReferenceMacro(OverrideOutputInformation, bool);
158 itkBooleanMacro(OverrideOutputInformation);
160
161protected:
163
164 ~FastMarchingImageFilterBase() override = default;
165
166 void
167 PrintSelf(std::ostream & os, Indent indent) const override;
168
172
178
180 void
182
183 void
185
188
190 GetTotalNumberOfNodes() const override;
191
192 void
193 SetOutputValue(OutputImageType * oImage, const NodeType & iNode, const OutputPixelType & iValue) override;
194
196 const OutputPixelType
197 GetOutputValue(OutputImageType * oImage, const NodeType & iNode) const override;
198
200 unsigned char
201 GetLabelValueForGivenNode(const NodeType & iNode) const override;
202
204 void
205 SetLabelValueForGivenNode(const NodeType & iNode, const LabelType & iLabel) override;
206
208 void
209 UpdateNeighbors(OutputImageType * oImage, const NodeType & iNode) override;
210
212 void
213 UpdateValue(OutputImageType * oImage, const NodeType & iNode) override;
214
216 bool
217 CheckTopology(OutputImageType * oImage, const NodeType & iNode) override;
218 void
221
223 void
225
227 double
228 Solve(OutputImageType * oImage, const NodeType & iNode, InternalNodeStructureArray & iNeighbors) const;
229
230 //
231 // Functions and variables to check for topology changes (2D/3D only).
232 //
233
234 // Functions/data for the 2-D case
235 void
237 bool
239 bool
240 IsCriticalC1Configuration2D(const std::bitset<9> &) const;
241 bool
242 IsCriticalC2Configuration2D(const std::bitset<9> &) const;
243 bool
244 IsCriticalC3Configuration2D(const std::bitset<9> &) const;
245 bool
246 IsCriticalC4Configuration2D(const std::bitset<9> &) const;
247
250
251 // Functions/data for the 3-D case
252 void
254 bool
255 IsCriticalC1Configuration3D(const std::bitset<8> &) const;
256 unsigned int
257 IsCriticalC2Configuration3D(const std::bitset<8> &) const;
258 bool
260
263
264 // Functions for both 2D/3D cases
265 bool
267 bool
269
271
272private:
273};
274} // end namespace itk
275
276#ifndef ITK_MANUAL_INSTANTIATION
277# include "itkFastMarchingImageFilterBase.hxx"
278#endif
279
280#endif // itkFastMarchingImageFilterBase_h
Array class with size defined at construction time.
Definition itkArray.h:48
Base class for all data objects in ITK.
FastMarchingTraits< TInput, TOutput > Traits
typename Traits::InputPixelType InputPixelType
typename Traits::OutputDomainPointer OutputDomainPointer
typename Traits::InputDomainType InputDomainType
typename Traits::OutputDomainType OutputDomainType
typename Traits::InputDomainPointer InputDomainPointer
FastMarchingBase()
Constructor.
typename Traits::OutputPixelType OutputPixelType
typename Traits::LabelType LabelType
void InitializeOutput(OutputImageType *oImage) override
typename OutputImageType::RegionType OutputRegionType
typename Superclass::OutputDomainPointer OutputImagePointer
bool IsCriticalC1Configuration2D(const std::bitset< 9 > &) const
typename Traits::NodePairContainerType NodePairContainerType
typename Superclass::InputDomainPointer InputImagePointer
typename NeighborhoodIteratorType::RadiusType NeighborhoodRadiusType
~FastMarchingImageFilterBase() override=default
bool IsCriticalC1Configuration3D(const std::bitset< 8 > &) const
IdentifierType GetTotalNumberOfNodes() const override
Get the total number of nodes in the domain.
bool IsChangeWellComposed3D(const NodeType &) const
double Solve(OutputImageType *oImage, const NodeType &iNode, InternalNodeStructureArray &iNeighbors) const
void GetInternalNodesUsed(OutputImageType *oImage, const NodeType &iNode, InternalNodeStructureArray &ioNodesUsed)
NeighborhoodIterator< LabelImageType > NeighborhoodIteratorType
unsigned char GetLabelValueForGivenNode(const NodeType &iNode) const override
FastMarchingBase< TInput, TOutput > Superclass
Image< unsigned int, ImageDimension > ConnectedComponentImageType
typename ConnectedComponentImageType::Pointer ConnectedComponentImagePointer
FixedArray< InternalNodeStructure, ImageDimension > InternalNodeStructureArray
Image< unsigned char, ImageDimension > LabelImageType
unsigned int IsCriticalC2Configuration3D(const std::bitset< 8 > &) const
void SetLabelValueForGivenNode(const NodeType &iNode, const LabelType &iLabel) override
void SetOutputValue(OutputImageType *oImage, const NodeType &iNode, const OutputPixelType &iValue) override
Set the output value (front value) for a given node.
typename Superclass::InputDomainType InputImageType
typename OutputImageType::PointType OutputPointType
bool IsChangeWellComposed2D(const NodeType &) const
const OutputPixelType GetOutputValue(OutputImageType *oImage, const NodeType &iNode) const override
virtual void SetOutputSize(const OutputSizeType &size)
void PrintSelf(std::ostream &os, Indent indent) const override
void EnlargeOutputRequestedRegion(DataObject *output) override
void UpdateNeighbors(OutputImageType *oImage, const NodeType &iNode) override
typename OutputImageType::DirectionType OutputDirectionType
bool IsCriticalC2Configuration2D(const std::bitset< 9 > &) const
typename LabelImageType::Pointer LabelImagePointer
bool IsCriticalC3Configuration2D(const std::bitset< 9 > &) const
bool CheckTopology(OutputImageType *oImage, const NodeType &iNode) override
bool DoesVoxelChangeViolateWellComposedness(const NodeType &) const
void GenerateOutputInformation() override
typename OutputImageType::SizeType OutputSizeType
typename OutputImageType::SpacingType OutputSpacingType
ConnectedComponentImagePointer m_ConnectedComponentImage
typename Traits::NodePairContainerConstIterator NodePairContainerConstIterator
typename Traits::NodePairContainerPointer NodePairContainerPointer
typename Superclass::OutputDomainType OutputImageType
bool IsCriticalC4Configuration2D(const std::bitset< 9 > &) const
typename Traits::OutputPixelType OutputPixelType
void UpdateValue(OutputImageType *oImage, const NodeType &iNode) override
bool DoesVoxelChangeViolateStrictTopology(const NodeType &) const
typename Traits::LabelType LabelType
Simulate a standard C array with copy semantics.
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
Defines iteration of a local N-dimensional neighborhood of pixels across an itk::Image.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
SizeValueType IdentifierType
Definition itkIntTypes.h:90