Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkOtsuTool3D.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 #ifndef mitkOtsuTool3D_h
13 #define mitkOtsuTool3D_h
14 
15 #include <mitkSegWithPreviewTool.h>
17 
18 namespace us
19 {
20  class ModuleResource;
21 }
22 
23 namespace mitk
24 {
25  class Image;
26 
38  {
39  public:
41  itkFactorylessNewMacro(Self);
42  itkCloneMacro(Self);
43 
44  const char *GetName() const override;
46 
47  void Activated() override;
48 
49  itkSetMacro(NumberOfBins, unsigned int);
50  itkGetConstMacro(NumberOfBins, unsigned int);
51 
52  itkSetMacro(NumberOfRegions, unsigned int);
53  itkGetConstMacro(NumberOfRegions, unsigned int);
54 
55  itkSetMacro(UseValley, bool);
56  itkGetConstMacro(UseValley, bool);
57  itkBooleanMacro(UseValley);
58 
60  unsigned int GetMaxNumberOfBins() const;
61 
62  protected:
64  ~OtsuTool3D() = default;
65 
66  void UpdatePrepare() override;
67  void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, MultiLabelSegmentation* previewImage, TimeStepType timeStep) override;
68 
69  unsigned int m_NumberOfBins = 128;
70  unsigned int m_NumberOfRegions = 2;
71  bool m_UseValley = false;
72  }; // class
73 } // namespace
74 #endif
#define MITKSEGMENTATION_EXPORT
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
Otsu multi-threshold 3D segmentation tool with preview.
us::ModuleResource GetIconResource() const override
Returns the tool button icon of the tool wrapped by a usModuleResource.
mitkClassMacro(OtsuTool3D, SegWithPreviewTool)
const char * GetName() const override
Returns the name of this tool. Make it short!
void UpdatePrepare() override
unsigned int GetMaxNumberOfBins() const
void Activated() override
Called when the tool gets activated.
void DoUpdatePreview(const Image *inputAtTimeStep, const Image *oldSegAtTimeStep, MultiLabelSegmentation *previewImage, TimeStepType timeStep) override
~OtsuTool3D()=default
Base class for any auto segmentation tool that provides a preview of the new segmentation.
Represents a resource (text file, image, etc.) embedded in a CppMicroServices module.
class ITK_EXPORT Image
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).