ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkKLMRegionGrowImageFilter.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 itkKLMRegionGrowImageFilter_h
19#define itkKLMRegionGrowImageFilter_h
20
21#include "itkImage.h"
25#include "itkConceptChecking.h"
26#include <algorithm>
27#include <functional>
28
29namespace itk
30{
161template <typename TInputImage, typename TOutputImage>
162class ITK_TEMPLATE_EXPORT KLMRegionGrowImageFilter : public RegionGrowImageFilter<TInputImage, TOutputImage>
163{
164public:
165 ITK_DISALLOW_COPY_AND_MOVE(KLMRegionGrowImageFilter);
166
172
174 itkNewMacro(Self);
175
177 itkOverrideGetNameOfClassMacro(KLMRegionGrowImageFilter);
178
180 using InputImageType = TInputImage;
181 using InputImagePointer = typename TInputImage::Pointer;
182 using InputImageConstPointer = typename TInputImage::ConstPointer;
183
185 using InputImagePixelType = typename TInputImage::PixelType;
186
188 using InputImageVectorType = typename TInputImage::PixelType::VectorType;
189
191 static constexpr unsigned int InputImageVectorDimension = InputImagePixelType::Dimension;
192
194 using InputImageIndexType = typename TInputImage::IndexType;
195
199
201 using InputRegionType = typename TInputImage::RegionType;
202
205 using typename Superclass::GridSizeType;
206
208 using OutputImageType = TOutputImage;
209 using OutputImagePointer = typename TOutputImage::Pointer;
210
212 static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
213
215 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
216
218 using OutputImagePixelType = typename TOutputImage::PixelType;
219
221 using OutputImageVectorType = typename TOutputImage::PixelType::VectorType;
222
224 static constexpr unsigned int OutputImageVectorDimension = OutputImagePixelType::Dimension;
225
227 using OutputImageIndexType = typename TOutputImage::IndexType;
228
231
234
237
240
243
246
249
252
254 using MeanRegionIntensityType = vnl_vector<double>;
255
258
261
266 itkSetMacro(MaximumLambda, double);
267 itkGetConstReferenceMacro(MaximumLambda, double);
271 itkSetMacro(NumberOfRegions, unsigned int);
272 itkGetConstReferenceMacro(NumberOfRegions, unsigned int);
277
279 void
281
283 void
285
288#if defined(THIS_CONCEPT_FAILS_ON_GCC)
290 itkConceptMacro(SameVectorDimension,
292#endif // end THIS_CONCEPT_FAILS_ON_GCC
293
294protected:
296 ~KLMRegionGrowImageFilter() override = default;
297 void
298 PrintSelf(std::ostream & os, Indent indent) const override;
299
303 void
304 GenerateData() override;
305
309 void
311
316 void
318
321 void
323
327 void
328 MergeRegions() override;
329
331 virtual void
333
335 void
337
339 void
341
345
351 virtual void
353
357 virtual void
359
360private:
361 using InputImageSizeType = typename TInputImage::SizeType;
364
365 double m_MaximumLambda{ 1000 };
366 unsigned int m_NumberOfRegions{ 0 };
367
369
370 double m_InternalLambda{ 0 };
371 unsigned int m_InitialNumberOfRegions{ 0 };
372 double m_TotalBorderLength{ 0.0 };
373
374 std::vector<KLMSegmentationRegionPtr> m_RegionsPointer{};
375 std::vector<KLMSegmentationBorderPtr> m_BordersPointer{};
376 std::vector<KLMSegmentationBorderArrayPtr> m_BordersDynamicPointer{};
378
381}; // class KLMRegionGrowImageFilter
382} // namespace itk
383
384#ifndef ITK_MANUAL_INSTANTIATION
385# include "itkKLMRegionGrowImageFilter.hxx"
386#endif
387
388#endif
Base class for all data objects in ITK.
A multi-dimensional iterator templated over image type that walks a region of pixels.
A multi-dimensional iterator templated over image type that walks a region of pixels.
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
Object maintaining a reference to a list of borders associated with a region.
static constexpr unsigned int OutputImageVectorDimension
void ApplyRegionGrowImageFilter() override
Image< RegionLabelType, Self::LabelImageDimension > LabelImageType
typename TInputImage::Pointer InputImagePointer
typename TOutputImage::IndexType OutputImageIndexType
typename KLMSegmentationRegion::RegionLabelType RegionLabelType
typename TOutputImage::Pointer OutputImagePointer
typename TInputImage::ConstPointer InputImageConstPointer
typename TInputImage::IndexType InputImageIndexType
ImageRegionIterator< TInputImage > InputImageIterator
virtual void GenerateOutputImage()
void GenerateInputRequestedRegion() override
LabelImagePointer GenerateLabelledImage(LabelImageType *labelImagePtr)
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void InitializeRegionParameters(InputRegionType region)
~KLMRegionGrowImageFilter() override=default
std::vector< KLMSegmentationRegionPtr > m_RegionsPointer
static constexpr unsigned int OutputImageDimension
void EnlargeOutputRequestedRegion(DataObject *) override
std::vector< KLMSegmentationBorderPtr > m_BordersPointer
ImageRegionIterator< TOutputImage > OutputImageIterator
typename KLMSegmentationBorder::Pointer KLMSegmentationBorderPtr
typename TInputImage::PixelType::VectorType InputImageVectorType
static constexpr unsigned int InputImageVectorDimension
typename TInputImage::SizeType InputImageSizeType
ImageRegionIterator< LabelImageType > LabelImageIterator
static constexpr RegionLabelType LabelImageDimension
typename TOutputImage::PixelType OutputImagePixelType
typename LabelImageType::Pointer LabelImagePointer
RegionGrowImageFilter< TInputImage, TOutputImage > Superclass
typename TInputImage::RegionType InputRegionType
KLMDynamicBorderArray< BorderType > KLMSegmentationBorderArrayPtr
typename LabelImageType::IndexType LabelImageIndexType
static constexpr unsigned int InputImageDimension
typename LabelImageType::PixelType LabelImagePixelType
std::vector< KLMSegmentationBorderArrayPtr > m_BordersDynamicPointer
ImageRegionConstIterator< TInputImage > InputImageConstIterator
KLMSegmentationBorderArrayPtr * m_BorderCandidate
typename TOutputImage::PixelType::VectorType OutputImageVectorType
typename TInputImage::PixelType InputImagePixelType
LabelImagePointer GetLabelledImage()
typename KLMSegmentationRegion::Pointer KLMSegmentationRegionPtr
Base class for KLMSegmentationBorder object.
Superclass::RegionLabelType RegionLabelType
typename TInputImage::SizeType GridSizeType
Implements transparent reference counting.
#define itkConceptMacro(name, concept)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....