Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef mitkBinaryThresholdULTool_h_Included
00019 #define mitkBinaryThresholdULTool_h_Included
00020
00021 #include "mitkCommon.h"
00022 #include "MitkExtExports.h"
00023 #include "mitkAutoSegmentationTool.h"
00024 #include "mitkDataNode.h"
00025
00026 #include <itkImage.h>
00027 #include <itkBinaryThresholdImageFilter.h>
00028
00029 namespace mitk
00030 {
00031
00041 class MitkExt_EXPORT BinaryThresholdULTool : public AutoSegmentationTool
00042 {
00043 public:
00044
00045 Message2<int,int> IntervalBordersChanged;
00046 Message2<int, int> ThresholdingValuesChanged;
00047
00048 mitkClassMacro(BinaryThresholdULTool, AutoSegmentationTool);
00049 itkNewMacro(BinaryThresholdULTool);
00050
00051 virtual const char** GetXPM() const;
00052 virtual const char* GetName() const;
00053
00054 virtual void Activated();
00055 virtual void Deactivated();
00056
00057 virtual void SetThresholdValues(int lower, int upper);
00058 virtual void AcceptCurrentThresholdValue(const std::string& organName, const Color& color);
00059 virtual void CancelThresholding();
00060
00061
00062 protected:
00063
00064 BinaryThresholdULTool();
00065 virtual ~BinaryThresholdULTool();
00066
00067 void SetupPreviewNodeFor( DataNode* nodeForThresholding );
00068
00069 void CreateNewSegmentationFromThreshold(DataNode* node, const std::string& organType, const Color& color);
00070
00071 void OnRoiDataChanged();
00072 void UpdatePreview();
00073
00074 template <typename TPixel, unsigned int VImageDimension>
00075 void ITKThresholding( itk::Image<TPixel, VImageDimension>* originalImage, mitk::Image* segmentation, unsigned int timeStep );
00076
00077 DataNode::Pointer m_ThresholdFeedbackNode;
00078 DataNode::Pointer m_OriginalImageNode;
00079 DataNode::Pointer m_NodeForThresholding;
00080
00081 int m_SensibleMinimumThresholdValue;
00082 int m_SensibleMaximumThresholdValue;
00083 int m_CurrentLowerThresholdValue;
00084 int m_CurrentUpperThresholdValue;
00085
00086 typedef itk::Image<int, 3> ImageType;
00087 typedef itk::Image< Tool::DefaultSegmentationDataType, 3> SegmentationType;
00088 typedef itk::BinaryThresholdImageFilter<ImageType, SegmentationType> ThresholdFilterType;
00089 ThresholdFilterType::Pointer m_ThresholdFilter;
00090
00091 };
00092
00093 }
00094
00095 #endif
00096