Medical Imaging Interaction Toolkit  2025.12.02
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 
28  {
29  public:
31  itkFactorylessNewMacro(Self);
32  itkCloneMacro(Self);
33 
34  const char *GetName() const override;
35  const char **GetXPM() const override;
37 
38  void Activated() override;
39 
40  itkSetMacro(NumberOfBins, unsigned int);
41  itkGetConstMacro(NumberOfBins, unsigned int);
42 
43  itkSetMacro(NumberOfRegions, unsigned int);
44  itkGetConstMacro(NumberOfRegions, unsigned int);
45 
46  itkSetMacro(UseValley, bool);
47  itkGetConstMacro(UseValley, bool);
48  itkBooleanMacro(UseValley);
49 
51  unsigned int GetMaxNumberOfBins() const;
52 
53  protected:
55  ~OtsuTool3D() = default;
56 
57  void UpdatePrepare() override;
58  void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, MultiLabelSegmentation* previewImage, TimeStepType timeStep) override;
59 
60  unsigned int m_NumberOfBins = 128;
61  unsigned int m_NumberOfRegions = 2;
62  bool m_UseValley = false;
63  }; // class
64 } // namespace
65 #endif
#define MITKSEGMENTATION_EXPORT
Image class for storing images.
Definition: mitkImage.h:70
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
us::ModuleResource GetIconResource() const override
Returns the tool button icon of the tool wrapped by a usModuleResource.
const char ** GetXPM() const override
Returns an icon in the XPM format.
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.
class ITK_EXPORT Image
Find image slices visible on a given plane.
std::size_t TimeStepType