Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
Medical Imaging Interaction Toolkit
mitkOtsuSegmentationFilter.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 mitkOtsuSegmentationFilter_h
14 #define mitkOtsuSegmentationFilter_h
15 
16 //#include "MitkSBExports.h"
17 #include "mitkITKImageImport.h"
18 #include "mitkImage.h"
19 #include "mitkImageToImageFilter.h"
20 
21 #include "itkImage.h"
22 
24 
25 namespace mitk
26 {
39  {
40  public:
41  typedef unsigned short OutputPixelType;
42  typedef itk::Image<OutputPixelType, 3> itkOutputImageType;
44 
46  itkFactorylessNewMacro(Self);
47  itkCloneMacro(Self);
48  itkGetMacro(NumberOfThresholds, unsigned int);
49 
50  void SetNumberOfThresholds(unsigned int number)
51  {
52  if (number < 1)
53  {
54  MITK_WARN << "Tried to set an invalid number of thresholds in the OtsuSegmentationFilter.";
55  return;
56  }
57  m_NumberOfThresholds = number;
58  }
59 
60  void SetValleyEmphasis(bool useValley) { m_ValleyEmphasis = useValley; }
61  void SetNumberOfBins(unsigned int number)
62  {
63  if (number < 1)
64  {
65  MITK_WARN << "Tried to set an invalid number of bins in the OtsuSegmentationFilter.";
66  return;
67  }
68  m_NumberOfBins = number;
69  }
70 
71  protected:
73  ~OtsuSegmentationFilter() override;
74  void GenerateData() override;
75  // virtual void GenerateOutputInformation();
76 
77  private:
78  unsigned int m_NumberOfThresholds;
79  bool m_ValleyEmphasis;
80  unsigned int m_NumberOfBins;
81 
82  }; // class
83 
84 } // namespace
85 #endif
mitk::OtsuSegmentationFilter::ImageConverterType
mitk::ITKImageImport< itkOutputImageType > ImageConverterType
Definition: mitkOtsuSegmentationFilter.h:43
mitkImageToImageFilter.h
mitkImage.h
mitk::OtsuSegmentationFilter::OutputPixelType
unsigned short OutputPixelType
Definition: mitkOtsuSegmentationFilter.h:41
mitk::OtsuSegmentationFilter::SetNumberOfThresholds
void SetNumberOfThresholds(unsigned int number)
Definition: mitkOtsuSegmentationFilter.h:50
mitk::OtsuSegmentationFilter::SetValleyEmphasis
void SetValleyEmphasis(bool useValley)
Definition: mitkOtsuSegmentationFilter.h:60
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::OtsuSegmentationFilter
A filter that performs a multiple threshold otsu image segmentation.
Definition: mitkOtsuSegmentationFilter.h:38
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::OtsuSegmentationFilter::itkOutputImageType
itk::Image< OutputPixelType, 3 > itkOutputImageType
Definition: mitkOtsuSegmentationFilter.h:42
mitk::ITKImageImport
Pipelined import of itk::Image.
Definition: mitkITKImageImport.h:36
mitkITKImageImport.h
mitk::OtsuSegmentationFilter::SetNumberOfBins
void SetNumberOfBins(unsigned int number)
Definition: mitkOtsuSegmentationFilter.h:61
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
MITK_WARN
#define MITK_WARN
Definition: mitkLog.h:210
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MitkSegmentationExports.h
mitk::ImageToImageFilter
Superclass of all classes having one or more Images as input and generating Images as output.
Definition: mitkImageToImageFilter.h:25