ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelSetMorphBaseImageFilter.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#ifndef itkLabelSetMorphBaseImageFilter_h
19#define itkLabelSetMorphBaseImageFilter_h
20
21#include "itkNumericTraits.h"
23
24namespace itk
25{
26#if ITK_VERSION_MAJOR < 4
27using ThreadIdType = int;
28using RegionIndexType = int;
29#else
30using RegionIndexType = unsigned int;
31#endif
45template <typename TInputImage, bool doDilate, typename TOutputImage = TInputImage>
46class ITK_EXPORT LabelSetMorphBaseImageFilter : public ImageToImageFilter<TInputImage, TOutputImage>
47{
48public:
49 ITK_DISALLOW_COPY_AND_MOVE(LabelSetMorphBaseImageFilter);
50
56
58 itkNewMacro(Self);
59
61 itkOverrideGetNameOfClassMacro(LabelSetMorphBaseImageFilter);
62
64 using InputImageType = TInputImage;
65 using OutputImageType = TOutputImage;
66 using PixelType = typename TInputImage::PixelType;
68 using OutputPixelType = typename TOutputImage::PixelType;
70
71 using OutputIndexType = typename OutputImageType::IndexType;
72 using OutputIndexValueType = typename OutputImageType::IndexValueType;
73
75 using InputImagePointer = typename TInputImage::Pointer;
76 using InputImageConstPointer = typename TInputImage::ConstPointer;
77 using InputSizeType = typename TInputImage::SizeType;
78 using OutputSizeType = typename TOutputImage::SizeType;
79
83
84 using OutputImageRegionType = typename OutputImageType::RegionType;
85
86 // set all of the scales the same
87 void
89
91 itkGetConstReferenceMacro(Radius, RadiusType);
92
97 itkSetMacro(UseImageSpacing, bool);
98 itkGetConstReferenceMacro(UseImageSpacing, bool);
99 itkBooleanMacro(UseImageSpacing);
100
102 static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
103 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
104 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
105
109
110 void
111 writeDist(std::string fname);
112
113protected:
115 ~LabelSetMorphBaseImageFilter() override = default;
116
119
120 void
121 ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override;
122
123 void
124 GenerateData() override;
125
126 // Override since the filter produces the entire dataset.
127 void
129
131 void
132 PrintSelf(std::ostream & os, Indent indent) const override;
133
138
139 typename DistanceImageType::Pointer m_DistanceImage;
140
144
145 // last dimension index with m_Scale > 0; the erosion output commits here
147
148 // this is the first non-zero entry in the radius. Needed to
149 // support elliptical operations
151};
152} // end namespace itk
153
154#ifndef ITK_MANUAL_INSTANTIATION
155# include "itkLabelSetMorphBaseImageFilter.hxx"
156#endif
157
158#endif
Base class for all data objects in ITK.
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:53
void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override
typename itk::Image< RealType, TInputImage::ImageDimension > DistanceImageType
RegionIndexType SplitRequestedRegion(RegionIndexType i, RegionIndexType num, OutputImageRegionType &splitRegion) override
void EnlargeOutputRequestedRegion(DataObject *output) override
void SetRadius(ScalarRealType scale)
typename itk::FixedArray< ScalarRealType, TInputImage::ImageDimension > RadiusType
void PrintSelf(std::ostream &os, Indent indent) const override
void writeDist(std::string fname)
~LabelSetMorphBaseImageFilter() override=default
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned int ThreadIdType
Definition itkIntTypes.h:98
#define itkSetMacro(name, type)