Medical Imaging Interaction Toolkit  2023.04.99-95e0615a
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
47  ~BinaryThresholdBaseTool() override;
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, LabelSetImage* previewImage, TimeStepType timeStep) override;
58 
59  template <typename TPixel, unsigned int VImageDimension>
60  void ITKThresholding(const itk::Image<TPixel, VImageDimension>* inputImage,
61  LabelSetImage *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
mitk::SegWithPreviewTool
Base class for any auto segmentation tool that provides a preview of the new segmentation.
Definition: mitkSegWithPreviewTool.h:38
mitkSegWithPreviewTool.h
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
mitk::Message2< ScalarType, ScalarType >
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitkCommon.h
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
mitkDataNode.h
mitk::TimeStepType
std::size_t TimeStepType
Definition: mitkTimeGeometry.h:27
mitk::BinaryThresholdBaseTool
Base class for binary threshold tools.
Definition: mitkBinaryThresholdBaseTool.h:35
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MitkSegmentationExports.h
mitk::BinaryThresholdBaseTool::ThresholdingValuesChanged
Message2< ScalarType, ScalarType > ThresholdingValuesChanged
Definition: mitkBinaryThresholdBaseTool.h:39
mitk::BinaryThresholdBaseTool::IntervalBordersChanged
Message3< double, double, bool > IntervalBordersChanged
Definition: mitkBinaryThresholdBaseTool.h:38
mitk::Message3< double, double, bool >
mitk::LabelSetImage
LabelSetImage class for handling labels and layers in a segmentation session.
Definition: mitkLabelSetImage.h:29
mitk::ScalarType
double ScalarType
Definition: mitkNumericConstants.h:20