Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkFillRegionBaseTool.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 mitkFillRegionBaseTool_h
14 #define mitkFillRegionBaseTool_h
15 
16 #include <mitkCommon.h>
17 #include <mitkContourModelUtils.h>
18 #include <mitkImage.h>
19 #include <mitkSegTool2D.h>
21 
22 #include <mitkDataNode.h>
23 
24 #include <mitkImageCast.h>
25 
26 namespace mitk
27 {
41  {
42  public:
44 
48 
49  protected:
50  FillRegionBaseTool(); // purposely hidden
51  ~FillRegionBaseTool() override;
52 
53  void ConnectActionsAndFunctions() override;
54 
56  virtual void OnClick(StateMachineAction*, InteractionEvent* interactionEvent);
57 
72  virtual Image::Pointer GenerateFillImage(const Image* workingSlice, Point3D seedPoint, mitk::Label::PixelType& seedLabelValue) const;
73 
76  virtual void PrepareFilling(const Image* workingSlice, Point3D seedPoint) = 0;
77 
82 
83  Label::PixelType m_FillLabelValue = 0;
84  Label::PixelType m_SeedLabelValue = 0;
85 
87  private:
88  };
89 
90 } // namespace
91 
92 #endif
#define MITKSEGMENTATION_EXPORT
Base class for tools that fill a connected region of a 2D slice.
~FillRegionBaseTool() override
virtual Image::Pointer GenerateFillImage(const Image *workingSlice, Point3D seedPoint, mitk::Label::PixelType &seedLabelValue) const
Generates the mask image indicating which pixels should be filled.
virtual void OnClick(StateMachineAction *, InteractionEvent *interactionEvent)
Add a control point and finish current segment.
MultiLabelSegmentation::LabelValueVectorType GetAffectedLabelValues() const override
The modified label is the one written by the fill (e.g. the active label for Fill,...
mitkClassMacro(FillRegionBaseTool, SegTool2D)
void ConnectActionsAndFunctions() override
virtual void PrepareFilling(const Image *workingSlice, Point3D seedPoint)=0
mitk::Label::AlgorithmType GetAlgorithmType() const override
A single click triggers a connected-component flood/morphology that decides the affected region,...
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Base class for all interaction events in MITK.
unsigned short PixelType
Pixel type used for label values (unsigned short).
Definition: mitkLabel.h:106
AlgorithmType
Enumeration describing how a label was created or refined.
Definition: mitkLabel.h:283
std::vector< LabelValueType > LabelValueVectorType
Abstract base class for segmentation tools.
Definition: mitkSegTool2D.h:57
Represents an action that is executed after a certain event in the state machine mechanism.
Find image slices visible on a given plane.