Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkBinaryThresholdTool_h_Included
18 #define mitkBinaryThresholdTool_h_Included
19 
21 #include "mitkCommon.h"
22 #include "mitkDataNode.h"
24 
25 #include <itkImage.h>
26 
27 namespace us
28 {
29  class ModuleResource;
30 }
31 
32 namespace mitk
33 {
44  {
45  public:
48 
50  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
51 
52  virtual const char **GetXPM() const override;
53  us::ModuleResource GetIconResource() const override;
54  virtual const char *GetName() const override;
55 
56  virtual void Activated() override;
57  virtual void Deactivated() override;
58 
59  virtual void SetThresholdValue(double value);
60  virtual void AcceptCurrentThresholdValue();
61  virtual void CancelThresholding();
62 
63  protected:
64  BinaryThresholdTool(); // purposely hidden
65  virtual ~BinaryThresholdTool();
66 
67  void SetupPreviewNode();
68 
69  void CreateNewSegmentationFromThreshold(DataNode *node);
70 
71  void OnRoiDataChanged();
72  void UpdatePreview();
73 
74  template <typename TPixel, unsigned int VImageDimension>
75  void ITKThresholding(itk::Image<TPixel, VImageDimension> *originalImage,
76  mitk::Image *segmentation,
77  double thresholdValue,
78  unsigned int timeStep);
79  template <typename TPixel, unsigned int VImageDimension>
80  void ITKThresholdingOldBinary(itk::Image<TPixel, VImageDimension> *originalImage,
81  mitk::Image *segmentation,
82  double thresholdValue,
83  unsigned int timeStep);
84 
85  DataNode::Pointer m_ThresholdFeedbackNode;
86  DataNode::Pointer m_OriginalImageNode;
87  DataNode::Pointer m_NodeForThresholding;
88 
89  double m_SensibleMinimumThresholdValue;
90  double m_SensibleMaximumThresholdValue;
91  double m_CurrentThresholdValue;
92  bool m_IsFloatImage;
93 
94  bool m_IsOldBinary = false;
95  };
96 
97 } // namespace
98 
99 #endif
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Message3< double, double, bool > IntervalBordersChanged
Calculates the segmented volumes for binary images.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Image class for storing images.
Definition: mitkImage.h:76
Superclass for tool that create a new segmentation without user interaction in render windows...
Message1< double > ThresholdingValueChanged
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:66
Super-class that provides the functionality of a StateMachine to DataInteractors. ...