Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
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 (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 mitkBinaryThresholdULTool_h_Included
14 #define mitkBinaryThresholdULTool_h_Included
15 
17 #include "mitkCommon.h"
18 #include "mitkDataNode.h"
20 
21 #include <itkBinaryThresholdImageFilter.h>
22 #include <itkImage.h>
23 
24 namespace us
25 {
26  class ModuleResource;
27 }
28 
29 namespace mitk
30 {
41  {
42  public:
45 
47  itkFactorylessNewMacro(Self) 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 SetThresholdValues(double lower, double upper);
57  virtual void AcceptCurrentThresholdValue();
58  virtual void CancelThresholding();
59 
60  protected:
61  BinaryThresholdULTool(); // purposely hidden
62  ~BinaryThresholdULTool() override;
63 
64  void SetupPreviewNode();
65 
66  void CreateNewSegmentationFromThreshold(DataNode *node);
67 
68  void OnRoiDataChanged();
69  void UpdatePreview();
70 
74 
79 
80  bool m_IsOldBinary = false;
81 
82  typedef itk::Image<int, 3> ImageType;
83  typedef itk::Image<Tool::DefaultSegmentationDataType, 3> SegmentationType; // this is sure for new segmentations
84  typedef itk::BinaryThresholdImageFilter<ImageType, SegmentationType> ThresholdFilterType;
85  ThresholdFilterType::Pointer m_ThresholdFilter;
86  };
87 
88 } // namespace
89 
90 #endif
Message3< double, double, bool > IntervalBordersChanged
double ScalarType
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Message2< mitk::ScalarType, mitk::ScalarType > ThresholdingValuesChanged
mitk::ScalarType m_SensibleMinimumThresholdValue
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Superclass for tool that create a new segmentation without user interaction in render windows...
mitk::ScalarType m_SensibleMaximumThresholdValue
itk::BinaryThresholdImageFilter< ImageType, SegmentationType > ThresholdFilterType
static std::string GetName(std::string fileName, std::string suffix)
itk::Image< Tool::DefaultSegmentationDataType, 3 > SegmentationType
ThresholdFilterType::Pointer m_ThresholdFilter
Class for nodes of the DataTree.
Definition: mitkDataNode.h:64
Calculates the segmented volumes for binary images.
Super-class that provides the functionality of a StateMachine to DataInteractors. ...