Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkGrowCutTool.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 mitkGrowCutTool_h
14 #define mitkGrowCutTool_h
15 
16 #include <mitkSegWithPreviewTool.h>
18 
19 namespace us
20 {
21  class ModuleResource;
22 }
23 
24 namespace mitk
25 {
37  {
38  public:
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42 
44  itkSetMacro(DistancePenalty, double);
45 
47  itkGetConstMacro(DistancePenalty, double);
48 
50  typedef itk::Image<DefaultSegmentationDataType, 3> SeedImageType;
51 
53  typedef typename SeedImageType::IndexType IndexType;
54 
56  const char *GetName() const override;
57 
60 
61  void Activated() override;
62  void Deactivated() override;
63 
69 
70  protected:
71  GrowCutTool(); // purposely hidden
72  ~GrowCutTool() override;
73 
74  void DoUpdatePreview(const Image *inputAtTimeStep,
75  const Image *oldSegAtTimeStep,
76  MultiLabelSegmentation *previewImage,
77  TimeStepType timeStep) override;
78 
79  double m_DistancePenalty = 0.0;
80  };
81 
82 } // namespace mitk
83 
84 #endif
#define MITKSEGMENTATION_EXPORT
Interactive GrowCut segmentation tool.
us::ModuleResource GetIconResource() const override
Returns the icon resource for this tool's button.
mitkClassMacro(GrowCutTool, SegWithPreviewTool)
void DoUpdatePreview(const Image *inputAtTimeStep, const Image *oldSegAtTimeStep, MultiLabelSegmentation *previewImage, TimeStepType timeStep) override
void Deactivated() override
Called when the tool gets deactivated.
bool SeedImageIsValid()
Checks whether the current seed image is valid for running GrowCut.
~GrowCutTool() override
itk::Image< DefaultSegmentationDataType, 3 > SeedImageType
Type of the seed image used by GrowCut.
SeedImageType::IndexType IndexType
Index type for the seed image.
void Activated() override
Called when the tool gets activated.
const char * GetName() const override
Returns the display name of this tool ("GrowCut").
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
MultiLabelSegmentation class for handling labels and layers in a segmentation session.
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.
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).