Medical Imaging Interaction Toolkit  2023.12.99-b884b24c
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
mitkImageToImageFilter.h
MitkModelFitExports.h
mitk::BinaryImageToLabelSetImageFilter
Converts an binary image to a LabelSetImage. The amount of labels equals the connected components.
Definition: mitkBinaryImageToLabelSetImageFilter.h:26
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
MITKMODELFIT_EXPORT
#define MITKMODELFIT_EXPORT
Definition: MitkModelFitExports.h:15
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitkCommon.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::ImageToImageFilter
Superclass of all classes having one or more Images as input and generating Images as output.
Definition: mitkImageToImageFilter.h:25