diff --git a/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditor.h b/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditor.h index 9cca66d9d2..b6767e37ed 100644 --- a/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditor.h +++ b/CoreUI/Bundles/org.mitk.gui.qt.common/src/QmitkStdMultiWidgetEditor.h @@ -1,70 +1,69 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QMITKSTDMULTIWIDGETEDITOR_H_ #define QMITKSTDMULTIWIDGETEDITOR_H_ #include #include #include #include #include -class MITK_QT_COMMON QmitkStdMultiWidgetEditor : public QObject, +class MITK_QT_COMMON QmitkStdMultiWidgetEditor : public berry::QtEditorPart, virtual public berry::IPartListener { Q_OBJECT - Q_INTERFACES(berry::IEditorPart) - + public: berryObjectMacro(QmitkStdMultiWidgetEditor); static const std::string EDITOR_ID; QmitkStdMultiWidgetEditor(); QmitkStdMultiWidgetEditor(const QmitkStdMultiWidgetEditor& other); ~QmitkStdMultiWidgetEditor(); QmitkStdMultiWidget* GetStdMultiWidget(); void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input); void SetFocus(); void DoSave() {} void DoSaveAs() {} bool IsDirty() const { return false; } bool IsSaveAsAllowed() const { return false; } protected: void CreateQtPartControl(QWidget* parent); // IPartListener Events::Types GetPartEventTypes() const; virtual void PartClosed (berry::IWorkbenchPartReference::Pointer partRef); virtual void PartHidden (berry::IWorkbenchPartReference::Pointer partRef); virtual void PartVisible (berry::IWorkbenchPartReference::Pointer partRef); private: QmitkStdMultiWidget* m_StdMultiWidget; QmitkDnDFrameWidget* m_DndFrameWidget; }; #endif /*QMITKSTDMULTIWIDGETEDITOR_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h b/Modules/Bundles/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h index 4ab106287c..804e7d0fc4 100644 --- a/Modules/Bundles/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h +++ b/Modules/Bundles/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h @@ -1,180 +1,180 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 10185 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QmitkBasicImageProcessingView_H__INCLUDED) #define QmitkBasicImageProcessingView_H__INCLUDED #include "QmitkFunctionality.h" #include "../BasicimageprocessingDll.h" #include "ui_QmitkBasicImageProcessingViewControls.h" #include "QmitkStepperAdapter.h" #include #include /*! \brief This module allows to use some basic image processing filters for preprocessing, image enhancement and testing purposes Several basic ITK image processing filters, like denoising, morphological and edge detection are encapsulated in this module and can be selected via a list and an intuitive parameter input. The selected filter will be applied on the image, and a new image showing the output is displayed as result. Also, some image arithmetic operations are available. Images can be 3D or 4D. In the 4D case, the filters work on the 3D image selected via the time slider. The result is also a 3D image. \sa QmitkFunctionality, QObject \class QmitkBasicImageProcessing \author Tobias Schwarz \version 1.0 (3M3) \date 2009-05-10 \ingroup Bundles */ -class BASICIMAGEPROCESSING_EXPORT QmitkBasicImageProcessing : public QObject, public QmitkFunctionality +class BASICIMAGEPROCESSING_EXPORT QmitkBasicImageProcessing : public QmitkFunctionality { Q_OBJECT public: /*! \brief default constructor */ QmitkBasicImageProcessing(); /*! \brief default destructor */ virtual ~QmitkBasicImageProcessing(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); virtual void Activated(); /*! \brief Invoked when the DataManager selection changed */ virtual void OnSelectionChanged(std::vector nodes); protected slots: /* * When an action is selected in the "one image ops" list box */ void SelectAction(int action); /* * When an action is selected in the "two image ops" list box */ void SelectAction2(int operation); /* * The "Execute" button in the "one image ops" box was triggered */ void StartButtonClicked(); /* * The "Execute" button in the "two image ops" box was triggered */ void StartButton2Clicked(); /* * Switch between the one and the two image operations GUI */ void ChangeGUI(); private: /* * After a one image operation, reset the "one image ops" panel */ void ResetOneImageOpPanel(); /* * Helper method to reset the parameter set panel */ void ResetParameterPanel(); /* * After a two image operation, reset the "two image ops" panel */ void ResetTwoImageOpPanel(); /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkBasicImageProcessingViewControls *m_Controls; //mitk::DataNode* m_SelectedImageNode; mitk::DataStorageSelection::Pointer m_SelectedImageNode; QmitkStepperAdapter* m_TimeStepperAdapter; berry::ISelectionListener::Pointer m_SelectionListener; enum ActionType { NOACTIONSELECTED, CATEGORY_DENOISING, GAUSSIAN, MEDIAN, TOTALVARIATION, CATEGORY_MORPHOLOGICAL, DILATION, EROSION, OPENING, CLOSING, CATEGORY_EDGE_DETECTION, GRADIENT, LAPLACIAN, SOBEL, CATEGORY_MISC, THRESHOLD, INVERSION, DOWNSAMPLING, } m_SelectedAction; enum OperationType{ TWOIMAGESNOACTIONSELECTED, CATEGORY_ARITHMETIC, ADD, SUBTRACT, MULTIPLY, DIVIDE, CATEGORY_BOOLEAN, AND, OR, XOR } m_SelectedOperation; }; #endif // !defined(QmitkBasicImageProcessing_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.colourimageprocessing/src/internal/QmitkColourImageProcessingView.h b/Modules/Bundles/org.mitk.gui.qt.colourimageprocessing/src/internal/QmitkColourImageProcessingView.h index 3ba1ab0d49..783d353282 100644 --- a/Modules/Bundles/org.mitk.gui.qt.colourimageprocessing/src/internal/QmitkColourImageProcessingView.h +++ b/Modules/Bundles/org.mitk.gui.qt.colourimageprocessing/src/internal/QmitkColourImageProcessingView.h @@ -1,77 +1,77 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 17:19:30 +0200 (Do, 28 Mai 2009) $ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED #define _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED #include #include #include #include "mitkDataStorage.h" #include #include #include #include "ui_QmitkColourImageProcessingViewControls.h" -class QmitkColourImageProcessingView : public QObject, public QmitkFunctionality +class QmitkColourImageProcessingView : public QmitkFunctionality { Q_OBJECT public: static const std::string VIEW_ID; QmitkColourImageProcessingView(); virtual ~QmitkColourImageProcessingView(); virtual void CreateQtPartControl(QWidget *parent); virtual void SelectionChanged(berry::IWorkbenchPart::Pointer part, berry::ISelection::ConstPointer selection); protected slots: void OnConvertToRGBAImage(); void OnConvertImageMaskColorToRGBAImage(); void OnCombineRGBA(); void OnChangeColor(); protected: Ui::QmitkColourImageProcessingViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; berry::ISelectionListener::Pointer m_SelectionListener; private: mitk::WeakPointer m_SelectedNode; mitk::WeakPointer m_SelectedNode2; int m_Color[3]; }; #endif // _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h b/Modules/Bundles/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h index bfdcdea810..3849287cad 100644 --- a/Modules/Bundles/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h +++ b/Modules/Bundles/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h @@ -1,268 +1,268 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 18127 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QMITKDATAMANAGERVIEW_H_ #define QMITKDATAMANAGERVIEW_H_ // Own includes #include #include #include #include #include #include /// Qmitk #include #include #include #include #include #include #include #include "mitkQtDataManagerDll.h" // Forward declarations class QMenu; class QAction; class QComboBox; class QWidgetAction; class QSlider; class QModelIndex; class QTreeView; class QPushButton; class QToolBar; class QMenu; class QmitkDataStorageTreeModel; /// /// \ingroup org_mitk_gui_qt_datamanager_internal /// /// \brief A View class that can show all data tree nodes of a certain DataStorage /// /// \TODO: complete PACS support, in save dialog show regular filename /// -class MITK_QT_DATAMANAGER QmitkDataManagerView : public QObject, public berry::QtViewPart +class MITK_QT_DATAMANAGER QmitkDataManagerView : public berry::QtViewPart { Q_OBJECT public: static const std::string VIEW_ID; // = "org.mitk.extapp.defaultperspective" /// /// \brief Standard ctor. /// QmitkDataManagerView(); /// /// \brief Standard dtor. /// virtual ~QmitkDataManagerView(); /// /// \brief Returns all selected nodes in a vector /// std::vector GetSelectedNodes() const; public slots: /// /// Invoked when the opacity slider changed /// void OpacityChanged(int value); /// /// Invoked when the opacity action changed /// In this function the the opacity slider is set to the selected nodes opacity value /// void OpacityActionChanged(); /// /// Invoked when the color button is pressed /// void ColorChanged(); /// /// Invoked when the color action changed /// void ColorActionChanged(); /// /// Invoked when the color button is pressed /// void TextureInterpolationChanged(); /// /// Invoked when the color action changed /// void TextureInterpolationToggled ( bool checked ); /// /// SurfaceRepresentationActionToggled /// void SurfaceRepresentationMenuAboutToShow (); ///public /// SurfaceRepresentationActionToggled /// void SurfaceRepresentationActionToggled ( bool checked ); /// /// \brief Shows a node context menu. /// void NodeTableViewContextMenuRequested( const QPoint & index ); /// /// \brief Invoked when an element should be saved. /// void SaveSelectedNodes( bool checked = false ); /// /// \brief Invoked when an element should be removed. /// void RemoveSelectedNodes( bool checked = false ); /// /// \brief Invoked when an element should be reinitiliased. /// void ReinitSelectedNodes( bool checked = false ); /// /// \brief Invoked when the visibility of the selected nodes should be toggled. /// void MakeAllNodesInvisible ( bool checked = false ); /// /// \brief Makes all selected nodes visible, all other nodes invisible. /// void ShowOnlySelectedNodes ( bool checked = false ); /// /// \brief Invoked when the visibility of the selected nodes should be toggled. /// void ToggleVisibilityOfSelectedNodes ( bool checked = false ); /// /// \brief Invoked when infos of the selected nodes should be shown in a dialog. /// void ShowInfoDialogForSelectedNodes ( bool checked = false ); /// /// \brief Shows a load dialog. /// void Load ( bool checked = false ); /// /// \brief Reinits everything. /// void GlobalReinit ( bool checked = false ); /// /// Invoked when the preferences were changed /// void OnPreferencesChanged(const berry::IBerryPreferences*); /// /// \brief will be toggled when a extension point context menu action is toggled /// this is a proxy method which will load the corresponding extension class /// and run IContextMenuAction /// void ContextMenuActionTriggered( bool ); /// /// Invoked when the DataManager selection changed /// virtual void SelectionChanged(berry::IWorkbenchPart::Pointer part , berry::ISelection::ConstPointer selection); /// Invoked when the median action is invoked void OtsuFilter( bool checked = false ); /// When rows are inserted auto expand them void NodeTreeViewRowsInserted ( const QModelIndex & parent, int start, int end ); /// will setup m_CurrentRowCount void NodeTreeViewRowsRemoved ( const QModelIndex & parent, int start, int end ); /// Whenever the selection changes set the "selected" property respectively void NodeSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ); protected: /// /// \brief Create the view here. /// virtual void CreateQtPartControl(QWidget* parent); void SetFocus(); mitk::DataStorage::Pointer GetDataStorage() const; /// /// \brief Shows a file open dialog. /// void FileOpen( const char * fileName, mitk::DataNode* parentNode ); protected: QWidget* m_Parent; QmitkDnDFrameWidget* m_DndFrameWidget; /// /// \brief A plain widget as the base pane. /// QmitkDataStorageTreeModel* m_NodeTreeModel; /// /// \brief The BlueBerry selection provider /// QmitkDataNodeSelectionProvider::Pointer m_SelectionProvider; /// /// Holds the preferences for the datamanager. /// berry::IBerryPreferences::Pointer m_DataManagerPreferencesNode; /// /// saves the configuration elements for the context menu actions from extension points /// std::map m_ConfElements; /// /// \brief The Table view to show the selected nodes. /// QTreeView* m_NodeTreeView; /// /// \brief The context menu that shows up when right clicking on a node. /// QMenu* m_NodeMenu; /// /// \brief flag indicating whether a surface created from a selected decimation is decimated with vtkQuadricDecimation or not /// bool m_SurfaceDecimation; ///# Actions for the Context Menu /// Global Reinit Action QAction* m_GlobalReinitAction; /// Save Action QAction* m_SaveAction; /// Remove Action QAction* m_RemoveAction; /// Reinit Action QAction* m_ReinitAction; /// A Slider widget to change the opacity of a node QSlider* m_OpacitySlider; /// Opacity action QWidgetAction* m_OpacityAction; /// button to change the color of a node QPushButton* m_ColorButton; /// Color action QWidgetAction* m_ColorAction; /// TextureInterpolation action QAction* m_TextureInterpolation; /// TextureInterpolation action QAction* m_SurfaceRepresentation; /// Show only selected nodes QAction* m_ShowOnlySelectedNodes; /// Toggles visibility of selected nodes QAction* m_ToggleSelectedVisibility; /// Shows infos for selected nodes QAction* m_ActionShowInfoDialog; /// Special filter action for images QAction* m_OtsuFilterAction; /// A selection listener for datatreenode events berry::ISelectionListener::Pointer m_SelectionListener; /// berry::SelectionChangedAdapter must be a friend to call friend struct berry::SelectionChangedAdapter; /// saves the current amount of rows shown in the datamanager size_t m_CurrentRowCount; private: /// Reopen multi widget editor if it has been closed void ReinitMultiWidgetEditor(); }; #endif /*QMITKDATAMANAGERVIEW_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.h b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.h index 370e9c11ef..bb4205cc72 100644 --- a/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.deformableregistration/src/internal/QmitkDeformableRegistrationView.h @@ -1,207 +1,207 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QMITKDEFORMABLEREGISTRATION_H #define QMITKDEFORMABLEREGISTRATION_H #include "QmitkFunctionality.h" #include "ui_QmitkDeformableRegistrationViewControls.h" #include "../DeformableregistrationDll.h" #include "berryISelectionListener.h" #include "berryIStructuredSelection.h" /*! \brief The DeformableRegistration functionality is used to perform deformable registration. This functionality allows you to register two 2D as well as two 3D images in a non rigid manner. Register means to align two images, so that they become as similar as possible. Therefore you can select from different deformable registration methods. Registration results will directly be applied to the Moving Image. The result is shown in the multi-widget. For more informations see: \ref QmitkDeformableRegistrationUserManual \sa QmitkFunctionality \ingroup Functionalities \ingroup DeformableRegistration */ -class DEFORMABLEREGISTRATION_EXPORT QmitkDeformableRegistrationView : public QObject, public QmitkFunctionality +class DEFORMABLEREGISTRATION_EXPORT QmitkDeformableRegistrationView : public QmitkFunctionality { friend struct SelListenerDeformableRegistration; Q_OBJECT public: static const std::string VIEW_ID; /*! \brief default constructor */ QmitkDeformableRegistrationView(QObject *parent=0, const char *name=0); /*! \brief default destructor */ virtual ~QmitkDeformableRegistrationView(); /*! \brief method for creating the applications main widget */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief Sets the StdMultiWidget and connects it to the functionality. */ virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); /*! \brief Removes the StdMultiWidget and disconnects it from the functionality. */ virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Method which is called when this functionality is selected in MITK */ virtual void Activated(); /*! \brief Method which is called whenever the functionality is deselected in MITK */ virtual void Deactivated(); virtual void Visible(); virtual void Hidden(); void DataNodeHasBeenRemoved(const mitk::DataNode* node); signals: /*! \brief Signal that informs about that the fixed image should be reinitialized in the multi-widget. */ void reinitFixed(const mitk::Geometry3D *); /*! \brief Signal that informs about that the moving image should be reinitialized in the multi-widget. */ void reinitMoving(const mitk::Geometry3D *); /*! \brief Signal that informs about that the BSpline registration should be performed. */ void calculateBSplineRegistration(); protected slots: /*! * sets the fixed Image according to TreeNodeSelector widget */ void FixedSelected(mitk::DataNode::Pointer fixedImage); /*! * sets the moving Image according to TreeNodeSelector widget */ void MovingSelected(mitk::DataNode::Pointer movingImage); /*! * checks if registration is possible */ bool CheckCalculate(); /*! * stores whether the image will be shown in grayvalues or in red for fixed image and green for moving image * @param show if true, then images will be shown in red and green */ void ShowRedGreen(bool show); /*! * set the selected opacity for moving image * @param opacity the selected opacity */ void OpacityUpdate(float opacity); /*! \brief Sets the selected opacity for moving image @param opacity the selected opacity */ void OpacityUpdate(int opacity); /*! * sets the images to grayvalues or fixed image to red and moving image to green * @param redGreen if true, then images will be shown in red and green */ void SetImageColor(bool redGreen); /*! \brief Checks whether the registration can be performed. */ void CheckCalculateEnabled(); /*! \brief Performs the registration. */ void Calculate(); /*! * Prints the values of the deformationfield */ void ApplyDeformationField(); void SetImagesVisible(berry::ISelection::ConstPointer selection); void TabChanged(int index); void SwitchImages(); protected: berry::ISelectionListener::Pointer m_SelListener; berry::IStructuredSelection::ConstPointer m_CurrentSelection; /*! * default main widget containing 4 windows showing 3 * orthogonal slices of the volume and a 3d render window */ QmitkStdMultiWidget * m_MultiWidget; /*! * control widget to make all changes for Deformable registration */ Ui::QmitkDeformableRegistrationViewControls m_Controls; mitk::DataNode::Pointer m_MovingNode; mitk::DataNode::Pointer m_FixedNode; bool m_ShowRedGreen; float m_Opacity; float m_OriginalOpacity; mitk::Color m_FixedColor; mitk::Color m_MovingColor; bool m_Deactivated; }; #endif //QMITKDEFORMABLEREGISTRATION_H diff --git a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h index a0bc56036a..1c336fa64c 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTExampleView.h @@ -1,259 +1,259 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-06 10:44:43 +0200 (Mi, 06 Mai 2009) $ Version: $Revision: 17109 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QmitkIGTExampleView_H__INCLUDED) #define QmitkIGTExampleView_H__INCLUDED #include "QmitkFunctionality.h" #include "mitkTestingConfig.h" #include "mitkTrackingDeviceSource.h" #include "mitkNavigationDataDisplacementFilter.h" #include "mitkTrackingDevice.h" #include "mitkNavigationDataRecorder.h" #include "mitkNavigationDataPlayer.h" #include "mitkNavigationDataToPointSetFilter.h" #include "mitkNavigationDataToMessageFilter.h" #include "QmitkPlotWidget.h" #include "ui_QmitkIGTExampleViewControls.h" #include "../IgtexampleDll.h" class QmitkStdMultiWidget; class QmitkIGTExampleViewControls; class QTextEdit; /*! \brief QmitkIGTExampleView Example functionality that shows the usage of the MITK-IGT component \sa QmitkFunctionality \ingroup Functionalities */ -class QmitkIGTExampleView : public QObject, public QmitkFunctionality +class QmitkIGTExampleView : public QmitkFunctionality { Q_OBJECT public: /*! \brief default constructor */ QmitkIGTExampleView(QObject *parent=0, const char *name=0); /*! \brief default destructor */ virtual ~QmitkIGTExampleView(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); virtual void AddToFunctionalityOptionsList(mitk::PropertyList* p); /*! \brief method for creating an QAction object, i.e. button & menu entry @param parent the parent QWidget */ //Port virtual QAction * CreateAction(QActionGroup *parent); /*! \brief method is called when the bundle is started */ virtual void Activated(); /*! \brief method is called when the bundle is closed */ virtual void Deactivated(); #ifdef BUILD_TESTING /** * \brief This method performs an automated functionality test. */ virtual int TestYourself(); #endif protected slots: /**Documentation * \brief executes MITK-IGT-Tracking code * * This method will create and initialize a mitk::NDITrackingDevice with one tool. * It will start the tracking, read the tracking data from the tool 50 times and * then clean up everything. */ void OnTestTracking(); /**Documentation * \brief executes MITK-IGT-Navigation code * * This method will create and initialize a mitk::NDITrackingDevice with one tool. * Then it builds an example MITK-IGT filter pipeline: * - TrackingDeviceSource filter initialized with the NDITrackingDevice as source of the pipeline * - NavigationDataDisplacementFilter * The Offset parameter of the displacement filter is searched in the functionality's options list. * It can be written to that list either by the method OnParametersChanged() that gets called after * the user changes the parameter in the GUI or by the persistence mechanism of MITK (the complete * options list will be saved to disk on application exit and restored on the next application restart). * if the Offset parameter is not found in the list, a default value is used. * After building the filter pipeline, it is initialized and tracking is started, so that following * calls to OnMeasure() can trigger pipeline updates and retrieve NavigationData objects. */ void OnTestNavigation(); /**Documentation * \brief performs one measurement using the navigation pipeline * * This method uses the MITK-IGT pipeline that was set up by OnTestNavigation() before. * it iterates over all outputs of the last filter in the pipeline, updates each and writes * its transformed tracking data to the GUI. */ void OnMeasure(); /**Documentation * \brief performs continuous measurements using the navigation pipeline * * This method calls the above OnMeasure() */ void OnMeasureContinuously(); /** * \brief stops the navigation pipeline and perform clean up */ void OnStop(); /**Documentation * \brief reads the filter parameters from the GUI after they were changed * * The Control widget will store all parameters of the displacement filter * in a mitk::PropertyList. OnParametersChanged() gets called after the user * changed the parameters. It will add that list to the functionality's own * m_Options PropertyList, overwriting any properties that might exist with * the same name (all MITK-IGT filters should use unique property names). * OnTestNavigation() will use the functionality's m_Options list to initialize * the DisplacementFilter. */ void OnParametersChanged(); /**Documentation * \brief Starts recording of tracking data * * This method sets up a IGT pipeline that connects a tracking device * with a NavigationDataRecorder filter and then starts a timer that * updates the recorder periodically if parameter toggled is TRUE. If it is FALSE the recorder will be stopped. */ void OnRecordingToggle(bool toggled); /**Documentation * \brief Stops the recording of tracking data and starts the replay * * This method sets up a new pipeline that connects a NavigationDataPlayer with a * NavigationDataToPointSetFilter as an example for an alternative visualization * method and then starts a Replay timer that updates the recorder periodically if parameter toggled is TRUE. If it is FALSE the Replay timer will be stopped. */ void OnPlayingToggle(bool toggled); /**Documentation * \brief Timer update method for recording of tracking data * * updates the recording filter and displays a message in the status bar */ void OnRecording(); /**Documentation * \brief Timer update method for replaying of tracking data * * updates the replay filter, rerenders the 3D render window and * displays a message in the status bar */ void OnPlaying(); /**Documentation * \brief Display a graph and progress bar that shows error values from the first navigation data * * This method is an example of how to use NavigationDataToMessageFilter to update * GUI elements from a IGT pipeline. It creates a NavigationDataToMessageFilter, * sets its input to the first output of the displacement filter * and registers the OnErrorValueChanged() method as a callback whenever the * error value of the input navigation data changes. */ void OnShowErrorPlot(); /**Documentation * \brief Callback method of the NavigationDataToMessageFilter * * This method will be called by NavigationDataToMessageFilter when the * error value of its input navigation data object changes. * The method calculates an overall error value and adds it both to an * error plot widget and to a progress bar. If the error is above a hardcoded * threshold, a warning is also displayed in the text output widget */ void OnErrorValueChanged(mitk::NavigationData::CovarianceMatrixType v, unsigned int index); /**Documentation * \brief Shows a file dialog for choosing tool description files * * This method is called when the m_ToolBtn is pressed and a tracking * device was selected which needs tool description data. * */ void OnLoadTool(); /**Documentation * \brief Chooses the current tracking device * * This method is called when the m_TrackingDevice selector changed. */ void OnTrackingDeviceTextChanged( const QString & ); protected: mitk::TrackingDevice::Pointer ConfigureTrackingDevice(); ///< create the selected tracker object and configure it (using values from m_Controls) QmitkStdMultiWidget * m_MultiWidget; ///< default render widget Ui::QmitkIGTExampleControls * m_Controls; ///< GUI widget for this functionality mitk::TrackingDeviceSource::Pointer m_Source; ///< first filter in the pipeline mitk::NavigationDataDisplacementFilter::Pointer m_Displacer; ///< displacement filter that adds an offset to NDs mitk::NavigationDataToNavigationDataFilter::Pointer m_EndOfPipeline; // Pointer to last filter in the pipeline mitk::NavigationDataRecorder::Pointer m_Recorder; ///< records NDs to a XML file mitk::NavigationDataPlayer::Pointer m_Player; ///< plays a XML file mitk::NavigationDataToPointSetFilter::Pointer m_PointSetFilter; ///< has a NDs as input and a PointSet as output mitk::NavigationDataToMessageFilter::Pointer m_MessageFilter; ///< calls OnErrorValueChanged when the error value of its input changes mitk::PointSet::Pointer m_PointSet; ///< stores the output of the pointsetfilter QmitkPlotWidget::DataVector m_XValues; ///< X-Values of the error plot (timestamp of navigation data) QmitkPlotWidget::DataVector m_YValues; ///< Y-Values of the error plot (error value of navigation data QTextEdit* out; ///< pointer to output widget QTimer* m_Timer; ///< timer for continuous tracking update QTimer* m_RecordingTimer; ///< timer for continuous recording QTimer* m_PlayingTimer; ///< timer for continuous playing QStringList m_ToolList; ///< list to the tool description files }; #endif // !defined(QmitkIGTExampleView_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h index 6d5be4f9b0..a0391cfea4 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igtexample/src/internal/QmitkIGTRecorderView.h @@ -1,109 +1,109 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-06 10:44:43 +0200 (Mi, 06 Mai 2009) $ Version: $Revision: 17109 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QmitkIGTRecorderView_H__INCLUDED) #define QmitkIGTRecorderView_H__INCLUDED #include "QmitkFunctionality.h" #include "mitkTestingConfig.h" #include "mitkTrackingDeviceSource.h" #include "mitkTrackingDevice.h" #include "mitkNavigationDataRecorder.h" #include "mitkNavigationDataPlayer.h" #include "mitkNavigationDataToPointSetFilter.h" #include "mitkNavigationDataToMessageFilter.h" #include "mitkNavigationDataObjectVisualizationFilter.h" #include "ui_QmitkIGTRecorderViewControls.h" #include "../IgtexampleDll.h" class QmitkStdMultiWidget; class QmitkIGTRecorderViewControls; class QTextEdit; class QmitkNDIConfigurationWidget; /*! \brief QmitkIGTRecorderView Example functionality that shows the usage of the MITK-IGT component \sa QmitkFunctionality \ingroup Functionalities */ -class QmitkIGTRecorderView : public QObject, public QmitkFunctionality +class QmitkIGTRecorderView : public QmitkFunctionality { Q_OBJECT public: /*! \brief default constructor */ QmitkIGTRecorderView(QObject *parent=0, const char *name=0); /*! \brief default destructor */ virtual ~QmitkIGTRecorderView(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); protected slots: void OnStartRecording(); void OnStopRecording(); void OnPauseRecording(bool pause); void OnStartReplaying(); void OnStopReplaying(); void RecordFrame(); void OnConnect(); void OnDisconnect(); protected: mitk::TrackingDevice::Pointer ConfigureTrackingDevice(); ///< create the selected tracker object and configure it (using values from m_Controls) void SetupIGTPipeline(mitk::TrackingDevice::Pointer tracker, QString fileName); mitk::DataNode::Pointer CreateInstrumentVisualization(const char* label); QmitkStdMultiWidget * m_MultiWidget; ///< default render widget Ui::QmitkIGTRecorderControls * m_Controls; ///< GUI widget for this functionality mitk::TrackingDeviceSource::Pointer m_Source; ///< first filter in the pipeline mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; mitk::NavigationDataRecorder::Pointer m_Recorder; ///< records NDs to a XML file mitk::NavigationDataToPointSetFilter::Pointer m_PointSetFilter; ///< has a NDs as input and a PointSet as output mitk::NavigationDataToMessageFilter::Pointer m_MessageFilter; ///< calls OnErrorValueChanged when the error value of its input changes //mitk::NavigationDataPlayer::Pointer m_Player; ///< plays a XML file QTimer* m_Timer; ///< timer for continuous tracking update QTimer* m_RecordingTimer; ///< timer for continuous recording QTimer* m_PlayingTimer; ///< timer for continuous playing QStringList m_ToolList; ///< list to the tool description files QmitkNDIConfigurationWidget* m_ConfigWidget; }; #endif // !defined(QmitkIGTRecorderView_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h index 59c73a4819..991a6fe252 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igttoolpairnavigation/src/internal/QmitkToolPairNavigationView.h @@ -1,165 +1,165 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 17:19:30 +0200 (Do, 28 Mai 2009) $ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _QMITKTOOLPAIRNAVIGATIONVIEW_H_INCLUDED #define _QMITKTOOLPAIRNAVIGATIONVIEW_H_INCLUDED #include #include #include "ui_QmitkToolPairNavigationViewControls.h" #include #include #include #include class QmitkNDIConfigurationWidget; class QmitkUpdateTimerWidget; class QmitkToolDistanceWidget; /*! * \ingroup org_mitk_gui_qt_igttoolpairnavigation_internal * * \brief This view can be used to guide one tracking tool to another tracking tool. * The plugin connects to a tracking system and shows the connected/added tools in two 3D widgets (standard 3D widget is interactable, the other (widget2) isn't). * Furthermore it calculates the distance between the two tools and displays it in GUI. * In widget 4 the tool connected on port b is shown from the point of view of the tool in port a. * * \sa QmitkFunctionality */ -class QmitkToolPairNavigationView : public QObject, public QmitkFunctionality +class QmitkToolPairNavigationView : public QmitkFunctionality { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkToolPairNavigationView(); virtual ~QmitkToolPairNavigationView(); virtual void CreateQtPartControl(QWidget *parent); /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// \brief Called when the functionality is activated virtual void Activated(); virtual void Deactivated(); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: void Disconnected(); void ToolsAdded(QStringList tools); void ToolsChanged(); /** * @brief starting navigation **/ void SetNavigationUp(); /** * @brief stopping navigation **/ void StopNavigation(); void StartNavigation(); void RenderScene(); protected: typedef std::map NameToIndexMap; typedef std::list StringList; /** * @brief setup the IGT pipeline **/ void SetupIGTPipeline(); /** * @brief stops the tracking and deletes all pipeline objects **/ void DestroyIGTPipeline(); /** * @brief create objects for visualization **/ mitk::DataNode::Pointer CreateConeAsInstrumentVisualization(const char* label = ""); mitk::DataNode::Pointer CreateSphereAsInstrumentVisualization(const char* label = ""); /** * @brief remove the visualized objects **/ void RemoveVisualizationObjects( mitk::DataStorage* ds ); /** * @brief MultiWidget for this view **/ QmitkStdMultiWidget* m_MultiWidget; /** * @brief GUI widget with tool distances matrix **/ QmitkToolDistanceWidget* m_DistanceWidget; /** * @brief source of the tracking system **/ mitk::TrackingDeviceSource::Pointer m_Source; /** * @brief visualizer **/ mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; ///< visualization filter mitk::CameraVisualization::Pointer m_CameraVisualizer; //GUI widget to connect to a NDI tracker QmitkNDIConfigurationWidget* m_NDIConfigWidget; /** *@brief setting up the bundle widgets **/ void CreateBundleWidgets(QWidget* parent); Ui::QmitkToolPairNavigationViewControls m_Controls; int m_LastMapperIDWidget3; }; #endif // _QMITKTOOLPAIRNAVIGATIONVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.igttutorial/src/internal/QmitkImageGuidedTherapyTutorialView.h b/Modules/Bundles/org.mitk.gui.qt.igttutorial/src/internal/QmitkImageGuidedTherapyTutorialView.h index ec9081180f..916109cadd 100644 --- a/Modules/Bundles/org.mitk.gui.qt.igttutorial/src/internal/QmitkImageGuidedTherapyTutorialView.h +++ b/Modules/Bundles/org.mitk.gui.qt.igttutorial/src/internal/QmitkImageGuidedTherapyTutorialView.h @@ -1,102 +1,102 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-03-21 19:27:37 +0100 (Sa, 21 Mrz 2009) $ Version: $Revision: 16719 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _QMITKIMAGEGUIDEDTHERAPYTUTORIALVIEW_H_INCLUDED #define _QMITKIMAGEGUIDEDTHERAPYTUTORIALVIEW_H_INCLUDED #include #include #include "ui_QmitkImageGuidedTherapyTutorialViewControls.h" #include "../IgttutorialDll.h" #include "mitkTrackingDeviceSource.h" #include "mitkNavigationDataObjectVisualizationFilter.h" /** * \brief QmitkIGTTutorial shows a small typically navigation MITK functionality. * * Any kind of navigation application will start with the connection to a tracking system * and as we do image guided procedures we want to show something on the screen. In this * tutorial we connect to the NDI Polaris tracking system (or alternatively use a virtual tracking device) * and we will show the movement of a tool as cone in the StdMultiWidget editor. * * \sa also take a look at the CMakeLists.txt of this functionality to see how to * link to the mitkIGT library. * \sa QmitkFunctionality * \ingroup Functionalities */ -class IGTTUTORIAL_EXPORT QmitkImageGuidedTherapyTutorialView : public QObject, public QmitkFunctionality +class IGTTUTORIAL_EXPORT QmitkImageGuidedTherapyTutorialView : public QmitkFunctionality { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkImageGuidedTherapyTutorialView(); virtual ~QmitkImageGuidedTherapyTutorialView(); virtual void CreateQtPartControl(QWidget *parent); /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// \brief Called when the functionality is activated virtual void Activated(); virtual void Deactivated(); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: /** * \brief Execute MITK-IGT Tutorial */ void OnStartIGT(); /** * \brief stop IGT scene and clean up */ void OnStopIGT(); /** * \brief timer based update of IGT scene */ void OnTimer(); protected: Ui::QmitkImageGuidedTherapyTutorialViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; ///< our display widget mitk::TrackingDeviceSource::Pointer m_Source; ///< source filer that connects to the tracking device mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; ///< visualization filter uses output from m_Source QTimer* m_Timer; ///< timer for continuous tracking update }; #endif // _QMITKIMAGEGUIDEDTHERAPYTUTORIALVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.cpp b/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.cpp index 3515db05d9..c460bbdd6d 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.cpp +++ b/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.cpp @@ -1,499 +1,498 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 14134 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #include #include "QmitkImageCropper.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mitkUndoController.h" #include "mitkBoundingObjectCutter.h" #include "mitkImageAccessByItk.h" #include "mitkITKImageImport.h" #include "mitkIDataStorageService.h" #include "mitkNodePredicateDataType.h" #include //to be moved to mitkInteractionConst.h by StateMachineEditor const mitk::OperationType QmitkImageCropper::OP_EXCHANGE = 717; // constructors for operation classes QmitkImageCropper::opExchangeNodes::opExchangeNodes( mitk::OperationType type, mitk::DataNode* node, mitk::BaseData* oldData, mitk::BaseData* newData ) :mitk::Operation(type),m_Node(node),m_OldData(oldData),m_NewData(newData), m_NodeDeletedObserverTag(0), m_OldDataDeletedObserverTag(0), m_NewDataDeletedObserverTag(0) { // listen to the node the image is hold itk::MemberCommand::Pointer nodeDeletedCommand = itk::MemberCommand::New(); nodeDeletedCommand->SetCallbackFunction(this, &opExchangeNodes::NodeDeleted); m_NodeDeletedObserverTag = m_Node->AddObserver(itk::DeleteEvent(), nodeDeletedCommand); m_OldDataDeletedObserverTag = m_OldData->AddObserver(itk::DeleteEvent(), nodeDeletedCommand); m_NewDataDeletedObserverTag = m_NewData->AddObserver(itk::DeleteEvent(), nodeDeletedCommand); } // destructor for operation class QmitkImageCropper::opExchangeNodes::~opExchangeNodes() { if (m_Node != NULL) { m_Node->RemoveObserver(m_NodeDeletedObserverTag); m_Node=NULL; } if (m_OldData.IsNotNull()) { m_OldData->RemoveObserver(m_OldDataDeletedObserverTag); m_OldData=NULL; } if (m_NewData.IsNotNull()) { m_NewData->RemoveObserver(m_NewDataDeletedObserverTag); m_NewData=NULL; } } void QmitkImageCropper::opExchangeNodes::NodeDeleted(const itk::Object * /*caller*/, const itk::EventObject &/*event*/) { m_Node = NULL; m_OldData = NULL; m_NewData = NULL; } QmitkImageCropper::QmitkImageCropper(QObject *parent) -: QObject(parent), -m_Controls(NULL), m_ParentWidget(0) +: m_Controls(NULL), m_ParentWidget(0) { m_Interface = new mitk::ImageCropperEventInterface; m_Interface->SetImageCropper( this ); } QmitkImageCropper::~QmitkImageCropper() { //delete smart pointer objects m_CroppingObjectNode = NULL; m_CroppingObject = NULL; m_Interface->Delete(); } void QmitkImageCropper::CreateQtPartControl(QWidget* parent) { if (!m_Controls) { m_ParentWidget = parent; // build ui elements m_Controls = new Ui::QmitkImageCropperControls; m_Controls->setupUi(parent); // setup ui elements m_Controls->groupInfo->hide(); m_Controls->m_SurroundingSlider->hide(); m_Controls->m_SurroundingSpin->hide(); m_Controls->m_NewBoxButton->setEnabled(true); // create ui element connections this->CreateConnections(); } } void QmitkImageCropper::CreateConnections() { if ( m_Controls ) { connect( m_Controls->btnCrop, SIGNAL(clicked()), this, SLOT(CropImage())); // click on the crop button connect( m_Controls->m_NewBoxButton, SIGNAL(clicked()), this, SLOT(CreateNewBoundingObject()) ); connect( m_Controls->m_EnableSurroundingCheckBox, SIGNAL(toggled(bool)), this, SLOT(SurroundingCheck(bool)) ); connect( m_Controls->chkInformation, SIGNAL(toggled(bool)), this, SLOT(ChkInformationToggled(bool)) ); } } void QmitkImageCropper::Activated() { QmitkFunctionality::Activated(); // just call the inherited function } void QmitkImageCropper::Deactivated() { RemoveBoundingObjectFromNode(); QmitkFunctionality::Deactivated(); // just call the inherited function mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } /*! When called with an opExchangeNodes, it changes the content of a node from one data set to another */ void QmitkImageCropper::ExecuteOperation (mitk::Operation *operation) { if (!operation) return; switch (operation->GetOperationType()) { case OP_EXCHANGE: { //RemoveBoundingObjectFromNode(); opExchangeNodes* op = static_cast(operation); op->GetNode()->SetData(op->GetNewData()); mitk::RenderingManager::GetInstance()->InitializeViews(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); break; } default:; } } void QmitkImageCropper::CreateNewBoundingObject() { // attach the cuboid to the image and update the views if (this->IsVisible()) { if (m_ImageNode.IsNotNull()) { m_ImageToCrop = dynamic_cast(m_ImageNode->GetData()); if(m_ImageToCrop.IsNotNull()) { if (this->GetDefaultDataStorage()->GetNamedDerivedNode("CroppingObject", m_ImageNode)) { // We are in "Reset bounding box!" mode m_CroppingObject->FitGeometry(m_ImageToCrop->GetTimeSlicedGeometry()); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); return; } bool fitCroppingObject = false; if(m_CroppingObject.IsNull()) { CreateBoundingObject(); fitCroppingObject = true; } if (m_CroppingObject.IsNull()) return; AddBoundingObjectToNode( m_ImageNode, fitCroppingObject ); m_ImageNode->SetVisibility(true); mitk::RenderingManager::GetInstance()->InitializeViews(); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); m_Controls->m_NewBoxButton->setText("Reset bounding box!"); m_Controls->btnCrop->setEnabled(true); } } else QMessageBox::information(NULL, "Image cropping functionality", "Load an image first!"); } } void QmitkImageCropper::SurroundingCheck(bool value) { if(value) { if(m_ImageNode.IsNotNull()) { mitk::DataNode *imageNode = m_ImageNode.GetPointer(); if (imageNode) { mitk::BaseData* data = imageNode->GetData(); if (data) { // test if this data item is an image or not (could also be a surface or something totally different) mitk::Image* image = dynamic_cast( data ); if (image) { float min = 10000.0; float max = -10000.0; min = image->GetScalarValueMin(); max = image->GetScalarValueMax(); m_Controls->m_SurroundingSlider->setRange((int)min,(int)max); m_Controls->m_SurroundingSpin->setRange((int)min,(int)max); } } } m_Controls->m_SurroundingSlider->show(); m_Controls->m_SurroundingSpin->show(); } else m_Controls->m_EnableSurroundingCheckBox->setChecked(false); } else { m_Controls->m_SurroundingSlider->hide(); m_Controls->m_SurroundingSpin->hide(); } } void QmitkImageCropper::CropImage() { // test, if image is selected if (m_ImageToCrop.IsNull()) return; // test, if bounding box is visible if (m_CroppingObjectNode.IsNull()) { QMessageBox::information(NULL, "Image cropping functionality", "Generate a new bounding object first!"); return; } // image and bounding object ok mitk::BoundingObjectCutter::Pointer cutter = mitk::BoundingObjectCutter::New(); cutter->SetBoundingObject( m_CroppingObject ); cutter->SetInput( m_ImageToCrop ); cutter->AutoOutsideValueOff(); // do the actual cutting try { cutter->Update(); //cutter->UpdateLargestPossibleRegion(); } catch(itk::ExceptionObject&) { QMessageBox::warning ( NULL, tr("Cropping not possible"), tr("Sorry, the bounding box has to be completely inside the image.\n\n" "The possibility to drag it larger than the image is a bug and has to be fixed."), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton ); return; } // cutting successful mitk::Image::Pointer resultImage = cutter->GetOutput(); resultImage->DisconnectPipeline(); if(m_Controls->m_EnableSurroundingCheckBox->isChecked()) { AccessByItk_1( resultImage, AddSurrounding, resultImage); resultImage = m_surrImage; } RemoveBoundingObjectFromNode(); { opExchangeNodes* doOp = new opExchangeNodes(OP_EXCHANGE, m_ImageNode.GetPointer(), m_ImageNode->GetData(), resultImage); opExchangeNodes* undoOp = new opExchangeNodes(OP_EXCHANGE, m_ImageNode.GetPointer(), resultImage, m_ImageNode->GetData()); // TODO: MITK doesn't recognize that a new event happens in the next line, // because nothing happens in the render window. // As a result the undo action will happen together with the last action // recognized by MITK. mitk::OperationEvent* operationEvent = new mitk::OperationEvent( m_Interface, doOp, undoOp, "Crop image"); mitk::UndoController::GetCurrentUndoModel()->SetOperationEvent( operationEvent ); // tell the undo controller about the action ExecuteOperation(doOp); // execute action } m_Controls->m_NewBoxButton->setEnabled(true); m_Controls->btnCrop->setEnabled(false); } template < typename TPixel, unsigned int VImageDimension > void QmitkImageCropper::AddSurrounding( itk::Image< TPixel, VImageDimension >* itkImage, mitk::Image::Pointer image) { typedef itk::Image< TPixel, VImageDimension > InputImageType; typename InputImageType::Pointer extended = InputImageType::New(); typename InputImageType::IndexType start; start[0]=0; start[1]=0; start[2]=0; unsigned int *dims = image->GetDimensions(); typename InputImageType::SizeType size; size[0]=dims[0]; size[1]=dims[1]; size[2]=dims[2]; typename InputImageType::RegionType region; region.SetSize(size); region.SetIndex(start); extended->SetRegions(region); extended->SetDirection(itkImage->GetDirection()); extended->SetOrigin(itkImage->GetOrigin()); extended->Allocate(); extended->SetSpacing(itkImage->GetSpacing()); typename InputImageType::IndexType idx; progress = new QProgressDialog( "Adding surrounding...", "Abort", 0, (size[0]-1), m_Parent); progress->setLabelText("Image cropper"); progress->show(); for (unsigned int i=0;iSetPixel(idx, m_Controls->m_SurroundingSpin->value()); } else { extended->SetPixel(idx, itkImage->GetPixel(idx)); } } } progress->setValue(i); if ( progress->wasCanceled() ) break; } m_surrImage = mitk::Image::New(); m_surrImage = mitk::ImportItkImage(extended); } void QmitkImageCropper::CreateBoundingObject() { QStringList items; items << tr("Cuboid") << tr("Ellipsoid") << tr("Cylinder") << tr("Cone"); bool ok; QString item = QInputDialog::getItem(m_Parent, tr("Select Bounding Object"), tr("Type of Bounding Object:"), items, 0, false, &ok); if (!ok) return; if (item == "Ellipsoid") m_CroppingObject = mitk::Ellipsoid::New(); else if(item == "Cylinder") m_CroppingObject = mitk::Cylinder::New(); else if (item == "Cone") m_CroppingObject = mitk::Cone::New(); else if (item == "Cuboid") m_CroppingObject = mitk::Cuboid::New(); else return; m_CroppingObjectNode = mitk::DataNode::New(); m_CroppingObjectNode->SetData( m_CroppingObject ); m_CroppingObjectNode->SetProperty( "name", mitk::StringProperty::New( "CroppingObject" ) ); m_CroppingObjectNode->SetProperty( "color", mitk::ColorProperty::New(1.0, 1.0, 0.0) ); m_CroppingObjectNode->SetProperty( "opacity", mitk::FloatProperty::New(0.4) ); m_CroppingObjectNode->SetProperty( "layer", mitk::IntProperty::New(99) ); // arbitrary, copied from segmentation functionality m_CroppingObjectNode->SetProperty( "helper object", mitk::BoolProperty::New(true) ); m_AffineInteractor = mitk::AffineInteractor::New("AffineInteractions ctrl-drag", m_CroppingObjectNode); } void QmitkImageCropper::OnSelectionChanged(std::vector nodes) { this->RemoveBoundingObjectFromNode(); if (nodes.size() != 1 || dynamic_cast(nodes[0]->GetData()) == 0) { m_ParentWidget->setEnabled(false); return; } m_ImageNode = nodes[0]; m_ParentWidget->setEnabled(true); } void QmitkImageCropper::AddBoundingObjectToNode(mitk::DataNode* node, bool fit) { m_ImageToCrop = dynamic_cast(node->GetData()); if(!this->GetDefaultDataStorage()->Exists(m_CroppingObjectNode)) { this->GetDefaultDataStorage()->Add(m_CroppingObjectNode, node); if (fit) { m_CroppingObject->FitGeometry(m_ImageToCrop->GetTimeSlicedGeometry()); } mitk::GlobalInteraction::GetInstance()->AddInteractor( m_AffineInteractor ); } m_CroppingObjectNode->SetVisibility(true); } void QmitkImageCropper::RemoveBoundingObjectFromNode() { if (m_CroppingObjectNode.IsNotNull()) { if(this->GetDefaultDataStorage()->Exists(m_CroppingObjectNode)) { this->GetDefaultDataStorage()->Remove(m_CroppingObjectNode); mitk::GlobalInteraction::GetInstance()->RemoveInteractor(m_AffineInteractor); } m_Controls->m_NewBoxButton->setText("New bounding box!"); } } void QmitkImageCropper::ChkInformationToggled( bool on ) { if (on) m_Controls->groupInfo->show(); else m_Controls->groupInfo->hide(); } void QmitkImageCropper::StdMultiWidgetAvailable( QmitkStdMultiWidget& stdMultiWidget ) { m_MultiWidget = &stdMultiWidget; } void QmitkImageCropper::StdMultiWidgetNotAvailable() { m_MultiWidget = NULL; } void QmitkImageCropper::NodeRemoved(const mitk::DataNode *node) { std::string name = node->GetName(); if (strcmp(name.c_str(), "CroppingObject")==0) { m_Controls->btnCrop->setEnabled(false); m_Controls->m_NewBoxButton->setEnabled(true); } } diff --git a/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h b/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h index 6d889efa41..e0c09f9aa6 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h +++ b/Modules/Bundles/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropper.h @@ -1,219 +1,219 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 13136 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QMITK_IMAGECROPPER_H__INCLUDED) #define QMITK_IMAGECROPPER_H__INCLUDED #ifdef WIN32 #pragma warning( disable : 4250 ) #endif #include "QmitkFunctionality.h" #include #include #include #include #include "mitkWeakPointer.h" #include #include #include "mitkImageCropperEventInterface.h" #include "ui_QmitkImageCropperControls.h" /*! \ingroup org_mitk_gui_qt_imagecropper_internal \brief Functionality for cropping images with a cuboid This functionality lets the user select an image from the data tree, select an area of interest by placing a cuboid object, and then crop the image, so that pixels from outside the cuboid will remove. The image size is automatically reduced, if the cuboid is not rotated but parallel to the image axes. \b Implementation The functionality owns a cuboid (m_CroppingObject) and the associated interactor (m_AffineInteractor), which implements moving and scaling the cuboid. */ -class QmitkImageCropper : public QObject, public QmitkFunctionality, public mitk::OperationActor +class QmitkImageCropper : public QmitkFunctionality, public mitk::OperationActor { /// Operation base class, which holds pointers to a node of the data tree (mitk::DataNode) /// and to two data sets (mitk::BaseData) instances class opExchangeNodes: public mitk::Operation { public: opExchangeNodes( mitk::OperationType type, mitk::DataNode* node, mitk::BaseData* oldData, mitk::BaseData* newData ); ~opExchangeNodes(); mitk::DataNode* GetNode() { return m_Node; } mitk::BaseData* GetOldData() { return m_OldData; } mitk::BaseData* GetNewData() { return m_NewData; } protected: void NodeDeleted(const itk::Object * /*caller*/, const itk::EventObject & /*event*/); private: mitk::DataNode* m_Node; mitk::BaseData::Pointer m_OldData; mitk::BaseData::Pointer m_NewData; long m_NodeDeletedObserverTag; long m_OldDataDeletedObserverTag; long m_NewDataDeletedObserverTag; }; private: Q_OBJECT public: /*! \brief Constructor. Called by SampleApp (or other apps that use functionalities) */ QmitkImageCropper(QObject *parent=0); /*! \brief Destructor */ virtual ~QmitkImageCropper(); /*! \brief Creates the Qt widget containing the functionality controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget* parent); /*! \brief Creates the Qt connections needed */ virtual void CreateConnections(); /*! \brief Invoked when this functionality is selected by the application */ virtual void Activated(); /*! \brief Invoked when the user leaves this functionality */ virtual void Deactivated(); /// /// Called when a StdMultiWidget is available. /// virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget); /// /// Called when no StdMultiWidget is available. /// virtual void StdMultiWidgetNotAvailable(); /* \brief Interface of a mitk::StateMachine (for undo/redo) */ virtual void ExecuteOperation (mitk::Operation*); QWidget* GetControls(); public slots: virtual void CropImage(); virtual void SurroundingCheck(bool value); virtual void CreateNewBoundingObject(); virtual void ChkInformationToggled( bool on ); protected: /*! * Default main widget containing 4 windows showing 3 * orthogonal slices of the volume and a 3d render window */ QmitkStdMultiWidget* m_MultiWidget; /*! * Controls containing an image selection drop down, some usage information and a "crop" button */ Ui::QmitkImageCropperControls * m_Controls; /*! * The parent QWidget */ QWidget* m_ParentWidget; /*! * \brief A pointer to the node of the image to be croped. */ mitk::WeakPointer m_ImageNode; /*! * \brief A pointer to the image to be cropped. */ mitk::WeakPointer m_ImageToCrop; /*! * \brief The cuboid used for cropping. */ mitk::BoundingObject::Pointer m_CroppingObject; /*! * \brief Tree node of the cuboid used for cropping. */ mitk::DataNode::Pointer m_CroppingObjectNode; /*! * \brief Interactor for moving and scaling the cuboid */ mitk::AffineInteractor::Pointer m_AffineInteractor; /*! * \brief Creates the cuboid and its data tree node. */ virtual void CreateBoundingObject(); /*! * \brief Called from superclass, handles selection changes. */ virtual void OnSelectionChanged(std::vector nodes); /*! * \brief Finds the given node in the data tree and optionally fits the cuboid to it */ virtual void AddBoundingObjectToNode(mitk::DataNode* node, bool fit); /*! * \brief Removes the cuboid from any node and hides it from the user. */ virtual void RemoveBoundingObjectFromNode(); template < typename TPixel, unsigned int VImageDimension > void AddSurrounding( itk::Image< TPixel, VImageDimension >* itkImage, mitk::Image::Pointer image); virtual void NodeRemoved(const mitk::DataNode* node); private: // operation constant static const mitk::OperationType OP_EXCHANGE; QProgressDialog *progress; mitk::Image::Pointer m_surrImage; //Interface class for undo redo mitk::ImageCropperEventInterface* m_Interface; }; #endif // !defined(QMITK_IMAGECROPPER_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h b/Modules/Bundles/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h index 4c1b6c1d19..89ab34e2e5 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h +++ b/Modules/Bundles/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h @@ -1,89 +1,89 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _QMITKIMAGENAVIGATORVIEW_H_INCLUDED #define _QMITKIMAGENAVIGATORVIEW_H_INCLUDED #include #include "berryISizeProvider.h" #include #include #include #include "QmitkStepperAdapter.h" #include #include "ui_QmitkImageNavigatorViewControls.h" #include "berryISizeProvider.h" /*! * \ingroup org_mitk_gui_qt_imagenavigator_internal * * \brief QmitkImageNavigatorView * * Document your class here. * * \sa QmitkFunctionality */ -class QmitkImageNavigatorView : public QObject, public berry::QtViewPart, public berry::ISizeProvider +class QmitkImageNavigatorView : public berry::QtViewPart, public berry::ISizeProvider { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkImageNavigatorView(); virtual ~QmitkImageNavigatorView(); virtual void CreateQtPartControl(QWidget *parent); QmitkStdMultiWidget* GetActiveStdMultiWidget(); void SetFocus(); virtual int GetSizeFlags(bool width); virtual int ComputePreferredSize(bool width, int /*availableParallel*/, int /*availablePerpendicular*/, int preferredResult); protected slots: protected: friend class ImageNavigatorPartListener; void SetMultiWidget(QmitkStdMultiWidget* multiWidget); Ui::QmitkImageNavigatorViewControls m_Controls; QmitkStdMultiWidget* m_MultiWidget; QmitkStepperAdapter* m_TransversalStepper; QmitkStepperAdapter* m_SagittalStepper; QmitkStepperAdapter* m_FrontalStepper; QmitkStepperAdapter* m_TimeStepper; berry::IPartListener::Pointer multiWidgetListener; }; #endif // _QMITKIMAGENAVIGATORVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h index bc968e5751..2b81d7ea81 100644 --- a/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h +++ b/Modules/Bundles/org.mitk.gui.qt.imagestatistics/src/internal/QmitkImageStatisticsView.h @@ -1,161 +1,161 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 20:08:26 +0200 (Do, 28 Mai 2009) $ Version: $Revision: 10185 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QmitkImageStatisticsView_H__INCLUDED) #define QmitkImageStatisticsView_H__INCLUDED #include "QmitkFunctionality.h" #include "../ImageStatisticsDll.h" #include "ui_QmitkImageStatisticsViewControls.h" #include "QmitkStepperAdapter.h" #include "mitkImageStatisticsCalculator.h" #include #include #include #include "mitkPlanarLine.h" /*! \brief QmitkImageStatistics \sa QmitkFunctionality \ingroup Functionalities */ -class IMAGESTATISTICS_EXPORT QmitkImageStatistics : public QObject, public QmitkFunctionality +class IMAGESTATISTICS_EXPORT QmitkImageStatistics : public QmitkFunctionality { Q_OBJECT public: /*! \ Convenient typedefs */ typedef mitk::DataStorage::SetOfObjects ConstVector; typedef ConstVector::ConstPointer ConstVectorPointer; typedef ConstVector::ConstIterator ConstVectorIterator; /*! \brief default constructor */ QmitkImageStatistics(QObject *parent=0, const char *name=0); /*! \brief default destructor */ virtual ~QmitkImageStatistics(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); bool IsExclusiveFunctionality() const; virtual bool event( QEvent *event ); void OnSelectionChanged( std::vector nodes ); protected slots: void ClipboardHistogramButtonClicked(); void ClipboardStatisticsButtonClicked(); protected: void StdMultiWidgetAvailable( QmitkStdMultiWidget& stdMultiWidget ); void FillStatisticsTableView( const mitk::ImageStatisticsCalculator::Statistics &s, const mitk::Image *image ); void InvalidateStatisticsTableView(); /** \brief Issues a request to update statistics by sending an event to the * Qt event processing queue. * * Statistics update should only be executed after program execution returns * to the Qt main loop. This mechanism also prevents multiple execution of * updates where only one is required.*/ void RequestStatisticsUpdate(); /** \brief Recalculate statistics for currently selected image and mask and * update the GUI. */ void UpdateStatistics(); /** \brief Listener for progress events to update progress bar. */ void UpdateProgressBar(); /** \brief Removes any cached images which are no longer referenced elsewhere. */ void RemoveOrphanImages(); /** \brief Computes an Intensity Profile along line and updates the histogram widget with it. */ void ComputeIntensityProfile( mitk::PlanarLine* line ); void Visible( ); typedef std::map< mitk::Image *, mitk::ImageStatisticsCalculator::Pointer > ImageStatisticsMapType; /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkImageStatisticsViewControls *m_Controls; QmitkStepperAdapter* m_TimeStepperAdapter; unsigned int m_CurrentTime; QString m_Clipboard; // Image and mask data mitk::DataNode *m_SelectedImageNode; mitk::Image *m_SelectedImage; mitk::DataNode *m_SelectedMaskNode; mitk::Image *m_SelectedImageMask; mitk::PlanarFigure *m_SelectedPlanarFigure; long m_ImageObserverTag; long m_ImageMaskObserverTag; long m_PlanarFigureObserverTag; // Hash map for associating one image statistics calculator with each iamge // (so that previously calculated histograms / statistics can be recovered // if a recalculation is not required) ImageStatisticsMapType m_ImageStatisticsMap; mitk::ImageStatisticsCalculator::Pointer m_CurrentStatisticsCalculator; bool m_CurrentStatisticsValid; bool m_StatisticsUpdatePending; }; #endif // !defined(QmitkImageStatistics_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.isosurface/src/internal/QmitkIsoSurface.h b/Modules/Bundles/org.mitk.gui.qt.isosurface/src/internal/QmitkIsoSurface.h index 285dcdb915..6d4c1c7c10 100644 --- a/Modules/Bundles/org.mitk.gui.qt.isosurface/src/internal/QmitkIsoSurface.h +++ b/Modules/Bundles/org.mitk.gui.qt.isosurface/src/internal/QmitkIsoSurface.h @@ -1,122 +1,122 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 13136 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QMITK_ISOSURFACE_H__INCLUDED) #define QMITK_ISOSURFACE_H__INCLUDED #include "QmitkFunctionality.h" #include "mitkColorSequenceRainbow.h" #include "mitkDataStorage.h" #include "ui_QmitkIsoSurfaceControls.h" //class QmitkStdMultiWidget; //class QmitkIsoSurfaceControls; /*! \brief IsoSurface \sa QmitkFunctionality \ingroup org_mitk_gui_qt_isosurface_internal */ -class QmitkIsoSurface : public QObject, public QmitkFunctionality +class QmitkIsoSurface : public QmitkFunctionality { Q_OBJECT public: /*! \brief default constructor */ QmitkIsoSurface(QObject *parent=0, const char *name=0); virtual ~QmitkIsoSurface(); /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ //virtual QWidget * CreateControlWidget(QWidget *parent); virtual void CreateQtPartControl(QWidget *parent); /*! \brief method for creating the applications main widget */ //virtual QWidget * CreateMainWidget(QWidget * parent); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief method for creating an QAction object, i.e. button & menu entry @param parent the parent QWidget */ //virtual QAction * CreateAction(QActionGroup *parent); /// /// Called when a StdMultiWidget is available. /// virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget); /// /// Called when no StdMultiWidget is available. /// virtual void StdMultiWidgetNotAvailable(); protected slots: virtual void DataStorageChanged(); /* * just an example slot for the example TreeNodeSelector widget */ void ImageSelected(const mitk::DataNode* item); /*! \brief method for creating a surface object */ void CreateSurface(); protected: /*! * default main widget containing 4 windows showing 3 * orthogonal slices of the volume and a 3d render window */ //QmitkStdMultiWidget * m_MultiWidget; /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkIsoSurfaceControls * m_Controls; /*! * image which is used to create the surface */ mitk::Image* m_MitkImage; /*! * read thresholdvalue from GUI and convert it to float */ float getThreshold(); /*! * variable to count Surfaces and give it to name */ int m_SurfaceCounter; mitk::ColorSequenceRainbow m_RainbowColor; }; #endif // !defined(QMITK_ISOSURFACE_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h b/Modules/Bundles/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h index fab0564dbd..0b16d668b0 100644 --- a/Modules/Bundles/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h +++ b/Modules/Bundles/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h @@ -1,125 +1,125 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-03-21 19:27:37 +0100 (Sa, 21 Mrz 2009) $ Version: $Revision: 16719 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED #define _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED #include #include #include #include #include "ui_QmitkMITKSurfaceMaterialEditorViewControls.h" /* #include #include #include #include #include #include #include "QtGui/QMenubarUpdatedEvent" */ #include "QmitkRenderWindow.h" #include "mitkCommon.h" #include "mitkDataStorage.h" #include "mitkDataNode.h" #include "mitkShaderProperty.h" #include "mitkSurface.h" #include "vtkRenderer.h" #include "vtkTextActor.h" /*! \brief QmitkMITKSurfaceMaterialEditorView \sa QmitkFunctionality \ingroup Functionalities */ -class QmitkMITKSurfaceMaterialEditorView : public QObject, public QmitkFunctionality +class QmitkMITKSurfaceMaterialEditorView : public QmitkFunctionality { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkMITKSurfaceMaterialEditorView(); virtual ~QmitkMITKSurfaceMaterialEditorView(); virtual void CreateQtPartControl(QWidget *parent); /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// \brief Called when the functionality is activated virtual void Activated(); virtual void Deactivated(); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); virtual void OnSelectionChanged(std::vector nodes); protected slots: void SurfaceSelected(); protected: Ui::QmitkMITKSurfaceMaterialEditorViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; private: mitk::Surface::Pointer m_Surface; mitk::DataStorage::Pointer m_DataTree; mitk::DataNode::Pointer m_DataNode; mitk::DataNode::Pointer m_SelectedDataNode; std::list fixedProperties; std::list shaderProperties; unsigned long observerIndex; bool observerAllocated; mitk::ShaderProperty::Pointer observedProperty; void InitPreviewWindow(); int usedTimer; void timerEvent( QTimerEvent *e ); void RefreshPropertiesList(); void postRefresh(); void shaderEnumChange(const itk::Object *caller, const itk::EventObject &event); berry::IStructuredSelection::ConstPointer m_CurrentSelection; berry::ISelectionListener::Pointer m_SelectionListener; }; #endif // _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h b/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h index 028ab1e5d8..8f861b0e20 100644 --- a/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h +++ b/Modules/Bundles/org.mitk.gui.qt.measurement/src/internal/QmitkMeasurement.h @@ -1,201 +1,201 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 15412 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QMITK_MEASUREMENT_H__INCLUDED) #define QMITK_MEASUREMENT_H__INCLUDED #include #include #include #include #include #include #include #include #include #include #include #include #include class QmitkPlanarFiguresTableModel; class QGridLayout; class QMainWindow; class QToolBar; class QLabel; class QTableView; class QTextBrowser; class vtkRenderer; class vtkCornerAnnotation; /// /// A view for doing measurements in digital images by means of /// mitk::Planarfigures which can represent drawing primitives (Lines, circles, ...). /// The view consists of only three main elements: /// 1. A toolbar for activating PlanarFigure drawing /// 2. A textbrowser which shows details for the selected PlanarFigures /// 3. A button for copying all details to the clipboard /// -class QmitkMeasurement : public QObject, public QmitkFunctionality +class QmitkMeasurement : public QmitkFunctionality { Q_OBJECT public: /// /// Just a shortcut /// typedef std::vector DataNodes; /// /// Initialize pointers to 0. The rest is done in CreateQtPartControl() /// QmitkMeasurement(); /// /// Remove all event listener from DataStorage, DataStorageSelection, Selection Service /// virtual ~QmitkMeasurement(); public: /// /// Initializes all variables. /// Builds up GUI. /// void CreateQtPartControl(QWidget* parent); /// /// Set widget planes visibility to false. /// Show only transversal view. /// Add an interactor to all PlanarFigures in the DataStorage (if they dont have one yet). /// Add their interactor to the global interaction. /// virtual void Activated(); /// /// Show widget planes and all renderwindows again. /// Remove all planar figure interactors from the global interaction. /// virtual void Deactivated(); /// /// Invoked from a DataStorage selection /// virtual void NodeChanged(const mitk::DataNode* node); virtual void PropertyChanged(const mitk::DataNode* node, const mitk::BaseProperty* prop); virtual void NodeRemoved(const mitk::DataNode* node); virtual void NodeAddedInDataStorage(const mitk::DataNode* node); virtual void PlanarFigureInitialized(); virtual void PlanarFigureSelected( itk::Object* object, const itk::EventObject& event ); virtual void AddFigureToDataStorage(mitk::PlanarFigure* figure, const QString& name, const char *propertyKey = NULL, mitk::BaseProperty *property = NULL ); /// /// Invoked when the DataManager selection changed. /// If an image is in the selection it will be set as the selected one for measurement, /// If a planarfigure is in the selection its parent image will be set as the selected one for measurement. /// All selected planarfigures will be added to m_SelectedPlanarFigures. /// Then PlanarFigureSelectionChanged is called /// virtual void OnSelectionChanged(std::vector nodes); public slots: /// /// Called when the renderwindow gets deleted /// void OnRenderWindowDelete(QObject * obj = 0); protected: /// /// Prints all features of the selected PlanarFigures into the TextBrowser. /// For the last figure in the selection list: /// - Go to the corresponding slice and show figure /// - Draw info text on the bottom right side of the corresponding renderwindow /// void PlanarFigureSelectionChanged(); /// Draws a string on the bottom left side of the render window /// void SetMeasurementInfoToRenderWindow(const QString& text, QmitkRenderWindow* _RenderWindow); bool AssertDrawingIsPossible(bool checked); protected slots: ///# draw actions void ActionDrawLineTriggered( bool checked = false ); void ActionDrawPathTriggered( bool checked = false ); void ActionDrawAngleTriggered( bool checked = false ); void ActionDrawFourPointAngleTriggered( bool checked = false ); void ActionDrawEllipseTriggered( bool checked = false ); void ActionDrawRectangleTriggered( bool checked = false ); void ActionDrawPolygonTriggered( bool checked = false ); void ActionDrawArrowTriggered( bool checked = false ); void ActionDrawTextTriggered( bool checked = false ); void CopyToClipboard( bool checked = false ); // fields // widgets protected: QGridLayout* m_Layout; QLabel* m_SelectedImage; QAction* m_DrawLine; QAction* m_DrawPath; QAction* m_DrawAngle; QAction* m_DrawFourPointAngle; QAction* m_DrawEllipse; QAction* m_DrawRectangle; QAction* m_DrawPolygon; QToolBar* m_DrawActionsToolBar; QActionGroup* m_DrawActionsGroup; QTextBrowser* m_SelectedPlanarFiguresText; QPushButton* m_CopyToClipboard; vtkRenderer * m_MeasurementInfoRenderer; vtkCornerAnnotation *m_MeasurementInfoAnnotation; // Selection service /// berry::SelectionChangedAdapter must be a friend to call friend struct berry::SelectionChangedAdapter; berry::ISelectionListener::Pointer m_SelectionListener; mitk::DataStorageSelection::Pointer m_SelectedPlanarFigures; /// Selected image on which measurements will be performed /// mitk::DataStorageSelection::Pointer m_SelectedImageNode; mitk::WeakPointer m_CurrentFigureNode; /// Counter variables to give a newly created Figure a unique name. /// unsigned int m_LineCounter; unsigned int m_PathCounter; unsigned int m_AngleCounter; unsigned int m_FourPointAngleCounter; unsigned int m_EllipseCounter; unsigned int m_RectangleCounter; unsigned int m_PolygonCounter; unsigned int m_EndPlacementObserverTag; unsigned int m_SelectObserverTag; bool m_Visible; bool m_CurrentFigureNodeInitialized; /// /// Saves the last renderwindow any info data was inserted /// QmitkRenderWindow* m_LastRenderWindow; private: mitk::DataNode::Pointer DetectTopMostVisibleImage(); }; #endif // !defined(QMITK_MEASUREMENT_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.h b/Modules/Bundles/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.h index 8850781576..0e113ebcf6 100644 --- a/Modules/Bundles/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.h +++ b/Modules/Bundles/org.mitk.gui.qt.moviemaker/src/internal/QmitkMovieMaker.h @@ -1,301 +1,301 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 15436 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QMITK_MOVIEMAKER_H__INCLUDED) #define QMITK_MOVIEMAKER_H__INCLUDED #include "QmitkFunctionality.h" #include "mitkCameraRotationController.h" #include "mitkStepper.h" #include "mitkMultiStepper.h" #include "mitkMovieGenerator.h" #include "itkCommand.h" #include "QVTKWidget.h" #include "vtkEventQtSlotConnect.h" #include "vtkRenderWindow.h" #include "mitkVtkPropRenderer.h" #include "ui_QmitkMovieMakerControls.h" //#include "../MovieMakerDll.h" //class QmitkStdMultiWidget; //class QmitkMovieMakerControls; class QmitkStepperAdapter; class vtkCamera; class QTimer; class QTime; /** * \brief Functionality for creating movies (AVIs) * \ingroup Functionalities * * * - \ref QmitkMovieMakerOverview * - \ref QmitkMovieMakerImplementation * - \ref QmitkMovieMakerTodo * * \section QmitkMovieMakerOverview Overview * * The MovieMaker functionality extends existing modes of data visualization * with animation capabilities. The animation aspect determines which * aspect of a visualization gets animated. This aspect can be spatial * (i.e. the camera position and orientation in a 3D view, or the selected * slice in a 2D view), temporal (the time step in a time-based dataset), or * something more sophisticated (for example, volume rendering transfer * functions might be changed dynamically as part of an animation to produce * interesting effects). Currently, the following animation modes are * supported: * * - Rotation of the camera around the dataset (3D views) * - Stepping through the dataset slice by slice (2D views) * - Stepping through a time-based dataset (2D and 3D views) * * As can be seen in the screenshot below, the functionality provides cine * controls to start, pause and stop the animation. The direction of the * animation can be selected (forward, backward or ping-pong). The animation * can be set to either the spatial or the temporal aspect, or to both * aspects combined. The cycle time determines the duration of one animation * loop. * * In a multi-view scenario, the animation is applied to the currently * focussed view. Other views which display the same data may be affected as * well. * * Animations can be written on disk; the corresponding button creates an * animation consisting of one single loop and writes every animation frame * into an AVI file. * * \image html QmitkMovieMakerGUI.png * * \section QmitkMovieMakerImplementation Implementation * * The following diagram provides an overview over the classes collaborating * with QmitkMovieMaker. * * \image html QmitkMovieMakerClasses.png * * The respective roles of these classes are: * - QmitkMovieMaker * - Provides a class interface for configuring and controlling the * animation * - Is associated with the user interface * - As a Functionality, controls initialization and maintainance of the * involved components * - mitk::BaseController * - Controls an animation aspect (slice selection, camera angle, ...) * - Subclass mitk::SliceNavigationController: Transfers the animation * requests to the associated Renderer for selecting a slice in a 3D * dataset * - Subclass mitk::CameraRotationController: Modifies the camera angle * - mitk::Stepper * - Link between MovieMaker and Controller * - Holds the current step position of the associated animation aspect * (e.g. the camera rotation angle, or the slice number) * - mitk::FocusManager * - Determines which of the available RenderWindows (and thereby which * Renderers) the animation shall be applied to * - mitk::BaseRenderer * - Controls the rendering of a dataset * - Target class of the animation * - mitk::MovieGenerator * - Writes an AVI file * * * \section QmitkMovieMakerTodo Future plans * * The basic animation capabilities of this functionality could be extended * to allow the creation of more sophisticated animations. Potentially useful * features include: * * - Camera paths: Allow the definition of complex camera paths along * which the camera can then be moved during an animation. This might be * done by defining camera keyframes between which camera movements are * interpolated (as in standard 3D animation applications). Paths derived * from anatomical features (e.g. vessel graphs) could also serve as a * basis for camera movements. * - Color / transfer function animation: Choosing suitable color * and transfer functions is critical to the quality and benefit of volume * rendering. Dynamically changing transfer functions could visually enrich * an animation. One way of achieving this could be to define transfer * function keyframes between which an animation interpolates. * */ -class QmitkMovieMaker: public QObject, public QmitkFunctionality +class QmitkMovieMaker: public QmitkFunctionality { Q_OBJECT public: /** \brief Constructor. */ QmitkMovieMaker(QObject *parent=0, const char *name=0); /** \brief Destructor. */ virtual ~QmitkMovieMaker(); /** \brief Method for creating the widget containing the application * controls, like sliders, buttons etc. */ void CreateQtPartControl(QWidget *parent); // virtual QWidget * CreateControlWidget(QWidget *parent); /** \brief Method for creating the connections of main and control widget. */ virtual void CreateConnections(); /** \brief Method for creating an QAction object, i.e. button & menu entry. * @param parent the parent QWidget */ // virtual QAction * CreateAction(QActionGroup *parent); virtual void Activated(); virtual void Deactivated(); /** \brief Called when another window receives the focus. */ void FocusChange(); virtual void DataStorageChanged(); /// /// Called when a StdMultiWidget is available. /// virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget); /// /// Called when no StdMultiWidget is available. /// virtual void StdMultiWidgetNotAvailable(); signals: void StartBlockControls(); void EndBlockControls(); void EndBlockControlsMovieDeactive(); public slots: /** \brief Start playing the animation by restarting the timer. */ void StartPlaying(); /** \brief Pauses playing the animation by stopping the timer. */ void PausePlaying(); /** \brief Stops playing the animation and resets the stepper. */ void StopPlaying(); /** \brief Sets animation looping ON/OFF. */ void SetLooping(bool looping); /** \brief Sets the direction: 0 = forward, 1 = backward, 2 = pingpong. */ void SetDirection(int direction); /** \brief Sets the animation aspect: * 0 = spatial, 1 = temporal, 2 = combined. */ void SetAspect(int aspect); /** \brief Sets a specified stepper window, which is moving. */ void SetStepperWindow(int window); /** \brief Sets a specified recording window, from which the movie is generated. */ void SetRecordingWindow(int window); /** \brief Advances the animation by one frame. * Exactly how much the stepper advances depends on the time elapsed since * the last call to this function. */ void AdvanceAnimation(); protected slots: void RenderSlot(); void GenerateMovie(); void GenerateScreenshot(); void GenerateHR3DScreenshot(); void RBTNForward(); void RBTNBackward(); void RBTNPingPong(); void RBTNSpatial(); void RBTNTemporal(); void RBTNCombined(); void BlockControls(); void UnBlockControls(); void UnBlockControlsMovieDeactive(); void BlockControls(bool blocked); void DeleteMStepper(); signals: void SwitchDirection(int); void SwitchAspect(int); void SwitchSelectedStepperWindow(int); void SwitchSelectedRecordingWindow(int); protected: QObject *parentWidget; QVTKWidget * widget; QmitkStdMultiWidget* m_MultiWidget; vtkEventQtSlotConnect * connections; vtkRenderWindow * renderWindow; mitk::VtkPropRenderer::Pointer m_PropRenderer; Ui::QmitkMovieMakerControls* m_Controls; private: mitk::BaseController* GetSpatialController(); mitk::BaseController* GetTemporalController(); void UpdateLooping(); void UpdateDirection(); void UpdateGUI(); mitk::Stepper* GetAspectStepper(); /*! \brief taking a screenshot "from" the specified renderer \param magnificationFactor specifying the quality of the screenshot (the magnification of the actual RenderWindow size) \param fileName file location and name where the screenshot should be saved */ void TakeScreenshot(vtkRenderer* renderer, unsigned int magnificationFactor, QString fileName); QmitkStepperAdapter* m_StepperAdapter; typedef itk::SimpleMemberCommand MemberCommand; MemberCommand::Pointer m_FocusManagerCallback; QTimer* m_Timer; QTime* m_Time; bool m_Looping; int m_Direction; int m_Aspect; mitk::MultiStepper::Pointer m_Stepper; mitk::BaseRenderer * m_RecordingRenderer; mitk::MovieGenerator::Pointer m_movieGenerator; unsigned long m_FocusManagerObserverTag; unsigned long m_StepperObserverTag; }; #endif // !defined(QMITK_MOVIEMAKER_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h index 2639c99404..a3fb81d40c 100644 --- a/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.pointbasedregistration/src/internal/QmitkPointBasedRegistrationView.h @@ -1,298 +1,298 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QMITK_POINTBASEDREGISTRATION_H__INCLUDED) #define QMITK_POINTBASEDREGISTRATION_H__INCLUDED #include "QmitkFunctionality.h" #include "berryISelectionListener.h" #include "berryIStructuredSelection.h" //#include "mitkTestingConfig.h" // IMPORTANT: this defines or undefines BUILD_TESTING ! #include #include #include #include #include #include //#include "QmitkMessageBoxHelper.h" #include "ui_QmitkPointBasedRegistrationViewControls.h" #include "../PointbasedregistrationDll.h" /*! \brief The PointBasedRegistration functionality is used to perform point based registration. This functionality allows you to register 2D as well as 3D images in a rigid and deformable manner via corresponding PointSets. Register means to align two images, so that they become as similar as possible. Therefore you have to set corresponding points in both images, which will be matched. The movement, which has to be performed on the points to align them will be performed on the moving image as well. The result is shown in the multi-widget. For more informations see: \ref QmitkPointBasedRegistrationUserManual \sa QmitkFunctionality \ingroup Functionalities \ingroup PointBasedRegistration */ -class POINTBASEDREGISTRATION_EXPORT QmitkPointBasedRegistrationView : public QObject, public QmitkFunctionality +class POINTBASEDREGISTRATION_EXPORT QmitkPointBasedRegistrationView : public QmitkFunctionality { friend struct SelListenerPointBasedRegistration; Q_OBJECT public: static const std::string VIEW_ID; /*! \brief Default constructor */ QmitkPointBasedRegistrationView(QObject *parent=0, const char *name=0); /*! \brief Default destructor */ virtual ~QmitkPointBasedRegistrationView(); /*! \brief method for creating the applications main widget */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief Sets the StdMultiWidget and connects it to the functionality. */ virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); /*! \brief Removes the StdMultiWidget and disconnects it from the functionality. */ virtual void StdMultiWidgetNotAvailable(); /*! \brief Method for creating the connections of main and control widget */ virtual void CreateConnections(); virtual void Activated(); virtual void Deactivated(); virtual void Visible(); virtual void Hidden(); // // #ifdef BUILD_TESTING // / ** // \brief Testing entry point // * / // virtual int TestYourself(); // // / ** // \brief Helper method for testing // * / // bool TestAllTools(); // // // protected slots: // /** // \brief Helper method for testing // */ // void RegistrationErrorDialogFound( QWidget* widget ); // // /** // \brief Helper method for testing // */ // void ClearPointSetDialogFound( QWidget* widget ); // // private: // bool m_MessageBox; // // // public: // #else // // slot function is needed, because moc ignores our #ifdefs // void RegistrationErrorDialogFound( QWidget* widget ) {} // // slot function is needed, because moc ignores our #ifdefs // void ClearPointSetDialogFound(QWidget* widget){} // #endif void DataNodeHasBeenRemoved(const mitk::DataNode* node); protected slots: /*! \brief Sets the fixed Image according to TreeNodeSelector widget */ void FixedSelected(mitk::DataNode::Pointer fixedImage); /*! \brief Sets the moving Image according to TreeNodeSelector widget */ void MovingSelected(mitk::DataNode::Pointer movingImage); /*! \brief Calculates registration with vtkLandmarkTransform */ void calculateLandmarkbased(); /*! \brief Calculates registration with itkLandmarkWarping */ void calculateLandmarkWarping(); /*! \brief Calculates registration with ICP and vtkLandmarkTransform */ void calculateLandmarkbasedWithICP(); /*! \brief lets the fixed image become invisible and the moving image visible */ void HideMovingImage(bool hide); /*! \brief lets the moving image become invisible and the fixed image visible */ void HideFixedImage(bool hide); /*! \brief Checks if registration is possible */ bool CheckCalculate(); /*! \brief Performs an undo for the last transform. */ void UndoTransformation(); /*! \brief Performs a redo for the last undo transform. */ void RedoTransformation(); /*! \brief Stores whether the image will be shown in grayvalues or in red for fixed image and green for moving image @param show if true, then images will be shown in red and green */ void showRedGreen(bool show); /*! \brief Sets the selected opacity for moving image @param opacity the selected opacity */ void OpacityUpdate(float opacity); /*! \brief Sets the selected opacity for moving image @param opacity the selected opacity */ void OpacityUpdate(int opacity); /*! \brief Updates the moving landmarks */ void updateMovingLandmarksList(); /*! \brief Updates the fixed landmarks */ void updateFixedLandmarksList(); /*! \brief Sets the images to gray values or fixed image to red and moving image to green @param redGreen if true, then images will be shown in red and green */ void setImageColor(bool redGreen); /*! \brief Clears the undo and redo transformation lists. */ void clearTransformationLists(); /*! \brief Calculates the landmark error for the selected transformation. */ void checkLandmarkError(); /*! \brief Changes the transformation type and calls checkLandmarkError(). */ void transformationChanged(int transform); /*! \brief Checks whether the registration can be performed. */ bool checkCalculateEnabled(); /*! \brief Performs the registration. */ void calculate(); void SetImagesVisible(berry::ISelection::ConstPointer /*selection*/); void SwitchImages(); protected: berry::ISelectionListener::Pointer m_SelListener; berry::IStructuredSelection::ConstPointer m_CurrentSelection; /*! * default main widget containing 4 windows showing 3 * orthogonal slices of the volume and a 3d render window */ QmitkStdMultiWidget * m_MultiWidget; /*! * control widget to make all changes for point based registration */ Ui::QmitkPointBasedRegistrationControls m_Controls; mitk::PointSet::Pointer m_FixedLandmarks; mitk::PointSet::Pointer m_MovingLandmarks; mitk::DataNode::Pointer m_MovingPointSetNode; mitk::DataNode::Pointer m_FixedPointSetNode; mitk::DataNode::Pointer m_MovingNode; mitk::DataNode::Pointer m_FixedNode; std::list m_UndoGeometryList; std::list m_UndoPointsGeometryList; std::list m_RedoGeometryList; std::list m_RedoPointsGeometryList; bool m_ShowRedGreen; float m_Opacity; float m_OriginalOpacity; mitk::Color m_FixedColor; mitk::Color m_MovingColor; int m_Transformation; bool m_HideFixedImage; bool m_HideMovingImage; std::string m_OldFixedLabel; std::string m_OldMovingLabel; bool m_Deactivated; int m_CurrentFixedLandmarksObserverID; int m_CurrentMovingLandmarksObserverID; itk::SimpleMemberCommand::Pointer m_FixedLandmarksChangedCommand; itk::SimpleMemberCommand::Pointer m_MovingLandmarksChangedCommand; }; #endif // !defined(QMITK_POINTBASEDREGISTRATION_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h b/Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h index 142e0f3b8b..e45f9f989d 100755 --- a/Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h +++ b/Modules/Bundles/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h @@ -1,57 +1,57 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QmitkPointSetInteraction_H__INCLUDED) #define QmitkPointSetInteraction_H__INCLUDED #include #include #include #include #include namespace Ui { class QmitkPointSetInteractionControls; }; /*! \brief QmitkPointSetInteractionView */ -class QmitkPointSetInteractionView : public QObject, public QmitkFunctionality +class QmitkPointSetInteractionView : public QmitkFunctionality { Q_OBJECT public: QmitkPointSetInteractionView(QObject *parent=0); virtual ~QmitkPointSetInteractionView(); virtual void CreateQtPartControl(QWidget *parent); void OnSelectionChanged(std::vector nodes); void Activated(); void Deactivated(); void NodeChanged(const mitk::DataNode* node); bool IsExclusiveFunctionality() const; virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget); virtual void StdMultiWidgetClosed(QmitkStdMultiWidget& stdMultiWidget); protected slots: void OnAddPointSetClicked(); protected: Ui::QmitkPointSetInteractionControls * m_Controls; mitk::WeakPointer m_SelectedPointSetNode; mitk::WeakPointer m_SelectedPointSetInteractor; }; #endif // !defined(QmitkPointSetInteraction_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.regiongrowing/src/internal/QmitkRegionGrowingView.h b/Modules/Bundles/org.mitk.gui.qt.regiongrowing/src/internal/QmitkRegionGrowingView.h index f2cb0d0d41..d456dd3d9b 100644 --- a/Modules/Bundles/org.mitk.gui.qt.regiongrowing/src/internal/QmitkRegionGrowingView.h +++ b/Modules/Bundles/org.mitk.gui.qt.regiongrowing/src/internal/QmitkRegionGrowingView.h @@ -1,93 +1,93 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QmitkRegionGrowingView_h #define QmitkRegionGrowingView_h #include #include #include "mitkPointSet.h" #include #include "ui_QmitkRegionGrowingViewControls.h" /*! \brief QmitkRegionGrowingView Functionality for demonstration of MITK basics. This functionality allows the user to set some seed points that are used for a simple region growing algorithm from ITK. \warning This is only for demonstration, it is NOT meant to be useful! \sa QmitkFunctionality \ingroup Functionalities */ -class QmitkRegionGrowingView : public QObject, public QmitkFunctionality +class QmitkRegionGrowingView : public QmitkFunctionality { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; QmitkRegionGrowingView(); virtual ~QmitkRegionGrowingView(); virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); virtual void Deactivated(); protected slots: /// \brief Called when the user clicks the GUI button void DoImageProcessing(); protected: /*! \brief ITK image processing function This function is templated like an ITK image. The MITK-Macro AccessByItk determines the actual pixel type and dimensionality of a given MITK image and calls this function for further processing (in our case region growing) */ template < typename TPixel, unsigned int VImageDimension > void ItkImageProcessing( itk::Image< TPixel, VImageDimension >* itkImage, mitk::Geometry3D* imageGeometry, mitk::DataNode* parent ); /// \brief called by QmitkFunctionality when DataManager's selection has changed virtual void OnSelectionChanged( std::vector nodes ); /// \brief This is the actual seed point data object mitk::PointSet::Pointer m_PointSet; Ui::QmitkRegionGrowingViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; }; #endif // _QMITKREGIONGROWINGVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h index 2843cec1e7..e3349962c5 100644 --- a/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.rigidregistration/src/internal/QmitkRigidRegistrationView.h @@ -1,289 +1,289 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QMITKRIGIDREGISTRATION_H #define QMITKRIGIDREGISTRATION_H #include "QmitkFunctionality.h" #include "ui_QmitkRigidRegistrationViewControls.h" #include "berryISelectionListener.h" #include "berryIStructuredSelection.h" #include "../RigidregistrationDll.h" // Time Slider related #include /*! \brief This functionality allows you to register 2D as well as 3D images in a rigid manner. Register means to align two images, so that they become as similar as possible. Therefore you can select from different transforms, metrics and optimizers. Registration results will directly be applied to the Moving Image. \sa QmitkFunctionality \ingroup Functionalities \ingroup RigidRegistration \author Daniel Stein */ -class RIGIDREGISTRATION_EXPORT QmitkRigidRegistrationView : public QObject, public QmitkFunctionality +class RIGIDREGISTRATION_EXPORT QmitkRigidRegistrationView : public QmitkFunctionality { friend struct SelListenerRigidRegistration; Q_OBJECT public: static const std::string VIEW_ID; /*! \brief default constructor */ QmitkRigidRegistrationView(QObject *parent=0, const char *name=0); /*! \brief default destructor */ virtual ~QmitkRigidRegistrationView(); /*! \brief method for creating the applications main widget */ virtual void CreateQtPartControl(QWidget *parent); /*! \brief Sets the StdMultiWidget and connects it to the functionality. */ virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); /*! \brief Removes the StdMultiWidget and disconnects it from the functionality. */ virtual void StdMultiWidgetNotAvailable(); /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Method which is called when this functionality is selected in MITK */ virtual void Activated(); /*! \brief Method which is called whenever the functionality is deselected in MITK */ virtual void Deactivated(); virtual void Visible(); virtual void Hidden(); void DataNodeHasBeenRemoved(const mitk::DataNode* node); signals: protected slots: /*! * sets the fixed Image according to TreeNodeSelector widget */ void FixedSelected(mitk::DataNode::Pointer fixedImage); /*! * sets the moving Image according to TreeNodeSelector widget */ void MovingSelected(mitk::DataNode::Pointer movingImage); /*! * checks if registration is possible */ bool CheckCalculate(); /*! * \brief Undo the last registration. */ void UndoTransformation(); /*! * \brief Redo the last registration */ void RedoTransformation(); /*! * \brief Adds a new Transformation to the undo list and enables the undo button. */ void AddNewTransformationToUndoList(); /*! * \brief Translates the moving image in x, y and z direction given by translateVector * * @param translateVector Contains the translation in x, y and z direction. */ void Translate(int* translateVector); /*! * \brief Rotates the moving image in x, y and z direction given by rotateVector * * @param rotateVector Contains the rotation around x, y and z axis. */ void Rotate(int* rotateVector); /*! * \brief Scales the moving image in x, y and z direction given by scaleVector * * @param scaleVector Contains the scaling around x, y and z axis. */ void Scale(int* scaleVector); /*! * \brief Automatically aligns the image centers. */ void AlignCenters(); /*! * \brief Stores whether the image will be shown in gray values or in red for fixed image and green for moving image * @param show if true, then images will be shown in red and green */ void ShowRedGreen(bool show); /*! * \brief Changes the visibility of the manual registration methods accordingly to the checkbox "Manual Registration" in GUI * @param show if true, then manual registration methods will be shown */ void ShowManualRegistrationFrame(bool show); /*! * \brief Sets the selected opacity for moving image * @param opacity the selected opacity */ void OpacityUpdate(float opacity); /*! \brief Sets the selected opacity for moving image @param opacity the selected opacity */ void OpacityUpdate(int opacity); /*! * \brief Sets the images to grayvalues or fixed image to red and moving image to green * @param redGreen if true, then images will be shown in red and green */ void SetImageColor(bool redGreen); /*! * \brief Clears the undo and redo lists and sets the undo and redo buttons to disabled. */ void ClearTransformationLists(); void SetUndoEnabled( bool enable ); void SetRedoEnabled( bool enable ); void CheckCalculateEnabled(); void xTrans_valueChanged( int v ); void yTrans_valueChanged( int v ); void zTrans_valueChanged( int v ); void xRot_valueChanged( int v ); void yRot_valueChanged( int v ); void zRot_valueChanged( int v ); void xScale_valueChanged( int v ); void yScale_valueChanged( int v ); void zScale_valueChanged( int v ); void MovingImageChanged(); /*! * \brief Starts the registration process. */ void Calculate(); void SetOptimizerValue( double value ); void StopOptimizationClicked(); void UpdateTimestep(); void SetImagesVisible(berry::ISelection::ConstPointer /*selection*/); void CheckForMaskImages(); void UseFixedMaskImageChecked(bool checked); void UseMovingMaskImageChecked(bool checked); void TabChanged(int index); void SwitchImages(); protected: berry::ISelectionListener::Pointer m_SelListener; berry::IStructuredSelection::ConstPointer m_CurrentSelection; /*! * default main widget containing 4 windows showing 3 * orthogonal slices of the volume and a 3d render window */ QmitkStdMultiWidget * m_MultiWidget; /*! * control widget to make all changes for Deformable registration */ Ui::QmitkRigidRegistrationViewControls m_Controls; mitk::DataNode::Pointer m_MovingNode; mitk::DataNode::Pointer m_MovingMaskNode; mitk::DataNode::Pointer m_FixedNode; mitk::DataNode::Pointer m_FixedMaskNode; std::list m_UndoGeometryList; std::list > m_UndoChildGeometryList; std::list m_RedoGeometryList; std::list > m_RedoChildGeometryList; bool m_ShowRedGreen; float m_Opacity; float m_OriginalOpacity; bool m_Deactivated; int m_FixedDimension; int m_MovingDimension; int * translationParams; int * rotationParams; int * scalingParams; mitk::Color m_FixedColor; mitk::Color m_MovingColor; int m_TranslateSliderPos[3]; int m_RotateSliderPos[3]; int m_ScaleSliderPos[3]; QmitkStepperAdapter* m_TimeStepperAdapter; }; #endif //QMITKRigidREGISTRATION_H diff --git a/Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h b/Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h index 1f4995c2c5..ddb629241b 100644 --- a/Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h @@ -1,155 +1,155 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 1.12 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QmitkSegmentationView_h #define QmitkSegmentationView_h #include "QmitkFunctionality.h" #include #include "ui_QmitkSegmentationControls.h" class QmitkRenderWindow; // class QmitkSegmentationPostProcessing; /** * \ingroup ToolManagerEtAl * \ingroup org_mitk_gui_qt_segmentation_internal * \warning Implementation of this class is split up into two .cpp files to make things more compact. Check both this file and QmitkSegmentationOrganNamesHandling.cpp */ -class QmitkSegmentationView : public QObject, public QmitkFunctionality +class QmitkSegmentationView : public QmitkFunctionality { Q_OBJECT public: QmitkSegmentationView(); virtual ~QmitkSegmentationView(); /*! \brief Invoked when the DataManager selection changed */ virtual void OnSelectionChanged(mitk::DataNode* node); virtual void OnSelectionChanged(std::vector nodes); // reaction to new segmentations being created by segmentation tools void NewNodesGenerated(); void NewNodeObjectsGenerated(mitk::ToolManager::DataVectorType*); // QmitkFunctionality's activate/deactivate virtual void Activated(); virtual void Deactivated(); // QmitkFunctionality's changes regarding THE QmitkStdMultiWidget virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); virtual void StdMultiWidgetClosed(QmitkStdMultiWidget& stdMultiWidget); // BlueBerry's notification about preference changes (e.g. from a dialog) virtual void OnPreferencesChanged(const berry::IBerryPreferences*); // observer to mitk::RenderingManager's RenderingManagerViewsInitializedEvent event void RenderingManagerReinitialized(const itk::EventObject&); // observer to mitk::SliceController's SliceRotation event void SliceRotation(const itk::EventObject&); protected slots: void OnComboBoxSelectionChanged(const mitk::DataNode* node); // reaction to the button "New segmentation" void CreateNewSegmentation(); // reaction to the button "New segmentation" void CreateSegmentationFromSurface(); // called when a segmentation tool is activated void ManualToolSelected(int id); // called when one of "Manual", "Organ", "Lesion" pages of the QToolbox is selected void ToolboxStackPageChanged(int id); void OnSurfaceSelectionChanged(); //called when the checkbox Remember Contour Positions is selected/deselected void CheckboxRememberContourPositionsStateChanged(int state); protected: // a type for handling lists of DataNodes typedef std::vector NodeList; // set available multiwidget void SetMultiWidget(QmitkStdMultiWidget* multiWidget); // actively query the current selection of data manager //void PullCurrentDataManagerSelection(); // reactions to selection events from data manager (and potential other senders) //void BlueBerrySelectionChanged(berry::IWorkbenchPart::Pointer sourcepart, berry::ISelection::ConstPointer selection); mitk::DataNode::Pointer FindFirstRegularImage( std::vector nodes ); mitk::DataNode::Pointer FindFirstSegmentation( std::vector nodes ); // propagate BlueBerry selection to ToolManager for manual segmentation void SetToolManagerSelection(const mitk::DataNode* referenceData, const mitk::DataNode* workingData); // checks if selected reference image is aligned with the slices stack orientation of the StdMultiWidget void CheckImageAlignment(); // checks if given render window aligns with the slices of given image bool IsRenderWindowAligned(QmitkRenderWindow* renderWindow, mitk::Image* image); // make sure all images/segmentations look as selected by the users in this view's preferences void ForceDisplayPreferencesUponAllImages(); // decorates a DataNode according to the user preference settings void ApplyDisplayOptions(mitk::DataNode* node); // GUI setup void CreateQtPartControl(QWidget* parent); // handling of a list of known (organ name, organ color) combination // ATTENTION these methods are defined in QmitkSegmentationOrganNamesHandling.cpp QStringList GetDefaultOrganColorString(); void UpdateOrganList(QStringList& organColors, const QString& organname, mitk::Color colorname); void AppendToOrganList(QStringList& organColors, const QString& organname, int r, int g, int b); // If a contourmarker is selected, the plane in the related widget will be reoriented according to the marker`s geometry void OnContourMarkerSelected (const mitk::DataNode* node); // the Qt parent of our GUI (NOT of this object) QWidget* m_Parent; // our GUI Ui::QmitkSegmentationControls * m_Controls; // THE currently existing QmitkStdMultiWidget QmitkStdMultiWidget * m_MultiWidget; // QmitkSegmentationPostProcessing* m_PostProcessing; unsigned long m_RenderingManagerObserverTag; unsigned long m_SlicesRotationObserverTag1; unsigned long m_SlicesRotationObserverTag2; }; #endif /*QMITKsegmentationVIEW_H_*/ diff --git a/Modules/Bundles/org.mitk.gui.qt.simpleexample/src/internal/QmitkSimpleExampleView.h b/Modules/Bundles/org.mitk.gui.qt.simpleexample/src/internal/QmitkSimpleExampleView.h index 806924f206..638a4e96db 100644 --- a/Modules/Bundles/org.mitk.gui.qt.simpleexample/src/internal/QmitkSimpleExampleView.h +++ b/Modules/Bundles/org.mitk.gui.qt.simpleexample/src/internal/QmitkSimpleExampleView.h @@ -1,103 +1,103 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 17332 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED #define _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED #include #include #include "ui_QmitkSimpleExampleViewControls.h" #include /*! * \ingroup org_mitk_gui_qt_simpleexample_internal * * \brief QmitkSimpleExampleView * * Document your class here. * * \sa QmitkFunctionality */ -class QmitkSimpleExampleView : public QObject, public QmitkFunctionality +class QmitkSimpleExampleView : public QmitkFunctionality { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkSimpleExampleView(); virtual ~QmitkSimpleExampleView(); virtual void CreateQtPartControl(QWidget *parent); /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// \brief Called when the functionality is activated virtual void Activated(); virtual void Deactivated(); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: /*! qt slot for event processing from a qt widget defining the stereo mode of widget 4 */ void stereoSelectionChanged(int id); /*! initialize the transversal, sagittal, coronal and temporal slider according to the image dimensions */ void initNavigators(); /*! generate a movie as *.avi from the active render window */ void generateMovie(); /*! return the renderwindow of which the movie shall be created, what depends on the toggled button */ QmitkRenderWindow* GetMovieRenderWindow(); void OnRenderWindow1Clicked(); void OnRenderWindow2Clicked(); void OnRenderWindow3Clicked(); void OnRenderWindow4Clicked(); void OnTakeHighResolutionScreenshot(); ///< takes screenshot of the 3D window in 4x resolution of the render window void OnTakeScreenshot(); ///< takes screenshot of the selected render window protected: Ui::QmitkSimpleExampleViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; void TakeScreenshot(vtkRenderer* renderer, unsigned int magnificationFactor, QString fileName); ///< writes a screenshot in JPEG or PNG format to the file fileName bool m_NavigatorsInitialized; }; #endif // _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.simplemeasurement/src/internal/QmitkSimpleMeasurement.h b/Modules/Bundles/org.mitk.gui.qt.simplemeasurement/src/internal/QmitkSimpleMeasurement.h index f922dfa351..bdb6df1bb3 100644 --- a/Modules/Bundles/org.mitk.gui.qt.simplemeasurement/src/internal/QmitkSimpleMeasurement.h +++ b/Modules/Bundles/org.mitk.gui.qt.simplemeasurement/src/internal/QmitkSimpleMeasurement.h @@ -1,96 +1,96 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-03-21 14:46:24 +0100 (Sat, 21 Mar 2009) $ Version: $Revision: 15412 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #if !defined(QMITK_MEASUREMENT_H__INCLUDED) #define QMITK_MEASUREMENT_H__INCLUDED //#include "QmitkFunctionality.h" #include #include #include #include #include #include "ui_QmitkSimpleMeasurementControls.h" class QmitkStdMultiWidget; //!mm //class QmitkSimpleMeasurementControls; //! /*! \brief SimpleMeasurement Allows to measure distances, angles, etc. \sa QmitkFunctionality \ingroup org_mitk_gui_qt_simplemeasurement_internal */ -class QmitkSimpleMeasurement : public QObject, public QmitkFunctionality +class QmitkSimpleMeasurement : public QmitkFunctionality { Q_OBJECT public: virtual ~QmitkSimpleMeasurement(); virtual void Activated(); virtual void Deactivated(); virtual bool IsExclusiveFunctionality() const; /// /// Called when the selection in the workbench changed /// virtual void OnSelectionChanged(std::vector nodes); virtual void NodeRemoved(const mitk::DataNode* node); protected: // Pseudo Ctor void CreateQtPartControl(QWidget* parent); protected slots: void AddDistanceSimpleMeasurement(); void AddAngleSimpleMeasurement(); void AddPathSimpleMeasurement(); protected: /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkSimpleMeasurementControls * m_Controls; /* * Interactor for performing the simplemeasurements. */ mitk::WeakPointer m_PointSetInteractor; /* * Interactor for performing the simplemeasurements. */ mitk::WeakPointer m_SelectedPointSetNode; /* * Node representing the PointSet last created. It is used to delete empty point sets. */ std::vector m_CreatedPointSetNodes; }; #endif // !defined(QMITK_MEASUREMENT_H__INCLUDED) diff --git a/Modules/Bundles/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h b/Modules/Bundles/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h index 846578debc..ff85b1b4b6 100644 --- a/Modules/Bundles/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h @@ -1,117 +1,117 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision$ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QmitkUGVisualizationView_h #define QmitkUGVisualizationView_h #include #include #include "ui_QmitkUGVisualizationViewControls.h" class QWidgetAction; class QmitkBoolPropertyWidget; namespace mitk { class PropertyObserver; } /*! \brief QmitkUGVisualizationView \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation. \sa QmitkFunctionality \ingroup Functionalities */ -class QmitkUGVisualizationView : public QObject, public QmitkFunctionality +class QmitkUGVisualizationView : public QmitkFunctionality { // this is needed for all Qt objects that should have a Qt meta-object // (everything that derives from QObject and wants to have signal/slots) Q_OBJECT public: static const std::string VIEW_ID; QmitkUGVisualizationView(); virtual ~QmitkUGVisualizationView(); virtual void CreateQtPartControl(QWidget *parent); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected slots: void UpdateRenderWindow(); void ShowTFGeneratorWidget(bool show); void ShowScalarOpacityWidget(bool show); void ShowColorWidget(bool show); void ShowGradientOpacityWidget(bool show); protected: /// \brief called by QmitkFunctionality when DataManager's selection has changed virtual void OnSelectionChanged( std::vector nodes ); void CreateConnections(); private: friend class UGVisVolumeObserver; void UpdateGUI(); void UpdateEnablement(); Ui::QmitkUGVisualizationViewControls m_Controls; QmitkStdMultiWidget* m_MultiWidget; QWidgetAction* m_Outline2DAction; QmitkBoolPropertyWidget* m_Outline2DWidget; QAction* m_LODAction; QWidgetAction* m_ScalarVisibilityAction; QmitkBoolPropertyWidget* m_ScalarVisibilityWidget; int m_FirstVolumeRepId; QHash m_MapRepComboToEnumId; bool m_VolumeMode; bool m_ShowTFGeneratorWidget; bool m_ShowScalarOpacityWidget; bool m_ShowColorWidget; bool m_ShowGradientOpacityWidget; QAction* m_ShowTFGeneratorAction; QAction* m_ShowScalarOpacityAction; QAction* m_ShowColorAction; QAction* m_ShowGradientOpacityAction; mitk::PropertyObserver* m_VolumeModeObserver; }; #endif // _QMITKUGVISUALIZATIONVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.viewinitialization/src/internal/QmitkViewInitializationView.h b/Modules/Bundles/org.mitk.gui.qt.viewinitialization/src/internal/QmitkViewInitializationView.h index 50f6ebdacc..bb82bc17ca 100644 --- a/Modules/Bundles/org.mitk.gui.qt.viewinitialization/src/internal/QmitkViewInitializationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.viewinitialization/src/internal/QmitkViewInitializationView.h @@ -1,93 +1,93 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date: 2009-05-28 17:19:30 +0200 (Do, 28 Mai 2009) $ Version: $Revision: 17495 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED #define _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED #include #include #include "vtkRenderWindow.h" #include "ui_QmitkViewInitializationViewControls.h" /*! * \ingroup org_mitk_gui_qt_viewinitialization_internal * * \brief QmitkViewInitializationView * * Document your class here. * * \sa QmitkFunctionality */ -class QmitkViewInitializationView : public QObject, public QmitkFunctionality +class QmitkViewInitializationView : public QmitkFunctionality { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkViewInitializationView(); virtual ~QmitkViewInitializationView(); virtual void CreateQtPartControl(QWidget *parent); /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// \brief Called when the functionality is activated virtual void Activated(); virtual void Deactivated(); virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); virtual void StdMultiWidgetNotAvailable(); protected: vtkRenderWindow* GetSelectedRenderWindow(); void InitRenderWindowSelector(); void UpdateRendererList(); protected slots: virtual void OnApply(); virtual void OnResetAll(); protected: Ui::QmitkViewInitializationViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; unsigned long m_CommandTag; }; #endif // _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED diff --git a/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h b/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h index 7e048b7ea9..cd011c3c27 100755 --- a/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h +++ b/Modules/Bundles/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h @@ -1,87 +1,87 @@ /*========================================================================= Program: Medical Imaging & Interaction Toolkit Language: C++ Date: $Date$ Version: $Revision: 15646 $ Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef QMITKVOLUMEVISUALIZATIONVIEW_H_ #define QMITKVOLUMEVISUALIZATIONVIEW_H_ #include #include #include #include #include #include "mitkDataStorage.h" #include #include #include #include "ui_QmitkVolumeVisualizationViewControls.h" /** * \ingroup org_mitk_gui_qt_volumevisualization_internal */ -class QmitkVolumeVisualizationView : public QObject, public QmitkFunctionality +class QmitkVolumeVisualizationView : public QmitkFunctionality { Q_OBJECT public: void SetFocus(); QmitkVolumeVisualizationView(); virtual ~QmitkVolumeVisualizationView(); virtual void CreateQtPartControl(QWidget *parent); /// /// Invoked when the DataManager selection changed /// virtual void OnSelectionChanged( std::vector nodes ); protected slots: void OnMitkInternalPreset( int mode ); void OnEnableRendering( bool state ); void OnEnableLOD( bool state ); void OnRenderMode( int mode ); protected: /// /// A selection listener for datatreenode events /// berry::ISelectionListener::Pointer m_SelectionListener; Ui::QmitkVolumeVisualizationViewControls* m_Controls; private: mitk::WeakPointer m_SelectedNode; void UpdateInterface(); }; #endif /*QMITKVOLUMEVISUALIZATIONVIEW_H_*/