Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkBinaryThresholdULTool.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 mitkBinaryThresholdULTool_h_Included
18 #define mitkBinaryThresholdULTool_h_Included
19 
21 #include "mitkCommon.h"
22 #include "mitkDataNode.h"
24 
25 #include <itkBinaryThresholdImageFilter.h>
26 #include <itkImage.h>
27 
28 namespace us
29 {
30  class ModuleResource;
31 }
32 
33 namespace mitk
34 {
45  {
46  public:
49 
51  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
52 
53  virtual const char **GetXPM() const override;
54  us::ModuleResource GetIconResource() const override;
55  virtual const char *GetName() const override;
56 
57  virtual void Activated() override;
58  virtual void Deactivated() override;
59 
60  virtual void SetThresholdValues(double lower, double upper);
61  virtual void AcceptCurrentThresholdValue();
62  virtual void CancelThresholding();
63 
64  protected:
65  BinaryThresholdULTool(); // purposely hidden
66  virtual ~BinaryThresholdULTool();
67 
68  void SetupPreviewNode();
69 
70  void CreateNewSegmentationFromThreshold(DataNode *node);
71 
72  void OnRoiDataChanged();
73  void UpdatePreview();
74 
75  DataNode::Pointer m_ThresholdFeedbackNode;
76  DataNode::Pointer m_OriginalImageNode;
77  DataNode::Pointer m_NodeForThresholding;
78 
79  mitk::ScalarType m_SensibleMinimumThresholdValue;
80  mitk::ScalarType m_SensibleMaximumThresholdValue;
81  mitk::ScalarType m_CurrentLowerThresholdValue;
82  mitk::ScalarType m_CurrentUpperThresholdValue;
83 
84  bool m_IsOldBinary = false;
85 
86  typedef itk::Image<int, 3> ImageType;
87  typedef itk::Image<Tool::DefaultSegmentationDataType, 3> SegmentationType; // this is sure for new segmentations
88  typedef itk::BinaryThresholdImageFilter<ImageType, SegmentationType> ThresholdFilterType;
89  ThresholdFilterType::Pointer m_ThresholdFilter;
90  };
91 
92 } // namespace
93 
94 #endif
Message3< double, double, bool > IntervalBordersChanged
Base class of all tools used by mitk::ToolManager.
Definition: mitkTool.h:92
double ScalarType
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Message2< mitk::ScalarType, mitk::ScalarType > ThresholdingValuesChanged
#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...
mitk::Label::PixelType DefaultSegmentationDataType
Definition: mitkTool.h:95
itk::BinaryThresholdImageFilter< ImageType, SegmentationType > ThresholdFilterType
static std::string GetName(std::string fileName, std::string suffix)
itk::Image< Tool::DefaultSegmentationDataType, 3 > SegmentationType
Class for nodes of the DataTree.
Definition: mitkDataNode.h:66
Calculates the segmented volumes for binary images.
Super-class that provides the functionality of a StateMachine to DataInteractors. ...