Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkBinaryImageToLabelSetImageFilter.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkBinaryImageToLabelSetImageFilter_h
14 #define mitkBinaryImageToLabelSetImageFilter_h
15 
16 #include <mitkImageToImageFilter.h>
17 
18 #include "mitkCommon.h"
19 
20 #include "MitkModelFitExports.h"
21 
22 namespace mitk
23 {
27  {
28  public:
30  itkFactorylessNewMacro(Self);
31  itkCloneMacro(Self);
32 
33  void SetInput(const InputImageType* image) override;
34  void SetInput(unsigned int index, const InputImageType* image) override;
35 
36  itkSetMacro(FullyConnected, bool);
37  itkGetConstMacro(FullyConnected, bool);
38 
39  itkSetMacro(ForegroundValue, unsigned int);
40  itkGetConstMacro(ForegroundValue, unsigned int);
41 
42  itkSetMacro(OutputIsLabelSetImage, bool);
43  itkGetConstMacro(OutputIsLabelSetImage, bool);
44 
45  private:
46  using Superclass::SetInput;
47 
49  ~BinaryImageToLabelSetImageFilter() override = default;
50 
51  template <typename TPixel, unsigned int VImageDimension>
52  void ApplyBinaryImageToLabelMapFilter(const itk::Image<TPixel, VImageDimension>* inputImage);
53 
54  void GenerateData() override;
55  void VerifyInputInformation() const override;
56  void VerifyInputImage(const mitk::Image* inputImage) const;
57 
58  bool m_FullyConnected = true;
59  unsigned int m_ForegroundValue = 1;
60  bool m_OutputIsLabelSetImage = false;
61  };
62 }
63 
64 #endif
#define MITKMODELFIT_EXPORT
Converts an binary image to a MultiLabelSegmentation. The amount of labels equals the connected compo...
void SetInput(const InputImageType *image) override
void SetInput(unsigned int index, const InputImageType *image) override
mitkClassMacro(BinaryImageToLabelSetImageFilter, ImageToImageFilter)
Superclass of all classes generating Images (instances of class Image) as output.
Superclass of all classes having one or more Images as input and generating Images as output.
Image class for storing images.
Definition: mitkImage.h:70
Find image slices visible on a given plane.