diff --git a/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h b/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h index 6a2a1e80a9..b7809a4a58 100644 --- a/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h +++ b/Modules/Segmentation/Interactions/mitkAdaptiveRegionGrowingTool.h @@ -1,81 +1,133 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkAdaptiveRegionGrowingTool_h_Included #define mitkAdaptiveRegionGrowingTool_h_Included #include "mitkCommon.h" #include #include "mitkAutoSegmentationTool.h" #include "mitkDataStorage.h" #include "mitkPointSetInteractor.h" #include "mitkPointSet.h" namespace us { class ModuleResource; } namespace mitk { /** \brief Dummy Tool for AdaptiveRegionGrowingToolGUI to get Tool functionality for AdaptiveRegionGrowing. The actual logic is implemented in QmitkAdaptiveRegionGrowingToolGUI. \ingroup ToolManagerEtAl \sa mitk::Tool \sa QmitkInteractiveSegmentation */ class MitkSegmentation_EXPORT AdaptiveRegionGrowingTool : public AutoSegmentationTool { public: + /** + * @brief mitkClassMacro + */ mitkClassMacro(AdaptiveRegionGrowingTool, AutoSegmentationTool); itkFactorylessNewMacro(Self) itkCloneMacro(Self) + /** + * @brief Get XPM + * @return NULL + */ virtual const char** GetXPM() const; + + /** + * @brief Get name + * @return name of the Tool + */ virtual const char* GetName() const; - us::ModuleResource GetIconResource() const; + /** + * @brief Get icon resource + * @return the resource Object of the Icon + */ + us::ModuleResource GetIconResource() const; + /** + * @brief Adds interactor for the seedpoint and creates a seedpoint if neccessary. + * + * + */ virtual void Activated(); + + /** + * @brief Removes all set points and interactors. + * + * + */ virtual void Deactivated(); + /** + * @brief get pointset node + * @return the point set node + */ virtual DataNode::Pointer GetPointSetNode(); + /** + * @brief get reference data + * @return the current reference data. + */ mitk::DataNode* GetReferenceData(); + + /** + * @brief Get working data + * @return a list of all working data. + */ mitk::DataNode* GetWorkingData(); + + /** + * @brief Get datastorage + * @return the current data storage. + */ mitk::DataStorage* GetDataStorage(); protected: + /** + * @brief constructor + */ AdaptiveRegionGrowingTool(); // purposely hidden + + /** + * @brief destructor + */ virtual ~AdaptiveRegionGrowingTool(); private: PointSet::Pointer m_PointSet; PointSetInteractor::Pointer m_SeedPointInteractor; DataNode::Pointer m_PointSetNode; }; } // namespace #endif diff --git a/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h index c5bdcd03df..467cd69ad5 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h +++ b/Modules/SegmentationUI/Qmitk/QmitkAdaptiveRegionGrowingToolGUI.h @@ -1,162 +1,233 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_QmitkAdaptiveRegionGrowingToolGUI_H #define QMITK_QmitkAdaptiveRegionGrowingToolGUI_H #include "mitkDataStorage.h" #include "itkImage.h" #include "mitkGeometry3D.h" #include "mitkPointSet.h" #include "qwidget.h" #include "ui_QmitkAdaptiveRegionGrowingToolGUIControls.h" #include #include "QmitkToolGUI.h" #include "mitkAdaptiveRegionGrowingTool.h" class QmitkStdMultiWidget; class DataNode; class QmitkAdaptiveRegionGrowingToolGUIControls; /*! * * \brief QmitkAdaptiveRegionGrowingToolGUI * * Adaptive Region Growing View class of the segmentation. * */ class MitkSegmentationUI_EXPORT QmitkAdaptiveRegionGrowingToolGUI : public QmitkToolGUI { Q_OBJECT public: + /** + * @brief mitkClassMacro + */ mitkClassMacro(QmitkAdaptiveRegionGrowingToolGUI, QmitkToolGUI); itkFactorylessNewMacro(Self) itkCloneMacro(Self) QmitkAdaptiveRegionGrowingToolGUI(QWidget* parent=0); /** \brief Method to create the connections for the component. This Method is obligatory even if no connections is needed*/ virtual void CreateConnections(); ///** \brief Method to set the default data storage.*/ virtual void SetDataStorage(mitk::DataStorage* dataStorage); + /** + * @brief Method to set the used multiwidget. + * @param multiWidget + */ void SetMultiWidget(QmitkStdMultiWidget* multiWidget); + /** + * @brief Method to set the name of a data node. + * @param labledSegmentation Name of the labeled segmentation + * @param binaryImage Name of the binary image + * @param surface Name of the surface + */ void SetDataNodeNames(std::string labledSegmentation, std::string binaryImage, /*std::string vesselTree,*/ std::string surface); + /** + * @brief Method to enable/disable controls for region growing + * + * This method checks if a seed point is set and a segmentation exists. + * @param enable/disable controls + */ void EnableControls(bool enable); + /** + * @brief Method to set the input image node + * @param data node + */ void SetInputImageNode(mitk::DataNode* node); void Deactivated(); void Activated(); /** * @brief The created GUI from the .ui-File. This Attribute is obligatory */ Ui::QmitkAdaptiveRegionGrowingToolGUIControls m_Controls; protected slots: - void RunSegmentation(); + /** + * @brief Method to start the segmentation + * + * This method is called, when the "Start Segmentation" button is clicked. + */ + void RunSegmentation(); - void ChangeLevelWindow(double newValue);//called, when the Level Window is changed via the slider in the ControlWidget + /** + * @brief Method to change the level window + * + * This method is called, when the level window slider is changed via the slider in the control widget + * @param new value + */ + void ChangeLevelWindow(double newValue); - //****called, when the slider-position is modified via the +/- buttons - void IncreaseSlider(); + /** + * @brief Method to increase the preview slider + * + * This method is called, when the + button is clicked and increases the value by 1 + */ + void IncreaseSlider(); - void DecreaseSlider(); - //*** + /** + * @brief Method to decrease the preview slider + * + * This method is called, when the - button is clicked and decreases the value by 1 + */ + void DecreaseSlider(); - void ConfirmSegmentation(); + /** + * @brief Method to confirm the preview segmentation + * + * This method is called, when the "Confirm Segmentation" button is clicked. + */ + void ConfirmSegmentation(); - void UseVolumeRendering(bool on); + /** + * @brief Method to switch the volume rendering on/off + * @param on/off + */ + void UseVolumeRendering(bool on); - void SetLowerThresholdValue(double lowerThreshold); + /** + * @brief Method to set the lower threshold + * + * This method is called, when the minimum threshold slider has changed + * @param lower threshold + */ + void SetLowerThresholdValue(double lowerThreshold); - void SetUpperThresholdValue(double upperThreshold); + /** + * @brief Method to set upper threshold + * + * This Method is called, when the maximum threshold slider has changed + * @param upper threshold + */ + void SetUpperThresholdValue(double upperThreshold); - void OnNewToolAssociated(mitk::Tool*); + /** + * @brief Method to determine which tool to activate + * + * This method listens to the tool manager and activates this tool if requested otherwise disables this view + */ + void OnNewToolAssociated(mitk::Tool*); protected: mitk::AdaptiveRegionGrowingTool::Pointer m_RegionGrow3DTool; /** \brief Destructor. */ virtual ~QmitkAdaptiveRegionGrowingToolGUI(); //Pointer to the main widget to be able to reach the renderer QmitkStdMultiWidget* m_MultiWidget; mitk::DataStorage* m_DataStorage; mitk::DataNode::Pointer m_InputImageNode; + /** + * @brief Method to calculate parameter settings, when a seed point is set + */ void OnPointAdded(); private: std::string m_NAMEFORORGIMAGE; std::string m_NAMEFORLABLEDSEGMENTATIONIMAGE; std::string m_NAMEFORBINARYIMAGE; std::string m_NAMEFORSURFACE; mitk::ScalarType m_LOWERTHRESHOLD; //Hounsfield value mitk::ScalarType m_UPPERTHRESHOLD; //Hounsfield value mitk::ScalarType m_SeedPointValueMean; void RemoveHelperNodes(); int m_DetectedLeakagePoint; bool m_CurrentRGDirectionIsUpwards; // defines fixed threshold (true = LOWERTHRESHOLD fixed, false = UPPERTHRESHOLD fixed) int m_SeedpointValue; bool m_SliderInitialized; bool m_UseVolumeRendering; bool m_UpdateSuggestedThreshold; float m_SuggestedThValue; long m_PointSetAddObserverTag; template < typename TPixel, unsigned int VImageDimension > void StartRegionGrowing( itk::Image< TPixel, VImageDimension >* itkImage, mitk::BaseGeometry* imageGeometry, mitk::PointSet::PointType seedPoint ); template < typename TPixel, unsigned int VImageDimension > void ITKThresholding( itk::Image< TPixel, VImageDimension >* inputImage ); void InitializeLevelWindow(); void EnableVolumeRendering(bool enable); void UpdateVolumeRenderingThreshold(int thValue); }; #endif