Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkOtsuSegmentationFilter_h_Included
18 #define mitkOtsuSegmentationFilter_h_Included
19 
20 //#include "MitkSBExports.h"
21 #include "mitkITKImageImport.h"
22 #include "mitkImage.h"
23 #include "mitkImageToImageFilter.h"
24 
25 #include "itkImage.h"
26 
28 
29 namespace mitk
30 {
41  {
42  public:
43  typedef unsigned char OutputPixelType;
44  typedef itk::Image<OutputPixelType, 3> itkOutputImageType;
46 
48  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
49 
50  itkGetMacro(NumberOfThresholds, unsigned int);
51 
52  void SetNumberOfThresholds(unsigned int number)
53  {
54  if (number < 1)
55  {
56  MITK_WARN << "Tried to set an invalid number of thresholds in the OtsuSegmentationFilter.";
57  return;
58  }
59  m_NumberOfThresholds = number;
60  }
61 
62  void SetValleyEmphasis(bool useValley) { m_ValleyEmphasis = useValley; }
63  void SetNumberOfBins(unsigned int number)
64  {
65  if (number < 1)
66  {
67  MITK_WARN << "Tried to set an invalid number of bins in the OtsuSegmentationFilter.";
68  return;
69  }
70  m_NumberOfBins = number;
71  }
72 
73  protected:
75  virtual ~OtsuSegmentationFilter();
76  virtual void GenerateData() override;
77  // virtual void GenerateOutputInformation();
78 
79  private:
80  unsigned int m_NumberOfThresholds;
81  bool m_ValleyEmphasis;
82  unsigned int m_NumberOfBins;
83 
84  }; // class
85 
86 } // namespace
87 #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.
Pipelined import of itk::Image.
itk::Image< OutputPixelType, 3 > itkOutputImageType
#define MITK_WARN
Definition: mitkLogMacros.h:23
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
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