Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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_Included
14 #define mitkOtsuSegmentationFilter_h_Included
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 {
37  {
38  public:
39  typedef unsigned char OutputPixelType;
40  typedef itk::Image<OutputPixelType, 3> itkOutputImageType;
42 
44  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
45 
46  itkGetMacro(NumberOfThresholds, unsigned int);
47 
48  void SetNumberOfThresholds(unsigned int number)
49  {
50  if (number < 1)
51  {
52  MITK_WARN << "Tried to set an invalid number of thresholds in the OtsuSegmentationFilter.";
53  return;
54  }
55  m_NumberOfThresholds = number;
56  }
57 
58  void SetValleyEmphasis(bool useValley) { m_ValleyEmphasis = useValley; }
59  void SetNumberOfBins(unsigned int number)
60  {
61  if (number < 1)
62  {
63  MITK_WARN << "Tried to set an invalid number of bins in the OtsuSegmentationFilter.";
64  return;
65  }
66  m_NumberOfBins = number;
67  }
68 
69  protected:
71  ~OtsuSegmentationFilter() override;
72  void GenerateData() override;
73  // virtual void GenerateOutputInformation();
74 
75  private:
76  unsigned int m_NumberOfThresholds;
77  bool m_ValleyEmphasis;
78  unsigned int m_NumberOfBins;
79 
80  }; // class
81 
82 } // namespace
83 #endif
A filter that performs a multiple threshold otsu image segmentation.
Superclass of all classes generating some kind of mitk::BaseData.
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
void SetNumberOfThresholds(unsigned int number)
Pipelined import of itk::Image.
itk::Image< OutputPixelType, 3 > itkOutputImageType
#define MITK_WARN
Definition: mitkLogMacros.h:19
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Superclass of all classes having one or more Images as input and generating Images as output...
void SetNumberOfBins(unsigned int number)
mitk::ITKImageImport< itkOutputImageType > ImageConverterType