Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkBinaryThresholdBaseTool.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 mitkBinaryThresholdBaseTool_h
14 #define mitkBinaryThresholdBaseTool_h
15 
17 
18 #include <mitkSegWithPreviewTool.h>
19 
20 #include <mitkCommon.h>
21 #include <mitkDataNode.h>
22 
23 #include <itkBinaryThresholdImageFilter.h>
24 #include <itkImage.h>
25 
26 namespace mitk
27 {
41  {
42  public:
46 
50 
52 
58  virtual void SetThresholdValues(double lower, double upper);
59 
60  protected:
61  BinaryThresholdBaseTool(); // purposely hidden
63 
64  itkSetMacro(LockedUpperThreshold, bool);
65  itkGetMacro(LockedUpperThreshold, bool);
66  itkBooleanMacro(LockedUpperThreshold);
67 
68  itkGetMacro(SensibleMinimumThreshold, ScalarType);
69  itkGetMacro(SensibleMaximumThreshold, ScalarType);
70 
71  void InitiateToolByInput() override;
72  void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, MultiLabelSegmentation* previewImage, TimeStepType timeStep) override;
73 
74  template <typename TPixel, unsigned int VImageDimension>
75  void ITKThresholding(const itk::Image<TPixel, VImageDimension>* inputImage,
76  MultiLabelSegmentation *segmentation,
77  unsigned int timeStep);
78 
79  private:
80  ScalarType m_SensibleMinimumThreshold;
81  ScalarType m_SensibleMaximumThreshold;
82  ScalarType m_LowerThreshold;
83  ScalarType m_UpperThreshold;
84 
87  bool m_LockedUpperThreshold = false;
88 
89  };
90 
91 } // namespace
92 
93 #endif
#define MITKSEGMENTATION_EXPORT
Base class for binary threshold segmentation tools.
mitkClassMacro(BinaryThresholdBaseTool, SegWithPreviewTool)
void ITKThresholding(const itk::Image< TPixel, VImageDimension > *inputImage, MultiLabelSegmentation *segmentation, unsigned int timeStep)
Message2< ScalarType, ScalarType > ThresholdingValuesChanged
Emitted when the current thresholding values change. Parameters: lower threshold, upper threshold.
void InitiateToolByInput() override
virtual void SetThresholdValues(double lower, double upper)
Sets the lower and upper threshold values for the segmentation.
Message3< double, double, bool > IntervalBordersChanged
Emitted when the sensible threshold interval borders change. Parameters: lower border,...
void DoUpdatePreview(const Image *inputAtTimeStep, const Image *oldSegAtTimeStep, MultiLabelSegmentation *previewImage, TimeStepType timeStep) override
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.
Find image slices visible on a given plane.
std::size_t TimeStepType
Type for time step indices (non-negative integers starting from 0).
double ScalarType
Scalar type used throughout MITK for geometric computations.