Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkBinaryThresholdTool.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 mitkBinaryThresholdTool_h_Included
14 #define mitkBinaryThresholdTool_h_Included
15 
17 #include "mitkCommon.h"
18 #include "mitkDataNode.h"
20 
21 #include <itkImage.h>
22 
23 namespace us
24 {
25  class ModuleResource;
26 }
27 
28 namespace mitk
29 {
40  {
41  public:
44 
46  itkFactorylessNewMacro(Self);
47  itkCloneMacro(Self);
48 
49  const char **GetXPM() const override;
50  us::ModuleResource GetIconResource() const override;
51  const char *GetName() const override;
52 
53  void Activated() override;
54  void Deactivated() override;
55 
56  virtual void SetThresholdValue(double value);
57  virtual void AcceptCurrentThresholdValue();
58  virtual void CancelThresholding();
59 
60  protected:
61  BinaryThresholdTool(); // purposely hidden
62  ~BinaryThresholdTool() override;
63 
64  void SetupPreviewNode();
65 
66  void CreateNewSegmentationFromThreshold(DataNode *node);
67 
68  void OnRoiDataChanged();
69  void UpdatePreview();
70 
71  template <typename TPixel, unsigned int VImageDimension>
72  void ITKThresholding(itk::Image<TPixel, VImageDimension> *originalImage,
73  mitk::Image *segmentation,
74  double thresholdValue,
75  unsigned int timeStep);
76  template <typename TPixel, unsigned int VImageDimension>
77  void ITKThresholdingOldBinary(itk::Image<TPixel, VImageDimension> *originalImage,
78  mitk::Image *segmentation,
79  double thresholdValue,
80  unsigned int timeStep);
81 
85 
90 
91  bool m_IsOldBinary = false;
92  };
93 
94 } // namespace
95 
96 #endif
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
DataNode::Pointer m_NodeForThresholding
Message3< double, double, bool > IntervalBordersChanged
Calculates the segmented volumes for binary images.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
Superclass for tool that create a new segmentation without user interaction in render windows...
Message1< double > ThresholdingValueChanged
DataNode::Pointer m_ThresholdFeedbackNode
static void ITKThresholding(itk::Image< TPixel, VImageDimension > *originalImage, mitk::Image *segmentation, double lower, double upper, unsigned int timeStep)
static std::string GetName(std::string fileName, std::string suffix)
static void ITKThresholdingOldBinary(itk::Image< TPixel, VImageDimension > *originalImage, mitk::Image *segmentation, double lower, double upper, unsigned int timeStep)
Class for nodes of the DataTree.
Definition: mitkDataNode.h:57
Super-class that provides the functionality of a StateMachine to DataInteractors. ...