Medical Imaging Interaction Toolkit  2025.12.02
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 {
36  {
37  public:
40 
42 
43  virtual void SetThresholdValues(double lower, double upper);
44 
45  protected:
46  BinaryThresholdBaseTool(); // purposely hidden
48 
49  itkSetMacro(LockedUpperThreshold, bool);
50  itkGetMacro(LockedUpperThreshold, bool);
51  itkBooleanMacro(LockedUpperThreshold);
52 
53  itkGetMacro(SensibleMinimumThreshold, ScalarType);
54  itkGetMacro(SensibleMaximumThreshold, ScalarType);
55 
56  void InitiateToolByInput() override;
57  void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, MultiLabelSegmentation* previewImage, TimeStepType timeStep) override;
58 
59  template <typename TPixel, unsigned int VImageDimension>
60  void ITKThresholding(const itk::Image<TPixel, VImageDimension>* inputImage,
61  MultiLabelSegmentation *segmentation,
62  unsigned int timeStep);
63 
64  private:
65  ScalarType m_SensibleMinimumThreshold;
66  ScalarType m_SensibleMaximumThreshold;
67  ScalarType m_LowerThreshold;
68  ScalarType m_UpperThreshold;
69 
72  bool m_LockedUpperThreshold = false;
73 
74  };
75 
76 } // namespace
77 
78 #endif
#define MITKSEGMENTATION_EXPORT
Base class for binary threshold tools.
mitkClassMacro(BinaryThresholdBaseTool, SegWithPreviewTool)
void ITKThresholding(const itk::Image< TPixel, VImageDimension > *inputImage, MultiLabelSegmentation *segmentation, unsigned int timeStep)
Message2< ScalarType, ScalarType > ThresholdingValuesChanged
void InitiateToolByInput() override
virtual void SetThresholdValues(double lower, double upper)
Message3< double, double, bool > IntervalBordersChanged
void DoUpdatePreview(const Image *inputAtTimeStep, const Image *oldSegAtTimeStep, MultiLabelSegmentation *previewImage, TimeStepType timeStep) override
Image class for storing images.
Definition: mitkImage.h:70
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
double ScalarType