ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkLabelMapContourOverlayImageFilter.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 itkLabelMapContourOverlayImageFilter_h
19#define itkLabelMapContourOverlayImageFilter_h
20
21#include "itkLabelMapFilter.h"
23#include "itkRGBPixel.h"
24
25namespace itk
26{
27
57template <typename TLabelMap,
58 typename TFeatureImage,
59 typename TOutputImage = Image<RGBPixel<typename TFeatureImage::PixelType>, TFeatureImage::ImageDimension>>
60class ITK_TEMPLATE_EXPORT LabelMapContourOverlayImageFilter : public LabelMapFilter<TLabelMap, TOutputImage>
61{
62public:
63 ITK_DISALLOW_COPY_AND_MOVE(LabelMapContourOverlayImageFilter);
64
70
72 using LabelMapType = TLabelMap;
73 using LabelMapPointer = typename LabelMapType::Pointer;
74 using LabelMapConstPointer = typename LabelMapType::ConstPointer;
75 using LabelMapRegionType = typename LabelMapType::RegionType;
76 using LabelMapPixelType = typename LabelMapType::PixelType;
77 using LabelObjectType = typename LabelMapType::LabelObjectType;
78 using LabelType = typename LabelObjectType::LabelType;
79
80 using FeatureImageType = TFeatureImage;
81 using FeatureImagePointer = typename FeatureImageType::Pointer;
82 using FeatureImageConstPointer = typename FeatureImageType::ConstPointer;
83 using FeatureImageRegionType = typename FeatureImageType::RegionType;
84 using FeatureImagePixelType = typename FeatureImageType::PixelType;
85
86 using OutputImageType = TOutputImage;
87 using OutputImagePointer = typename OutputImageType::Pointer;
88 using OutputImageConstPointer = typename OutputImageType::ConstPointer;
89 using OutputImageRegionType = typename OutputImageType::RegionType;
90 using OutputImagePixelType = typename OutputImageType::PixelType;
91 using IndexType = typename OutputImageType::IndexType;
92 using SizeType = typename OutputImageType::SizeType;
93 using RegionType = typename OutputImageType::RegionType;
94
97
99 static constexpr unsigned int LabelMapDimension = TLabelMap::ImageDimension;
100 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
101 static constexpr unsigned int ImageDimension = TOutputImage::ImageDimension;
102
103 enum
104 {
105 PLAIN = 0,
108 };
109
110 enum
111 {
114 };
115
117 itkNewMacro(Self);
118
120 itkOverrideGetNameOfClassMacro(LabelMapContourOverlayImageFilter);
121
123 void
124 SetFeatureImage(TFeatureImage * input)
125 {
126 // Process object is not const-correct so the const casting is required.
127 this->SetNthInput(1, const_cast<TFeatureImage *>(input));
128 }
129
131 FeatureImageType *
136
138 void
139 SetInput1(TLabelMap * input)
140 {
141 this->SetInput(input);
142 }
143
145 void
146 SetInput2(TFeatureImage * input)
147 {
148 this->SetFeatureImage(input);
149 }
150
155 itkSetMacro(Opacity, double);
156 itkGetConstReferenceMacro(Opacity, double);
161 itkSetMacro(Type, int);
162 itkGetConstReferenceMacro(Type, int);
167 itkSetMacro(Priority, int);
168 itkGetConstReferenceMacro(Priority, int);
173 itkSetMacro(DilationRadius, SizeType);
174 itkGetConstReferenceMacro(DilationRadius, SizeType);
179 itkSetMacro(ContourThickness, SizeType);
180 itkGetConstReferenceMacro(ContourThickness, SizeType);
185 itkSetMacro(SliceDimension, int);
186 itkGetConstReferenceMacro(SliceDimension, int);
192 virtual void
193 SetFunctor(const FunctorType & functor)
194 {
195 if (m_Functor != functor)
196 {
197 m_Functor = functor;
198 this->Modified();
199 }
200 }
201 FunctorType &
203 {
204 return m_Functor;
205 }
206 const FunctorType &
208 {
209 return m_Functor;
210 }
211
212protected:
215
219 void
221
223 void
224 EnlargeOutputRequestedRegion(DataObject * itkNotUsed(output)) override;
225
226 void
228
229 void
230 DynamicThreadedGenerateData(const OutputImageRegionType & outputRegionForThread) override;
231
232 // part of a compile error workaround for GCC 4.8.5-28 (Red Hat) from 20150623
233 void
235 {
237 }
238
239 void
240 GenerateData() override;
241
242 void
244
245 void
247
248 void
249 PrintSelf(std::ostream & os, Indent indent) const override;
250
252 GetLabelMap() override
253 {
254 return m_TempImage;
255 }
256
257private:
258 double m_Opacity{};
259 int m_Type{};
265
267
268}; // end of class
269
270} // end namespace itk
271
272#ifndef ITK_MANUAL_INSTANTIATION
273# include "itkLabelMapContourOverlayImageFilter.hxx"
274#endif
275
276#endif
Base class for all data objects in ITK.
Functor for applying a colormap to a label image and combine it with a grayscale image.
virtual void SetInput(const InputImageType *input)
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
typename OutputImageType::RegionType OutputImageRegionType
typename FeatureImageType::ConstPointer FeatureImageConstPointer
typename LabelMapType::LabelObjectType LabelObjectType
typename OutputImageType::ConstPointer OutputImageConstPointer
void EnlargeOutputRequestedRegion(DataObject *output) override
void ThreadedProcessLabelObject(LabelObjectType *labelObject) override
LabelMapFilter< TLabelMap, TOutputImage > Superclass
void SuperclassDynamicTGD(const OutputImageRegionType &outputRegion)
void PrintSelf(std::ostream &os, Indent indent) const override
~LabelMapContourOverlayImageFilter() override=default
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
typename FeatureImageType::RegionType FeatureImageRegionType
virtual void SetFunctor(const FunctorType &functor)
typename Functor::LabelOverlayFunctor< FeatureImagePixelType, LabelMapPixelType, OutputImagePixelType > FunctorType
typename FeatureImageType::PixelType FeatureImagePixelType
void DynamicThreadedGenerateData(const OutputImageRegionType &outputRegionForThread) override
virtual void Modified() const
virtual void SetNthInput(DataObjectPointerArraySizeType idx, DataObject *input)
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
TTarget itkDynamicCastInDebugMode(TSource x)