diff --git a/Examples/BlueBerryExampleLauncher/BlueBerryExampleLauncherDialog.h b/Examples/BlueBerryExampleLauncher/BlueBerryExampleLauncherDialog.h index 0910fde0ab..c7049cbaf2 100644 --- a/Examples/BlueBerryExampleLauncher/BlueBerryExampleLauncherDialog.h +++ b/Examples/BlueBerryExampleLauncher/BlueBerryExampleLauncherDialog.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BLUEBERRYEXAMPLELAUNCHERDIALOG_H #define BLUEBERRYEXAMPLELAUNCHERDIALOG_H #include #include #include namespace Ui { class BlueBerryExampleLauncherDialog; } class BlueBerryExampleLauncherDialog : public QDialog { Q_OBJECT public: explicit BlueBerryExampleLauncherDialog(QWidget *parent = nullptr); - ~BlueBerryExampleLauncherDialog(); + ~BlueBerryExampleLauncherDialog() override; QString getDemoConfiguration(); private: Q_SLOT void configurationSelected(); Q_SLOT void dialogCanceled(); Q_SLOT void selectionChanged(int row); private: Ui::BlueBerryExampleLauncherDialog *ui; QStringList provisioningFiles; QList descriptions; QEventLoop eventLoop; }; #endif // BLUEBERRYEXAMPLELAUNCHERDIALOG_H diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h index 7cb2cd2cbe..fabd39b137 100644 --- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h +++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h @@ -1,51 +1,51 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkExampleDataStructureReaderService_h #define __mitkExampleDataStructureReaderService_h #include "mitkCommon.h" #include "mitkExampleDataStructure.h" #include #include #include namespace mitk { /** \brief The reader service for the MITK example data type */ class ExampleDataStructureReaderService : public mitk::AbstractFileReader { public: typedef mitk::ExampleDataStructure OutputType; ExampleDataStructureReaderService(const ExampleDataStructureReaderService &other); ExampleDataStructureReaderService(); - virtual ~ExampleDataStructureReaderService(); + ~ExampleDataStructureReaderService() override; using AbstractFileReader::Read; - virtual std::vector> Read() override; + std::vector> Read() override; private: ExampleDataStructureReaderService *Clone() const override; us::ServiceRegistration m_ServiceReg; }; } // namespace MITK #endif // __mitkExampleDataStructureReaderService_h diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h index 1e30ee8908..3c6e5c4bed 100644 --- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h +++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkExampleDataStructureSerializer_h_included #define mitkExampleDataStructureSerializer_h_included #include "mitkBaseDataSerializer.h" namespace mitk { /** \brief Serializes mitk::ExampleDataStructure for mitk::SceneIO */ class ExampleDataStructureSerializer : public BaseDataSerializer { public: mitkClassMacro(ExampleDataStructureSerializer, BaseDataSerializer); - itkFactorylessNewMacro(Self) itkCloneMacro(Self) virtual std::string Serialize() override; + itkFactorylessNewMacro(Self) itkCloneMacro(Self) std::string Serialize() override; protected: ExampleDataStructureSerializer(); - virtual ~ExampleDataStructureSerializer(); + ~ExampleDataStructureSerializer() override; }; } // namespace #endif diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h index 6d8e60a0c1..1a071de0d7 100644 --- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h +++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkExampleDataStructureWriterService_h #define __mitkExampleDataStructureWriterService_h #include #include namespace mitk { /** * Writes example data strucutres to a file * @ingroup Process */ class ExampleDataStructureWriterService : public mitk::AbstractFileWriter { public: typedef mitk::ExampleDataStructure InputType; ExampleDataStructureWriterService(); - virtual ~ExampleDataStructureWriterService(); + ~ExampleDataStructureWriterService() override; using AbstractFileWriter::Write; - virtual void Write() override; + void Write() override; protected: ExampleDataStructureWriterService(const ExampleDataStructureWriterService &other); - virtual mitk::ExampleDataStructureWriterService *Clone() const override; + mitk::ExampleDataStructureWriterService *Clone() const override; }; } // end of namespace mitk #endif //__mitkExampleDataStructureWriterService_h diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h index c890388f96..bd6ae8a54b 100644 --- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h +++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKEXAMPLEIOMIMETYPES_H #define MITKEXAMPLEIOMIMETYPES_H #include "mitkCustomMimeType.h" #include namespace mitk { class ExampleIOMimeTypes { public: // Deriving your own MimeType will probably be overkill in most situations. class ExampleDataStructureMimeType : public CustomMimeType { public: ExampleDataStructureMimeType(); - virtual bool AppliesTo(const std::string &path) const override; - virtual ExampleDataStructureMimeType *Clone() const override; + bool AppliesTo(const std::string &path) const override; + ExampleDataStructureMimeType *Clone() const override; }; static ExampleDataStructureMimeType EXAMPLE_MIMETYPE(); static std::string EXAMPLE_MIMETYPE_NAME(); // Simpler method of creating a new MimeType static CustomMimeType EXAMPLE_TWO_MIMETYPE(); static std::string EXAMPLE_TWO_MIMETYPE_NAME(); // Get all example Mime Types static std::vector Get(); private: // purposely not implemented ExampleIOMimeTypes(); ExampleIOMimeTypes(const ExampleIOMimeTypes &); }; } #endif // MITKEXAMPLEIOMIMETYPES_H diff --git a/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h b/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h index 6c244a5bf8..241b7fe560 100644 --- a/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h +++ b/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h @@ -1,87 +1,87 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _MITK_ExampleDataStructure_H #define _MITK_ExampleDataStructure_H #include #include "mitkBaseData.h" namespace mitk { /** * \brief Example Data Structure * * This class is an example of deriving your own data structure based on mitk::BaseData . */ class MITKNEWMODULE_EXPORT ExampleDataStructure : public BaseData { public: // virtual methods that need to be implemented - virtual void UpdateOutputInformation() override; - virtual void SetRequestedRegionToLargestPossibleRegion() override; - virtual bool RequestedRegionIsOutsideOfTheBufferedRegion() override; - virtual bool VerifyRequestedRegion() override; - virtual void SetRequestedRegion(const itk::DataObject *) override; + void UpdateOutputInformation() override; + void SetRequestedRegionToLargestPossibleRegion() override; + bool RequestedRegionIsOutsideOfTheBufferedRegion() override; + bool VerifyRequestedRegion() override; + void SetRequestedRegion(const itk::DataObject *) override; // Macros mitkClassMacro(ExampleDataStructure, BaseData); itkFactorylessNewMacro(Self) itkCloneMacro(Self) ////////////////// Interface /////////////////// // Get macros itkGetMacro(Data, std::string); itkGetConstMacro(Data, std::string); // Set macros itkSetMacro(Data, std::string); /** * \brief Append a string to the data string * * Takes a string that is appended to the data string. * * \param input string to be appended */ void AppendAString(const std::string input); protected: ExampleDataStructure(); - virtual ~ExampleDataStructure(); + ~ExampleDataStructure() override; // this string is the data stored in this example data structure std::string m_Data; private: }; /** * \brief Returns true if the example data structures are considered equal. * * They are considered equal if their string is equal */ MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide, mitk::ExampleDataStructure *rightHandSide, mitk::ScalarType eps, bool verbose); } // namespace mitk #endif /* _MITK_ExampleDataStructure_H */ diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/DicomView.h b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/DicomView.h index d5ad403cd6..8703148819 100644 --- a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/DicomView.h +++ b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/DicomView.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef DICOMVIEW_H_ #define DICOMVIEW_H_ #include #include #include "ui_QmitkDicomViewControls.h" /** * \brief A view class suited for the DicomPerspective within the custom viewer plug-in. * * This view class contributes dicom import functionality to the DicomPerspective. * The view controls are provided within CreatePartControl() by the QmitkDicomExternalDataWidget * class. A DicomView instance is part of the DicomPerspective for Dicom import functionality. */ // //! [DicomViewDecl] class DicomView : public QmitkAbstractView // //! [DicomViewDecl] { Q_OBJECT public: /** * String based view identifier. */ static const std::string VIEW_ID; /** * Standard constructor. */ DicomView(); /** * Standard destructor. */ - virtual ~DicomView(); + ~DicomView() override; /** * Creates the view control widgets provided by the QmitkDicomExternalDataWidget class. * Widgets associated with unused functionality are being removed and DICOM import and data * storage transfer funcionality being connected to the appropriate slots. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; protected Q_SLOTS: /** * Loads the DICOM series specified by the given string parameter and adds the resulting data * node to the data storage. Subsequently switches to the ViewerPerspective for further * data examination. */ void AddDataNodeFromDICOM(QHash eventProperties); protected: void SetFocus() override; Ui::QmitkDicomViewControls m_Controls; QWidget *m_Parent; }; #endif /*DICOMVIEW_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h index 951561c53d..7770aca353 100644 --- a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h +++ b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h @@ -1,147 +1,147 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SimpleRenderWindowView_H_ #define SimpleRenderWindowView_H_ #include #include #include class QmitkRenderWindow; class AbstractRenderWindowViewPrivate; /** * \brief A view class suited for the ViewerPerspective within the custom viewer plug-in. * * This view class contributes data node rendering functionality to the ViewerPerspective. * Being a subclass of QmitkAbstractView, this class yields access to the data storage and * thus is interconnected with the mitk::QmitkDataManagerView present in the same perspective. * As a subclass of mitk::IRenderWindowPart, this class provides an instance of QmitkRenderWindow. * A SimpleRenderWindowView instance is part of the ViewerPerspective for data visualization. */ // //! [SimpleRenderWindowViewDeclaration] class SimpleRenderWindowView : public QmitkAbstractView, public mitk::IRenderWindowPart // //! [SimpleRenderWindowViewDeclaration] { Q_OBJECT public: /** * Standard constructor. */ SimpleRenderWindowView(); - ~SimpleRenderWindowView(); + ~SimpleRenderWindowView() override; /** * String based view identifier. */ static const std::string VIEW_ID; berryObjectMacro(SimpleRenderWindowView); // ------------------- mitk::IRenderWindowPart ---------------------- /** * \see mitk::IRenderWindowPart::GetActiveQmitkRenderWindow() */ QmitkRenderWindow *GetActiveQmitkRenderWindow() const override; /** * \see mitk::IRenderWindowPart::GetRenderWindows() */ QHash GetRenderWindows() const; /** * \see mitk::IRenderWindowPart::GetQmitkRenderWindows() */ QHash GetQmitkRenderWindows() const override; /** * \see mitk::IRenderWindowPart::GetRenderWindow(QString) */ QmitkRenderWindow *GetRenderWindow(const QString &id) const; /** * \see mitk::IRenderWindowPart::GetQmitkRenderWindow(QString) */ QmitkRenderWindow *GetQmitkRenderWindow(const QString &id) const override; /** * \see mitk::IRenderWindowPart::GetSelectionPosition() */ mitk::Point3D GetSelectedPosition(const QString &id = QString()) const override; /** * \see mitk::IRenderWindowPart::SetSelectedPosition() */ void SetSelectedPosition(const mitk::Point3D &pos, const QString &id = QString()) override; /** * \see mitk::IRenderWindowPart::EnableDecorations() */ void EnableDecorations(bool enable, const QStringList &decorations = QStringList()) override; /** * \see mitk::IRenderWindowPart::IsDecorationEnabled() */ bool IsDecorationEnabled(const QString &decoration) const override; /** * \see mitk::IRenderWindowPart::GetDecorations() */ QStringList GetDecorations() const override; /** * \see mitk::QmitkAbstractRenderEditor::GetRenderingManager() */ mitk::IRenderingManager *GetRenderingManager() const override; /** * \see mitk::QmitkAbstractRenderEditor::RequestUpdate() */ void RequestUpdate( mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) override; /** * \see mitk::QmitkAbstractRenderEditor::ForceImmediateUpdate() */ void ForceImmediateUpdate(mitk::RenderingManager::RequestType) override; /** * \see mitk::QmitkAbstractRenderEditor::GetTimeNavigationController() */ mitk::SliceNavigationController *GetTimeNavigationController() const override; protected: void SetFocus() override; /** * Creates the QmitkRenderWindow whose renderer is being connected to the view's data storage. */ void CreateQtPartControl(QWidget *parent) override; private: /** * The view's render window. */ QmitkRenderWindow *m_RenderWindow; QScopedPointer d; }; #endif /*SimpleRenderWindowView_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewer.h b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewer.h index 27b3df183b..b43f3f3898 100644 --- a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewer.h +++ b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewer.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CUSTOMVIEWER_H_ #define CUSTOMVIEWER_H_ #include /// Qt #include #include class CustomViewerWorkbenchAdvisor; /** Documentation * \ingroup org_mitk_example_gui_customviewer * * \brief A blueberry application class as an entry point for the custom viewer plug-in. * * This class acts as an entry point application class for the dedicated custom viewer plug-in. */ class CustomViewer : public QObject, public berry::IApplication { Q_OBJECT Q_INTERFACES(berry::IApplication) public: /** Standard constructor.*/ CustomViewer(); /** Standard destructor.*/ - ~CustomViewer(); + ~CustomViewer() override; /** Starts the application.*/ QVariant Start(berry::IApplicationContext *context) override; /** Exits the application.*/ void Stop() override; }; #endif /*CUSTOMVIEWER_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchAdvisor.h b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchAdvisor.h index 013e92feed..c3b08a162b 100644 --- a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchAdvisor.h +++ b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchAdvisor.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include /** * \brief A WorkbenchAdvisor class for the custom viewer plug-in. * * This WorkbenchAdvisor class for the custom viewer plug-in adds and sets a Qt-Stylesheet * file to the berry::QtStyleManager during the initialization phase for customization purpose. */ // //! [WorkbenchAdvisorDecl] class CustomViewerWorkbenchAdvisor : public berry::QtWorkbenchAdvisor // //! [WorkbenchAdvisorDecl] { public: /** * Holds the ID-String of the initial window perspective. */ static const QString DEFAULT_PERSPECTIVE_ID; berry::WorkbenchWindowAdvisor *CreateWorkbenchWindowAdvisor(berry::IWorkbenchWindowConfigurer::Pointer) override; - ~CustomViewerWorkbenchAdvisor(); + ~CustomViewerWorkbenchAdvisor() override; /** * Gets the style manager (berry::IQtStyleManager), adds and initializes a Qt-Stylesheet-File (.qss). */ void Initialize(berry::IWorkbenchConfigurer::Pointer) override; /** * Returns the ID-String of the initial window perspective. */ QString GetInitialWindowPerspectiveId() override; }; diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchWindowAdvisor.h b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchWindowAdvisor.h index d4dd43f49c..6ef83e81a2 100644 --- a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchWindowAdvisor.h +++ b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/CustomViewerWorkbenchWindowAdvisor.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CUSTOMVIEWERWORKBENCHWINDOWADVISOR_H_ #define CUSTOMVIEWERWORKBENCHWINDOWADVISOR_H_ #include #include #include /** * \brief A WorkbenchWindowAdvisor class for the custom viewer plug-in. * * This class suits the custom viewer plug-in. Menu bar, tool bar and status bar are made invisible, * and the window title for the custom viewer is being set. The workbench window is being customized, * i.e. a perspectives tab-bar is arranged according to the PageComposite. The PageComposite is then * laid out according to perspective related contents by the WindowConfigurer. * * @see{ CustomViewerWorkbenchWindowAdvisor::PreWindowOpen(), CustomViewerWorkbenchWindowAdvisor::CreateWindowContents() * } */ // //! [CustomViewerWorkbenchWindowAdvisorClassDeclaration] class CustomViewerWorkbenchWindowAdvisor : public QObject, public berry::WorkbenchWindowAdvisor // //! [CustomViewerWorkbenchWindowAdvisorClassDeclaration] { Q_OBJECT public: /** * Standard constructor. */ CustomViewerWorkbenchWindowAdvisor(berry::IWorkbenchWindowConfigurer::Pointer configurer); /** * Standard destructor. */ - ~CustomViewerWorkbenchWindowAdvisor(); + ~CustomViewerWorkbenchWindowAdvisor() override; /** * Customizes the workbench window, i.e. arrange a perspectives tab-bar according to the * PageComposite. The PageComposite is given to the WindowConfigurer for perspective related layout. */ void CreateWindowContents(berry::Shell::Pointer shell) override; /** * For arbitrary actions after the window has been created but not yet opened. */ void PostWindowCreate() override; /** * Menu bar, tool bar and status bar are made invisible, and the window title is being set. */ void PreWindowOpen() override; private Q_SLOTS: /** * Allows for runtime stylesheet update. */ void UpdateStyle(); void OpenFile(); }; #endif /*CUSTOMVIEWERWORKBENCHWINDOWADVISOR_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/QtPerspectiveSwitcherTabBar.h b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/QtPerspectiveSwitcherTabBar.h index a59f0b41b0..31dcb5c445 100644 --- a/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/QtPerspectiveSwitcherTabBar.h +++ b/Examples/Plugins/org.mitk.example.gui.customviewer/src/internal/QtPerspectiveSwitcherTabBar.h @@ -1,74 +1,74 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QTPERSPECTIVESWITCHERTABBAR_H_ #define QTPERSPECTIVESWITCHERTABBAR_H_ #include #include #include #include /** * \brief A QTabBar providing perspective bar functionality in BlueBerry applications. * * This subclass of QTabBar acts as a perspective bar in BlueBerry applications. Providing * perspective switching functionality in a tab-bar like outfit, this class serves as an * alternative to the ToolBar based berry::QtPerspectiveSwitcher class. */ // //! [PerspectiveSwitcherDeclaration] class QtPerspectiveSwitcherTabBar : public QTabBar // //! [PerspectiveSwitcherDeclaration] { Q_OBJECT public: /** * Constructor. */ QtPerspectiveSwitcherTabBar(berry::IWorkbenchWindow::Pointer window); /** * Standard destructor. */ - ~QtPerspectiveSwitcherTabBar(); + ~QtPerspectiveSwitcherTabBar() override; private Q_SLOTS: /** * Implements perspective switching. */ void SwitchPerspective(); private: berry::IWorkbenchWindow::Pointer window; QScopedPointer perspListener; QHash perspIdToActionMap; /** * Neccessary to prevent initial tab switching. */ bool tabChanged; /** * Listener for perspective changes. Neccessary for consistent tab activation. */ friend struct QtPerspectiveSwitcherTabBarListener; }; #endif /* QTPERSPECTIVESWITCHERTABBAR_H_ */ diff --git a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h index 8561660bbf..cb34bab28b 100644 --- a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h +++ b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/IChangeText.h @@ -1,35 +1,35 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ICHANGETEXT_H_ #define ICHANGETEXT_H_ #include #include "org_mitk_example_gui_extensionpointdefinition_Export.h" struct org_mitk_example_gui_extensionpointdefinition_EXPORT IChangeText : public virtual berry::Object { berryObjectMacro(IChangeText) - virtual ~IChangeText(); + ~IChangeText() override; virtual QString ChangeText(const QString &s) = 0; }; Q_DECLARE_INTERFACE(IChangeText, "org.mitk.example.IChangeText") #endif /*ICHANGETEXT_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextDescriptor.h b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextDescriptor.h index 8da823c251..d9e72c74b3 100644 --- a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextDescriptor.h +++ b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextDescriptor.h @@ -1,90 +1,90 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CHANGETEXTDESCRIPTOR_H_ #define CHANGETEXTDESCRIPTOR_H_ #include #include #include "IChangeText.h" class ChangeTextDescriptor : public berry::Object { public: berryObjectMacro(ChangeTextDescriptor); /** * Initialize the "ChangeText" Descriptor with the given extension point. * * @param changeTextExtensionPoint * element, that refers to a extension point (type, id, name, class) */ ChangeTextDescriptor(berry::IConfigurationElement::Pointer changeTextExtensionPoint); /** * Default destructor */ - ~ChangeTextDescriptor(); + ~ChangeTextDescriptor() override; /** * Creates an instance of "ChangeText" defined in the descriptor. * * @return change text */ IChangeText::Pointer CreateChangeText(); /** * Returns the description of this "ChangeText". * * @return the description */ QString GetDescription() const; /** * Returns the id of this "ChangeText". * * @return the id */ QString GetID() const; /** * Returns the name of this "ChangeText". * * @return the name */ QString GetName() const; /** * Equals this class with the given parameter. * * @param object * the object for the equation * @return true, if the objects are equal :: false, if they differ in any way */ bool operator==(const Object *object) const override; private: // IConfigurationElements are used to access xml files (here: plugin.xml) berry::IConfigurationElement::Pointer m_ChangeTextExtensionPoint; IChangeText::Pointer m_ChangeText; QString m_Id; QString m_Name; QString m_Description; }; #endif /*CHANGETEXTDESCRIPTOR_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextRegistry.h b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextRegistry.h index 0c559450af..0512ad7d1f 100644 --- a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextRegistry.h +++ b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ChangeTextRegistry.h @@ -1,51 +1,51 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CHANGETEXTREGISTRY_H_ #define CHANGETEXTREGISTRY_H_ #include #include "ChangeTextDescriptor.h" class ChangeTextRegistry : public berry::Object { public: ChangeTextRegistry(); - ~ChangeTextRegistry(); + ~ChangeTextRegistry() override; /** * Return an "change text" descriptor with the given extension id. If no "change text" exists, * with the id return null. * * @param id * the id to search for * @return the descriptor or null */ ChangeTextDescriptor::Pointer Find(const QString &id) const; /** * Return a list of "change texts" defined in the registry. * * @return the change texts. */ QList GetChangeTexts() const; private: QHash m_ListRegisteredTexts; }; #endif /*CHANGETEXTREGISTRY_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ExtensionPointDefinition.h b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ExtensionPointDefinition.h index a78cd79ed2..28ed987b8b 100644 --- a/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ExtensionPointDefinition.h +++ b/Examples/Plugins/org.mitk.example.gui.extensionpointdefinition/src/internal/ExtensionPointDefinition.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef EXTENSIONPOINTDEFINITION_H_ #define EXTENSIONPOINTDEFINITION_H_ // berry includes #include // Qt includes #include #include class MinimalWorkbenchAdvisor; class ExtensionPointDefinition : public QObject, public berry::IApplication { Q_OBJECT Q_INTERFACES(berry::IApplication) public: ExtensionPointDefinition(); - ~ExtensionPointDefinition(); + ~ExtensionPointDefinition() override; QVariant Start(berry::IApplicationContext *context) override; void Stop() override; private: QScopedPointer wbAdvisor; }; #endif /*EXTENSIONPOINTDEFINITION_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h index c0892ec003..69448c0287 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED #define _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED #include #include namespace Ui { class QmitkColourImageProcessingViewControls; } class QmitkColourImageProcessingView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; QmitkColourImageProcessingView(); private: - virtual void SetFocus() override; + void SetFocus() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList &nodes) override; private slots: void OnConvertToRGBAImage(); void OnConvertImageMaskColorToRGBAImage(); void OnCombineRGBA(); void OnChangeColor(); private: Ui::QmitkColourImageProcessingViewControls *m_Controls; mitk::WeakPointer m_SelectedNode; mitk::WeakPointer m_SelectedNode2; int m_Color[3]; }; #endif // _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h index dfe417a3e6..6edd09866f 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h @@ -1,88 +1,88 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_ISOSURFACE_H__INCLUDED #define QMITK_ISOSURFACE_H__INCLUDED #include "QmitkAbstractView.h" #include "mitkColorSequenceRainbow.h" #include "mitkDataStorage.h" #include "ui_QmitkIsoSurfaceControls.h" /** * \brief IsoSurface * * \sa QmitkAbstractView */ class QmitkIsoSurface : public QmitkAbstractView { Q_OBJECT public: QmitkIsoSurface(QObject *parent = nullptr, const char *name = nullptr); - virtual ~QmitkIsoSurface(); + ~QmitkIsoSurface() override; private: /** * \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /** * \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); private slots: /* * just an example slot for the example TreeNodeSelector widget */ void ImageSelected(const mitk::DataNode *item); /** * \brief method for creating a surface object */ void CreateSurface(); private: /** * 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 // QMITK_ISOSURFACE_H__INCLUDED diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h index 1b4772a56a..1eb108f1ad 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h @@ -1,109 +1,109 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED #define _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED #include #include #include "ui_QmitkSimpleExampleViewControls.h" class QmitkStepperAdapter; class vtkRenderer; /** * \brief QmitkSimpleExampleView * * \sa QmitkAbstractView */ class QmitkSimpleExampleView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { // 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(); - ~QmitkSimpleExampleView(); + ~QmitkSimpleExampleView() override; private: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override; - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override; + void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override; /** * return the renderwindow of which the movie shall be created, what depends on the combo box */ QmitkRenderWindow *GetSelectedRenderWindow() const; /// writes a screenshot in JPEG or PNG format to the file fileName void TakeScreenshot(vtkRenderer *renderer, unsigned int magnificationFactor, QString fileName, QString filter = ""); /// returns path to the ffmpeg lib if configured in preferences QString GetFFmpegPath() const; private slots: /** * Qt slot for reacting on the selected render window from the combo box */ void RenderWindowSelected(const QString &id); /** * qt slot for event processing from a qt widget defining the stereo mode of a render window */ void StereoSelectionChanged(int id); /** * initialize the slice and temporal sliders according to the image dimensions */ void InitNavigators(); /** * generate a movie as *.avi from the active render window */ void GenerateMovie(); /// takes screenshot of the 3D window in 4x resolution of the render window void OnTakeHighResolutionScreenshot(); /// takes screenshot of the selected render window void OnTakeScreenshot(); private: Ui::QmitkSimpleExampleViewControls *m_Controls; bool m_NavigatorsInitialized; QScopedPointer m_SliceStepper; QScopedPointer m_TimeStepper; QScopedPointer m_MovieStepper; QWidget *m_Parent; QString m_PNGExtension = "PNG File (*.png)"; QString m_JPGExtension = "JPEG File (*.jpg)"; }; #endif // _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h index 3aa5fd2463..dbd96e4ccb 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h @@ -1,99 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSIMPELEMEASUREMENT_H #define MITKSIMPELEMEASUREMENT_H #include #include #include "mitkDataNode.h" #include "mitkPointSetDataInteractor.h" #include "ui_QmitkSimpleMeasurementControls.h" namespace Ui { class QmitkSimpleMeasurementControls; } /** * \brief SimpleMeasurement * Allows to measure distances, angles, etc. * * \sa QmitkAbstractView */ class QmitkSimpleMeasurement : public QmitkAbstractView, public mitk::IZombieViewPart { Q_OBJECT public: QmitkSimpleMeasurement(); - virtual ~QmitkSimpleMeasurement(); + ~QmitkSimpleMeasurement() override; private: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList &nodes) override; - virtual void NodeRemoved(const mitk::DataNode *node) override; + void NodeRemoved(const mitk::DataNode *node) override; - virtual void Activated() override; - virtual void Deactivated() override; - virtual void Visible() override; - virtual void Hidden() override; + void Activated() override; + void Deactivated() override; + void Visible() override; + void Hidden() override; - virtual void ActivatedZombieView(berry::SmartPointer zombieView) override; + void ActivatedZombieView(berry::SmartPointer zombieView) override; private slots: void AddDistanceSimpleMeasurement(); void AddAngleSimpleMeasurement(); void AddPathSimpleMeasurement(); void Finished(); private: /** * controls containing sliders for scrolling through the slices */ Ui::QmitkSimpleMeasurementControls *m_Controls; /* * Interactor for performing the simplemeasurements. */ mitk::PointSetDataInteractor::Pointer m_PointSetInteractor; /* * Interactor for performing the simplemeasurements. */ mitk::DataNode::Pointer m_SelectedPointSetNode; /** @brief * Node representing the PointSets which were created by this application. */ std::vector m_CreatedDistances; std::vector m_CreatedAngles; std::vector m_CreatedPaths; void StartEditingMeasurement(); void EndEditingMeasurement(); void UpdateMeasurementList(); }; #endif // QMITK_MEASUREMENT_H__INCLUDED diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h index b5cb66a60c..3a625551ed 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QMITK_SurfaceUtilities_H__INCLUDED) #define QMITK_SurfaceUtilities_H__INCLUDED #include #include #include "ui_QmitkSurfaceUtilitiesControls.h" /*! \brief TODO */ class QmitkSurfaceUtilities : public QmitkAbstractView { // 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; QmitkSurfaceUtilities(); - ~QmitkSurfaceUtilities(); + ~QmitkSurfaceUtilities() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; void SetFocus() override; protected slots: void OnEulerToMatrixClicked(); void OnMoveToOriginClicked(); void OnApplyTransformClicked(); void OnComputeCoG(); void OnGenerateTargetPoints(); void OnPerturbeSurface(); void OnAddOutliers(); protected: // methods to read in / write from / to GUI itk::Matrix ReadInFromGUI_RotationMatrix(); itk::Vector ReadInFromGUI_TranslationVector(); void WriteToGUI_RotationMatrix(itk::Matrix r); void WriteToGUI_TranslationVector(itk::Vector t); /** @brief Converts euler angles (in degrees!) to a rotation matrix. */ itk::Matrix ConvertEulerAnglesToRotationMatrix(double alpha, double beta, double gamma); Ui::QmitkSurfaceUtilitiesControls m_Controls; }; #endif // !defined(QMITK_ISOSURFACE_H__INCLUDED) diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h index 1f1e4eacaf..95668dffd2 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h @@ -1,117 +1,117 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSurfaceModifier_H_HEADER_INCLUDED_ #define MITKSurfaceModifier_H_HEADER_INCLUDED_ // mitk headers #include #include #include // itk headers #include #include #include class vtkPolyDataNormals; namespace mitk { /** Documentation * @brief This class offer some methods to modify a surface. */ class SurfaceModifier : public itk::Object { public: mitkClassMacroItkParent(SurfaceModifier, itk::Object); itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** @brief Adds gaussian noise to a surface (means to all vertexes). * @param maxNoiseVectorLenght Limits the length of the noise vector of each vertex. Value -1 disables the limit. * Default value is also -1. */ bool PerturbeSurface(mitk::Surface::Pointer surface, double varianceX, double varianceY, double varianceZ, double maxNoiseVectorLenght = -1); /** @brief Adds gaussian noise to a part of the vertexes of the surface. @param outlierChance The chance to perturbe a vertex. Consequently this is also approximately the percentage of vertexes that will be perturbed. */ bool AddOutlierToSurface( mitk::Surface::Pointer surface, double varianceX, double varianceY, double varianceZ, double outlierChance); /** @brief Transforms a surface with a given transform. This method transforms the vertexes which means manipulating * the vtkPolyData. * In some cases this is needed, for example if you want to use the transformed polydata later on. */ bool TransformSurface(mitk::Surface::Pointer surface, itk::Matrix TransformationR, itk::Vector TransformationT); /** @brief Transforms a surface with a given transform (uses the center of gravity of the surface as origin). This * method transforms the vertexes which means manipulating the vtkPolyData. * In some cases this is needed, for example if you want to use the transformed polydata later on. * @param OverallTransformationR Returns the overall transformation in world coordinates. (rotation) * @param OverallTransformationT Returns the overall transformation in world coordinates. (translation) */ bool TransformSurfaceCoGCoordinates(mitk::Surface::Pointer surface, itk::Matrix TransformationR, itk::Vector TransformationT, itk::Matrix &OverallTransformationR, itk::Vector &OverallTransformationT); /** @brief Moves the surface (respectively its center of gravity) to the center of the coordinate system. */ bool MoveSurfaceToCenter(mitk::Surface::Pointer surface); /** @brief Moves the surface (respectively its center of gravity) to the center of the coordinate system. @param TransformR (return value) returns the rotation of the transform which was applied to the surface to move it to the origin. @param TransformT (return value) returns the translation of the transform which was applied to the surface to move it to the origin. */ bool MoveSurfaceToCenter(mitk::Surface::Pointer surface, itk::Matrix &TransformR, itk::Vector &TransformT); /** @brief Creates a deep copy (clone) of the given surface and returns it */ mitk::Surface::Pointer DeepCopy(mitk::Surface::Pointer surface); protected: SurfaceModifier(); - ~SurfaceModifier(); + ~SurfaceModifier() override; mitk::Point3D PerturbePoint( mitk::Point3D point, double varianceX, double varianceY, double varianceZ); /** @brief perturbes a point along the given axis */ mitk::Point3D PerturbePointAlongAxis(mitk::Point3D point, mitk::Vector3D axis, double variance); mitk::Point3D TransformPoint(mitk::Point3D point, itk::Matrix TransformationR, itk::Vector TransformationT); mitk::Point3D GetCenterOfGravity(mitk::Surface::Pointer surface); itk::Statistics::MersenneTwisterRandomVariateGenerator::Pointer m_myRandomGenerator; }; } // namespace mitk #endif /* MITKSurfaceModifier_H_HEADER_INCLUDED_ */ diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h index aedeff88e5..75d03bc595 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_ #define MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_ // mitk headers #include "mitkSurface.h" #include namespace mitk { /** Documentation * @brief This filter converts the input surface into a point set. The output point set contains every point exactly * one time * (no dublicated points like in the stl-format). */ class SurfaceToPointSetFilter : public mitk::PointSetSource { public: mitkClassMacro(SurfaceToPointSetFilter, mitk::PointSetSource); itkFactorylessNewMacro(Self) itkCloneMacro(Self) using Superclass::SetInput; void SetInput(mitk::Surface::Pointer m_InputSurface); std::string GetErrorMessage(); protected: SurfaceToPointSetFilter(); - ~SurfaceToPointSetFilter(); + ~SurfaceToPointSetFilter() override; /** @brief method generating the output of this filter. Called in the updated process of the pipeline. */ - virtual void GenerateData() override; + void GenerateData() override; //############### members ######################## mitk::Surface::Pointer m_InputSurface; std::string m_ErrorMessage; }; } // namespace mitk #endif /* MITKSURFACETODISTANCEIMAGEFILTER_H_HEADER_INCLUDED_ */ diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h index 84904df251..249338fec4 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h @@ -1,99 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTARGETPOINTSCALCULATOR_H_HEADER_INCLUDED_ #define MITKTARGETPOINTSCALCULATOR_H_HEADER_INCLUDED_ // mitk headers #include "mitkCommon.h" #include "mitkImage.h" #include "mitkPointSet.h" #include "mitkSurface.h" // itk headers #include "itkObject.h" #include namespace mitk { /** * @brief This class offers methods to automatically calculate target points inside a (closed) surface. */ class TargetPointsCalculator : public itk::Object { public: mitkClassMacroItkParent(TargetPointsCalculator, itk::Object); itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** @brief identifier for target point calculation method */ enum TargetPointCalculationMethod { EvenlyDistributedTargetPoints, OneTargetPointInCenterOfGravity }; /** @brief Sets the method for the target point calculation. Default value is EvenlyDistributedTargetPoints. */ void SetTargetPointCalculationMethod(TargetPointCalculationMethod method); /** @brief Sets the inter point distance (in mm), which is a parameter for the evenly distributed target points. * This parameter is only used if the method is set to EvenlyDistributedTargetPoints. Default value is 20. */ void SetInterPointDistance(int d); /** @brief Sets the input surface. This parameter must be set before calculation is started. */ void SetInput(mitk::Surface::Pointer input); /** @brief Calculates the target points. * @return Returns true if calculation was successful. False if not, you can get an error message in this case. */ bool DoCalculate(); /** @return Returns the calculated target points. Returns null if no target points are calculated yet. */ mitk::PointSet::Pointer GetOutput(); /** @return Returns the last error message. Returns an empty string if there was no error yet. */ std::string GetErrorMessage(); protected: TargetPointsCalculator(); - ~TargetPointsCalculator(); + ~TargetPointsCalculator() override; typedef itk::Image ImageType; int m_InterPointDistance; mitk::PointSet::Pointer m_Output; mitk::Surface::Pointer m_Input; std::string m_ErrorMessage; TargetPointCalculationMethod m_Method; mitk::Image::Pointer CreateBinaryImage(); mitk::PointSet::Pointer CreateTargetPoints(mitk::Image::Pointer binaryImage); bool isInside(ImageType::Pointer currentImageAsitkImage, mitk::Point3D p); int RoundUpToGatter(int i, int gatter); int RoundUpToCentimeters(int i); mitk::PointSet::Pointer CreateTargetPointInCOG(mitk::Surface::Pointer surface); }; } #endif diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h index a4d794d0d1..7b91565ad9 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED #define _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED #include #include #include "vtkRenderWindow.h" #include #include "ui_QmitkViewInitializationViewControls.h" class QmitkViewInitializationView : public QmitkAbstractView, public mitk::ILifecycleAwarePart { // 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(); + ~QmitkViewInitializationView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); private: vtkRenderWindow *GetSelectedRenderWindow(); void InitRenderWindowSelector(); void UpdateRendererList(); - virtual void Activated() override; - virtual void Deactivated() override; - virtual void Visible() override; - virtual void Hidden() override; + void Activated() override; + void Deactivated() override; + void Visible() override; + void Hidden() override; private slots: virtual void OnApply(); virtual void OnResetAll(); private: Ui::QmitkViewInitializationViewControls *m_Controls; unsigned long m_CommandTag; }; #endif // _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h index add33b14f8..6fde9556b7 100644 --- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h +++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h @@ -1,89 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKVOLUMETRYVIEW_H_INCLUDED #define _QMITKVOLUMETRYVIEW_H_INCLUDED #include #include "mitkWeakPointer.h" namespace Ui { class QmitkVolumetryViewControls; } /** * \brief QmitkVolumetryView * * \sa QmitkAbstractView */ class QmitkVolumetryView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; QmitkVolumetryView(); private: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList &nodes) override; mitk::Image *GetImage() const; mitk::DataNode *GetOverlayNode() const; void CreateOverlayChild(); void UpdateSliderLabel(); void UpdateSlider(); const mitk::DataNode *GetImageNode() const; private slots: void OnCalculateVolume(); void OnTimeSeriesButtonClicked(); void OnThresholdSliderChanged(int value); void OnSaveCsvButtonClicked(); private: Ui::QmitkVolumetryViewControls *m_Controls; /// store weak pointer of the DataNode mitk::WeakPointer m_SelectedDataNode; mitk::DataNode::Pointer m_OverlayNode; mitk::DataStorage::Pointer m_DataStorage; QWidget *m_ParentWidget; }; #endif // _QMITKVOLUMETRYVIEW_H_INCLUDED diff --git a/Examples/Plugins/org.mitk.example.gui.minimalapplication/src/internal/MinimalApplication.h b/Examples/Plugins/org.mitk.example.gui.minimalapplication/src/internal/MinimalApplication.h index 199c9aa06d..05ac1e37c1 100644 --- a/Examples/Plugins/org.mitk.example.gui.minimalapplication/src/internal/MinimalApplication.h +++ b/Examples/Plugins/org.mitk.example.gui.minimalapplication/src/internal/MinimalApplication.h @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MINIMALAPPLICATION_H_ #define MINIMALAPPLICATION_H_ // Berry #include // Qt #include #include class MinimalWorkbenchAdvisor; class MinimalApplication : public QObject, public berry::IApplication { Q_OBJECT Q_INTERFACES(berry::IApplication) public: MinimalApplication(); - ~MinimalApplication(); + ~MinimalApplication() override; QVariant Start(berry::IApplicationContext *context) override; void Stop() override; }; #endif /*MINIMALAPPLICATION_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView1.h b/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView1.h index b2323296c8..3bc6d9b92f 100644 --- a/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView1.h +++ b/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView1.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef EMPTYVIEW1_H_ #define EMPTYVIEW1_H_ // berry includes #include // ui includes #include "ui_EmptyView1Controls.h" class EmptyView1 : public berry::QtViewPart { Q_OBJECT public: static const std::string VIEW_ID; EmptyView1(); - virtual ~EmptyView1(); + ~EmptyView1() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; protected: void SetFocus() override; private: Ui::EmptyView1Controls m_Controls; QWidget *m_Parent; }; #endif /*EMPTYVIEW1_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView2.h b/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView2.h index b8055cf583..6999460075 100644 --- a/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView2.h +++ b/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/EmptyView2.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef EMPTYVIEW2_H_ #define EMPTYVIEW2_H_ // berry includes #include // ui includes #include "ui_EmptyView2Controls.h" class EmptyView2 : public berry::QtViewPart { Q_OBJECT public: static const std::string VIEW_ID; EmptyView2(); - virtual ~EmptyView2(); + ~EmptyView2() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; protected: void SetFocus() override; private: Ui::EmptyView2Controls m_Controls; QWidget *m_Parent; }; #endif /*EMPTYVIEW2_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/MultiplePerspectives.h b/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/MultiplePerspectives.h index 92bbac9291..f756dfed14 100644 --- a/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/MultiplePerspectives.h +++ b/Examples/Plugins/org.mitk.example.gui.multipleperspectives/src/internal/MultiplePerspectives.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MULTIPLEPERSPECTIVES_H_ #define MULTIPLEPERSPECTIVES_H_ // berry includes #include // Qt includes #include #include class MultiplePerspectivesWorkbenchAdvisor; class MultiplePerspectives : public QObject, public berry::IApplication { Q_OBJECT Q_INTERFACES(berry::IApplication) public: MultiplePerspectives(); - ~MultiplePerspectives(); + ~MultiplePerspectives() override; QVariant Start(berry::IApplicationContext *context) override; void Stop() override; private: QScopedPointer wbAdvisor; }; #endif /*MULTIPLEPERSPECTIVES_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h b/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h index a848a8325b..493da96dc9 100644 --- a/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h +++ b/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkVideoPlayer_h #define QmitkVideoPlayer_h #include #include #include class QmitkVideoBackground; class QmitkOpenCVVideoControls; /** * \brief Allows to play videos with OpenCV */ class QmitkVideoPlayer : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: QmitkVideoPlayer(); - virtual ~QmitkVideoPlayer(); + ~QmitkVideoPlayer() override; private: void CreateQtPartControl(QWidget *parent) override; void SetFocus() override; void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override; void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override; mitk::OpenCVVideoSource::Pointer m_VideoSource; QmitkVideoBackground *m_VideoBackground; QmitkOpenCVVideoControls *m_OpenCVVideoControls; }; #endif // QmitkVideoPlayer_h diff --git a/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/PCAExample.h b/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/PCAExample.h index 0f43ea36e6..8ad430bcae 100644 --- a/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/PCAExample.h +++ b/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/PCAExample.h @@ -1,84 +1,84 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PCAExample_h #define PCAExample_h #include #include #include "ui_PCAExampleControls.h" /** \brief PCAExample \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class PCAExample : public QmitkAbstractView { // 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; PCAExample(); - virtual ~PCAExample(); + ~PCAExample() override; protected slots: /// \brief Called when the user clicks the GUI button void BtnPerfomPCAClicked(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList &nodes) override; /** Performs a PCA on a (3D) point set. * @param input Point set to work on. * @param[out] eigenVectors Eigenvectors as computed by the PCA. Returns an empty vector * if PCA failed or did not run before. * @param[out] eigenValues Eigenvalues as computed by the PCA. Returns an empty vector * if PCA failed or did not run before. The ID inside the vector * corresponds to the ID inside the eigenvector vector. For a 3D * pointset 3 eigenvalues and -vectors will be computed. * @param[out] pointsMean Returns the mean/center of the pointset */ bool comutePCA(mitk::PointSet::Pointer input, std::vector &eigenVectors, std::vector &eigenValues, mitk::Vector3D &pointsMean); /** Adds mitk data nodes for all eigenvectors to visualize them in the multi widget. */ void showEigenvectors(std::vector eigenVectors, std::vector eigenValues, mitk::Vector3D center); mitk::DataNode::Pointer m_Axis1Node; mitk::DataNode::Pointer m_Axis2Node; mitk::DataNode::Pointer m_Axis3Node; Ui::PCAExampleControls m_Controls; }; #endif // PCAExample_h diff --git a/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/org_mitk_example_gui_pcaexample_Activator.h b/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/org_mitk_example_gui_pcaexample_Activator.h index d80ec16e35..358f834e1d 100644 --- a/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/org_mitk_example_gui_pcaexample_Activator.h +++ b/Examples/Plugins/org.mitk.example.gui.pcaexample/src/internal/org_mitk_example_gui_pcaexample_Activator.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_example_gui_pcaexample_Activator_h #define org_mitk_example_gui_pcaexample_Activator_h #include namespace mitk { class org_mitk_example_gui_pcaexample_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_example_gui_pcaexample") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext *context); - void stop(ctkPluginContext *context); + void start(ctkPluginContext *context) override; + void stop(ctkPluginContext *context) override; }; // org_mitk_example_gui_pcaexample_Activator } #endif // org_mitk_example_gui_pcaexample_Activator_h diff --git a/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h b/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h index 79a10edd62..56fd98906f 100644 --- a/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h +++ b/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h @@ -1,93 +1,93 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkRegionGrowingView_h #define QmitkRegionGrowingView_h #include #include #include "ui_QmitkRegionGrowingViewControls.h" //! [includes] #include "mitkIRenderWindowPartListener.h" #include "mitkPointSet.h" #include class QmitkPointListWidget; //! [includes] /** \brief QmitkRegionGrowingView \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkRegionGrowingView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { // 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(); protected slots: /// \brief Called when the user clicks the GUI button void DoImageProcessing(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList &nodes) override; //! [render-window-part-listener] void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override; void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override; //! [render-window-part-listener] Ui::QmitkRegionGrowingViewControls m_Controls; private: //! [itkimageprocessing] /** \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 void ItkImageProcessing(itk::Image *itkImage, mitk::BaseGeometry *imageGeometry); //! [itkimageprocessing] //! [members] /// \brief This is the actual seed point data object mitk::PointSet::Pointer m_PointSet; QmitkPointListWidget *m_PointListWidget; //! [members] }; #endif // QmitkRegionGrowingView_h diff --git a/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/ListenerViewMitk.h b/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/ListenerViewMitk.h index 5cf326e698..c50bfc91ee 100644 --- a/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/ListenerViewMitk.h +++ b/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/ListenerViewMitk.h @@ -1,83 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef LISTENERVIEWMITK_H_ #define LISTENERVIEWMITK_H_ // QMitk includes #include // berry includes #include // Qt includes #include // ui includes #include "ui_ListenerViewMitkControls.h" /** * \ingroup org_mitk_example_gui_selectionservicemitk * * \brief This BlueBerry view is part of the BlueBerry example * "Selection service MITK". It creates two radio buttons that listen * for selection events of the Qlistwidget (SelectionProvider) and * change the radio button state accordingly. * * @see SelectionViewMitk * */ class ListenerViewMitk : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; ListenerViewMitk(); protected: void CreateQtPartControl(QWidget *parent) override; void SetFocus() override; //! [MITK Selection Listener method] /** @brief Reimplemention of method from QmitkAbstractView that implements the selection listener functionality. * @param part The workbench part responsible for the selection change. * @param nodes A list of selected nodes. * * @see QmitkAbstractView * */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList &nodes) override; //! [MITK Selection Listener method] private Q_SLOTS: /** @brief Simple slot function that changes the selection of the radio buttons according to the passed string. * @param selectStr QString that contains the name of the slected list element * */ void ToggleRadioMethod(QString selectStr); private: Ui::ListenerViewMitkControls m_Controls; QWidget *m_Parent; }; #endif /*LISTENERVIEWMITK_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/SelectionViewMitk.h b/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/SelectionViewMitk.h index ac0b0c5d44..3544dd69bb 100644 --- a/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/SelectionViewMitk.h +++ b/Examples/Plugins/org.mitk.example.gui.selectionservicemitk.views/src/internal/SelectionViewMitk.h @@ -1,61 +1,61 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SELECTIONVIEWMITK_H_ #define SELECTIONVIEWMITK_H_ // QMitk includes #include // ui includes #include "ui_SelectionViewMitkControls.h" /** * \ingroup org_mitk_example_gui_selectionservicemitk * * \brief This BlueBerry view is part of the BlueBerry example * "Selection service MITK". It creates a QListWidget that provides * the selection events for the selection listener. The selection * provider is MITK-based. */ class SelectionViewMitk : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; SelectionViewMitk(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; void SetFocus() override; private: //! [MITK Selection Provider method] /** @brief Reimplementation of method from QmitkAbstractView that returns the data node * selection model for the selection listener. */ QItemSelectionModel *GetDataNodeSelectionModel() const override; //! [MITK Selection Provider method] Ui::SelectionViewMitkControls m_Controls; QWidget *m_Parent; }; #endif /*SELECTIONVIEWMITK_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.selectionservicemitk/src/internal/SelectionServiceMitk.h b/Examples/Plugins/org.mitk.example.gui.selectionservicemitk/src/internal/SelectionServiceMitk.h index afde0fa7a5..3812ad27d6 100644 --- a/Examples/Plugins/org.mitk.example.gui.selectionservicemitk/src/internal/SelectionServiceMitk.h +++ b/Examples/Plugins/org.mitk.example.gui.selectionservicemitk/src/internal/SelectionServiceMitk.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SELECTIONSERVICEMITK_H_ #define SELECTIONSERVICEMITK_H_ // berry includes #include // Qt includes #include #include class SelectionServiceMITKWorkbenchAdvisor; /** * \ingroup org_mitk_example_gui_selectionservicemitk * * \brief This BlueBerry plugin is part of the BlueBerry example * "Selection service MITK". It creates a perspective with two views * that demonstrate the MitkDataNode-based selection service. */ class SelectionServiceMitk : public QObject, public berry::IApplication { Q_OBJECT Q_INTERFACES(berry::IApplication) public: SelectionServiceMitk(); - ~SelectionServiceMitk(); + ~SelectionServiceMitk() override; QVariant Start(berry::IApplicationContext *context) override; void Stop() override; private: QScopedPointer wbAdvisor; }; #endif /*SELECTIONSERVICEMITK_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/ListenerView.h b/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/ListenerView.h index 3c1980d0c2..fdcdfa9a66 100644 --- a/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/ListenerView.h +++ b/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/ListenerView.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef LISTENERVIEW_H_ #define LISTENERVIEW_H_ // berry includes #include #include #include // ui includes #include "ui_ListenerViewControls.h" /** * \ingroup org_mitk_example_gui_selectionserviceqt * * \brief This BlueBerry view is part of the BlueBerry example * "Selection service QT". It creates two radio buttons that listen * for selection events of the Qlistwidget (SelectionProvider) and * change the radio button state accordingly. * * @see SelectionView */ class ListenerView : public berry::QtViewPart { Q_OBJECT public: static const std::string VIEW_ID; ListenerView(); - ~ListenerView(); + ~ListenerView() override; protected: void CreateQtPartControl(QWidget *parent) override; void SetFocus() override; private Q_SLOTS: /** * @brief Simple slot function that changes the selection of the radio buttons according to the passed string. * @param selectStr QString that contains the name of the slected list element */ void ToggleRadioMethod(QString selectStr); private: //! [Qt Selection Listener method and pointer] /** * @brief Method of berry::ISelectionListener that implements the selection listener functionality. * @param sourcepart The workbench part responsible for the selection change. * @param selection This parameter holds the current selection. * * @see ISelectionListener */ void SelectionChanged(const berry::IWorkbenchPart::Pointer &sourcepart, const berry::ISelection::ConstPointer &selection); /** @brief this pointer holds the selection listener */ QScopedPointer m_SelectionListener; //! [Qt Selection Listener method and pointer] friend struct berry::SelectionChangedAdapter; Ui::ListenerViewControls m_Controls; QWidget *m_Parent; }; #endif /*LISTENERVIEW_H_*/ diff --git a/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/SelectionServiceQt.h b/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/SelectionServiceQt.h index b8d55f9c09..17f3fe0b5f 100644 --- a/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/SelectionServiceQt.h +++ b/Examples/Plugins/org.mitk.example.gui.selectionserviceqt/src/internal/SelectionServiceQt.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SELECTIONSERVICEQT_H_ #define SELECTIONSERVICEQT_H_ // berry includes #include // Qt includes #include #include class SelectionServiceQtWorkbenchAdvisor; /** * \ingroup org_mitk_example_gui_selectionserviceqt * * \brief This BlueBerry plugin is part of the BlueBerry example * "Selection service QT". It creates a perspective with two views * that demonstrate the Qt-based selection service. */ class SelectionServiceQt : public QObject, public berry::IApplication { Q_OBJECT Q_INTERFACES(berry::IApplication) public: SelectionServiceQt(); - ~SelectionServiceQt(); + ~SelectionServiceQt() override; QVariant Start(berry::IApplicationContext *context) override; void Stop() override; private: QScopedPointer wbAdvisor; }; #endif /*SELECTIONSERVICEQT_H_*/ diff --git a/Examples/Tutorial/Step6/Step6.h b/Examples/Tutorial/Step6/Step6.h index 8645f04fb9..cbae33fe51 100644 --- a/Examples/Tutorial/Step6/Step6.h +++ b/Examples/Tutorial/Step6/Step6.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef STEP6_H #define STEP6_H //#include #include #include #include #include #include #ifndef DOXYGEN_IGNORE class QLineEdit; class Step6 : public QWidget { Q_OBJECT public: Step6(int argc, char *argv[], QWidget *parent = nullptr); - ~Step6() {} + ~Step6() override override override override override override {} virtual void Initialize(); virtual int GetThresholdMin(); virtual int GetThresholdMax(); protected: void Load(int argc, char *argv[]); virtual void SetupWidgets(); template friend void RegionGrowing(itk::Image *itkImage, Step6 *step6); mitk::StandaloneDataStorage::Pointer m_DataStorage; mitk::Image::Pointer m_FirstImage; mitk::PointSet::Pointer m_Seeds; mitk::Image::Pointer m_ResultImage; mitk::DataNode::Pointer m_ResultNode; QLineEdit *m_LineEditThresholdMin; QLineEdit *m_LineEditThresholdMax; protected slots: virtual void StartRegionGrowing(); }; #endif // DOXYGEN_IGNORE #endif // STEP6_H /** \example Step6.h */ diff --git a/Examples/Tutorial/Step7/Step7.h b/Examples/Tutorial/Step7/Step7.h index 9615dc3652..63e38c3112 100644 --- a/Examples/Tutorial/Step7/Step7.h +++ b/Examples/Tutorial/Step7/Step7.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef STEP7_H #define STEP7_H #include "Step6.h" #ifndef DOXYGEN_IGNORE class Step7 : public Step6 { Q_OBJECT public: Step7(int argc, char *argv[], QWidget *parent = nullptr); - ~Step7() {} + ~Step7() override override override {} protected slots: - virtual void StartRegionGrowing() override; + void StartRegionGrowing() override; }; #endif // DOXYGEN_IGNORE #endif // STEP7_H /** \example Step7.h */ diff --git a/Examples/Tutorial/Step8/Step8.h b/Examples/Tutorial/Step8/Step8.h index 07f6e450e6..a2e434f85e 100644 --- a/Examples/Tutorial/Step8/Step8.h +++ b/Examples/Tutorial/Step8/Step8.h @@ -1,39 +1,39 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef STEP8_H #define STEP8_H #include "Step6.h" #ifndef DOXYGEN_IGNORE class Step8 : public Step6 { Q_OBJECT public: Step8(int argc, char *argv[], QWidget *parent = nullptr); - ~Step8() {} + ~Step8() override override {} protected: - virtual void SetupWidgets() override; + void SetupWidgets() override; protected slots: }; #endif // DOXYGEN_IGNORE #endif // STEP8_H /** \example Step8.h */ diff --git a/Modules/Classification/CLMiniApps/CLGlobalImageFeatures.cpp b/Modules/Classification/CLMiniApps/CLGlobalImageFeatures.cpp index 10836892b4..1ed5a6c78d 100644 --- a/Modules/Classification/CLMiniApps/CLGlobalImageFeatures.cpp +++ b/Modules/Classification/CLMiniApps/CLGlobalImageFeatures.cpp @@ -1,762 +1,762 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkCLPolyToNrrd_cpp #define mitkCLPolyToNrrd_cpp #include "time.h" #include #include #include #include "mitkCommandLineParser.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "itkNearestNeighborInterpolateImageFunction.h" #include "itkResampleImageFilter.h" #include #include #include "QmitkRegisterClasses.h" #include "QmitkRenderWindow.h" #include "vtkRenderLargeImage.h" #include "vtkPNGWriter.h" typedef itk::Image< double, 3 > FloatImageType; typedef itk::Image< unsigned short, 3 > MaskImageType; template class punct_facet : public std::numpunct { public: punct_facet(charT sep) : m_Sep(sep) { } protected: - charT do_decimal_point() const { return m_Sep; } + charT do_decimal_point() const override { return m_Sep; } private: charT m_Sep; }; template void ResampleImage(itk::Image* itkImage, float resolution, mitk::Image::Pointer& newImage) { typedef itk::Image ImageType; typedef itk::ResampleImageFilter ResampleFilterType; typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); auto spacing = itkImage->GetSpacing(); auto size = itkImage->GetLargestPossibleRegion().GetSize(); for (unsigned int i = 0; i < VImageDimension; ++i) { size[i] = size[i] / (1.0*resolution)*(1.0*spacing[i])+1.0; } spacing.Fill(resolution); resampler->SetInput(itkImage); resampler->SetSize(size); resampler->SetOutputSpacing(spacing); resampler->SetOutputOrigin(itkImage->GetOrigin()); resampler->SetOutputDirection(itkImage->GetDirection()); resampler->Update(); newImage->InitializeByItk(resampler->GetOutput()); mitk::GrabItkImageMemory(resampler->GetOutput(), newImage); } template static void CreateNoNaNMask(itk::Image* itkValue, mitk::Image::Pointer mask, mitk::Image::Pointer& newMask) { typedef itk::Image< TPixel, VImageDimension> LFloatImageType; typedef itk::Image< unsigned short, VImageDimension> LMaskImageType; typename LMaskImageType::Pointer itkMask = LMaskImageType::New(); mitk::CastToItkImage(mask, itkMask); typedef itk::ImageDuplicator< LMaskImageType > DuplicatorType; typename DuplicatorType::Pointer duplicator = DuplicatorType::New(); duplicator->SetInputImage(itkMask); duplicator->Update(); auto tmpMask = duplicator->GetOutput(); itk::ImageRegionIterator mask1Iter(itkMask, itkMask->GetLargestPossibleRegion()); itk::ImageRegionIterator mask2Iter(tmpMask, tmpMask->GetLargestPossibleRegion()); itk::ImageRegionIterator imageIter(itkValue, itkValue->GetLargestPossibleRegion()); while (!mask1Iter.IsAtEnd()) { mask2Iter.Set(0); if (mask1Iter.Value() > 0) { // Is not NaN if (imageIter.Value() == imageIter.Value()) { mask2Iter.Set(1); } } ++mask1Iter; ++mask2Iter; ++imageIter; } newMask->InitializeByItk(tmpMask); mitk::GrabItkImageMemory(tmpMask, newMask); } template static void ResampleMask(itk::Image* itkMoving, mitk::Image::Pointer ref, mitk::Image::Pointer& newMask) { typedef itk::Image< TPixel, VImageDimension> LMaskImageType; typedef itk::NearestNeighborInterpolateImageFunction< LMaskImageType> NearestNeighborInterpolateImageFunctionType; typedef itk::ResampleImageFilter ResampleFilterType; typename NearestNeighborInterpolateImageFunctionType::Pointer nn_interpolator = NearestNeighborInterpolateImageFunctionType::New(); typename LMaskImageType::Pointer itkRef = LMaskImageType::New(); mitk::CastToItkImage(ref, itkRef); typename ResampleFilterType::Pointer resampler = ResampleFilterType::New(); resampler->SetInput(itkMoving); resampler->SetReferenceImage(itkRef); resampler->UseReferenceImageOn(); resampler->SetInterpolator(nn_interpolator); resampler->Update(); newMask->InitializeByItk(resampler->GetOutput()); mitk::GrabItkImageMemory(resampler->GetOutput(), newMask); } static void ExtractSlicesFromImages(mitk::Image::Pointer image, mitk::Image::Pointer mask, mitk::Image::Pointer maskNoNaN, mitk::Image::Pointer morphMask, int direction, std::vector &imageVector, std::vector &maskVector, std::vector &maskNoNaNVector, std::vector &morphMaskVector) { typedef itk::Image< double, 2 > FloatImage2DType; typedef itk::Image< unsigned short, 2 > MaskImage2DType; FloatImageType::Pointer itkFloat = FloatImageType::New(); MaskImageType::Pointer itkMask = MaskImageType::New(); MaskImageType::Pointer itkMaskNoNaN = MaskImageType::New(); MaskImageType::Pointer itkMorphMask = MaskImageType::New(); mitk::CastToItkImage(mask, itkMask); mitk::CastToItkImage(maskNoNaN, itkMaskNoNaN); mitk::CastToItkImage(image, itkFloat); mitk::CastToItkImage(morphMask, itkMorphMask); int idxA, idxB, idxC; switch (direction) { case 0: idxA = 1; idxB = 2; idxC = 0; break; case 1: idxA = 0; idxB = 2; idxC = 1; break; case 2: idxA = 0; idxB = 1; idxC = 2; break; default: idxA = 1; idxB = 2; idxC = 0; break; } auto imageSize = image->GetLargestPossibleRegion().GetSize(); FloatImageType::IndexType index3D; FloatImage2DType::IndexType index2D; FloatImage2DType::SpacingType spacing2D; spacing2D[0] = itkFloat->GetSpacing()[idxA]; spacing2D[1] = itkFloat->GetSpacing()[idxB]; for (unsigned int i = 0; i < imageSize[idxC]; ++i) { FloatImage2DType::RegionType region; FloatImage2DType::IndexType start; FloatImage2DType::SizeType size; start[0] = 0; start[1] = 0; size[0] = imageSize[idxA]; size[1] = imageSize[idxB]; region.SetIndex(start); region.SetSize(size); FloatImage2DType::Pointer image2D = FloatImage2DType::New(); image2D->SetRegions(region); image2D->Allocate(); MaskImage2DType::Pointer mask2D = MaskImage2DType::New(); mask2D->SetRegions(region); mask2D->Allocate(); MaskImage2DType::Pointer masnNoNaN2D = MaskImage2DType::New(); masnNoNaN2D->SetRegions(region); masnNoNaN2D->Allocate(); MaskImage2DType::Pointer morph2D = MaskImage2DType::New(); morph2D->SetRegions(region); morph2D->Allocate(); unsigned long voxelsInMask = 0; for (unsigned int a = 0; a < imageSize[idxA]; ++a) { for (unsigned int b = 0; b < imageSize[idxB]; ++b) { index3D[idxA] = a; index3D[idxB] = b; index3D[idxC] = i; index2D[0] = a; index2D[1] = b; image2D->SetPixel(index2D, itkFloat->GetPixel(index3D)); mask2D->SetPixel(index2D, itkMask->GetPixel(index3D)); masnNoNaN2D->SetPixel(index2D, itkMaskNoNaN->GetPixel(index3D)); morph2D->SetPixel(index2D, itkMorphMask->GetPixel(index3D)); voxelsInMask += (itkMask->GetPixel(index3D) > 0) ? 1 : 0; } } image2D->SetSpacing(spacing2D); mask2D->SetSpacing(spacing2D); masnNoNaN2D->SetSpacing(spacing2D); morph2D->SetSpacing(spacing2D); mitk::Image::Pointer tmpFloatImage = mitk::Image::New(); tmpFloatImage->InitializeByItk(image2D.GetPointer()); mitk::GrabItkImageMemory(image2D, tmpFloatImage); mitk::Image::Pointer tmpMaskImage = mitk::Image::New(); tmpMaskImage->InitializeByItk(mask2D.GetPointer()); mitk::GrabItkImageMemory(mask2D, tmpMaskImage); mitk::Image::Pointer tmpMaskNoNaNImage = mitk::Image::New(); tmpMaskNoNaNImage->InitializeByItk(masnNoNaN2D.GetPointer()); mitk::GrabItkImageMemory(masnNoNaN2D, tmpMaskNoNaNImage); mitk::Image::Pointer tmpMorphMaskImage = mitk::Image::New(); tmpMorphMaskImage->InitializeByItk(morph2D.GetPointer()); mitk::GrabItkImageMemory(morph2D, tmpMorphMaskImage); if (voxelsInMask > 0) { imageVector.push_back(tmpFloatImage); maskVector.push_back(tmpMaskImage); maskNoNaNVector.push_back(tmpMaskNoNaNImage); morphMaskVector.push_back(tmpMorphMaskImage); } } } static void SaveSliceOrImageAsPNG(mitk::Image::Pointer image, mitk::Image::Pointer mask, std::string path, int index) { // Create a Standalone Datastorage for the single purpose of saving screenshots.. mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New(); QmitkRenderWindow renderWindow; renderWindow.GetRenderer()->SetDataStorage(ds); auto nodeI = mitk::DataNode::New(); nodeI->SetData(image); auto nodeM = mitk::DataNode::New(); nodeM->SetData(mask); ds->Add(nodeI); ds->Add(nodeM); auto geo = ds->ComputeBoundingGeometry3D(ds->GetAll()); mitk::RenderingManager::GetInstance()->InitializeViews(geo); mitk::SliceNavigationController::Pointer sliceNaviController = renderWindow.GetSliceNavigationController(); unsigned int numberOfSteps = 1; if (sliceNaviController) { numberOfSteps = sliceNaviController->GetSlice()->GetSteps(); sliceNaviController->GetSlice()->SetPos(0); } renderWindow.show(); renderWindow.resize(256, 256); for (unsigned int currentStep = 0; currentStep < numberOfSteps; ++currentStep) { if (sliceNaviController) { sliceNaviController->GetSlice()->SetPos(currentStep); } renderWindow.GetRenderer()->PrepareRender(); vtkRenderWindow* renderWindow2 = renderWindow.GetVtkRenderWindow(); mitk::BaseRenderer* baserenderer = mitk::BaseRenderer::GetInstance(renderWindow2); auto vtkRender = baserenderer->GetVtkRenderer(); vtkRender->GetRenderWindow()->WaitForCompletion(); vtkRenderLargeImage* magnifier = vtkRenderLargeImage::New(); magnifier->SetInput(vtkRender); magnifier->SetMagnification(3.0); std::stringstream ss; ss << path << "_Idx-" << index << "_Step-"<> tmpImageName; auto fileWriter = vtkPNGWriter::New(); fileWriter->SetInputConnection(magnifier->GetOutputPort()); fileWriter->SetFileName(tmpImageName.c_str()); fileWriter->Write(); fileWriter->Delete(); } } int main(int argc, char* argv[]) { // Commented : Updated to a common interface, include, if possible, mask is type unsigned short, uses Quantification, Comments // Name follows standard scheme with Class Name::Feature Name // Commented 2: Updated to use automatic inclusion of list of parameters if required. mitk::GIFImageDescriptionFeatures::Pointer ipCalculator = mitk::GIFImageDescriptionFeatures::New(); // Commented 2, Tested mitk::GIFFirstOrderStatistics::Pointer firstOrderCalculator = mitk::GIFFirstOrderStatistics::New(); //Commented 2 mitk::GIFFirstOrderHistogramStatistics::Pointer firstOrderHistoCalculator = mitk::GIFFirstOrderHistogramStatistics::New(); // Commented 2, Tested mitk::GIFFirstOrderNumericStatistics::Pointer firstOrderNumericCalculator = mitk::GIFFirstOrderNumericStatistics::New(); // Commented 2, Tested mitk::GIFVolumetricStatistics::Pointer volCalculator = mitk::GIFVolumetricStatistics::New(); // Commented 2, Tested mitk::GIFVolumetricDensityStatistics::Pointer voldenCalculator = mitk::GIFVolumetricDensityStatistics::New(); // Commented 2, Tested mitk::GIFCooccurenceMatrix::Pointer coocCalculator = mitk::GIFCooccurenceMatrix::New(); // Commented 2, Will not be tested mitk::GIFCooccurenceMatrix2::Pointer cooc2Calculator = mitk::GIFCooccurenceMatrix2::New(); //Commented 2 mitk::GIFNeighbouringGreyLevelDependenceFeature::Pointer ngldCalculator = mitk::GIFNeighbouringGreyLevelDependenceFeature::New(); //Commented 2, Tested mitk::GIFGreyLevelRunLength::Pointer rlCalculator = mitk::GIFGreyLevelRunLength::New(); // Commented 2 mitk::GIFGreyLevelSizeZone::Pointer glszCalculator = mitk::GIFGreyLevelSizeZone::New(); // Commented 2, Tested mitk::GIFGreyLevelDistanceZone::Pointer gldzCalculator = mitk::GIFGreyLevelDistanceZone::New(); //Commented 2, Tested mitk::GIFLocalIntensity::Pointer lociCalculator = mitk::GIFLocalIntensity::New(); //Commented 2, Tested mitk::GIFIntensityVolumeHistogramFeatures::Pointer ivohCalculator = mitk::GIFIntensityVolumeHistogramFeatures::New(); // Commented 2 mitk::GIFNeighbourhoodGreyToneDifferenceFeatures::Pointer ngtdCalculator = mitk::GIFNeighbourhoodGreyToneDifferenceFeatures::New(); //Commented 2, Tested mitk::GIFCurvatureStatistic::Pointer curvCalculator = mitk::GIFCurvatureStatistic::New(); //Commented 2, Tested std::vector features; features.push_back(volCalculator.GetPointer()); features.push_back(voldenCalculator.GetPointer()); features.push_back(curvCalculator.GetPointer()); features.push_back(firstOrderCalculator.GetPointer()); features.push_back(firstOrderNumericCalculator.GetPointer()); features.push_back(firstOrderHistoCalculator.GetPointer()); features.push_back(ivohCalculator.GetPointer()); features.push_back(lociCalculator.GetPointer()); features.push_back(coocCalculator.GetPointer()); features.push_back(cooc2Calculator.GetPointer()); features.push_back(ngldCalculator.GetPointer()); features.push_back(rlCalculator.GetPointer()); features.push_back(glszCalculator.GetPointer()); features.push_back(gldzCalculator.GetPointer()); features.push_back(ipCalculator.GetPointer()); features.push_back(ngtdCalculator.GetPointer()); mitkCommandLineParser parser; parser.setArgumentPrefix("--", "-"); mitk::cl::GlobalImageFeaturesParameter param; param.AddParameter(parser); parser.addArgument("--","-", mitkCommandLineParser::String, "---", "---", us::Any(),true); for (auto cFeature : features) { cFeature->AddArguments(parser); } parser.addArgument("--", "-", mitkCommandLineParser::String, "---", "---", us::Any(), true); parser.addArgument("description","d",mitkCommandLineParser::String,"Text","Description that is added to the output",us::Any()); parser.addArgument("direction", "dir", mitkCommandLineParser::String, "Int", "Allows to specify the direction for Cooc and RL. 0: All directions, 1: Only single direction (Test purpose), 2,3,4... Without dimension 0,1,2... ", us::Any()); parser.addArgument("slice-wise", "slice", mitkCommandLineParser::String, "Int", "Allows to specify if the image is processed slice-wise (number giving direction) ", us::Any()); parser.addArgument("output-mode", "omode", mitkCommandLineParser::Int, "Int", "Defines if the results of an image / slice are written in a single row (0 , default) or column (1)."); // Miniapp Infos parser.setCategory("Classification Tools"); parser.setTitle("Global Image Feature calculator"); parser.setDescription("Calculates different global statistics for a given segmentation / image combination"); parser.setContributor("MBI"); std::map parsedArgs = parser.parseArguments(argc, argv); param.ParseParameter(parsedArgs); if (parsedArgs.size()==0) { return EXIT_FAILURE; } if ( parsedArgs.count("help") || parsedArgs.count("h")) { return EXIT_SUCCESS; } //bool savePNGofSlices = true; //std::string folderForPNGOfSlices = "E:\\tmp\\bonekamp\\fig\\"; std::string version = "Version: 1.22"; MITK_INFO << version; std::ofstream log; if (param.useLogfile) { log.open(param.logfilePath, std::ios::app); log << std::endl; log << version; log << "Image: " << param.imagePath; log << "Mask: " << param.maskPath; } if (param.useDecimalPoint) { std::cout.imbue(std::locale(std::cout.getloc(), new punct_facet(param.decimalPoint))); } mitk::Image::Pointer image; mitk::Image::Pointer mask; mitk::Image::Pointer tmpImage = mitk::IOUtil::Load(param.imagePath); mitk::Image::Pointer tmpMask = mitk::IOUtil::Load(param.maskPath); image = tmpImage; mask = tmpMask; mitk::Image::Pointer morphMask = mask; if (param.useMorphMask) { morphMask = mitk::IOUtil::Load(param.morphPath); } log << " Check for Dimensions -"; if ((image->GetDimension() != mask->GetDimension())) { MITK_INFO << "Dimension of image does not match. "; MITK_INFO << "Correct one image, may affect the result"; if (image->GetDimension() == 2) { mitk::Convert2Dto3DImageFilter::Pointer multiFilter2 = mitk::Convert2Dto3DImageFilter::New(); multiFilter2->SetInput(tmpImage); multiFilter2->Update(); image = multiFilter2->GetOutput(); } if (mask->GetDimension() == 2) { mitk::Convert2Dto3DImageFilter::Pointer multiFilter3 = mitk::Convert2Dto3DImageFilter::New(); multiFilter3->SetInput(tmpMask); multiFilter3->Update(); mask = multiFilter3->GetOutput(); } } int writeDirection = 0; if (parsedArgs.count("output-mode")) { writeDirection = us::any_cast(parsedArgs["output-mode"]); } log << " Check for Resolution -"; if (param.resampleToFixIsotropic) { mitk::Image::Pointer newImage = mitk::Image::New(); AccessByItk_2(image, ResampleImage, param.resampleResolution, newImage); image = newImage; } if ( ! mitk::Equal(mask->GetGeometry(0)->GetOrigin(), image->GetGeometry(0)->GetOrigin())) { MITK_INFO << "Not equal Origins"; if (param.ensureSameSpace) { MITK_INFO << "Warning!"; MITK_INFO << "The origin of the input image and the mask do not match. They are"; MITK_INFO << "now corrected. Please check to make sure that the images still match"; image->GetGeometry(0)->SetOrigin(mask->GetGeometry(0)->GetOrigin()); } else { return -1; } } log << " Resample if required -"; if (param.resampleMask) { mitk::Image::Pointer newMaskImage = mitk::Image::New(); AccessByItk_2(mask, ResampleMask, image, newMaskImage); mask = newMaskImage; } log << " Check for Equality -"; if ( ! mitk::Equal(mask->GetGeometry(0)->GetSpacing(), image->GetGeometry(0)->GetSpacing())) { MITK_INFO << "Not equal Spacing"; if (param.ensureSameSpace) { MITK_INFO << "Warning!"; MITK_INFO << "The spacing of the mask was set to match the spacing of the input image."; MITK_INFO << "This might cause unintended spacing of the mask image"; image->GetGeometry(0)->SetSpacing(mask->GetGeometry(0)->GetSpacing()); } else { MITK_INFO << "The spacing of the mask and the input images is not equal."; MITK_INFO << "Terminating the programm. You may use the '-fi' option"; return -1; } } int direction = 0; if (parsedArgs.count("direction")) { direction = mitk::cl::splitDouble(parsedArgs["direction"].ToString(), ';')[0]; } MITK_INFO << "Start creating Mask without NaN"; mitk::Image::Pointer maskNoNaN = mitk::Image::New(); AccessByItk_2(image, CreateNoNaNMask, mask, maskNoNaN); //CreateNoNaNMask(mask, image, maskNoNaN); bool sliceWise = false; int sliceDirection = 0; unsigned int currentSlice = 0; bool imageToProcess = true; std::vector floatVector; std::vector maskVector; std::vector maskNoNaNVector; std::vector morphMaskVector; if ((parsedArgs.count("slice-wise")) && image->GetDimension() > 2) { MITK_INFO << "Enabled slice-wise"; sliceWise = true; sliceDirection = mitk::cl::splitDouble(parsedArgs["slice-wise"].ToString(), ';')[0]; MITK_INFO << sliceDirection; ExtractSlicesFromImages(image, mask, maskNoNaN, morphMask, sliceDirection, floatVector, maskVector, maskNoNaNVector, morphMaskVector); MITK_INFO << "Slice"; } log << " Configure features -"; for (auto cFeature : features) { if (param.defineGlobalMinimumIntensity) { cFeature->SetMinimumIntensity(param.globalMinimumIntensity); cFeature->SetUseMinimumIntensity(true); } if (param.defineGlobalMaximumIntensity) { cFeature->SetMaximumIntensity(param.globalMaximumIntensity); cFeature->SetUseMaximumIntensity(true); } if (param.defineGlobalNumberOfBins) { cFeature->SetBins(param.globalNumberOfBins); MITK_INFO << param.globalNumberOfBins; } cFeature->SetParameter(parsedArgs); cFeature->SetDirection(direction); cFeature->SetEncodeParameters(param.encodeParameter); } bool addDescription = parsedArgs.count("description"); mitk::cl::FeatureResultWritter writer(param.outputPath, writeDirection); if (param.useDecimalPoint) { writer.SetDecimalPoint(param.decimalPoint); } std::string description = ""; if (addDescription) { description = parsedArgs["description"].ToString(); } mitk::Image::Pointer cImage = image; mitk::Image::Pointer cMask = mask; mitk::Image::Pointer cMaskNoNaN = maskNoNaN; mitk::Image::Pointer cMorphMask = morphMask; if (param.useHeader) { writer.AddColumn("SoftwareVersion"); writer.AddColumn("Patient"); writer.AddColumn("Image"); writer.AddColumn("Segmentation"); } // Create a QTApplication and a Datastorage // This is necessary in order to save screenshots of // each image / slice. QApplication qtapplication(argc, argv); QmitkRegisterClasses(); std::vector allStats; log << " Begin Processing -"; while (imageToProcess) { if (sliceWise) { cImage = floatVector[currentSlice]; cMask = maskVector[currentSlice]; cMaskNoNaN = maskNoNaNVector[currentSlice]; cMorphMask = morphMaskVector[currentSlice]; imageToProcess = (floatVector.size()-1 > (currentSlice)) ? true : false ; } else { imageToProcess = false; } if (param.writePNGScreenshots) { SaveSliceOrImageAsPNG(cImage, cMask, param.pngScreenshotsPath, currentSlice); } if (param.writeAnalysisImage) { mitk::IOUtil::Save(cImage, param.anaylsisImagePath); } if (param.writeAnalysisMask) { mitk::IOUtil::Save(cMask, param.analysisMaskPath); } mitk::AbstractGlobalImageFeature::FeatureListType stats; for (auto cFeature : features) { log << " Calculating " << cFeature->GetFeatureClassName() << " -"; cFeature->SetMorphMask(cMorphMask); cFeature->CalculateFeaturesUsingParameters(cImage, cMask, cMaskNoNaN, stats); } for (std::size_t i = 0; i < stats.size(); ++i) { std::cout << stats[i].first << " - " << stats[i].second << std::endl; } writer.AddHeader(description, currentSlice, stats, param.useHeader, addDescription); if (true) { writer.AddSubjectInformation(MITK_REVISION); writer.AddSubjectInformation(param.imageFolder); writer.AddSubjectInformation(param.imageName); writer.AddSubjectInformation(param.maskName); } writer.AddResult(description, currentSlice, stats, param.useHeader, addDescription); allStats.push_back(stats); ++currentSlice; } log << " Process Slicewise -"; if (sliceWise) { mitk::AbstractGlobalImageFeature::FeatureListType statMean, statStd; for (std::size_t i = 0; i < allStats[0].size(); ++i) { auto cElement1 = allStats[0][i]; cElement1.first = "SliceWise Mean " + cElement1.first; cElement1.second = 0.0; auto cElement2 = allStats[0][i]; cElement2.first = "SliceWise Var. " + cElement2.first; cElement2.second = 0.0; statMean.push_back(cElement1); statStd.push_back(cElement2); } for (auto cStat : allStats) { for (std::size_t i = 0; i < cStat.size(); ++i) { statMean[i].second += cStat[i].second / (1.0*allStats.size()); } } for (auto cStat : allStats) { for (std::size_t i = 0; i < cStat.size(); ++i) { statStd[i].second += (cStat[i].second - statMean[i].second)*(cStat[i].second - statMean[i].second) / (1.0*allStats.size()); } } for (std::size_t i = 0; i < statMean.size(); ++i) { std::cout << statMean[i].first << " - " << statMean[i].second << std::endl; std::cout << statStd[i].first << " - " << statStd[i].second << std::endl; } if (true) { writer.AddSubjectInformation(MITK_REVISION); writer.AddSubjectInformation(param.imageFolder); writer.AddSubjectInformation(param.imageName); writer.AddSubjectInformation(param.maskName + " - Mean"); } writer.AddResult(description, currentSlice, statMean, param.useHeader, addDescription); if (true) { writer.AddSubjectInformation(MITK_REVISION); writer.AddSubjectInformation(param.imageFolder); writer.AddSubjectInformation(param.imageName); writer.AddSubjectInformation(param.maskName + " - Var."); } writer.AddResult(description, currentSlice, statStd, param.useHeader, addDescription); } if (param.useLogfile) { log << "Finished calculation" << std::endl; log.close(); } return 0; } #endif diff --git a/Modules/Classification/CLUtilities/include/itkLineHistogramBasedMassImageFilter.h b/Modules/Classification/CLUtilities/include/itkLineHistogramBasedMassImageFilter.h index 89dd972a8f..e95514b138 100644 --- a/Modules/Classification/CLUtilities/include/itkLineHistogramBasedMassImageFilter.h +++ b/Modules/Classification/CLUtilities/include/itkLineHistogramBasedMassImageFilter.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ITKLINEHISTOGRAMBASEDMASSIMAGEFILTER_H #define ITKLINEHISTOGRAMBASEDMASSIMAGEFILTER_H #include namespace itk { template< class TInputImageType, class TOutputImageType = TInputImageType, class TMaskImageType = itk::Image > class LineHistogramBasedMassImageFilter : public itk::ImageToImageFilter { public: typedef LineHistogramBasedMassImageFilter< TInputImageType, TOutputImageType > Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; typedef ImageToImageFilter< TInputImageType, TOutputImageType > Superclass; itkFactorylessNewMacro(Self); itkCloneMacro(Self); void SetImageMask(TMaskImageType * maskimage); void SetBinaryContour(TMaskImageType * contouriamge); private: typename TMaskImageType::Pointer m_ImageMask; typename TMaskImageType::Pointer m_BinaryContour; vnl_vector m_CenterOfMask; - void ThreadedGenerateData(const typename Superclass::OutputImageRegionType &outputRegionForThread, ThreadIdType threadId); - void BeforeThreadedGenerateData(); + void ThreadedGenerateData(const typename Superclass::OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override; + void BeforeThreadedGenerateData() override; // void GenerateOutputInformation(); vnl_vector GetCenterOfMass(const TMaskImageType * maskImage); LineHistogramBasedMassImageFilter(); - virtual ~LineHistogramBasedMassImageFilter(); + ~LineHistogramBasedMassImageFilter() override; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "../src/Features/itkLineHistogramBasedMassImageFilter.cpp" #endif #endif diff --git a/Modules/Classification/CLUtilities/include/itkLocalStatisticFilter.h b/Modules/Classification/CLUtilities/include/itkLocalStatisticFilter.h index 4ff22c4e54..3442546315 100644 --- a/Modules/Classification/CLUtilities/include/itkLocalStatisticFilter.h +++ b/Modules/Classification/CLUtilities/include/itkLocalStatisticFilter.h @@ -1,51 +1,51 @@ #ifndef itkLocalStatisticFilter_h #define itkLocalStatisticFilter_h #include "itkImageToImageFilter.h" namespace itk { template class LocalStatisticFilter : public ImageToImageFilter< TInputImageType, TOuputImageType> { public: typedef LocalStatisticFilter Self; typedef ImageToImageFilter< TInputImageType, TOuputImageType > Superclass; typedef SmartPointer< Self > Pointer; typedef typename TInputImageType::ConstPointer InputImagePointer; typedef typename TOuputImageType::Pointer OutputImagePointer; typedef typename TOuputImageType::RegionType OutputImageRegionType; itkNewMacro (Self); itkTypeMacro(LocalStatisticFilter, ImageToImageFilter); itkSetMacro(Size, int); itkGetConstMacro(Size, int); protected: LocalStatisticFilter(); - ~LocalStatisticFilter(){}; + ~LocalStatisticFilter() override{}; - virtual void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId); - virtual void BeforeThreadedGenerateData(void); + void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId) override; + void BeforeThreadedGenerateData(void) override; using itk::ProcessObject::MakeOutput; - virtual itk::ProcessObject::DataObjectPointer MakeOutput(itk::ProcessObject::DataObjectPointerArraySizeType /*idx*/) override; + itk::ProcessObject::DataObjectPointer MakeOutput(itk::ProcessObject::DataObjectPointerArraySizeType /*idx*/) override; void CreateOutputImage(InputImagePointer input, OutputImagePointer output); private: LocalStatisticFilter(const Self &); // purposely not implemented void operator=(const Self &); // purposely not implemented int m_Size; int m_Bins; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "itkLocalStatisticFilter.hxx" #endif #endif // itkLocalStatisticFilter_h diff --git a/Modules/Classification/CLUtilities/include/itkNeighborhoodFunctorImageFilter.h b/Modules/Classification/CLUtilities/include/itkNeighborhoodFunctorImageFilter.h index ceca645f52..9637f98092 100644 --- a/Modules/Classification/CLUtilities/include/itkNeighborhoodFunctorImageFilter.h +++ b/Modules/Classification/CLUtilities/include/itkNeighborhoodFunctorImageFilter.h @@ -1,140 +1,140 @@ #ifndef itkNeighborhoodFunctorImageFilter_h #define itkNeighborhoodFunctorImageFilter_h #include "itkImageToImageFilter.h" #include "itkZeroFluxNeumannBoundaryCondition.h" #include "itkConstNeighborhoodIterator.h" #include "itkImage.h" #include #include #include "itkHistogram.h" namespace itk { template class NeighborhoodFunctorImageFilter : public ImageToImageFilter< TInputImageType, TFeatureImageType> { public: typedef NeighborhoodFunctorImageFilter Self; typedef ImageToImageFilter Superclass; typedef SmartPointer< Self > Pointer; typedef SmartPointer< const Self > ConstPointer; itkNewMacro(Self); itkTypeMacro(NeighborhoodFunctorImageFilter, ImageToImageFilter); /** Extract some information from the image types. Dimensionality * of the two images is assumed to be the same. */ itkStaticConstMacro(ImageDimension, unsigned int, TFeatureImageType::ImageDimension); itkStaticConstMacro(InputImageDimension, unsigned int, TInputImageType::ImageDimension); typedef TInputImageType InputImageType; typedef typename TInputImageType::PixelType InputImagePixelType; typedef itk::Image MaskImageType; typedef typename MaskImageType::PixelType MaskImagePixelType; typedef TFeatureImageType FeatureImageType; typedef typename FeatureImageType::PixelType FeaturePixelType; typedef itk::Size SizeType; /** Typedef for generic boundary condition pointer. */ typedef ImageBoundaryCondition< InputImageType > * ImageBoundaryConditionPointerType; /** Typedef for the default boundary condition */ typedef ZeroFluxNeumannBoundaryCondition< InputImageType > DefaultBoundaryCondition; /** Superclass typedefs. */ typedef typename Superclass::OutputImageRegionType OutputImageRegionType; typedef Neighborhood< InputImagePixelType, InputImageDimension > NeighborhoodType; /** Allows a user to override the internal boundary condition. Care should be * be taken to ensure that the overriding boundary condition is a persistent * object during the time it is referenced. The overriding condition * can be of a different type than the default type as long as it is * a subclass of ImageBoundaryCondition. */ void OverrideBoundaryCondition(const ImageBoundaryConditionPointerType i) { m_BoundsCondition = i; } /** Get the boundary condition specified */ ImageBoundaryConditionPointerType GetBoundaryCondition() { return m_BoundsCondition; } void SetNeighborhoodSize(SizeType size){m_Size = size;} void SetNeighborhoodSize(unsigned int size){m_Size.Fill(size);} SizeType GetNeighborhoodSize(){return m_Size;} void SetMask(const typename MaskImageType::Pointer & ptr){m_MaskImage = ptr;} const FunctorType & GetFunctorReference() const { return m_Functor; } FunctorType & GetFunctorReference() { return m_Functor; } void SetFunctor(const FunctorType & func) { m_Functor = func; } protected: NeighborhoodFunctorImageFilter() { m_Size.Fill(0); m_MaskImage = nullptr; m_BoundsCondition = static_cast< ImageBoundaryConditionPointerType >( &m_DefaultBoundaryCondition ); this->SetNumberOfIndexedOutputs(FunctorType::OutputCount); } - ~NeighborhoodFunctorImageFilter(){} + ~NeighborhoodFunctorImageFilter() override{} - void BeforeThreadedGenerateData(); + void BeforeThreadedGenerateData() override; void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread, - ThreadIdType threadId); + ThreadIdType threadId) override; /** NeighborhoodFunctorImageFilter needs a larger input requested * region than the output requested region. As such, * NeighborhoodOperatorImageFilter needs to provide an implementation for * GenerateInputRequestedRegion() in order to inform the pipeline * execution model. * * \sa ProcessObject::GenerateInputRequestedRegion() */ void GenerateInputRequestedRegion() override; private: NeighborhoodFunctorImageFilter(const Self &); // purposely not implemented void operator=(const Self &); // purposely not implemented /** Pointer to a persistent boundary condition object used * for the image iterator. */ ImageBoundaryConditionPointerType m_BoundsCondition; /** Default boundary condition */ DefaultBoundaryCondition m_DefaultBoundaryCondition; /** Internal operator used to filter the image. */ FunctorType m_Functor; itk::Size m_Size; typename MaskImageType::Pointer m_MaskImage; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "../src/Features/itkNeighborhoodFunctorImageFilter.cpp" #endif #endif // itkFeatureImageFilter_h diff --git a/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h b/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h index e7698174e1..bcdf7ba013 100644 --- a/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h +++ b/Modules/Classification/CLVigraRandomForest/include/itkHessianMatrixEigenvalueImageFilter.h @@ -1,60 +1,60 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ITKHESSIANMATRIXEIGENVALUEIMAGEFILTER_H #define ITKHESSIANMATRIXEIGENVALUEIMAGEFILTER_H #include namespace itk { template< class TInputImageType, class TOutputImageType = TInputImageType, class TMaskImageType = itk::Image > class HessianMatrixEigenvalueImageFilter : public itk::ImageToImageFilter { public: typedef HessianMatrixEigenvalueImageFilter< TInputImageType, TOutputImageType > Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; typedef ImageToImageFilter< TInputImageType, TOutputImageType > Superclass; itkFactorylessNewMacro(Self); itkCloneMacro(Self); void SetImageMask(TMaskImageType * maskimage); itkSetMacro(Sigma,double) itkGetMacro(Sigma,double) private: typename TMaskImageType::Pointer m_ImageMask; double m_Sigma; - void GenerateData(); - void GenerateOutputInformation(); + void GenerateData() override; + void GenerateOutputInformation() override; HessianMatrixEigenvalueImageFilter(); - virtual ~HessianMatrixEigenvalueImageFilter(); + ~HessianMatrixEigenvalueImageFilter() override; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "../src/Algorithm/itkHessianMatrixEigenvalueImageFilter.cpp" #endif #endif diff --git a/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h b/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h index baf1c00be3..6a7d609c80 100644 --- a/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h +++ b/Modules/Classification/CLVigraRandomForest/include/itkStructureTensorEigenvalueImageFilter.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ITKSTRUCTURETENSOREIGENVALUEIMAGEFILTER_H #define ITKSTRUCTURETENSOREIGENVALUEIMAGEFILTER_H #include namespace itk { template< class TInputImageType, class TOutputImageType = TInputImageType, class TMaskImageType = itk::Image > class StructureTensorEigenvalueImageFilter : public itk::ImageToImageFilter { public: typedef StructureTensorEigenvalueImageFilter< TInputImageType, TOutputImageType > Self; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; typedef ImageToImageFilter< TInputImageType, TOutputImageType > Superclass; itkFactorylessNewMacro(Self); itkCloneMacro(Self); void SetImageMask(TMaskImageType * maskimage); itkSetMacro(InnerScale,double) itkGetMacro(InnerScale,double) itkSetMacro(OuterScale,double) itkGetMacro(OuterScale,double) private: typename TMaskImageType::Pointer m_ImageMask; double m_InnerScale, m_OuterScale; - void GenerateData(); - void GenerateOutputInformation(); + void GenerateData() override; + void GenerateOutputInformation() override; StructureTensorEigenvalueImageFilter(); - virtual ~StructureTensorEigenvalueImageFilter(); + ~StructureTensorEigenvalueImageFilter() override; }; } #ifndef ITK_MANUAL_INSTANTIATION #include "../src/Algorithm/itkStructureTensorEigenvalueImageFilter.cpp" #endif #endif diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h b/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h index 608579700b..fedfea13de 100644 --- a/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h +++ b/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h @@ -1,33 +1,33 @@ #ifndef mitkAdditionalRFData_h #define mitkAdditionalRFData_h #include namespace mitk { class AdditionalRFDataAbstract { public: // This function is necessary to be able to do dynamic casts virtual void NoFunction() = 0; virtual ~AdditionalRFDataAbstract() {}; }; class NoRFData : public AdditionalRFDataAbstract { public: - virtual void NoFunction() { return; } - virtual ~NoRFData() {}; + void NoFunction() override { return; } + ~NoRFData() override {}; }; class PURFData : public AdditionalRFDataAbstract { public: vigra::ArrayVector m_Kappa; - virtual void NoFunction(); - virtual ~PURFData() {}; + void NoFunction() override; + ~PURFData() override {}; }; } #endif //mitkAdditionalRFData_h diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h b/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h index 1a6c02704f..5af8f408bb 100644 --- a/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h +++ b/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h @@ -1,95 +1,95 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkPURFClassifier_h #define mitkPURFClassifier_h #include #include //#include #include #include namespace mitk { class MITKCLVIGRARANDOMFOREST_EXPORT PURFClassifier : public AbstractClassifier { public: mitkClassMacro(PURFClassifier, AbstractClassifier) itkFactorylessNewMacro(Self) itkCloneMacro(Self) PURFClassifier(); - ~PURFClassifier(); + ~PURFClassifier() override; - void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y); + void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) override; - Eigen::MatrixXi Predict(const Eigen::MatrixXd &X); + Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) override; Eigen::MatrixXi PredictWeighted(const Eigen::MatrixXd &X); - bool SupportsPointWiseWeight(); - bool SupportsPointWiseProbability(); + bool SupportsPointWiseWeight() override; + bool SupportsPointWiseProbability() override; void ConvertParameter(); vigra::ArrayVector CalculateKappa(const Eigen::MatrixXd & X_in, const Eigen::MatrixXi &Y_in); void SetRandomForest(const vigra::RandomForest & rf); const vigra::RandomForest & GetRandomForest() const; - void UsePointWiseWeight(bool); + void UsePointWiseWeight(bool) override; void SetMaximumTreeDepth(int); void SetMinimumSplitNodeSize(int); void SetPrecision(double); void SetSamplesPerTree(double); void UseSampleWithReplacement(bool); void SetTreeCount(int); void SetWeightLambda(double); void PrintParameter(std::ostream &str = std::cout); void SetClassProbabilities(Eigen::VectorXd probabilities); Eigen::VectorXd GetClassProbabilites(); private: // *------------------- // * THREADING // *------------------- struct TrainingData; struct PredictionData; struct EigenToVigraTransform; struct Parameter; vigra::MultiArrayView<2, double> m_Probabilities; Eigen::MatrixXd m_TreeWeights; Eigen::VectorXd m_ClassProbabilities; Parameter * m_Parameter; vigra::RandomForest m_RandomForest; static ITK_THREAD_RETURN_TYPE TrainTreesCallback(void *); static ITK_THREAD_RETURN_TYPE PredictCallback(void *); static ITK_THREAD_RETURN_TYPE PredictWeightedCallback(void *); static void VigraPredictWeighted(PredictionData *data, vigra::MultiArrayView<2, double> & X, vigra::MultiArrayView<2, int> & Y, vigra::MultiArrayView<2, double> & P); }; } #endif //mitkPURFClassifier_h diff --git a/Modules/ModelFit/include/mitkGenericParamModelFactory.h b/Modules/ModelFit/include/mitkGenericParamModelFactory.h index 1b917cdb76..47982bc94a 100644 --- a/Modules/ModelFit/include/mitkGenericParamModelFactory.h +++ b/Modules/ModelFit/include/mitkGenericParamModelFactory.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __GENERIC_PARAM_MODEL_FACTORY_H #define __GENERIC_PARAM_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkGenericParamModel.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT GenericParamModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(GenericParamModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const override; + ParametersType GetDefaultInitialParameterization() const override; protected: ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const override; GenericParamModelFactory(); - virtual ~GenericParamModelFactory(); + ~GenericParamModelFactory() override; private: //No copy constructor allowed GenericParamModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__GENERIC_PARAM_MODEL_FACTORY_H diff --git a/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h index b80786f2e5..ed6c9d4650 100644 --- a/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h +++ b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h @@ -1,83 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __GENERIC_PARAM_MODEL_PARAMETERIZER_H #define __GENERIC_PARAM_MODEL_PARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkGenericParamModel.h" namespace mitk { /** Parameterizer for the GenricParamModel. */ class MITKMODELFIT_EXPORT GenericParamModelParameterizer : public ConcreteModelParameterizerBase { public: typedef GenericParamModelParameterizer Self; typedef ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(GenericParamModelParameterizer, ConcreteModelParameterizerBase); itkFactorylessNewMacro(Self); typedef typename Superclass::ModelBaseType ModelBaseType; typedef typename Superclass::ModelBasePointer ModelBasePointer; typedef typename Superclass::ModelType ModelType; typedef typename Superclass::ModelPointer ModelPointer; typedef typename Superclass::StaticParameterValueType StaticParameterValueType; typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType; typedef typename Superclass::StaticParameterMapType StaticParameterMapType; typedef typename Superclass::IndexType IndexType; itkSetMacro(FunctionString, mitk::ModelBase::FunctionStringType); /**@pre The Number of paremeters must be between 1 and 10.*/ itkSetClampMacro(NumberOfParameters, ParametersSizeType, 1, 10); mitk::ModelBase::FunctionStringType GetFunctionString() const override; using Superclass::GenerateParameterizedModel; - virtual ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const; + ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const override; StaticParameterMapType GetGlobalStaticParameters() const override; - virtual ParametersType GetDefaultInitialParameterization() const override; + ParametersType GetDefaultInitialParameterization() const override; protected: GenericParamModelParameterizer(); - virtual ~GenericParamModelParameterizer(); + ~GenericParamModelParameterizer() override; mitk::ModelBase::FunctionStringType m_FunctionString; /**Number of parameters the model should offer / the function string contains.*/ ParametersSizeType m_NumberOfParameters; private: //No copy constructor allowed GenericParamModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __GENERIC_PARAM_MODEL_PARAMETERIZER_H diff --git a/Modules/ModelFit/include/mitkLinearModelFactory.h b/Modules/ModelFit/include/mitkLinearModelFactory.h index 6b686a24bb..771f0d5624 100644 --- a/Modules/ModelFit/include/mitkLinearModelFactory.h +++ b/Modules/ModelFit/include/mitkLinearModelFactory.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __LINEAR_TEST_MODEL_FACTORY_H #define __LINEAR_TEST_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkLinearModel.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT LinearModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(LinearModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: - virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) - const; + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) + const override; LinearModelFactory(); - virtual ~LinearModelFactory(); + ~LinearModelFactory() override; private: //No copy constructor allowed LinearModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__LINEAR_TEST_MODEL_FACTORY_H diff --git a/Modules/ModelFit/include/mitkT2DecayModelFactory.h b/Modules/ModelFit/include/mitkT2DecayModelFactory.h index b9b815ad55..a796cc04cd 100644 --- a/Modules/ModelFit/include/mitkT2DecayModelFactory.h +++ b/Modules/ModelFit/include/mitkT2DecayModelFactory.h @@ -1,57 +1,57 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __T2_DECAY_TEST_MODEL_FACTORY_H #define __T2_DECAY_TEST_MODEL_FACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkT2DecayModel.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT T2DecayModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(T2DecayModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); - virtual ParametersType GetDefaultInitialParameterization() const override; + ParametersType GetDefaultInitialParameterization() const override; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; protected: - virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) - const; + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) + const override; T2DecayModelFactory(); - virtual ~T2DecayModelFactory(); + ~T2DecayModelFactory() override; private: //No copy constructor allowed T2DecayModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif //__LINEAR_TEST_MODEL_FACTORY_H diff --git a/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h b/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h index aeb62bc389..a68e399623 100644 --- a/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h +++ b/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __T2_DECAY_MODEL_PARAMETERIZER_H #define __T2_DECAY_MODEL_PARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkT2DecayModel.h" #include "MitkModelFitExports.h" namespace mitk { class MITKMODELFIT_EXPORT T2DecayModelParameterizer : public mitk::ConcreteModelParameterizerBase { public: typedef T2DecayModelParameterizer Self; typedef mitk::ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(T2DecayModelParameterizer, mitk::ConcreteModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; - virtual ParametersType GetDefaultInitialParameterization() const override; + ParametersType GetDefaultInitialParameterization() const override; protected: T2DecayModelParameterizer(); - virtual ~T2DecayModelParameterizer(); + ~T2DecayModelParameterizer() override; private: //No copy constructor allowed T2DecayModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // __LINEAR_MODEL_PARAMETERIZER_H diff --git a/Modules/OpenIGTLink/mitkIGTLDummyMessage.h b/Modules/OpenIGTLink/mitkIGTLDummyMessage.h index 4a3f8311db..f25af30098 100644 --- a/Modules/OpenIGTLink/mitkIGTLDummyMessage.h +++ b/Modules/OpenIGTLink/mitkIGTLDummyMessage.h @@ -1,71 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIGTLDUMMYMESSAGE_H #define MITKIGTLDUMMYMESSAGE_H #include "MitkOpenIGTLinkExports.h" #include "igtlObject.h" #include "igtlStringMessage.h" #include "mitkIGTLMessageCloneHandler.h" namespace mitk { /** * \class IGTLDummyMessage * \brief This class is a dummy message to show how to implement a new message type */ class MITKOPENIGTLINK_EXPORT IGTLDummyMessage : public igtl::StringMessage { public: typedef IGTLDummyMessage Self; typedef StringMessage Superclass; typedef igtl::SmartPointer Pointer; typedef igtl::SmartPointer ConstPointer; igtlTypeMacro( mitk::IGTLDummyMessage, igtl::StringMessage ) igtlNewMacro( mitk::IGTLDummyMessage ) public: /** * Set dummy string */ void SetDummyString( const std::string& dummyString ); /** * Get dummy string */ std::string GetDummyString(); /** * Returns a clone of itself */ - igtl::MessageBase::Pointer Clone() ; + igtl::MessageBase::Pointer Clone() override ; protected: IGTLDummyMessage(); ~IGTLDummyMessage() override; std::string m_dummyString; }; mitkIGTMessageCloneClassMacro(IGTLDummyMessage, DummyMsgCloneHandler) } // namespace mitk #endif diff --git a/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h b/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h index 1a4c87d2d4..9d930f1230 100644 --- a/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h @@ -1,76 +1,76 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_CONCRETE_AIF_BASED_MODEL_FACTORY_H #define MITK_CONCRETE_AIF_BASED_MODEL_FACTORY_H #include "mitkConcreteModelFactoryBase.h" #include "mitkAIFParametrizerHelper.h" namespace mitk { template class ConcreteAIFBasedModelFactory : public mitk::ConcreteModelFactoryBase { public: mitkClassMacro(ConcreteAIFBasedModelFactory, ConcreteModelFactoryBase); typedef typename Superclass::ModelType ModelType; typedef TModelParameterizer ModelParameterizerType; protected: - virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) - const + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) + const override { mitk::ModelParameterizerBase::Pointer result; typename ModelParameterizerType::Pointer modelParameterizer = ModelParameterizerType::New(); modelFit::StaticParameterMap::ValueType aif = fit->staticParamMap.Get( ModelType::NAME_STATIC_PARAMETER_AIF); modelParameterizer->SetAIF(mitk::convertParameterToArray(aif)); modelFit::StaticParameterMap::ValueType aifGrid = fit->staticParamMap.Get( ModelType::NAME_STATIC_PARAMETER_AIFTimeGrid); modelParameterizer->SetAIFTimeGrid(mitk::convertParameterToArray(aifGrid)); result = modelParameterizer.GetPointer(); return result; }; ConcreteAIFBasedModelFactory() { }; - virtual ~ConcreteAIFBasedModelFactory() + ~ConcreteAIFBasedModelFactory() override { }; private: //No copy constructor allowed ConcreteAIFBasedModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h index cd57c9499d..650546078a 100644 --- a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h @@ -1,58 +1,58 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKEXTENDEDONETISSUECOMPARTMENTMODELFACTORY_H #define MITKEXTENDEDONETISSUECOMPARTMENTMODELFACTORY_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkExtendedOneTissueCompartmentModel.h" #include "mitkExtendedOneTissueCompartmentModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ExtendedOneTissueCompartmentModelFactory : public mitk::ConcreteAIFBasedModelFactory< ExtendedOneTissueCompartmentModelParameterizer> { public: mitkClassMacro(ExtendedOneTissueCompartmentModelFactory, ConcreteAIFBasedModelFactory); itkFactorylessNewMacro(Self); typedef Superclass::ModelType ModelType; typedef Superclass::ModelParameterizerType ModelParameterizerType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: ExtendedOneTissueCompartmentModelFactory(); - virtual ~ExtendedOneTissueCompartmentModelFactory(); + ~ExtendedOneTissueCompartmentModelFactory() override; private: //No copy constructor allowed ExtendedOneTissueCompartmentModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKEXTENDEDONETISSUECOMPARTMENTMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h index 6338ee598c..420fb741db 100644 --- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKEXTENDEDTOFTSMODELFACTORY_H #define MITKEXTENDEDTOFTSMODELFACTORY_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkExtendedToftsModel.h" #include "mitkExtendedToftsModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModelFactory : public mitk::ConcreteAIFBasedModelFactory { public: mitkClassMacro(ExtendedToftsModelFactory, ConcreteAIFBasedModelFactory); itkFactorylessNewMacro(Self); using ModelType = Superclass::ModelType; using ModelParameterizerType = Superclass::ModelParameterizerType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; - virtual ParametersType GetDefaultInitialParameterization() const override; + ParametersType GetDefaultInitialParameterization() const override; protected: ExtendedToftsModelFactory(); ~ExtendedToftsModelFactory() override; private: //No copy constructor allowed ExtendedToftsModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKEXTENDEDTOFTSMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h index 0d845f7dab..c4cf27b0d1 100644 --- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELFACTORY_H #define MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELFACTORY_H #include "mitkTwoCompartmentExchangeModelFactoryBase.h" #include "mitkNumericTwoCompartmentExchangeModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModelFactory : public mitk::TwoCompartmentExchangeModelFactoryBase { public: mitkClassMacro(NumericTwoCompartmentExchangeModelFactory, TwoCompartmentExchangeModelFactoryBase); itkFactorylessNewMacro(Self); protected: - ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const; + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const override; NumericTwoCompartmentExchangeModelFactory(); - virtual ~NumericTwoCompartmentExchangeModelFactory(); + ~NumericTwoCompartmentExchangeModelFactory() override; private: //No copy constructor allowed NumericTwoCompartmentExchangeModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h index c548d2a8ba..185ff245a0 100644 --- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H #define MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkNumericTwoCompartmentExchangeModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef NumericTwoCompartmentExchangeModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(NumericTwoCompartmentExchangeModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; itkSetMacro(ODEINTStepSize, double); itkGetConstReferenceMacro(ODEINTStepSize, double); /** Returns the global static parameters for the model. * @remark this default implementation assumes only AIF and its timegrid as static parameters. * Reimplement in derived classes to change this behavior.*/ - virtual StaticParameterMapType GetGlobalStaticParameters() const; + StaticParameterMapType GetGlobalStaticParameters() const override; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: double m_ODEINTStepSize; NumericTwoCompartmentExchangeModelParameterizer(); - virtual ~NumericTwoCompartmentExchangeModelParameterizer(); + ~NumericTwoCompartmentExchangeModelParameterizer() override; private: //No copy constructor allowed NumericTwoCompartmentExchangeModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h index bfaedf7d82..3916b76b6c 100644 --- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNUMERICTWOTISSUECOMPARTMENTMODELFACTORY_H #define MITKNUMERICTWOTISSUECOMPARTMENTMODELFACTORY_H #include "mitkTwoTissueCompartmentModelFactoryBase.h" #include "mitkNumericTwoTissueCompartmentModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModelFactory : public mitk::TwoTissueCompartmentModelFactoryBase { public: mitkClassMacro(NumericTwoTissueCompartmentModelFactory, TwoTissueCompartmentModelFactoryBase); itkFactorylessNewMacro(Self); protected: NumericTwoTissueCompartmentModelFactory(); - virtual ~NumericTwoTissueCompartmentModelFactory(); + ~NumericTwoTissueCompartmentModelFactory() override; private: //No copy constructor allowed NumericTwoTissueCompartmentModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKNUMERICTWOTISSUECOMPARTMENTMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h index ceae49150c..2bbb6c0916 100644 --- a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKONETISSUECOMPARTMENTMODELFACTORY_H #define MITKONETISSUECOMPARTMENTMODELFACTORY_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkOneTissueCompartmentModel.h" #include "mitkOneTissueCompartmentModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT OneTissueCompartmentModelFactory : public mitk::ConcreteAIFBasedModelFactory { public: mitkClassMacro(OneTissueCompartmentModelFactory, ConcreteAIFBasedModelFactory); itkFactorylessNewMacro(Self); typedef Superclass::ModelType ModelType; typedef Superclass::ModelParameterizerType ModelParameterizerType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: OneTissueCompartmentModelFactory(); - virtual ~OneTissueCompartmentModelFactory(); + ~OneTissueCompartmentModelFactory() override; private: //No copy constructor allowed OneTissueCompartmentModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKONETISSUECOMPARTMENTMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h index c9d18b16b8..6637c629fc 100644 --- a/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h @@ -1,55 +1,55 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKSTANDARDTOFTSMODELFACTORY_H #define MITKSTANDARDTOFTSMODELFACTORY_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkStandardToftsModel.h" #include "mitkStandardToftsModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT StandardToftsModelFactory : public mitk::ConcreteAIFBasedModelFactory { public: mitkClassMacro(StandardToftsModelFactory, ConcreteAIFBasedModelFactory); itkFactorylessNewMacro(Self); using ModelType = Superclass::ModelType; using ModelParameterizerType = Superclass::ModelParameterizerType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; - virtual ParametersType GetDefaultInitialParameterization() const override; + ParametersType GetDefaultInitialParameterization() const override; protected: StandardToftsModelFactory(); ~StandardToftsModelFactory() override; private: //No copy constructor allowed StandardToftsModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKSTANDARDTOFTSMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h index 432b50dede..7c561c16ca 100644 --- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h @@ -1,43 +1,43 @@ #ifndef MITKTHREESTEPLINEARMODELFACTORY_H #define MITKTHREESTEPLINEARMODELFACTORY_H #include #include "mitkConcreteModelFactoryBase.h" #include "mitkThreeStepLinearModel.h" #include "mitkThreeStepLinearModelParameterizer.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModelFactory : public ConcreteModelFactoryBase { public: mitkClassMacroItkParent(ThreeStepLinearModelFactory, ConcreteModelFactoryBase); itkFactorylessNewMacro(Self); /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: - virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) - const; + ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) + const override; ThreeStepLinearModelFactory(); - virtual ~ThreeStepLinearModelFactory(); + ~ThreeStepLinearModelFactory() override; private: //No copy constructor allowed ThreeStepLinearModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTHREESTEPLINEARMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h index 44d4a860fe..2ee429a292 100644 --- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h @@ -1,66 +1,66 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTHREESTEPLINEARMODELPARAMETERIZER_H #define MITKTHREESTEPLINEARMODELPARAMETERIZER_H #include "mitkConcreteModelParameterizerBase.h" #include "mitkThreeStepLinearModel.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModelParameterizer : public mitk::ConcreteModelParameterizerBase { public: typedef ThreeStepLinearModelParameterizer Self; typedef mitk::ConcreteModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(ThreeStepLinearModelParameterizer, ConcreteModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef Superclass::ModelPointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: ThreeStepLinearModelParameterizer(){}; - virtual ~ThreeStepLinearModelParameterizer(){}; + ~ThreeStepLinearModelParameterizer() override{}; private: //No copy constructor allowed ThreeStepLinearModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented };} #endif // MITKTHREESTEPLINEARMODELPARAMETERIZER_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h index ae7083f6b9..0fb2205285 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H #define MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H #include "mitkTwoCompartmentExchangeModelFactoryBase.h" #include "mitkTwoCompartmentExchangeModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoCompartmentExchangeModelFactory : public mitk::TwoCompartmentExchangeModelFactoryBase { public: mitkClassMacro(TwoCompartmentExchangeModelFactory, TwoCompartmentExchangeModelFactoryBase); itkFactorylessNewMacro(Self); protected: TwoCompartmentExchangeModelFactory(); - virtual ~TwoCompartmentExchangeModelFactory(); + ~TwoCompartmentExchangeModelFactory() override; private: //No copy constructor allowed TwoCompartmentExchangeModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h index 235d07d8b2..92f40dda11 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h +++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h @@ -1,83 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOCOMPARTMENTEXCHANGEMODELFACTORYBASE_H #define MITKTWOCOMPARTMENTEXCHANGEMODELFACTORYBASE_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkSimpleBarrierConstraintChecker.h" namespace mitk { template class TwoCompartmentExchangeModelFactoryBase : public mitk::ConcreteAIFBasedModelFactory< TModelParameterizer > { public: mitkClassMacro(TwoCompartmentExchangeModelFactoryBase, ConcreteAIFBasedModelFactory< TModelParameterizer >); itkFactorylessNewMacro(Self); typedef typename Superclass::ModelType ModelType; typedef typename Superclass::ModelParameterizerType ModelParameterizerType; typedef typename Superclass::ParametersType ParametersType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override { SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New(); constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_ve, 0.0); constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_ve, 1.0); constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_vp, 0.0); constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_vp, 1.0); SimpleBarrierConstraintChecker::ParameterIndexVectorType indices; indices.push_back(ModelType::POSITION_PARAMETER_ve); indices.push_back(ModelType::POSITION_PARAMETER_vp); constraints->SetUpperSumBarrier(indices, 1.0); return constraints.GetPointer(); }; - virtual ParametersType GetDefaultInitialParameterization() const + ParametersType GetDefaultInitialParameterization() const override { typename ModelParameterizerType::Pointer modelParameterizer = ModelParameterizerType::New(); return modelParameterizer->GetDefaultInitialParameterization(); }; protected: TwoCompartmentExchangeModelFactoryBase() { }; - virtual ~TwoCompartmentExchangeModelFactoryBase() + ~TwoCompartmentExchangeModelFactoryBase() override { }; private: //No copy constructor allowed TwoCompartmentExchangeModelFactoryBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h index 1979057eb4..fdd0d1cf72 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h +++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H #define MITKTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkTwoCompartmentExchangeModel.h" #include "MitkPharmacokineticsExports.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoCompartmentExchangeModelParameterizer : public mitk::AIFBasedModelParameterizerBase { public: typedef TwoCompartmentExchangeModelParameterizer Self; typedef mitk::AIFBasedModelParameterizerBase Superclass; typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; itkTypeMacro(TwoCompartmentExchangeModelParameterizer, mitk::AIFBasedModelParameterizerBase); itkFactorylessNewMacro(Self); typedef Superclass::ModelBaseType ModelBaseType; typedef Superclass::ModelBasePointer ModelBasePointer; typedef Superclass::ModelType ModelType; typedef ModelType::Pointer ModelPointer; typedef Superclass::StaticParameterValueType StaticParameterValueType; typedef Superclass::StaticParameterValuesType StaticParameterValuesType; typedef Superclass::StaticParameterMapType StaticParameterMapType; typedef Superclass::IndexType IndexType; /** This function returns the default parameterization (e.g. initial parametrization for fitting) defined by the model developer for for the given model.*/ - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: TwoCompartmentExchangeModelParameterizer(); - virtual ~TwoCompartmentExchangeModelParameterizer(); + ~TwoCompartmentExchangeModelParameterizer() override; private: //No copy constructor allowed TwoCompartmentExchangeModelParameterizer(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h index 02992a958c..bcc0ffeef6 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOTISSUECOMPARTMENTFDGMODELFACTORY_H #define MITKTWOTISSUECOMPARTMENTFDGMODELFACTORY_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkTwoTissueCompartmentFDGModel.h" #include "mitkTwoTissueCompartmentFDGModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentFDGModelFactory : public mitk::ConcreteAIFBasedModelFactory { public: mitkClassMacro(TwoTissueCompartmentFDGModelFactory, ConcreteAIFBasedModelFactory); itkFactorylessNewMacro(Self); typedef Superclass::ModelType ModelType; typedef Superclass::ModelParameterizerType ModelParameterizerType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override; - virtual ParametersType GetDefaultInitialParameterization() const; + ParametersType GetDefaultInitialParameterization() const override; protected: TwoTissueCompartmentFDGModelFactory(); - virtual ~TwoTissueCompartmentFDGModelFactory(); + ~TwoTissueCompartmentFDGModelFactory() override; private: //No copy constructor allowed TwoTissueCompartmentFDGModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOTISSUECOMPARTMENTFDGMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h index ce54c2584a..793baa41e8 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h +++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h @@ -1,51 +1,51 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOTISSUECOMPARTMENTMODELFACTORY_H #define MITKTWOTISSUECOMPARTMENTMODELFACTORY_H #include "mitkTwoTissueCompartmentModelFactoryBase.h" #include "mitkTwoTissueCompartmentModelParameterizer.h" namespace mitk { class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentModelFactory : public mitk::TwoTissueCompartmentModelFactoryBase { public: mitkClassMacro(TwoTissueCompartmentModelFactory, TwoTissueCompartmentModelFactoryBase); itkFactorylessNewMacro(Self); protected: TwoTissueCompartmentModelFactory(); - virtual ~TwoTissueCompartmentModelFactory(); + ~TwoTissueCompartmentModelFactory() override; private: //No copy constructor allowed TwoTissueCompartmentModelFactory(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOTISSUECOMPARTMENTMODELFACTORY_H diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h index 83db60e14f..f91c22f1b2 100644 --- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h +++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKTWOTISSUECOMPARTMENTFACTORYBASE_H #define MITKTWOTISSUECOMPARTMENTFACTORYBASE_H #include "mitkConcreteAIFBasedModelFactory.h" #include "mitkAIFBasedModelParameterizerBase.h" #include "mitkSimpleBarrierConstraintChecker.h" namespace mitk { template class TwoTissueCompartmentModelFactoryBase : public mitk::ConcreteAIFBasedModelFactory< TModelParameterizer > { public: mitkClassMacro(TwoTissueCompartmentModelFactoryBase, ConcreteAIFBasedModelFactory< TModelParameterizer >); itkFactorylessNewMacro(Self); typedef typename Superclass::ModelType ModelType; typedef typename Superclass::ModelParameterizerType ModelParameterizerType; typedef typename Superclass::ParametersType ParametersType; ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override { SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New(); /**@TODO: Mit Charlie klaren ob es eine sinnvolle default Einstellung gibt.*/ constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_K1, 0, 0); constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k2, 0, 0); constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k3, 0, 0); constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k4, 0, 0); constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_VB, 0, 0); constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_VB, 1, 0); constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_K1, 1.0, 0); constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k2, 1.0, 0); constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k3, 1.0, 0); constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k4, 1.0, 0); return constraints.GetPointer(); }; - virtual ParametersType GetDefaultInitialParameterization() const + ParametersType GetDefaultInitialParameterization() const override { typename ModelParameterizerType::Pointer modelParameterizer = ModelParameterizerType::New(); return modelParameterizer->GetDefaultInitialParameterization(); }; protected: TwoTissueCompartmentModelFactoryBase() { }; - virtual ~TwoTissueCompartmentModelFactoryBase() + ~TwoTissueCompartmentModelFactoryBase() override { }; private: //No copy constructor allowed TwoTissueCompartmentModelFactoryBase(const Self& source); void operator=(const Self&); //purposely not implemented }; } #endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H diff --git a/Modules/PhotoacousticsAlgorithms/include/mitkBeamformingSettings.h b/Modules/PhotoacousticsAlgorithms/include/mitkBeamformingSettings.h index b50654b3f0..8684d9632e 100644 --- a/Modules/PhotoacousticsAlgorithms/include/mitkBeamformingSettings.h +++ b/Modules/PhotoacousticsAlgorithms/include/mitkBeamformingSettings.h @@ -1,248 +1,248 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITK_BEAMFORMING_SETTINGS #define MITK_BEAMFORMING_SETTINGS #include #include #include #include namespace mitk { /*! * \brief Class holding the configuration data for the beamforming filters mitk::BeamformingFilter and mitk::PhotoacousticOCLBeamformingFilter * * A detailed description can be seen below. All parameters should be set manually for successfull beamforming. */ class MITKPHOTOACOUSTICSALGORITHMS_EXPORT BeamformingSettings : public itk::Object { public: mitkClassMacroItkParent(BeamformingSettings, itk::Object); itkCloneMacro(Self); /** \brief Available apodization functions: * - Hamming function. * - Von-Hann function. * - Box function. */ enum Apodization { Hamm, Hann, Box }; /** \brief Available beamforming algorithms: * - DAS (Delay and sum). * - DMAS (Delay multiply and sum). */ enum BeamformingAlgorithm { DMAS, DAS, sDMAS }; /** \brief Available geometries for Probes: * - Linear * - Concave */ enum ProbeGeometry { Linear, Concave}; itkGetConstMacro(PitchInMeters, float); itkGetConstMacro(SpeedOfSound, float); itkGetConstMacro(TimeSpacing, float); itkGetConstMacro(Angle, float); itkGetConstMacro(IsPhotoacousticImage, bool); itkGetConstMacro(TransducerElements, unsigned int); itkGetConstMacro(SamplesPerLine, unsigned int); itkGetConstMacro(ReconstructionLines, unsigned int); itkGetConstMacro(InputDim, const unsigned int*); itkGetConstMacro(UseGPU, bool); itkGetConstMacro(GPUBatchSize, unsigned int); itkGetConstMacro(ApodizationFunction, const float*); itkGetConstMacro(Apod, Apodization); itkGetConstMacro(ApodizationArraySize, int); itkGetConstMacro(Algorithm, BeamformingAlgorithm); itkGetConstMacro(ReconstructionDepth, float); itkGetConstMacro(Geometry, ProbeGeometry); itkGetConstMacro(ProbeRadius, float); itkGetConstMacro(ElementHeights, float*); itkGetConstMacro(ElementPositions, float*); itkGetConstMacro(HorizontalExtent, float); /** \brief function for mitk::PhotoacousticOCLBeamformingFilter to check whether buffers need to be updated * this method only checks parameters relevant for the openCL implementation */ static bool SettingsChangedOpenCL(const BeamformingSettings::Pointer lhs, const BeamformingSettings::Pointer rhs) { return !((std::abs(lhs->GetAngle() - rhs->GetAngle()) < 0.01f) && // 0.01 degree error margin (lhs->GetApod() == rhs->GetApod()) && (lhs->GetGeometry() == rhs->GetGeometry()) && - (abs(lhs->GetProbeRadius() - rhs->GetProbeRadius()) < 0.001f) && + (std::abs(lhs->GetProbeRadius() - rhs->GetProbeRadius()) < 0.001f) && (lhs->GetIsPhotoacousticImage() == rhs->GetIsPhotoacousticImage()) && (std::abs(lhs->GetPitchInMeters() - rhs->GetPitchInMeters()) < 0.000001f) && // 0.0001 mm error margin (lhs->GetReconstructionLines() == rhs->GetReconstructionLines()) && (lhs->GetSamplesPerLine() == rhs->GetSamplesPerLine()) && (lhs->GetReconstructionDepth() == rhs->GetReconstructionDepth()) && (std::abs(lhs->GetSpeedOfSound() - rhs->GetSpeedOfSound()) < 0.01f) && (std::abs(lhs->GetTimeSpacing() - rhs->GetTimeSpacing()) < 0.00000000001f) && //0.01 ns error margin (lhs->GetTransducerElements() == rhs->GetTransducerElements())); } static Pointer New(float pitchInMeters, float speedOfSound, float timeSpacing, float angle, bool isPhotoacousticImage, unsigned int samplesPerLine, unsigned int reconstructionLines, unsigned int* inputDim, float reconstructionDepth, bool useGPU, unsigned int GPUBatchSize, Apodization apod, unsigned int apodizationArraySize, BeamformingAlgorithm algorithm, ProbeGeometry geometry, float probeRadius) { Pointer smartPtr = new BeamformingSettings(pitchInMeters, speedOfSound, timeSpacing, angle, isPhotoacousticImage, samplesPerLine, reconstructionLines, inputDim, reconstructionDepth, useGPU, GPUBatchSize, apod, apodizationArraySize, algorithm, geometry, probeRadius); smartPtr->UnRegister(); return smartPtr; } unsigned short* GetMinMaxLines(); protected: /** */ BeamformingSettings(float pitchInMeters, float speedOfSound, float timeSpacing, float angle, bool isPhotoacousticImage, unsigned int samplesPerLine, unsigned int reconstructionLines, unsigned int* inputDim, float reconstructionDepth, bool useGPU, unsigned int GPUBatchSize, Apodization apod, unsigned int apodizationArraySize, BeamformingAlgorithm algorithm, ProbeGeometry geometry, float probeRadius ); - ~BeamformingSettings(); + ~BeamformingSettings() override; /** \brief Pitch of the used transducer in [m]. */ float m_PitchInMeters; /** \brief Speed of sound in the used medium in [m/s]. */ float m_SpeedOfSound; /** \brief The time spacing of the input image */ float m_TimeSpacing; // [s] /** \brief The angle of the transducer elements */ float m_Angle; /** \brief Flag whether processed image is a photoacoustic image or an ultrasound image */ bool m_IsPhotoacousticImage; /** \brief How many transducer elements the used transducer had. */ unsigned int m_TransducerElements; /** \brief How many vertical samples should be used in the final image. */ unsigned int m_SamplesPerLine; /** \brief How many lines should be reconstructed in the final image. */ unsigned int m_ReconstructionLines; /** \brief Sets the dimensions of the inputImage. */ const unsigned int* m_InputDim; /** \brief The Depth up to which the filter should reconstruct the image [m] */ float m_ReconstructionDepth; /** \brief Decides whether GPU computing should be used */ bool m_UseGPU; unsigned int m_GPUBatchSize; /** \brief Sets the amount of image slices in batches when GPU is used */ const float* m_ApodizationFunction; /** \brief Sets the used apodization function. */ Apodization m_Apod; /** \brief Sets the resolution of the apodization array (must be greater than 0). */ int m_ApodizationArraySize; /** \brief Sets the used beamforming algorithm. */ BeamformingAlgorithm m_Algorithm; /** \brief Sets the used probe geometry */ ProbeGeometry m_Geometry; /** \brief Sets the radius of the curved probe [m] */ float m_ProbeRadius; /** */ float *m_ElementHeights; /** */ float *m_ElementPositions; /** */ float m_HorizontalExtent; /** */ unsigned short* m_MinMaxLines; }; } #endif //MITK_BEAMFORMING_SETTINGS diff --git a/Modules/PhotoacousticsAlgorithms/source/OpenCLFilter/mitkPhotoacousticBModeFilter.cpp b/Modules/PhotoacousticsAlgorithms/source/OpenCLFilter/mitkPhotoacousticBModeFilter.cpp index 8408229d5a..c3b7ba5e06 100644 --- a/Modules/PhotoacousticsAlgorithms/source/OpenCLFilter/mitkPhotoacousticBModeFilter.cpp +++ b/Modules/PhotoacousticsAlgorithms/source/OpenCLFilter/mitkPhotoacousticBModeFilter.cpp @@ -1,91 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "./OpenCLFilter/mitkPhotoacousticBModeFilter.h" #include "usServiceReference.h" #include mitk::PhotoacousticBModeFilter::PhotoacousticBModeFilter() : m_UseLogFilter(false) { this->SetNumberOfIndexedInputs(1); this->SetNumberOfRequiredInputs(1); } mitk::PhotoacousticBModeFilter::~PhotoacousticBModeFilter() { } void mitk::PhotoacousticBModeFilter::GenerateInputRequestedRegion() { Superclass::GenerateInputRequestedRegion(); mitk::Image::Pointer output = this->GetOutput(); mitk::Image::Pointer input = this->GetInput(); if (!output->IsInitialized()) return; input->SetRequestedRegionToLargestPossibleRegion(); } void mitk::PhotoacousticBModeFilter::GenerateOutputInformation() { mitk::Image::ConstPointer input = this->GetInput(); mitk::Image::Pointer output = this->GetOutput(); if ((output->IsInitialized()) && (this->GetMTime() <= m_TimeOfHeaderInitialization.GetMTime())) return; output->Initialize(input->GetPixelType(), input->GetDimension(), input->GetDimensions()); output->GetGeometry()->SetSpacing(input->GetGeometry()->GetSpacing()); output->GetGeometry()->Modified(); output->SetPropertyList(input->GetPropertyList()->Clone()); m_TimeOfHeaderInitialization.Modified(); } void mitk::PhotoacousticBModeFilter::GenerateData() { GenerateOutputInformation(); mitk::Image::Pointer input = this->GetInput(); mitk::Image::Pointer output = this->GetOutput(); if (!output->IsInitialized()) return; mitk::ImageReadAccessor reader(input); unsigned int size = output->GetDimension(0) * output->GetDimension(1) * output->GetDimension(2); const float* InputData = (const float*)(reader.GetData()); float* OutputData = new float[size]; if (!m_UseLogFilter) for (unsigned int i = 0; i < size; ++i) { - OutputData[i] = abs(InputData[i]); + OutputData[i] = std::abs(InputData[i]); } else { for (unsigned int i = 0; i < size; ++i) { - OutputData[i] = log(abs(InputData[i])); + OutputData[i] = log(std::abs(InputData[i])); } } output->SetImportVolume(OutputData, 0, 0, mitk::Image::ImportMemoryManagementType::CopyMemory); delete[] OutputData; m_TimeOfHeaderInitialization.Modified(); } diff --git a/Modules/PhotoacousticsAlgorithms/test/mitkCastToFloatImageFilterTest.cpp b/Modules/PhotoacousticsAlgorithms/test/mitkCastToFloatImageFilterTest.cpp index ab43018f02..e729d990ae 100644 --- a/Modules/PhotoacousticsAlgorithms/test/mitkCastToFloatImageFilterTest.cpp +++ b/Modules/PhotoacousticsAlgorithms/test/mitkCastToFloatImageFilterTest.cpp @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include class mitkCastToFloatImageFilterTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkCastToFloatImageFilterTestSuite); MITK_TEST(testShortConversion); MITK_TEST(testIntConversion); MITK_TEST(testLongConversion); MITK_TEST(testFloatConversion); MITK_TEST(testDoubleConversion); CPPUNIT_TEST_SUITE_END(); private: mitk::CastToFloatImageFilter::Pointer m_CastToFloatImageFilter; const unsigned int NUM_ITERATIONS = 15; const unsigned int DATA_DIM = 10; public: void setUp() override { m_CastToFloatImageFilter = mitk::CastToFloatImageFilter::New(); } template void test() { TPixelType* data = new TPixelType[DATA_DIM*DATA_DIM*DATA_DIM]; for (unsigned int i = 0; i < DATA_DIM*DATA_DIM*DATA_DIM; ++i) { data[i] = (TPixelType)i; } mitk::Image::Pointer inputImage = mitk::Image::New(); unsigned int dimension[3]{ DATA_DIM, DATA_DIM, DATA_DIM }; inputImage->Initialize(mitk::MakeScalarPixelType(), 3, dimension); inputImage->SetImportVolume(data); for (unsigned int iteration = 0; iteration < NUM_ITERATIONS; ++iteration) { m_CastToFloatImageFilter->SetInput(inputImage); m_CastToFloatImageFilter->Update(); mitk::Image::Pointer outputImage = m_CastToFloatImageFilter->GetOutput(); mitk::ImageReadAccessor readAccess(outputImage); const float* outputData = (const float*)readAccess.GetData(); for (unsigned int i = 0; i < DATA_DIM*DATA_DIM*DATA_DIM; ++i) { - CPPUNIT_ASSERT_MESSAGE(std::string("expected " + std::to_string(data[i]) + " but was " + std::to_string(outputData[i])), abs(outputData[i] - data[i]) < mitk::eps); + CPPUNIT_ASSERT_MESSAGE(std::string("expected " + std::to_string(data[i]) + " but was " + std::to_string(outputData[i])), std::abs(outputData[i] - data[i]) < mitk::eps); } } } void testFloatConversion() { test(); } void testShortConversion() { test(); test(); } void testIntConversion() { test(); test(); } void testDoubleConversion() { test(); } void testLongConversion() { test(); } void tearDown() override { m_CastToFloatImageFilter = nullptr; } }; MITK_TEST_SUITE_REGISTRATION(mitkCastToFloatImageFilter) diff --git a/Modules/PhotoacousticsAlgorithms/test/mitkCropImageFilterTest.cpp b/Modules/PhotoacousticsAlgorithms/test/mitkCropImageFilterTest.cpp index 808382eb97..90c85b9d44 100644 --- a/Modules/PhotoacousticsAlgorithms/test/mitkCropImageFilterTest.cpp +++ b/Modules/PhotoacousticsAlgorithms/test/mitkCropImageFilterTest.cpp @@ -1,127 +1,127 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include class mitkCropImageFilterTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkCropImageFilterTestSuite); MITK_TEST(testCropImage); CPPUNIT_TEST_SUITE_END(); private: mitk::CropImageFilter::Pointer m_CropImageFilter; const unsigned int NUM_ITERATIONS = 5; const unsigned int DATA_DIM = 25; public: void setUp() override { m_CropImageFilter = mitk::CropImageFilter::New(); } void test() { std::random_device r; std::default_random_engine randGen(r()); std::uniform_int_distribution randDistr(0, (DATA_DIM / 2) - 1); float* data = new float[DATA_DIM*DATA_DIM*DATA_DIM]; for (unsigned int i = 0; i < DATA_DIM*DATA_DIM*DATA_DIM; ++i) { data[i] = (float)i; } mitk::Image::Pointer inputImage = mitk::Image::New(); unsigned int dimension[3]{ DATA_DIM, DATA_DIM, DATA_DIM }; inputImage->Initialize(mitk::MakeScalarPixelType(), 3, dimension); inputImage->SetImportVolume(data, 0, 0, mitk::Image::ImportMemoryManagementType::CopyMemory); for (unsigned int iteration = 0; iteration < NUM_ITERATIONS; ++iteration) { unsigned int XPixelsCropStart = randDistr(randGen); unsigned int YPixelsCropStart = randDistr(randGen); unsigned int ZPixelsCropStart = randDistr(randGen); unsigned int XPixelsCropEnd = randDistr(randGen); unsigned int YPixelsCropEnd = randDistr(randGen); unsigned int ZPixelsCropEnd = randDistr(randGen); unsigned int newXDim = DATA_DIM - XPixelsCropStart - XPixelsCropEnd; unsigned int newYDim = DATA_DIM - YPixelsCropStart - YPixelsCropEnd; unsigned int newZDim = DATA_DIM - ZPixelsCropStart - ZPixelsCropEnd; m_CropImageFilter->SetInput(inputImage); m_CropImageFilter->SetXPixelsCropStart(XPixelsCropStart); m_CropImageFilter->SetYPixelsCropStart(YPixelsCropStart); m_CropImageFilter->SetZPixelsCropStart(ZPixelsCropStart); m_CropImageFilter->SetXPixelsCropEnd(XPixelsCropEnd); m_CropImageFilter->SetYPixelsCropEnd(YPixelsCropEnd); m_CropImageFilter->SetZPixelsCropEnd(ZPixelsCropEnd); m_CropImageFilter->Update(); mitk::Image::Pointer outputImage = m_CropImageFilter->GetOutput(); mitk::ImageReadAccessor readAccess(outputImage); const float* outputData = (const float*)readAccess.GetData(); CPPUNIT_ASSERT_MESSAGE(std::string("expected x size to be " + std::to_string(newXDim) + " but was " + std::to_string(outputImage->GetDimension(0))), newXDim == outputImage->GetDimension(0)); CPPUNIT_ASSERT_MESSAGE(std::string("expected y size to be " + std::to_string(newYDim) + " but was " + std::to_string(outputImage->GetDimension(1))), newYDim == outputImage->GetDimension(1)); CPPUNIT_ASSERT_MESSAGE(std::string("expected z size to be " + std::to_string(newZDim) + " but was " + std::to_string(outputImage->GetDimension(2))), newZDim == outputImage->GetDimension(2)); for (unsigned int z = 0; z < newZDim; ++z) { for (unsigned int y = 0; y < newYDim; ++y) { for (unsigned int x = 0; x < newXDim; ++x) { unsigned int origPos = (x + XPixelsCropStart) + (y + YPixelsCropStart) * DATA_DIM + (z + ZPixelsCropStart) * DATA_DIM * DATA_DIM; unsigned int outPos = x + y * newXDim + z * newXDim * newYDim; CPPUNIT_ASSERT_MESSAGE(std::string("expected " + std::to_string(data[origPos]) + " but was " + std::to_string(outputData[outPos])), - abs((float)outputData[outPos] - (float)data[origPos]) < mitk::eps); + std::abs((float)outputData[outPos] - (float)data[origPos]) < mitk::eps); } } } } delete[] data; } void testCropImage() { for (int repetition = 0; repetition < 20; ++repetition) { MITK_INFO << "[" << (repetition + 1) << "/20]"; test(); } } void tearDown() override { m_CropImageFilter = nullptr; } }; MITK_TEST_SUITE_REGISTRATION(mitkCropImageFilter) diff --git a/Modules/PhotoacousticsAlgorithms/test/mitkPAFilterServiceTest.cpp b/Modules/PhotoacousticsAlgorithms/test/mitkPAFilterServiceTest.cpp index d43501a92d..82b4a16f2a 100644 --- a/Modules/PhotoacousticsAlgorithms/test/mitkPAFilterServiceTest.cpp +++ b/Modules/PhotoacousticsAlgorithms/test/mitkPAFilterServiceTest.cpp @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include // us #include #include #include #include #include #include #include class mitkPAFilterServiceTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkPAFilterServiceTestSuite); MITK_TEST(testRunning); CPPUNIT_TEST_SUITE_END(); private: mitk::PhotoacousticFilterService::Pointer m_PhotoacousticFilterService; mitk::BeamformingSettings::Pointer m_BeamformingSettings; unsigned int* inputDimensions; const int xDim = 16; const int yDim = 128; const int length = yDim * xDim; public: void setUp() override { m_PhotoacousticFilterService = mitk::PhotoacousticFilterService::New(); m_BeamformingSettings = CreateBeamformingSettings(); } mitk::BeamformingSettings::Pointer CreateBeamformingSettings() { inputDimensions = new unsigned int[length]; inputDimensions[0] = yDim; inputDimensions[1] = xDim; mitk::BeamformingSettings::Pointer outputSettings = mitk::BeamformingSettings::New( (float)(0.3 / 1000), (float)(1500), (float)(0.0125 / 1000000), 27, true, 3000, 128, inputDimensions, yDim * (0.0125 / 1000000) * (1500), false, 16, mitk::BeamformingSettings::Apodization::Box, 128, mitk::BeamformingSettings::BeamformingAlgorithm::DAS, mitk::BeamformingSettings::ProbeGeometry::Linear, 0); return outputSettings; } void testRunning() { float* testArray = new float[length]; for (int i = 0; i < length; ++i) { testArray[i] = 0; } mitk::PixelType pixelType = mitk::MakeScalarPixelType(); mitk::Image::Pointer testImage = mitk::Image::New(); testImage->Initialize(pixelType, 2, inputDimensions); testImage->SetImportSlice(testArray, 0, 0, 0, mitk::Image::ImportMemoryManagementType::CopyMemory); delete[] testArray; mitk::ImageReadAccessor readAccessInput(testImage); const float* inputArray = (const float*)readAccessInput.GetData(); for (int i = 0; i < length; ++i) { - CPPUNIT_ASSERT_MESSAGE(std::string("Input array already not correct: " + std::to_string(inputArray[i])), abs(inputArray[i]) < 1e-5f); + CPPUNIT_ASSERT_MESSAGE(std::string("Input array already not correct: " + std::to_string(inputArray[i])), std::abs(inputArray[i]) < 1e-5f); } auto output = m_PhotoacousticFilterService->ApplyBeamforming(testImage, m_BeamformingSettings); mitk::ImageReadAccessor readAccess(output); const float* outputArray = (const float*)readAccess.GetData(); for (int i = 0; i < length; ++i) { - CPPUNIT_ASSERT_MESSAGE(std::string("Output array not correct: " + std::to_string(abs(outputArray[i]))), abs(outputArray[i]) < 1e-5f); + CPPUNIT_ASSERT_MESSAGE(std::string("Output array not correct: " + std::to_string(std::abs(outputArray[i]))), std::abs(outputArray[i]) < 1e-5f); } } void tearDown() override { m_PhotoacousticFilterService = nullptr; delete[] inputDimensions; } }; MITK_TEST_SUITE_REGISTRATION(mitkPAFilterService) diff --git a/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h b/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h index 3f710b79a2..f6c27845cc 100644 --- a/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h +++ b/Modules/PhotoacousticsLib/include/mitkPALinearSpectralUnmixingFilter.h @@ -1,103 +1,103 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKLINEARPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H #define MITKLINEARPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H #include #include namespace mitk { namespace pa { /** * \brief This filter is subclass of the spectral unmixing filter base. All algorithms in this class are * based on the Eigen open source c++ library. It takes a multispectral pixel as input and returns a vector * with the unmixing result. * * Input: * - endmemberMatrix Eigen Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains * the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method. * - inputVector Eigen Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece) * so the pixelvalue of the first wavelength is stored in inputVector[0] and so on. * * Output: * - Eigen vector with unmixing result of one multispectral pixel. The ith element of the vector corresponds to the ith entry of the * m_Chromophore vector. * * Algorithms (see AlgortihmType enum): * - HOUSEHOLDERQR computes the solution by QR decomposition * - COLPIVHOUSEHOLDERQR computes the solution by QR decomposition * - FULLPIVHOUSEHOLDERQR computes the solution by QR decomposition * - LDLT computes the solution by Cholesky decomposition * - LLT computes the solution by Cholesky decomposition * - JACOBISVD computes the solution by singular value decomposition uses least square solver * * Possible exceptions: * - "algorithm not working": doesn't work now (2018/06/19) * - "404 VIGRA ALGORITHM NOT FOUND": Algorithm not implemented */ class MITKPHOTOACOUSTICSLIB_EXPORT LinearSpectralUnmixingFilter : public SpectralUnmixingFilterBase { public: mitkClassMacro(LinearSpectralUnmixingFilter, SpectralUnmixingFilterBase) itkFactorylessNewMacro(Self) /** * \brief Contains all implemented Eigen algorithms for spectral unmixing. For detailed information of the algorithms look at the * mitkPALinearSpectralUnmixingFilter.h documentation (section Algorithms). */ enum AlgortihmType { HOUSEHOLDERQR, LDLT, LLT, COLPIVHOUSEHOLDERQR, JACOBISVD, FULLPIVLU, FULLPIVHOUSEHOLDERQR }; /** * \brief Takes a mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType and fix it for usage at the "SpectralUnmixingAlgorithm" method. * @param algorithmName has to be a mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType */ void SetAlgorithm(AlgortihmType inputAlgorithmName); protected: LinearSpectralUnmixingFilter(); - virtual ~LinearSpectralUnmixingFilter(); + ~LinearSpectralUnmixingFilter() override; /** * \brief overrides the baseclass method with a mehtod to calculate the spectral unmixing result vector. Herain the class performs the * algorithm set by the "SetAlgorithm" method and writes the result into a Eigen vector which is the return value. * @param endmemberMatrix Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains * the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method. * @param inputVector Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece) * so the pixelvalue of the first wavelength is stored in inputVector[0] and so on. * @throws if the algorithmName is not a member of the enum VigraAlgortihmType * @throws if one chooses the ldlt/llt solver which doens't work yet */ - virtual Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix endmemberMatrix, + Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix endmemberMatrix, Eigen::VectorXf inputVector) override; private: AlgortihmType algorithmName; }; } } #endif // MITKLINEARPHOTOACOUSTICSPECTRALUNMIXINGFILTER_H diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterBase.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterBase.h index a297b37b1a..ae4fd3465b 100644 --- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterBase.h +++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterBase.h @@ -1,198 +1,198 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERBASE_H #define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERBASE_H #include "mitkImageToImageFilter.h" #include //Includes for smart pointer usage #include "mitkCommon.h" #include "itkLightObject.h" // Includes for AddEnmemberMatrix #include "mitkPAPropertyCalculator.h" #include namespace mitk { namespace pa { /** * \brief The spectral unmixing filter base is designed as superclass for several spectral unmixing filter eg. Eigen- or Vigrabased ones. * One can add wavelengths and chromophores and get a unmixed output images out of one MITK input image using algorithms from the subclasses. * * Input: * The unmixing input has to be a 3D MITK image where the XY-plane is a image and the Z-direction represents recordings for different * wavelengths. Herein a XY-plane for a specific Z-direction will be called "image". Every image has to be assigned to a certain wavelength. * The "AddWavelength" uses "push_back" to write float values into a vector. The first wavelength will correspond to the first image!!! * If there a more input images 'I' then added wavelengths 'w' the filter base interprets the next x images as repetition sequence of the same * wavelengths. If I % w !=0 the surplus image(s) will be dropped. * Addtionaly one has to add chromophores from the property calculator class enum "ChromophoreType" with the "AddChromophore" method. * This method as well uses "push_back" but the chosen (arbitary) order will be the order of the outputs. * * Output: * The output will be one MITK image per chosen chromophore. Where the XY-plane is a image and the Z-direction represents recordings for different * sequences. Furthermore it is possible to creat an output image that contains the information about the relative error between unmixing result * and the input image. * * Subclasses: * - mitkPASpectralUnmixingFilterVigra * - mitkPALinearSpectralUnmixingFilter (uses Eigen algorithms) * - mitkPASpectralUnmixingFilterSimplex * * Possible exceptions: * - "PIXELTYPE ERROR! FLOAT 32 REQUIRED": The MITK input image has to consist out of floats. * - "ERROR! REMOVE WAVELENGTHS!": One needs at least the same amount of images (z-dimension) then added wavelengths. * - "ADD MORE WAVELENGTHS!": One needs at least the same amount of wavelengths then added chromophores. * - "WAVELENGTH XXX nm NOT SUPPORTED!": The wavelength is not part of the proptery calculater data base. The data base can be found @ * [...]\mitk\Modules\PhotoacousticsLib\Resources\spectralLIB.dat * - "ADD OUTPUTS HAS TO BE LARGER THEN ZERO!" * - "NO WAVELENGHTS/CHROMOPHORES SELECZED! * - "INDEX ERROR! NUMBER OF OUTPUTS DOESN'T FIT TO OTHER SETTIGNS!" */ class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilterBase : public mitk::ImageToImageFilter { public: mitkClassMacro(SpectralUnmixingFilterBase, mitk::ImageToImageFilter); /** * \brief AddChromophore takes mitk::pa::PropertyCalculator::ChromophoreType and writes them at the end of the m_Chromophore vector. * The call of the method sets the order of the GetOutput method! * * @param chromophore has to be element of porperty calculater enum chromophore type * @return for wavelength smaller then 300nm and larger then 1000nm the return will be 0, because not at the data base (2018/06/19) */ void AddChromophore(mitk::pa::PropertyCalculator::ChromophoreType chromophore); /** * \brief AddWavelength takes integers and writes them at the end of the m_Wavelength vector. The first call of the method then * corresponds to the first input image and so on. * @param wavelength database supports integers between 300 and 1000 nm */ void AddWavelength(int wavelength); /* * \brief Verbose gives more information to the console. Default value is false. * @param verbose is the boolian to activate the MITK_INFO logged to the console */ virtual void Verbose(bool verbose); /** * \brief AddOutputs takes an integer and sets indexed outputs * @param outputs integer correponds to the number of output images * @throws if outputs == 0 */ virtual void AddOutputs(unsigned int outputs); /* * \brief RelativeError returns a image which compare the L2 norm of the input vector with the unmixing result * @param relativeError is the boolian to activate this tool */ virtual void RelativeError(bool relativeError); /** * \brief AddRelativeErrorSettings takes integers and writes them at the end of the m_RelativeErrorSettings vector. * @param value has to be a integer */ virtual void AddRelativeErrorSettings(int value); ofstream myfile; // just for testing purposes; has to be removeed protected: /** * \brief Constructor creats proptery calculater smart pointer new() */ SpectralUnmixingFilterBase(); - virtual ~SpectralUnmixingFilterBase(); + ~SpectralUnmixingFilterBase() override; /** * \brief The subclasses will override the mehtod to calculate the spectral unmixing result vector. * @param endmemberMatrix Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains * the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method. * @param inputVector Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece) * so the pixelvalue of the first wavelength is stored in inputVector[0] and so on. * @throws if algorithm implementiation fails (implemented for the algorithms with critical requirements) */ virtual Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix endmemberMatrix, Eigen::VectorXf inputVector) = 0; bool m_Verbose = false; bool m_RelativeError = false; std::vector m_Chromophore; std::vector m_Wavelength; std::vector m_RelativeErrorSettings; private: /* * \brief Initialized output images with the same XY-plane size like the input image and total size in z-direction equals number of sequences. * The pixel type is set to float. * @param totalNumberOfSequences = (unsigned int) (numberOfInputImages / numberOfWavelength) >= 1 */ virtual void InitializeOutputs(unsigned int totalNumberOfSequences); /* * \brief Checks if there are a suitable amount of wavelengths and if the input image consists of floats. * @param input pointer on the MITK input image * @throws if there are more wavelength then images * @throws if there are more chromophores then wavelengths * @throws if the pixel type is not float 32 * @throws if no chromophores or wavelengths selected as input * @throws if the number of indexed outputs does'nt fit to the expected number */ virtual void CheckPreConditions(mitk::Image::Pointer input); /* * \brief Inherit from the "ImageToImageFilter" Superclass. Herain it calls InitializeOutputs, CalculateEndmemberMatrix and * CheckPreConditions methods and enables pixelwise access to do spectral unmixing with the "SpectralUnmixingAlgorithm" * method. In the end the method writes the results into the new MITK output images. */ - virtual void GenerateData() override; + void GenerateData() override; /* * \brief Creats a Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains * the absorbtion of chromophore j @ wavelength i. The absorbtion values are taken from the "PropertyElement" method. * @param m_Chromophore is a vector of "PropertyCalculator::ChromophoreType" containing all selected chromophores for the unmixing * @param m_Wavelength is a vector of integers containing all wavelengths of one sequence */ virtual Eigen::Matrix CalculateEndmemberMatrix( std::vector m_Chromophore, std::vector m_Wavelength); /* * \brief "PropertyElement" is the tool to access the absorbtion values out of the database using mitk::pa::PropertyCalculator::GetAbsorptionForWavelengt * and checks if the requested wavelength is part of the database (not zero values). The "ONEENDMEMBER" is a pseudo absorber with static absorbtion 1 * at every wavelength and is therefor not part of the database. If this one is the selected chromophore the return value is 1 for every wavelength. * @param wavelength has to be integer between 300 and 1000 nm * @param chromophore has to be a mitk::pa::PropertyCalculator::ChromophoreType * @throws if mitk::pa::PropertyCalculator::GetAbsorptionForWavelengt returns 0, because this means that the delivered wavelength is not in the database. */ virtual float PropertyElement(mitk::pa::PropertyCalculator::ChromophoreType, int wavelength); /* * \brief calculates the relative error between the input image and the unmixing result in the L2 norm * @param endmemberMatrix is a Eigen matrix containing the endmember information * @param inputVector is a Eigen vector containing the multispectral information of one pixel * @param resultVector is a Eigen vector containing the spectral unmmixing result */ float CalculateRelativeError(Eigen::Matrix endmemberMatrix, Eigen::VectorXf inputVector, Eigen::VectorXf resultVector); PropertyCalculator::Pointer m_PropertyCalculatorEigen; }; } } #endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERBASE_ diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h index def0212178..89d07c7144 100644 --- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h +++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterLagrange.h @@ -1,41 +1,41 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERLAGRANGE_H #define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERLAGRANGE_H #include #include namespace mitk { namespace pa { class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilterLagrange : public SpectralUnmixingFilterBase { public: mitkClassMacro(SpectralUnmixingFilterLagrange, SpectralUnmixingFilterBase) //itkFactorylessNewMacro(Self) protected: SpectralUnmixingFilterLagrange(); - virtual ~SpectralUnmixingFilterLagrange(); + ~SpectralUnmixingFilterLagrange() override; private: }; } } #endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERLAGRANGE_H diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h index a5920f4239..bf9272d21c 100644 --- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h +++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterSimplex.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERSIMPLEX_H #define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERSIMPLEX_H #include #include namespace mitk { namespace pa { class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilterSimplex : public SpectralUnmixingFilterBase { public: mitkClassMacro(SpectralUnmixingFilterSimplex, SpectralUnmixingFilterBase) itkFactorylessNewMacro(Self) protected: SpectralUnmixingFilterSimplex(); - virtual ~SpectralUnmixingFilterSimplex(); + ~SpectralUnmixingFilterSimplex() override; private: - virtual Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix EndmemberMatrix, + Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix EndmemberMatrix, Eigen::VectorXf inputVector) override; int factorial(int n); virtual Eigen::Matrix GenerateA(Eigen::Matrix EndmemberMatrix, Eigen::VectorXf inputVector, int i); Eigen::Matrix GenerateD2(Eigen::Matrix A); float simplexVolume(Eigen::Matrix Matrix); virtual Eigen::VectorXf Normalization(Eigen::Matrix EndmemberMatrix, Eigen::VectorXf inputVector); }; } } #endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERSIMPLEX_H diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h index a8b7926a5b..4291f44b06 100644 --- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h +++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingFilterVigra.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERVIGRA_H #define MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERVIGRA_H #include #include #include namespace mitk { namespace pa { /** * \brief This filter is subclass of the spectral unmixing filter base. All algorithms in this class are * based on the vigra open source c++ library. It takes a multispectral pixel as input and returns a vector * with the unmixing result. * * Input: * - endmemberMatrix Eigen Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains * the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method. * - inputVector Eigen Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece) * so the pixelvalue of the first wavelength is stored in inputVector[0] and so on. * * Output: * - Eigen vector with unmixing result of one multispectral pixel. The ith element of the vector corresponds to the ith entry of the * m_Chromophore vector. * * Algorithms (see VigraAlgortihmType enum): * - LARS algorithm minimizes (A*x-b)^2 s.t. x>=0 using least angle regression * - GOLDFARB minimizes (A*x-b)^2 s.t. x>=0 using the Goldfarb-Idnani algorithm * - WEIGHTED minimizes transpose(A*x-b)*diag(weights)*(A*x-b) using QR decomposition * - LS minimizes (A*x-b)^2 using QR decomposition * * Possible exceptions: * - "404 VIGRA ALGORITHM NOT FOUND": Algorithm not implemented */ class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingFilterVigra : public SpectralUnmixingFilterBase { public: mitkClassMacro(SpectralUnmixingFilterVigra, SpectralUnmixingFilterBase) itkFactorylessNewMacro(Self) /** * \brief Contains all implemented Vigra algorithms for spectral unmixing. For detailed information of the algorithms look at the * mitkPASpectralUnmixingFilterVigra.h documentation (section Algorithms). */ enum VigraAlgortihmType { LARS, GOLDFARB, WEIGHTED, LS }; /** * \brief AddWeight takes integers and writes them at the end of the weightsvec vector. The first call of the method then * corresponds to the first input image/wavelength and so on. * @param weight is a percentage (integer) between 1 and 100 */ void AddWeight(unsigned int weight); /** * \brief Takes a mitk::pa::SpectralUnmixingFilterVigra::VigraAlgortihmType and fix it for usage at the "SpectralUnmixingAlgorithm" * method. * @param algorithmName has to be a mitk::pa::SpectralUnmixingFilterVigra::VigraAlgortihmType */ void SetAlgorithm(VigraAlgortihmType inputAlgorithmName); protected: SpectralUnmixingFilterVigra(); - virtual ~SpectralUnmixingFilterVigra(); + ~SpectralUnmixingFilterVigra() override; /** * \brief overrides the baseclass method with a mehtod to calculate the spectral unmixing result vector. Herain it first converts the * Eigen inputs to the Vigra class. Afterwards the class performs the algorithm set by the "SetAlgorithm" method and writes the result * into a Eigen vector which is the return value. * @param endmemberMatrix Matrix with number of chromophores colums and number of wavelengths rows so matrix element (i,j) contains * the absorbtion of chromophore j @ wavelength i taken from the database by PropertyElement method. * @param inputVector Vector containing values of one pixel of XY-plane image with number of wavelength rows (z-dimension of a sequenece) * so the pixelvalue of the first wavelength is stored in inputVector[0] and so on. * @throws if the algorithmName is not a member of the enum VigraAlgortihmType */ - virtual Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix EndmemberMatrix, + Eigen::VectorXf SpectralUnmixingAlgorithm(Eigen::Matrix EndmemberMatrix, Eigen::VectorXf inputVector) override; private: std::vector weightsvec; SpectralUnmixingFilterVigra::VigraAlgortihmType algorithmName; }; } } #endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGFILTERVIGRA_H diff --git a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingSO2.h b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingSO2.h index 63bd582815..9ea8d40ed5 100644 --- a/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingSO2.h +++ b/Modules/PhotoacousticsLib/include/mitkPASpectralUnmixingSO2.h @@ -1,116 +1,116 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTICSPECTRALUNMIXINGSO2_H #define MITKPHOTOACOUSTICSPECTRALUNMIXINGSO2_H #include "mitkImageToImageFilter.h" #include //Includes for smart pointer usage #include "mitkCommon.h" #include "itkLightObject.h" namespace mitk { namespace pa { /** * \brief derives out of two identical sized MITK images the oxygen saturation and return one MITK image as result. Furthermore * it is possible to set settings that the result shows just SO2 values above a threshold, or above a input value for Hb, HbO2 to * get just a oxygen saturation image of interessting structures. * * Input: * The input has to be two 3D MITK images. The order of the inputs matter! The first input has to be the Hb image the second input * has to be the HbO2 image. The settings are integer values. The SO2 threshold therefore is percentage value. * * Output: * The output will be one MITK image. Where one can see the oxygen saturation of all pixels above the set threholds. If a pixel is * below a threhold or NAN then the value will be set to zero. * * UPDATE: SO2 Filter will get an second output, the total hemoglobin value with ->GetOutput(1). */ class MITKPHOTOACOUSTICSLIB_EXPORT SpectralUnmixingSO2 : public mitk::ImageToImageFilter { public: mitkClassMacro(SpectralUnmixingSO2, mitk::ImageToImageFilter); itkFactorylessNewMacro(Self); /** * \brief AddSO2Settings takes integers and writes them at the end of the m_SO2Settings vector. * @param value of the Setting */ virtual void AddSO2Settings(int value); /** * \brief Verbose gives more information to the console. Default value is false. * @param m_Verbose is the boolian to activate the MITK_INFO logged to the console */ virtual void Verbose(bool verbose); protected: /** * \brief Constructor sets number of input images to two and number of output images to one, respectively. */ SpectralUnmixingSO2(); - virtual ~SpectralUnmixingSO2(); + ~SpectralUnmixingSO2() override; std::vector m_SO2Settings; bool m_Verbose = false; private: /** * \brief Inherit from the "ImageToImageFilter" Superclass. Herain it calls InitializeOutputs and the CheckPreConditions * methods and enables pixelwise access to the inputs to calculate the oxygen saturation via the "calculate SO2" method. */ - virtual void GenerateData() override; + void GenerateData() override; /** * \brief Initialized output images with the same size like the input image. The pixel type is set to float. */ virtual void InitializeOutputs(); /** * \brief Checks if the dimensions of the input images are equal and made out of floating poinhts. * @throws if the inputs don't have the same size * @throws if input images don't consist of floats */ virtual void CheckPreConditions(mitk::Image::Pointer inputHbO2, mitk::Image::Pointer inputHb); /** * \brief calculates HbO2 / (Hb + HbO2) and afterwards checks if the result is significant (SO2ValueNotSiginificant method). * If not the method returns zero otherwise it returns the calculated result. * @param pixelHb is the pixel value of the Hb input. * @param pixelHb is the pixel value of the Hb input. * @warn if the sO2 value is NAN (in patricular if Hb == -HbO2), but result will be set to zero */ float CalculateSO2(float pixelHb, float pixelHbO2); /** * \brief calculates (Hb + HbO2). * @param pixelHb is the pixel value of the Hb input. * @param pixelHb is the pixel value of the Hb input. * @warn if the tHb value is NAN (in patricular if Hb == -HbO2), but result will be set to zero */ float CalculateTHb(float pixelHb, float pixelHbO2); /** * \brief return true if SO2 result is not significant by checking if the input values are above the threshold of the settings */ bool SO2ValueNotSiginificant(float Hb, float HbO2, float result); }; } } #endif // MITKPHOTOACOUSTICSPECTRALUNMIXINGSO2_ diff --git a/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h b/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h index 2351f24aec..429a970faa 100644 --- a/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h +++ b/Modules/PhotoacousticsLib/include/mitkPATissueGeneratorParameters.h @@ -1,217 +1,217 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTICTISSUEGENERATORPARAMETERS_H #define MITKPHOTOACOUSTICTISSUEGENERATORPARAMETERS_H #include #include //Includes for smart pointer usage #include "mitkCommon.h" #include "itkLightObject.h" namespace mitk { namespace pa { class MITKPHOTOACOUSTICSLIB_EXPORT TissueGeneratorParameters : public itk::Object { public: mitkClassMacroItkParent(TissueGeneratorParameters, itk::Object) itkFactorylessNewMacro(Self) /** * Callback function definition of a VesselMeanderStrategy */ typedef void (VesselMeanderStrategy::*CalculateNewVesselPositionCallback) (Vector::Pointer, double, std::mt19937*); itkGetMacro(XDim, int) itkGetMacro(YDim, int) itkGetMacro(ZDim, int) itkGetMacro(VoxelSpacingInCentimeters, double) itkGetMacro(DoPartialVolume, bool) itkGetMacro(UseRngSeed, bool) itkGetMacro(RngSeed, long) itkGetMacro(RandomizePhysicalProperties, bool) itkGetMacro(RandomizePhysicalPropertiesPercentage, double) itkGetMacro(ForceVesselsMoveAlongYDirection, bool) itkGetMacro(MinBackgroundAbsorption, double) itkGetMacro(MaxBackgroundAbsorption, double) itkGetMacro(BackgroundScattering, double) itkGetMacro(BackgroundAnisotropy, double) itkGetMacro(AirAbsorption, double) itkGetMacro(AirScattering, double) itkGetMacro(AirAnisotropy, double) itkGetMacro(AirThicknessInMillimeters, double) itkGetMacro(SkinAbsorption, double) itkGetMacro(SkinScattering, double) itkGetMacro(SkinAnisotropy, double) itkGetMacro(SkinThicknessInMillimeters, double) itkGetMacro(CalculateNewVesselPositionCallback, CalculateNewVesselPositionCallback) itkGetMacro(MinNumberOfVessels, int) itkGetMacro(MaxNumberOfVessels, int) itkGetMacro(MinVesselBending, double) itkGetMacro(MaxVesselBending, double) itkGetMacro(MinVesselAbsorption, double) itkGetMacro(MaxVesselAbsorption, double) itkGetMacro(MinVesselRadiusInMillimeters, double) itkGetMacro(MaxVesselRadiusInMillimeters, double) itkGetMacro(VesselBifurcationFrequency, int) itkGetMacro(MinVesselScattering, double) itkGetMacro(MaxVesselScattering, double) itkGetMacro(MinVesselAnisotropy, double) itkGetMacro(MaxVesselAnisotropy, double) itkGetMacro(MinVesselZOrigin, double) itkGetMacro(MaxVesselZOrigin, double) itkGetMacro(MCflag, double) itkGetMacro(MCLaunchflag, double) itkGetMacro(MCBoundaryflag, double) itkGetMacro(MCLaunchPointX, double) itkGetMacro(MCLaunchPointY, double) itkGetMacro(MCLaunchPointZ, double) itkGetMacro(MCFocusPointX, double) itkGetMacro(MCFocusPointY, double) itkGetMacro(MCFocusPointZ, double) itkGetMacro(MCTrajectoryVectorX, double) itkGetMacro(MCTrajectoryVectorY, double) itkGetMacro(MCTrajectoryVectorZ, double) itkGetMacro(MCRadius, double) itkGetMacro(MCWaist, double) itkSetMacro(XDim, int) itkSetMacro(YDim, int) itkSetMacro(ZDim, int) itkSetMacro(VoxelSpacingInCentimeters, double) itkSetMacro(DoPartialVolume, bool) itkSetMacro(UseRngSeed, bool) itkSetMacro(RngSeed, long) itkSetMacro(RandomizePhysicalProperties, bool) itkSetMacro(RandomizePhysicalPropertiesPercentage, double) itkSetMacro(ForceVesselsMoveAlongYDirection, bool) itkSetMacro(MinBackgroundAbsorption, double) itkSetMacro(MaxBackgroundAbsorption, double) itkSetMacro(BackgroundScattering, double) itkSetMacro(BackgroundAnisotropy, double) itkSetMacro(AirAbsorption, double) itkSetMacro(AirScattering, double) itkSetMacro(AirAnisotropy, double) itkSetMacro(AirThicknessInMillimeters, double) itkSetMacro(SkinAbsorption, double) itkSetMacro(SkinScattering, double) itkSetMacro(SkinAnisotropy, double) itkSetMacro(SkinThicknessInMillimeters, double) itkSetMacro(CalculateNewVesselPositionCallback, CalculateNewVesselPositionCallback) itkSetMacro(MinNumberOfVessels, int) itkSetMacro(MaxNumberOfVessels, int) itkSetMacro(MinVesselBending, double) itkSetMacro(MaxVesselBending, double) itkSetMacro(MinVesselAbsorption, double) itkSetMacro(MaxVesselAbsorption, double) itkSetMacro(MinVesselRadiusInMillimeters, double) itkSetMacro(MaxVesselRadiusInMillimeters, double) itkSetMacro(VesselBifurcationFrequency, int) itkSetMacro(MinVesselScattering, double) itkSetMacro(MaxVesselScattering, double) itkSetMacro(MinVesselAnisotropy, double) itkSetMacro(MaxVesselAnisotropy, double) itkSetMacro(MinVesselZOrigin, double) itkSetMacro(MaxVesselZOrigin, double) itkSetMacro(MCflag, double) itkSetMacro(MCLaunchflag, double) itkSetMacro(MCBoundaryflag, double) itkSetMacro(MCLaunchPointX, double) itkSetMacro(MCLaunchPointY, double) itkSetMacro(MCLaunchPointZ, double) itkSetMacro(MCFocusPointX, double) itkSetMacro(MCFocusPointY, double) itkSetMacro(MCFocusPointZ, double) itkSetMacro(MCTrajectoryVectorX, double) itkSetMacro(MCTrajectoryVectorY, double) itkSetMacro(MCTrajectoryVectorZ, double) itkSetMacro(MCRadius, double) itkSetMacro(MCWaist, double) protected: TissueGeneratorParameters(); - ~TissueGeneratorParameters(); + ~TissueGeneratorParameters() override; private: int m_XDim; int m_YDim; int m_ZDim; double m_VoxelSpacingInCentimeters; bool m_DoPartialVolume; bool m_UseRngSeed; long m_RngSeed; bool m_RandomizePhysicalProperties; double m_RandomizePhysicalPropertiesPercentage; bool m_ForceVesselsMoveAlongYDirection; double m_MinBackgroundAbsorption; double m_MaxBackgroundAbsorption; double m_BackgroundScattering; double m_BackgroundAnisotropy; double m_AirAbsorption; double m_AirScattering; double m_AirAnisotropy; double m_AirThicknessInMillimeters; double m_SkinAbsorption; double m_SkinScattering; double m_SkinAnisotropy; double m_SkinThicknessInMillimeters; CalculateNewVesselPositionCallback m_CalculateNewVesselPositionCallback; int m_MinNumberOfVessels; int m_MaxNumberOfVessels; double m_MinVesselBending; double m_MaxVesselBending; double m_MinVesselAbsorption; double m_MaxVesselAbsorption; double m_MinVesselRadiusInMillimeters; double m_MaxVesselRadiusInMillimeters; int m_VesselBifurcationFrequency; double m_MinVesselScattering; double m_MaxVesselScattering; double m_MinVesselAnisotropy; double m_MaxVesselAnisotropy; double m_MinVesselZOrigin; double m_MaxVesselZOrigin; double m_MCflag; double m_MCLaunchflag; double m_MCBoundaryflag; double m_MCLaunchPointX; double m_MCLaunchPointY; double m_MCLaunchPointZ; double m_MCFocusPointX; double m_MCFocusPointY; double m_MCFocusPointZ; double m_MCTrajectoryVectorX; double m_MCTrajectoryVectorY; double m_MCTrajectoryVectorZ; double m_MCRadius; double m_MCWaist; }; } } #endif // MITKPHOTOACOUSTICTISSUEGENERATORPARAMETERS_H diff --git a/Modules/PhotoacousticsLib/include/mitkPAVesselDrawer.h b/Modules/PhotoacousticsLib/include/mitkPAVesselDrawer.h index 0c1082a00d..763d6cacd5 100644 --- a/Modules/PhotoacousticsLib/include/mitkPAVesselDrawer.h +++ b/Modules/PhotoacousticsLib/include/mitkPAVesselDrawer.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKVESSELDRAWER_H #define MITKVESSELDRAWER_H #include "mitkVector.h" #include "mitkPAVesselMeanderStrategy.h" #include "mitkPAInSilicoTissueVolume.h" #include "mitkPAVector.h" #include "mitkPAVesselProperties.h" #include //Includes for smart pointer usage #include "mitkCommon.h" #include "itkLightObject.h" namespace mitk { namespace pa { class MITKPHOTOACOUSTICSLIB_EXPORT VesselDrawer : public itk::LightObject { public: mitkClassMacroItkParent(VesselDrawer, itk::LightObject); itkFactorylessNewMacro(Self); void ExpandAndDrawVesselInVolume( VesselProperties::Pointer properties, InSilicoTissueVolume::Pointer volume); protected: VesselDrawer(); - virtual ~VesselDrawer(); + ~VesselDrawer() override; private: }; } } #endif // MITKVESSELDRAWER_H diff --git a/Modules/PhotoacousticsLib/include/mitkPAVolume.h b/Modules/PhotoacousticsLib/include/mitkPAVolume.h index c3ba2bd7cf..bf0494f34f 100644 --- a/Modules/PhotoacousticsLib/include/mitkPAVolume.h +++ b/Modules/PhotoacousticsLib/include/mitkPAVolume.h @@ -1,150 +1,150 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPHOTOACOUSTIC3dVOLUME_H #define MITKPHOTOACOUSTIC3dVOLUME_H #include "MitkPhotoacousticsLibExports.h" //Includes for smart pointer usage #include #include namespace mitk { namespace pa { /** * @brief The Volume class is designed to encapsulate volumetric information and to provide convenience methods * for data access and image conversions. */ class MITKPHOTOACOUSTICSLIB_EXPORT Volume : public itk::LightObject { public: mitkClassMacroItkParent(Volume, itk::LightObject); /** *@brief returns smartpointer reference to a new instance of this objects. * The given data array will be freed upon calling this constructor. *@param data *@param xDim *@param yDim *@param zDim *@param spacing *@return smartpointer reference to a new instance of this object */ static Volume::Pointer New(double* data, unsigned int xDim, unsigned int yDim, unsigned int zDim, double spacing); static Volume::Pointer New(mitk::Image::Pointer image); /** * @brief GetData. Returns data at wanted position. For performance reasons, this method will not check, * if the specified position it within the array. Please use the GetXDim(), GetYDim() and GetZDim() methods * to check for yourself if necessary. * * @param x * @param y * @param z * @return the data contained within the data array held by this Volume at * positon x|y|z. */ double GetData(unsigned int x, unsigned int y, unsigned int z); /** * Returns a const reference to the data encapsuled by this class. */ double* GetData() const; /** * @brief SetData * @param data * @param x * @param y * @param z */ void SetData(double data, unsigned int x, unsigned int y, unsigned int z); /** * @brief GetXDim * @return size of x dimension of this Volume */ unsigned int GetXDim(); /** * @brief GetYDim * @return size of y dimension of this Volume */ unsigned int GetYDim(); /** * @brief GetZDim * @return size of z dimension of this Volume */ unsigned int GetZDim(); /** *@brief returns the Volume instance as an mitk image */ Image::Pointer AsMitkImage(); /** * @brief DeepCopy * @return a deep copy of this Volume. the old volume remains intact and memory is NOT shared * between the objects. */ Volume::Pointer DeepCopy(); /** *@brief convenience method to enable consistent access to the dat array *@return a 1d index from 3d pixel coordinates */ long long GetIndex(unsigned int x, unsigned int y, unsigned int z); double GetSpacing(); void SetSpacing(double spacing); protected: /** * @brief Initialize initializes this volume with the given pointer to the data array. * It is assumed, that the array is of dimension xDim|yDim|zDim. * The Photoacoustic3DVolume will handle memory management of the array and delete it on * constructor call. * * @param data a pointer to the data array * @param xDim x dimension of the data * @param yDim y dimension of the data * @param zDim z dimension of the data */ Volume(double* data, unsigned int xDim, unsigned int yDim, unsigned int zDim, double spacing); Volume(mitk::Image::Pointer image); - virtual ~Volume(); + ~Volume() override; const int NUMBER_OF_SPATIAL_DIMENSIONS = 3; Image::Pointer m_InternalMitkImage; // this data is kept to enable fast access unsigned int m_XDim; unsigned int m_YDim; unsigned int m_ZDim; double* m_FastAccessDataPointer; }; } } #endif // MITKPHOTOACOUSTIC3dVOLUME_H diff --git a/Modules/PhotoacousticsLib/test/mitkPhotoacousticVesselTest.cpp b/Modules/PhotoacousticsLib/test/mitkPhotoacousticVesselTest.cpp index b31d7ca57e..a943cb358b 100644 --- a/Modules/PhotoacousticsLib/test/mitkPhotoacousticVesselTest.cpp +++ b/Modules/PhotoacousticsLib/test/mitkPhotoacousticVesselTest.cpp @@ -1,184 +1,184 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include "mitkPAInSilicoTissueVolume.h" #include "mitkPAVector.h" #include "mitkPAVessel.h" class mitkPhotoacousticVesselTestSuite : public mitk::TestFixture { CPPUNIT_TEST_SUITE(mitkPhotoacousticVesselTestSuite); MITK_TEST(testEmptyInitializationProperties); MITK_TEST(testWalkInStraightLine); MITK_TEST(testBifurcate); CPPUNIT_TEST_SUITE_END(); private: mitk::pa::Vessel::Pointer m_TestVessel; mitk::pa::Vessel::CalculateNewVesselPositionCallback m_StraightLine; mitk::pa::Vessel::CalculateNewVesselPositionCallback m_Diverging; mitk::pa::InSilicoTissueVolume::Pointer m_TestInSilicoVolume; mitk::pa::TissueGeneratorParameters::Pointer m_TestVolumeParameters; public: void setUp() override { auto params = mitk::pa::VesselProperties::New(); m_TestVessel = mitk::pa::Vessel::New(params); m_StraightLine = &mitk::pa::VesselMeanderStrategy::CalculateNewDirectionVectorInStraightLine; m_Diverging = &mitk::pa::VesselMeanderStrategy::CalculateNewRandomlyDivergingDirectionVector; m_TestVolumeParameters = createTestVolumeParameters(); auto rng = std::mt19937(); m_TestInSilicoVolume = mitk::pa::InSilicoTissueVolume::New(m_TestVolumeParameters, &rng); } mitk::pa::TissueGeneratorParameters::Pointer createTestVolumeParameters() { auto returnParameters = mitk::pa::TissueGeneratorParameters::New(); returnParameters->SetXDim(10); returnParameters->SetYDim(10); returnParameters->SetZDim(10); returnParameters->SetMinBackgroundAbsorption(0); returnParameters->SetMaxBackgroundAbsorption(0); returnParameters->SetBackgroundScattering(0); returnParameters->SetBackgroundAnisotropy(0); return returnParameters; } void testEmptyInitializationProperties() { CPPUNIT_ASSERT(m_TestVessel->CanBifurcate() == false); CPPUNIT_ASSERT(m_TestVessel->IsFinished() == true); } void testWalkInStraightLine() { auto testPosition = mitk::pa::Vector::New(); testPosition->SetElement(0, 0); testPosition->SetElement(1, 4); testPosition->SetElement(2, 4); auto testDirection = mitk::pa::Vector::New(); testDirection->SetElement(0, 1); testDirection->SetElement(1, 0); testDirection->SetElement(2, 0); auto params = mitk::pa::VesselProperties::New(); params->SetDoPartialVolume(false); params->SetRadiusInVoxel(1); params->SetBifurcationFrequency(100); params->SetAbsorptionCoefficient(10); params->SetScatteringCoefficient(10); params->SetAnisotopyCoefficient(10); params->SetPositionVector(testPosition); params->SetDirectionVector(testDirection); m_TestVessel = mitk::pa::Vessel::New(params); CPPUNIT_ASSERT(m_TestVessel->CanBifurcate() == false); CPPUNIT_ASSERT(m_TestVessel->IsFinished() == false); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4)) <= mitk::eps); m_TestVessel->ExpandVessel(m_TestInSilicoVolume, m_StraightLine, 0, nullptr); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4) - 10) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4) - 10) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 5, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 5, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 5, 4)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 6, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 6, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 6, 4)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 5)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 5)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 5)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 6)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 6)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 6)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(2, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(2, 4, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(2, 4, 4)) <= mitk::eps); m_TestVessel->ExpandVessel(m_TestInSilicoVolume, m_StraightLine, 0, nullptr); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4) - 10) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4) - 10) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 5, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 5, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 5, 4)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 6, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 6, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 6, 4)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 5)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 5)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 5)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 6)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 6)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 6)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4) - 10) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4) - 10) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4) - 10) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(1, 4, 4) - 10) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(2, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(2, 4, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(2, 4, 4)) <= mitk::eps); CPPUNIT_ASSERT_MESSAGE(std::to_string(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(3, 4, 4)), - abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(3, 4, 4)) <= mitk::eps); + std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(3, 4, 4)) <= mitk::eps); } void testBifurcate() { auto testPosition = mitk::pa::Vector::New(); testPosition->SetElement(0, 0); testPosition->SetElement(1, 4); testPosition->SetElement(2, 4); auto testDirection = mitk::pa::Vector::New(); testDirection->SetElement(0, 1); testDirection->SetElement(1, 0); testDirection->SetElement(2, 0); auto params = mitk::pa::VesselProperties::New(); params->SetRadiusInVoxel(1); params->SetBifurcationFrequency(1); params->SetAbsorptionCoefficient(10); params->SetScatteringCoefficient(10); params->SetAnisotopyCoefficient(10); params->SetPositionVector(testPosition); params->SetDirectionVector(testDirection); m_TestVessel = mitk::pa::Vessel::New(params); CPPUNIT_ASSERT(m_TestVessel->CanBifurcate() == false); CPPUNIT_ASSERT(m_TestVessel->IsFinished() == false); CPPUNIT_ASSERT(std::abs(m_TestInSilicoVolume->GetAbsorptionVolume()->GetData(0, 4, 4)) <= mitk::eps); m_TestVessel->ExpandVessel(m_TestInSilicoVolume, m_StraightLine, 0, nullptr); m_TestVessel->ExpandVessel(m_TestInSilicoVolume, m_StraightLine, 0, nullptr); CPPUNIT_ASSERT(m_TestVessel->CanBifurcate() == true); std::mt19937 rng; auto bifurcationVessel = m_TestVessel->Bifurcate(&rng); CPPUNIT_ASSERT(m_TestVessel->CanBifurcate() == false); CPPUNIT_ASSERT(bifurcationVessel->CanBifurcate() == false); } void tearDown() override { } }; MITK_TEST_SUITE_REGISTRATION(mitkPhotoacousticVessel) diff --git a/Modules/Python/autoload/PythonService/mitkPythonService.h b/Modules/Python/autoload/PythonService/mitkPythonService.h index 1c810b23f0..40135c9303 100644 --- a/Modules/Python/autoload/PythonService/mitkPythonService.h +++ b/Modules/Python/autoload/PythonService/mitkPythonService.h @@ -1,111 +1,111 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkPythonService_h #define mitkPythonService_h #include #include "mitkIPythonService.h" #include #include "mitkSurface.h" namespace mitk { /// /// implementation of the IPythonService using ctkabstractpythonmanager /// \see IPythonService class PythonService: public itk::LightObject, public mitk::IPythonService { public: /// /// instantiate python manager here PythonService(); /// /// empty implementation... - ~PythonService(); + ~PythonService() override; /// /// \see IPythonService::Execute() - std::string Execute( const std::string& pythonCommand, int commandType = SINGLE_LINE_COMMAND ); + std::string Execute( const std::string& pythonCommand, int commandType = SINGLE_LINE_COMMAND ) override; /// /// \see IPythonService::ExecuteScript() - void ExecuteScript(const std::string &pathToPythonScript); + void ExecuteScript(const std::string &pathToPythonScript) override; /// /// \see IPythonService::PythonErrorOccured() - bool PythonErrorOccured() const; + bool PythonErrorOccured() const override; /// /// \see IPythonService::GetVariableStack() - std::vector GetVariableStack() const; + std::vector GetVariableStack() const override; /// /// \see IPythonService::DoesVariableExist() - bool DoesVariableExist(const std::string& name) const; + bool DoesVariableExist(const std::string& name) const override; /// /// \see IPythonService::GetVariable() - std::string GetVariable(const std::string& name) const; + std::string GetVariable(const std::string& name) const override; /// /// \see IPythonService::AddPythonCommandObserver() - void AddPythonCommandObserver( PythonCommandObserver* observer ); + void AddPythonCommandObserver( PythonCommandObserver* observer ) override; /// /// \see IPythonService::RemovePythonCommandObserver() - void RemovePythonCommandObserver( PythonCommandObserver* observer ); + void RemovePythonCommandObserver( PythonCommandObserver* observer ) override; /// /// \see IPythonService::NotifyObserver() - void NotifyObserver( const std::string& command ); + void NotifyObserver( const std::string& command ) override; /// /// \see IPythonService::IsItkPythonWrappingAvailable() - bool IsSimpleItkPythonWrappingAvailable(); + bool IsSimpleItkPythonWrappingAvailable() override; /// /// \see IPythonService::CopyToPythonAsItkImage() - bool CopyToPythonAsSimpleItkImage( mitk::Image* image, const std::string& varName ); + bool CopyToPythonAsSimpleItkImage( mitk::Image* image, const std::string& varName ) override; /// /// \see IPythonService::CopyItkImageFromPython() - mitk::Image::Pointer CopySimpleItkImageFromPython( const std::string& varName ); + mitk::Image::Pointer CopySimpleItkImageFromPython( const std::string& varName ) override; /// /// \see IPythonService::IsOpenCvPythonWrappingAvailable() - bool IsOpenCvPythonWrappingAvailable(); + bool IsOpenCvPythonWrappingAvailable() override; /// /// \see IPythonService::CopyToPythonAsCvImage() - bool CopyToPythonAsCvImage( mitk::Image* image, const std::string& varName ); + bool CopyToPythonAsCvImage( mitk::Image* image, const std::string& varName ) override; /// /// \see IPythonService::CopyCvImageFromPython() - mitk::Image::Pointer CopyCvImageFromPython( const std::string& varName ); + mitk::Image::Pointer CopyCvImageFromPython( const std::string& varName ) override; /// /// \see IPythonService::IsVtkPythonWrappingAvailable() - bool IsVtkPythonWrappingAvailable(); + bool IsVtkPythonWrappingAvailable() override; /// /// \see IPythonService::CopyToPythonAsVtkPolyData() - bool CopyToPythonAsVtkPolyData( mitk::Surface* surface, const std::string& varName ); + bool CopyToPythonAsVtkPolyData( mitk::Surface* surface, const std::string& varName ) override; /// /// \see IPythonService::CopyVtkPolyDataFromPython() - mitk::Surface::Pointer CopyVtkPolyDataFromPython( const std::string& varName ); + mitk::Surface::Pointer CopyVtkPolyDataFromPython( const std::string& varName ) override; /// /// \return the ctk abstract python manager instance - ctkAbstractPythonManager* GetPythonManager(); + ctkAbstractPythonManager* GetPythonManager() override; - void AddRelativeSearchDirs(std::vector< std::string > dirs); + void AddRelativeSearchDirs(std::vector< std::string > dirs) override; - void AddAbsoluteSearchDirs(std::vector< std::string > dirs); + void AddAbsoluteSearchDirs(std::vector< std::string > dirs) override; protected: private: QList m_Observer; ctkAbstractPythonManager m_PythonManager; bool m_ItkWrappingAvailable; bool m_OpenCVWrappingAvailable; bool m_VtkWrappingAvailable; bool m_ErrorOccured; }; } #endif diff --git a/Modules/ToFHardware/mitkToFDeviceFactoryManager.h b/Modules/ToFHardware/mitkToFDeviceFactoryManager.h index b98fdabec8..ce2ee7415a 100644 --- a/Modules/ToFHardware/mitkToFDeviceFactoryManager.h +++ b/Modules/ToFHardware/mitkToFDeviceFactoryManager.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkToFDeviceListener_h #define __mitkToFDeviceListener_h #include #include "mitkToFCameraDevice.h" //Microservices #include namespace mitk { struct IToFDeviceFactory; /** * @brief ToFDeviceListener * * @ingroup ToFHardware */ class MITKTOFHARDWARE_EXPORT ToFDeviceFactoryManager: public itk::Object { public: mitkClassMacroItkParent( ToFDeviceFactoryManager, itk::Object ); itkFactorylessNewMacro(Self) itkCloneMacro(Self) std::vector GetRegisteredDeviceFactories(); std::vector GetConnectedDevices(); ToFCameraDevice* GetInstanceOfDevice(int index); protected: ToFDeviceFactoryManager(); - ~ToFDeviceFactoryManager(); + ~ToFDeviceFactoryManager() override; std::vector m_RegisteredFactoryNames; std::vector > m_RegisteredFactoryRefs; private: }; } //END mitk namespace #endif diff --git a/Modules/US/USModel/mitkUSIGTLDevice.h b/Modules/US/USModel/mitkUSIGTLDevice.h index 8e0291208b..69d3ec77d8 100644 --- a/Modules/US/USModel/mitkUSIGTLDevice.h +++ b/Modules/US/USModel/mitkUSIGTLDevice.h @@ -1,165 +1,165 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKIGTLDevice_H_HEADER_INCLUDED_ #define MITKIGTLDevice_H_HEADER_INCLUDED_ #include #include #include #include #include #include #include #include #include #include namespace itk { template class SmartPointer; } namespace mitk { class USVideoDeviceCustomControls; class USAbstractControlInterface; /** * \brief A mitk::USIGTLDevice is a USDevice to receive images over an OpenIGTLink * connection. It registers an OIGTL device as a Microservice to receive image messages * and transforms them to mitk::Images. It can act both as a server (listening for * incoming connections) and as a client (connecting to an existing OIGTL server). * * \ingroup US */ class MITKUS_EXPORT USIGTLDevice : public mitk::USDevice { public: mitkClassMacro(USIGTLDevice, mitk::USDevice); // To open a device (Manufacturer, Model, Hostname, Port, IsServer) mitkNewMacro5Param(Self, std::string, std::string, std::string, int, bool); std::string GetDeviceClass() override; USImageSource::Pointer GetUSImageSource() override; USIGTLDevice(std::string manufacturer, std::string model, std::string host, int port, bool server); /** * Getter for the custom control interface which was created during the * construction process of mitk::USIGTLDevice. * * \return custom control interface of the video device */ itk::SmartPointer GetControlInterfaceCustom() override; /** * \brief Remove the IGTLDevice from the micro service. */ void UnregisterOnService(); // Neu hinzugefügt: /** * \brief Return all probes for this USVideoDevice or an empty vector it no probes were set * Returns a std::vector of all probes that exist for this USVideoDevice if there were probes set while creating or modifying this USVideoDevice. * Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it! */ - virtual std::vector GetAllProbes() override; + std::vector GetAllProbes() override; /** * \brief Cleans the std::vector containing all configured probes. */ - virtual void DeleteAllProbes() override; + void DeleteAllProbes() override; /** * \brief Return current active probe for this USDevice * Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice. * Returns null otherwise */ - virtual mitk::USProbe::Pointer GetCurrentProbe() override; + mitk::USProbe::Pointer GetCurrentProbe() override; /** \brief adds a new probe to the device */ - virtual void AddNewProbe(mitk::USProbe::Pointer probe) override; + void AddNewProbe(mitk::USProbe::Pointer probe) override; /** * \brief get the probe by its name * Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned. */ - virtual mitk::USProbe::Pointer GetProbeByName(std::string name) override; + mitk::USProbe::Pointer GetProbeByName(std::string name) override; /** * \brief Removes the Probe with the given name */ - virtual void RemoveProbeByName(std::string name) override; + void RemoveProbeByName(std::string name) override; /** * \brief Sets the first existing probe or the default probe of the video device * as the current probe of it. */ - virtual void SetDefaultProbeAsCurrentProbe() override; + void SetDefaultProbeAsCurrentProbe() override; /** * \brief Sets the probe with the given name as current probe if the named probe exists. */ - virtual void SetCurrentProbe(std::string probename) override; + void SetCurrentProbe(std::string probename) override; /** * \brief Sets the given spacing of the current depth of the current probe. */ void SetSpacing(double xSpacing, double ySpacing) override; protected: bool OnInitialization() override; bool OnConnection() override; bool OnDisconnection() override; bool OnActivation() override; bool OnDeactivation() override; /** * \brief Grabs the next frame from the Video input. * This method is called internally, whenever Update() is invoked by an Output. */ - virtual void GenerateData() override; + void GenerateData() override; private: std::string m_Host; int m_Port; mitk::IGTLDevice::Pointer m_Device; mitk::IGTL2DImageDeviceSource::Pointer m_DeviceSource; mitk::IGTLTrackingDataDeviceSource::Pointer m_TransformDeviceSource; mitk::IGTLMessageToUSImageFilter::Pointer m_Filter; /** * \brief custom control interface for us video device */ itk::SmartPointer m_ControlInterfaceCustom; /** * \brief probes for this USVideoDevice */ std::vector < mitk::USProbe::Pointer > m_Probes; /** \brief probe that is currently in use */ mitk::USProbe::Pointer m_CurrentProbe; }; } // namespace mitk #endif // MITKIGTLDevice_H_HEADER_INCLUDED_ diff --git a/Modules/US/USModel/mitkUSVideoDevice.h b/Modules/US/USModel/mitkUSVideoDevice.h index cb989d82ca..88d350b634 100644 --- a/Modules/US/USModel/mitkUSVideoDevice.h +++ b/Modules/US/USModel/mitkUSVideoDevice.h @@ -1,252 +1,252 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSVideoDevice_H_HEADER_INCLUDED_ #define MITKUSVideoDevice_H_HEADER_INCLUDED_ #include #include #include "mitkUSDevice.h" #include "mitkUSImageVideoSource.h" #include "mitkUSProbe.h" #include namespace itk { template class SmartPointer; } namespace mitk { class USVideoDeviceCustomControls; class USAbstractControlInterface; /** * \brief A mitk::USVideoDevice is the common class for video only devices. * They capture video input either from a file or from a device and * transform the output into an mitk::USImage with attached metadata. * This simple implementation does only capture and display 2d images without * registration for example. * * \ingroup US */ class MITKUS_EXPORT USVideoDevice : public mitk::USDevice { public: mitkClassMacro(USVideoDevice, mitk::USDevice); // To open a device (DeviceID, Manufacturer, Model) mitkNewMacro3Param(Self, int, std::string, std::string); // To open A VideoFile (Path, Manufacturer, Model) mitkNewMacro3Param(Self, std::string, std::string, std::string); // To open a device (DeviceID, Metadata) mitkNewMacro2Param(Self, int, mitk::USImageMetadata::Pointer); // To open A VideoFile (Path, Metadata) mitkNewMacro2Param(Self, std::string, mitk::USImageMetadata::Pointer); /** * \return the qualified name of this class (as returned by GetDeviceClassStatic()) */ std::string GetDeviceClass() override; /** * This methode is necessary instead of a static member attribute to avoid * "static initialization order fiasco" when an instance of this class is * used in a module activator. * * \return the qualified name of this class */ static std::string GetDeviceClassStatic(); /** * Getter for the custom control interface which was created during the * construction process of mitk::USVideoDevice. * * \return custom control interface of the video device */ itk::SmartPointer GetControlInterfaceCustom() override; /** * \brief Remove this device from the micro service. * This method is public for mitk::USVideoDevice, because this devices * can be completly removed. This is not possible for API devices, which * should be available while their sub module is loaded. */ void UnregisterOnService(); /** * \return mitk::USImageSource connected to this device */ USImageSource::Pointer GetUSImageSource() override; /** * \brief Return all probes for this USVideoDevice or an empty vector it no probes were set * Returns a std::vector of all probes that exist for this USVideoDevice if there were probes set while creating or modifying this USVideoDevice. * Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it! */ - virtual std::vector GetAllProbes() override; + std::vector GetAllProbes() override; /** * \brief Cleans the std::vector containing all configured probes. */ - virtual void DeleteAllProbes() override; + void DeleteAllProbes() override; /** * \brief Return current active probe for this USVideoDevice * Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USVideoDevice. * Returns null otherwise */ - virtual mitk::USProbe::Pointer GetCurrentProbe() override; + mitk::USProbe::Pointer GetCurrentProbe() override; /** \brief adds a new probe to the device */ - virtual void AddNewProbe(mitk::USProbe::Pointer probe) override; + void AddNewProbe(mitk::USProbe::Pointer probe) override; /** * \brief get the probe by its name * Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned. */ - virtual mitk::USProbe::Pointer GetProbeByName(std::string name) override; + mitk::USProbe::Pointer GetProbeByName(std::string name) override; /** * \brief Removes the Probe with the given name */ - virtual void RemoveProbeByName(std::string name) override; + void RemoveProbeByName(std::string name) override; /** \brief True, if this Device plays back a file, false if it recieves data from a device */ bool GetIsSourceFile(); /** * \brief Sets the first existing probe or the default probe of the video device * as the current probe of it. */ - virtual void SetDefaultProbeAsCurrentProbe() override; + void SetDefaultProbeAsCurrentProbe() override; /** * \brief Sets the probe with the given name as current probe if the named probe exists. */ - virtual void SetCurrentProbe( std::string probename ) override; + void SetCurrentProbe( std::string probename ) override; /** * \brief Sets the given spacing of the current depth of the current probe. */ void SetSpacing( double xSpacing, double ySpacing ) override; itkGetMacro(ImageVector, std::vector); itkGetMacro(DeviceID, int); itkGetMacro(FilePath, std::string); protected: /** * \brief Creates a new device that will deliver USImages taken from a video device. * under windows, try -1 for device number, which will grab the first available one * (Open CV functionality) */ USVideoDevice(int videoDeviceNumber, std::string manufacturer, std::string model); /** * \brief Creates a new device that will deliver USImages taken from a video file. */ USVideoDevice(std::string videoFilePath, std::string manufacturer, std::string model); /** * \brief Creates a new device that will deliver USImages taken from a video device. * under windows, try -1 for device number, which will grab the first available one * (Open CV functionality) */ USVideoDevice(int videoDeviceNumber, mitk::USImageMetadata::Pointer metadata); /** * \brief Creates a new device that will deliver USImages taken from a video file. */ USVideoDevice(std::string videoFilePath, mitk::USImageMetadata::Pointer metadata); ~USVideoDevice() override; /** * \brief Initializes common properties for all constructors. */ void Init(); /** * \brief Is called during the initialization process. * Returns true if successful and false if unsuccessful. Additionally, you may throw an exception to clarify what went wrong. */ bool OnInitialization() override; /** * \brief Is called during the connection process. * Returns true if successful and false if unsuccessful. Additionally, you may throw an exception to clarify what went wrong. */ bool OnConnection() override; /** * \brief Is called during the disconnection process. * Returns true if successful and false if unsuccessful. Additionally, you may throw an exception to clarify what went wrong. */ bool OnDisconnection() override; /** * \brief Is called during the activation process. After this method is finsihed, the device should be generating images */ bool OnActivation() override; /** * \brief Is called during the deactivation process. After a call to this method the device should still be connected, but not producing images anymore. */ bool OnDeactivation() override; /** * \brief Grabs the next frame from the Video input. * This method is called internally, whenever Update() is invoked by an Output. */ - virtual void GenerateData() override; + void GenerateData() override; /** * \brief The image source that we use to aquire data */ mitk::USImageVideoSource::Pointer m_Source; /** * \brief True, if this source plays back a file, false if it recieves data from a device */ bool m_SourceIsFile; /** * \brief The device id to connect to. Undefined, if m_SourceIsFile == true; */ int m_DeviceID; /** * \brief The Filepath id to connect to. Undefined, if m_SourceIsFile == false; */ std::string m_FilePath; /** * \brief custom control interface for us video device */ itk::SmartPointer m_ControlInterfaceCustom; /** * \brief probes for this USVideoDevice */ std::vector < mitk::USProbe::Pointer > m_Probes; /** \brief probe that is currently in use */ mitk::USProbe::Pointer m_CurrentProbe; }; } // namespace mitk #endif // MITKUSVideoDevice_H_HEADER_INCLUDED_ diff --git a/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h b/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h index dfc8bb59a5..81f1f536a9 100644 --- a/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h +++ b/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h @@ -1,279 +1,279 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkAbstractUltrasoundTrackerDevice_h #define __mitkAbstractUltrasoundTrackerDevice_h #include #include "mitkUSDevice.h" #include "mitkImageSource.h" #include "mitkNavigationDataSource.h" // Microservices #include #include #include #include #include #include namespace itk { template class SmartPointer; } namespace mitk { class NavigationDataSmoothingFilter; class NavigationDataDelayFilter; class NavigationDataDisplacementFilter; /** * \brief Abstract class for an easy handling of a combination of an USDevice and * a NavigationDataSource. * This class can be used as an ImageSource subclass. Additionally tracking data be * retrieved from the NavigationDataSource returned by GetTrackingDevice(). * * A calibration of the ultrasound image stream to the navigation datas can be set * for the currently active zoom level (of the ultrasound device) by SetCalibration() * The ultrasound images are transformed according to this calibration in the * GenerateData() method. */ class MITKUSNAVIGATION_EXPORT AbstractUltrasoundTrackerDevice : public mitk::ImageSource { public: static const std::string DeviceClassIdentifier; static const char* DefaultProbeIdentifier; static const char* ProbeAndDepthSeperator; static const std::string US_INTERFACE_NAME; static const std::string US_PROPKEY_DEVICENAME; static const std::string US_PROPKEY_CLASS; static const std::string US_PROPKEY_ID; mitkClassMacro(AbstractUltrasoundTrackerDevice, mitk::ImageSource); mitkNewMacro3Param(AbstractUltrasoundTrackerDevice, USDevice::Pointer, itk::SmartPointer, bool); itkGetMacro(UltrasoundDevice, itk::SmartPointer); itkSetMacro(UltrasoundDevice, itk::SmartPointer); itkGetMacro(TrackingDeviceDataSource, itk::SmartPointer); itkSetMacro(TrackingDeviceDataSource, itk::SmartPointer); itkGetMacro(IsTrackedUltrasoundActive, bool); /** * \brief Getter for calibration data of the currently active depth and probe. * * \return Transformation for calibration or null if no calibration is available. */ AffineTransform3D::Pointer GetCalibration(); /** * \brief Getter for calibration data of the given depth and the currently active probe. * * \param depth depth of the b mode ultrasound image for which the calibration should be returned * \return Transformation for calibration or null if no calibration is available. */ AffineTransform3D::Pointer GetCalibration(std::string depth); /** * \brief Getter for calibration data of the given depth and probe. * * \param depth depth of the b mode ultrasound image for which the calibration should be returned * \param probe probe of the ultrasound device for which the calibration should be returned * \return Transformation for calibration or null if no calibration is available. */ AffineTransform3D::Pointer GetCalibration(std::string depth, std::string probe); /** Returns the index to world transform of the US plane. */ virtual AffineTransform3D::Pointer GetUSPlaneTransform(); /** * \brief Sets a transformation as calibration data. * Calibration data is set for the currently activated probe and their current * zoom factor. It also marks the device as calibrated. */ void SetCalibration(AffineTransform3D::Pointer calibration); /** * \brief Removes the calibration data of the currently active depth and probe. * \return true on success, false if there was no calibration */ bool RemoveCalibration(); /** * \brief Removes the calibration data of the given depth and the currently active probe. * * \param depth depth of the b mode ultrasound image for which the calibration should be removed * \return true on success, false if there was no calibration */ bool RemoveCalibration(std::string depth); /** * \brief Removes the calibration data of the given depth and probe. * * \param depth depth of the b mode ultrasound image for which the calibration should be removed * \param probe probe of the ultrasound device for which the calibration should be removed * \return true on success, false if there was no calibration */ bool RemoveCalibration(std::string depth, std::string probe); /** * \brief Returns the Class of the Device. */ std::string GetDeviceClass(); /** * \brief Wrapper for returning USImageSource of the UltrasoundDevice. */ USImageSource::Pointer GetUSImageSource(); itk::SmartPointer GetNavigationDataSource(); /** * \return true if the device is calibrated for the currently selected probe with the current zoom level */ bool GetIsCalibratedForCurrentStatus(); /** * \return true if a calibration was loaded for at least one probe and depth */ bool GetContainsAtLeastOneCalibration(); /** * \brief Serializes all contained calibrations into an xml fragment. * * The returned string contains one parent node named "calibrations" and several * subnodes, one for each calibration that is present. */ std::string SerializeCalibration(); /** * \brief Deserializes a string provided by a prior call to Serialize(). * If the bool flag is true, all prior calibrations will be deleted. * If the flag is set to false, prior calibrations will be retained, but overwritten * if one of equal name is present. * * \throws mitk::Exception if the given string could not be parsed correctly. */ void DeserializeCalibration(const std::string &xmlString, bool clearPreviousCalibrations = true); void SetNumberOfSmoothingValues(unsigned int numberOfSmoothingValues); void SetDelayCount(unsigned int delayCount); /** * \brief Remove this device from the micro service. * This method is public for mitk::USCombinedModality, because this devices * can be completly removed. This is not possible for API devices, which * should be available while their sub module is loaded. */ void UnregisterOnService(); virtual void RegisterAsMicroservice(); /** * \brief Wrapper for returning custom control interface of the UltrasoundDevice. */ virtual itk::SmartPointer GetControlInterfaceCustom(); /** * \brief Wrapper for returning B mode control interface of the UltrasoundDevice. */ virtual itk::SmartPointer GetControlInterfaceBMode(); /** * \brief Wrapper for returning probes control interface of the UltrasoundDevice. */ virtual itk::SmartPointer GetControlInterfaceProbes(); /** * \brief Wrapper for returning doppler control interface of the UltrasoundDevice. */ virtual itk::SmartPointer GetControlInterfaceDoppler(); /** * \brief Can toggle if the combined modality is currently updated or freezed. * * \param freeze true to stop updating the ultrasound image and the tracking data, false to start updating again */ virtual void SetIsFreezed(bool freeze); /** * \return true if device is currently freezed (no image/tracking data update is done), false otherwise */ virtual bool GetIsFreezed(); /** * \brief Called when mitk::AbstractUltrasoundTrackerDevice::SetIsFreezed() is called. * Subclasses can overwrite this method to do additional actions. Default * implementation does noting. */ virtual void OnFreeze(bool) { } protected: AbstractUltrasoundTrackerDevice( USDevice::Pointer usDevice, itk::SmartPointer trackingDevice, bool trackedUltrasoundActive ); - virtual ~AbstractUltrasoundTrackerDevice(); + ~AbstractUltrasoundTrackerDevice() override; /** * \brief Grabs the next frame from the input. * Must be implemented by the derived class. * This method is called internally, whenever Update() is invoked by an Output. */ - virtual void GenerateData() override; + void GenerateData() override; std::string GetIdentifierForCurrentCalibration(); std::string GetIdentifierForCurrentProbe(); std::string GetCurrentDepthValue(); void RebuildFilterPipeline(); USDevice::Pointer m_UltrasoundDevice; itk::SmartPointer m_TrackingDeviceDataSource; std::map m_Calibrations; itk::SmartPointer m_SmoothingFilter; itk::SmartPointer m_DelayFilter; itk::SmartPointer m_DisplacementFilter; itk::SmartPointer m_LastFilterOfIGTPipeline; unsigned int m_NumberOfSmoothingValues; unsigned int m_DelayCount; /** * \brief The device's ServiceRegistration object that allows to modify it's Microservice registraton details. */ us::ServiceRegistration m_ServiceRegistration; /** * \brief Properties of the device's Microservice. */ us::ServiceProperties m_ServiceProperties; private: bool m_IsFreezed; bool m_IsTrackedUltrasoundActive; }; } // namespace mitk MITK_DECLARE_SERVICE_INTERFACE(mitk::AbstractUltrasoundTrackerDevice, "org.mitk.services.AbstractUltrasoundTrackerDevice") #endif diff --git a/Modules/US/USNavigation/mitkTrackedUltrasound.h b/Modules/US/USNavigation/mitkTrackedUltrasound.h index 32a3d81816..1a47925960 100644 --- a/Modules/US/USNavigation/mitkTrackedUltrasound.h +++ b/Modules/US/USNavigation/mitkTrackedUltrasound.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __mitkTrackedUltrasound_h #define __mitkTrackedUltrasound_h #include #include "mitkUSDevice.h" #include "mitkImageSource.h" #include "mitkAbstractUltrasoundTrackerDevice.h" #include "mitkNavigationDataSource.h" namespace itk { template class SmartPointer; } namespace mitk { /** * \brief Combination of USDevice and NavigationDataSource. * This class can be used as an ImageSource subclass. Additionally tracking data be * retrieved from the NavigationDataSource returned by GetTrackingDevice(). * * A calibration of the ultrasound image stream to the navigation datas can be set * for the currently active zoom level (of the ultrasound device) by SetCalibration(). * The ultrasound images are transformed according to this calibration in the * GenerateData() method. */ class MITKUSNAVIGATION_EXPORT TrackedUltrasound : public mitk::AbstractUltrasoundTrackerDevice { public: mitkClassMacro(TrackedUltrasound, mitk::AbstractUltrasoundTrackerDevice); mitkNewMacro3Param(TrackedUltrasound, USDevice::Pointer, itk::SmartPointer, bool); - virtual AffineTransform3D::Pointer GetUSPlaneTransform(); + AffineTransform3D::Pointer GetUSPlaneTransform() override; protected: TrackedUltrasound( USDevice::Pointer usDevice, itk::SmartPointer trackingDevice, bool trackedUltrasoundActive = true ); - virtual ~TrackedUltrasound(); + ~TrackedUltrasound() override; /** * \brief Grabs the next frame from the input. * This method is called internally, whenever Update() is invoked by an Output. */ void GenerateData() override; /** * \brief Freezes or unfreezes the TrackedUltrasound device. */ void OnFreeze(bool) override; }; } // namespace mitk #endif // __mitkTrackedUltrasound_h diff --git a/Modules/US/USNavigation/mitkUSCombinedModality.h b/Modules/US/USNavigation/mitkUSCombinedModality.h index 6d8bf2781c..95c9e260d3 100644 --- a/Modules/US/USNavigation/mitkUSCombinedModality.h +++ b/Modules/US/USNavigation/mitkUSCombinedModality.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSCombinedModality_H_HEADER_INCLUDED_ #define MITKUSCombinedModality_H_HEADER_INCLUDED_ #include #include "mitkUSDevice.h" #include "mitkImageSource.h" #include "mitkAbstractUltrasoundTrackerDevice.h" #include "mitkNavigationDataSource.h" // Microservices #include #include namespace itk { template class SmartPointer; } namespace mitk { class USControlInterfaceBMode; class USControlInterfaceProbes; class USControlInterfaceDoppler; /** * \brief Combination of USDevice and NavigationDataSource. * This class can be used as an ImageSource subclass. Additionally tracking data be * retrieved from the NavigationDataSource returned by GetTrackingDevice(). * * A calibration of the ultrasound image stream to the navigation datas can be set * for the currently active zoom level (of the ultrasound device) by SetCalibration(). * The ultrasound images are transformed according to this calibration in the * GenerateData() method. */ class MITKUSNAVIGATION_EXPORT USCombinedModality : public mitk::AbstractUltrasoundTrackerDevice { public: mitkClassMacro(USCombinedModality, mitk::AbstractUltrasoundTrackerDevice); mitkNewMacro3Param(USCombinedModality, USDevice::Pointer, itk::SmartPointer, bool); - virtual AffineTransform3D::Pointer GetUSPlaneTransform(); + AffineTransform3D::Pointer GetUSPlaneTransform() override; protected: USCombinedModality( USDevice::Pointer usDevice, itk::SmartPointer trackingDevice, bool trackedUltrasoundActive = false ); - virtual ~USCombinedModality(); + ~USCombinedModality() override; /** * \brief Grabs the next frame from the input. * This method is called internally, whenever Update() is invoked by an Output. */ void GenerateData() override; /** * \brief Freezes or unfreezes the CombinedModality. */ void OnFreeze(bool) override; }; } // namespace mitk #endif // MITKUSCombinedModality_H_HEADER_INCLUDED_ diff --git a/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h index cfc6955fdb..ff9c305bb7 100644 --- a/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h +++ b/Modules/USUI/Qmitk/QmitkUSControlsCustomDiPhASDeviceWidget.h @@ -1,117 +1,117 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkUSControlsCustomDiPhASDeviceWidget_H #define QmitkUSControlsCustomDiPhASDeviceWidget_H #include "QmitkUSAbstractCustomWidget.h" #include "mitkUSDiPhASDeviceCustomControls.h" #include "mitkUSDevice.h" #include namespace Ui { class QmitkUSControlsCustomDiPhASDeviceWidget; } /** \brief Widget for custom controls of mitk::USDiPhASDevice. * This class handles the itk::USDiPhASDeviceCustomControls of video device * objects. */ class QmitkUSControlsCustomDiPhASDeviceWidget : public QmitkUSAbstractCustomWidget { Q_OBJECT private slots: virtual void OnCompensateEnergyChanged(); virtual void OnUseBModeFilterChanged(); virtual void OnVerticalSpacingChanged(); virtual void OnRecordChanged(); virtual void OnScatteringCoefficientChanged(); virtual void OnCompensateScatteringChanged(); virtual void OnChangedSavingSettings(); //Transmit virtual void OnTransmitPhaseLengthChanged(); virtual void OnExcitationFrequencyChanged(); virtual void OnTransmitEventsChanged(); virtual void OnVoltageChanged(); virtual void OnModeChanged(); //Receive virtual void OnScanDepthChanged(); virtual void OnAveragingCountChanged(); virtual void OnTGCMinChanged(); virtual void OnTGCMaxChanged(); virtual void OnDataTypeChanged(); //Beamforming virtual void OnPitchChanged(); virtual void OnReconstructedSamplesChanged(); virtual void OnReconstructedLinesChanged(); virtual void OnSpeedOfSoundChanged(); //Bandpass virtual void OnBandpassEnabledChanged(); virtual void OnLowCutChanged(); virtual void OnHighCutChanged(); public: /** * Constructs widget object. All gui control elements will be disabled until * QmitkUSAbstractCustomWidget::SetDevice() was called. */ QmitkUSControlsCustomDiPhASDeviceWidget(); - ~QmitkUSControlsCustomDiPhASDeviceWidget(); + ~QmitkUSControlsCustomDiPhASDeviceWidget() override override; /** * Getter for the device class of mitk:USDiPhASDevice. */ std::string GetDeviceClass() const override; /** * Creates new QmitkUSAbstractCustomWidget with the same mitk::USDiPhASDevice * and the same mitk::USDiPhASDeviceCustomControls which were set on the * original object. * * This method is just for being calles by the factory. Use * QmitkUSAbstractCustomWidget::CloneForQt() instead, if you want a clone of * an object. */ QmitkUSAbstractCustomWidget* Clone(QWidget* parent = nullptr) const override; /** * Gets control interface from the device which was currently set. Control * elements are according to current crop area of the device. If custom * control interface is null, the control elements stay disabled. */ void OnDeviceSet() override; void Initialize() override; protected: void BlockSignalAndSetValue(QSpinBox* target, int value); private: QmitkUSControlsCustomDiPhASDeviceWidget(QWidget *parent); Ui::QmitkUSControlsCustomDiPhASDeviceWidget* ui; mitk::USDiPhASDeviceCustomControls::Pointer m_ControlInterface; int m_OldReconstructionLines; }; #endif // QmitkUSControlsCustomDiPhASDeviceWidget_H \ No newline at end of file diff --git a/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h b/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h index 154320da7e..da291ba6fd 100644 --- a/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h +++ b/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h @@ -1,105 +1,105 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkUSControlsCustomVideoDeviceWidget_H #define QmitkUSControlsCustomVideoDeviceWidget_H #include "QmitkUSAbstractCustomWidget.h" #include "mitkUSVideoDeviceCustomControls.h" #include "mitkUSVideoDevice.h" #include namespace Ui { class QmitkUSControlsCustomVideoDeviceWidget; } /** \brief Widget for custom controls of mitk::USVideoDevice. * This class handles the itk::USVideoDeviceCustomControls of video device * objects. */ class QmitkUSControlsCustomVideoDeviceWidget : public QmitkUSAbstractCustomWidget { Q_OBJECT private slots: /** * \brief Called when user changes one of the crop area control elements. */ void OnCropAreaChanged(); /** * \brief Called when user changes the scanning depth of the ultrasound */ void OnDepthChanged(); /** * \brief Called when user chagnes the identifier for the probe of the ultrasoud machine */ void OnProbeChanged(); /** * \brief Get all depths for the given probe and fill them into a combobox */ void SetDepthsForProbe(std::string probename); public: QmitkUSControlsCustomVideoDeviceWidget(); - ~QmitkUSControlsCustomVideoDeviceWidget(); + ~QmitkUSControlsCustomVideoDeviceWidget() override override; /** * Getter for the device class of mitk:USVideoDevice. */ std::string GetDeviceClass() const override; /** * Creates new QmitkUSAbstractCustomWidget with the same mitk::USVideoDevice * and the same mitk::USVideoDeviceCustomControls which were set on the * original object. * * This method is just for being calles by the factory. Use * QmitkUSAbstractCustomWidget::CloneForQt() instead, if you want a clone of * an object. */ QmitkUSAbstractCustomWidget* Clone(QWidget* parent = nullptr) const override; /** * Gets control interface from the device which was currently set. Control * elements are according to current crop area of the device. If custom * control interface is null, the control elements stay disabled. */ void OnDeviceSet() override; void Initialize() override; protected: void BlockSignalAndSetValue(QSpinBox* target, int value); mitk::USImageVideoSource::USImageCropping m_Cropping; private: /** * Constructs widget object. All gui control elements will be disabled until * QmitkUSAbstractCustomWidget::SetDevice() was called. */ QmitkUSControlsCustomVideoDeviceWidget(QWidget *parent); Ui::QmitkUSControlsCustomVideoDeviceWidget* ui; mitk::USVideoDeviceCustomControls::Pointer m_ControlInterface; }; #endif // QmitkUSControlsCustomVideoDeviceWidget_H \ No newline at end of file diff --git a/Plugins/org.blueberry.core.jobs/src/berryJob.h b/Plugins/org.blueberry.core.jobs/src/berryJob.h index b5ef3530c7..5863bf8d9e 100644 --- a/Plugins/org.blueberry.core.jobs/src/berryJob.h +++ b/Plugins/org.blueberry.core.jobs/src/berryJob.h @@ -1,639 +1,639 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _BERRY_JOB_H #define _BERRY_JOB_H #include #include // #include "berryISchedulingRule.h" #include "berryJobExceptions.h" #include "internal/berryInternalJob.h" #include #include namespace berry { struct IJobManager; /** * Jobs are units of runnable work that can be scheduled to be run with the job * manager. Once a job has completed, it can be scheduled to run again (jobs are * reusable). *

* Jobs have a state that indicates what they are currently doing. When constructed, * jobs start with a state value of NONE. When a job is scheduled * to be run, it moves into the WAITING state. When a job starts * running, it moves into the RUNNING state. When execution finishes * (either normally or through cancellation), the state changes back to * NONE. *

* A job can also be in the SLEEPING state. This happens if a user * calls Job.sleep() on a waiting job, or if a job is scheduled to run after a specified * delay. Only jobs in the WAITING state can be put to sleep. * Sleeping jobs can be woken at any time using Job.wakeUp(), which will put the * job back into the WAITING state. *

* Jobs can be assigned a priority that is used as a hint about how the job should * be scheduled. There is no guarantee that jobs of one priority will be run before * all jobs of lower priority. The documentation of the various priority constants provide * more detail about what each priority means. By default, jobs start in the * LONG priority class. * * @see IJobManager * */ //TODO struct Job: public InternalJob, public IAdaptable class BERRY_JOBS Job: public InternalJob { public: berryObjectMacro(Job); /** * Job status return value that is used to indicate asynchronous job completion. * @see Job#Run(IProgressMonitor::Pointer) * @see Job#Done(IStatus::Pointer) */ static const IStatus::Pointer ASYNC_FINISH ; /* Job priorities */ /** * Job priority constant (value 10) for interactive jobs. * Interactive jobs generally have priority over all other jobs. * Interactive jobs should be either fast running or very low on CPU * usage to avoid blocking other interactive jobs from running. * * @see #GetPriority() * @see #SetPriority(int) * @see #Run(IProgressMonitor::Pointer) */ static const int INTERACTIVE = 10; /** * Job priority constant (value 20) for short background jobs. * Short background jobs are jobs that typically complete within a second, * but may take longer in some cases. Short jobs are given priority * over all other jobs except interactive jobs. * * @see #GetPriority() * @see #SetPriority(int) * @see #Run(IProgressMonitor::Pointer) */ static const int SHORT = 20; /** * Job priority constant (value 30) for long-running background jobs. * * @see #GetPriority() * @see #SetPriority(int) * @see #Run(IProgressMonitor::Pointer) */ static const int LONG = 30; /** * Job priority constant (value 40) for build jobs. Build jobs are * generally run after all other background jobs complete. * * @see #GetPriority() * @see #SetPriority(int) * @see #Run(IProgressMonitor) */ static const int BUILD = 40; /** * Job priority constant (value 50) for decoration jobs. * Decoration jobs have lowest priority. Decoration jobs generally * compute extra information that the user may be interested in seeing * but is generally not waiting for. * * @see #GetPriority() * @see #SetPriority(int) * @see #Run(IProgressMonitor) */ static const int DECORATE = 50; /** * Job state code (value 0) indicating that a job is not * currently sleeping, waiting, or running (i.e., the job manager doesn't know * anything about the job). * * @see #GetState() */ static const int NONE = 0; /** * Job state code (value 1) indicating that a job is sleeping. * * @see #Run(IProgressMonitor) * @see #GetState() */ static const int SLEEPING = 0x01; /** * Job state code (value 2) indicating that a job is waiting to be run. * * @see #GetState() */ static const int WAITING = 0x02; /** * Job state code (value 4) indicating that a job is currently running * * @see #GetState() */ static const int RUNNING = 0x04; /** * Returns the job manager. * * @return the job manager */ static const IJobManager* GetJobManager(); /** * Creates a new job with the specified name. The job name is a human-readable * value that is displayed to users. The name does not need to be unique, but it * must not be null. * * @param name the name of the job. */ Job(const QString& name); /** * Registers a job listener with this job * Has no effect if an identical listener is already registered. * * @param listener the listener to be added. */ void AddJobChangeListener(IJobChangeListener* listener); /** * Returns whether this job belongs to the given family. Job families are * represented as objects that are not interpreted or specified in any way * by the job manager. Thus, a job can choose to belong to any number of * families. *

* Clients may override this method. This default implementation always returns * false. Overriding implementations must return false * for families they do not recognize. *

* * @param family the job family identifier * @return true if this job belongs to the given family, and * false otherwise. */ bool BelongsTo(Object::Pointer family) override; /** * Stops the job. If the job is currently waiting, * it will be removed from the queue. If the job is sleeping, * it will be discarded without having a chance to resume and its sleeping state * will be cleared. If the job is currently executing, it will be asked to * stop but there is no guarantee that it will do so. * * @return false if the job is currently running (and thus may not * respond to cancellation), and true in all other cases. */ bool Cancel(); /** * Jobs that complete their execution asynchronously must indicate when they * are finished by calling this method. This method must not be called by * a job that has not indicated that it is executing asynchronously. *

* This method must not be called from within the scope of a job's run * method. Jobs should normally indicate completion by returning an appropriate * status from the run method. Jobs that return a status of * ASYNC_FINISH from their run method must later call * done to indicate completion. * * @param result a status object indicating the result of the job's execution. * @see #ASYNC_FINISH * @see #Run(IProgressMonitor::Pointer) */ void Done(IStatus::Pointer result); /** * Returns the human readable name of this job. The name is never * null. * * @return the name of this job */ QString GetName() const; /** * Returns the priority of this job. The priority is used as a hint when the job * is scheduled to be run. * * @return the priority of the job. One of INTERACTIVE, SHORT, LONG, BUILD, * or DECORATE. */ int GetPriority() const; /** * Returns the value of the property of this job identified by the given key, * or null if this job has no such property. * * @param key the name of the property * @return the value of the property, * or null if this job has no such property * @see #SetProperty(QualifiedName, Object) */ //TODO QualifiedName GetPropertys ///Object GetProperty(QualifiedName key) const ; /** * Returns the result of this job's last run. * * @return the result of this job's last run, or null if this * job has never finished running. */ IStatus::Pointer GetResult() const ; /** * Returns the scheduling rule for this job. Returns null if this job has no * scheduling rule. * * @return the scheduling rule for this job, or null. * @see ISchedulingRule * @see #SetRule(ISchedulingRule::Pointer) */ ISchedulingRule::Pointer GetRule() const; /** * Returns the state of the job. Result will be one of: *

    *
  • Job.RUNNING - if the job is currently running.
  • *
  • Job.WAITING - if the job is waiting to be run.
  • *
  • Job.SLEEPING - if the job is sleeping.
  • *
  • Job.NONE - in all other cases.
  • *
*

* Note that job state is inherently volatile, and in most cases clients * cannot rely on the result of this method being valid by the time the * result is obtained. For example, if getState returns * RUNNING, the job may have actually completed by the * time the getState method returns. All clients can infer from * invoking this method is that the job was recently in the returned state. * * @return the job state */ int GetState() const; /** * Returns the thread that this job is currently running in. * * @return the thread this job is running in, or null * if this job is not running or the thread is unknown. */ Poco::Thread* GetThread() const; /** * Returns whether this job is blocking a higher priority non-system job from * starting due to a conflicting scheduling rule. Returns false * if this job is not running, or is not blocking a higher priority non-system job. * * @return true if this job is blocking a higher priority non-system * job, and false otherwise. * @see #GetRule() * @see #IsSystem() */ bool IsBlocking(); /** * Returns whether this job is a system job. System jobs are typically not * revealed to users in any UI presentation of jobs. Other than their UI presentation, * system jobs act exactly like other jobs. If this value is not explicitly set, jobs * are treated as non-system jobs. The default value is false. * * @return true if this job is a system job, and * false otherwise. * @see #SetSystem(bool) */ bool IsSystem() const; /** * Returns whether this job has been directly initiated by a UI end user. * These jobs may be presented differently in the UI. The default value * is false. * * @return true if this job is a user-initiated job, and * false otherwise. * @see #SetUser(bool) */ bool IsUser() const; /** * Waits until this job is finished. This method will block the calling thread until the * job has finished executing, or until this thread has been interrupted. If the job * has not been scheduled, this method returns immediately. A job must not * be joined from within the scope of its run method. *

* If this method is called on a job that reschedules itself from within the * run method, the join will return at the end of the first execution. * In other words, join will return the first time this job exits the * {@link #RUNNING} state, or as soon as this job enters the {@link #NONE} state. *

*

* If this method is called while the job manager is suspended, this job * will only be joined if it is already running; if this job is waiting or sleeping, * this method returns immediately. *

*

* Note that there is a deadlock risk when using join. If the calling thread owns * a lock or object monitor that the joined thread is waiting for, deadlock * will occur. *

* * @exception InterruptedException if this thread is interrupted while waiting * @see ILock * @see IJobManager#Suspend() */ //TODO Error Join Problem InterruptedException /// void Join() ; /** * Removes a job listener from this job. * Has no effect if an identical listener is not already registered. * * @param listener the listener to be removed */ void RemoveJobChangeListener(IJobChangeListener* listener); /** * Schedules this job to be run. The job is added to a queue of waiting * jobs, and will be run when it arrives at the beginning of the queue. *

* This is a convenience method, fully equivalent to * Schedule(0L). *

* @see #Schedule(long) */ void Schedule(); /** * Schedules this job to be run after a specified delay. The job is put in the * {@link #SLEEPING} state until the specified delay has elapsed, after which * the job is added to a queue of {@link #WAITING} jobs. Once the job arrives * at the beginning of the queue, it will be run at the first available opportunity. *

* Jobs of equal priority and delay with conflicting scheduling * rules are guaranteed to run in the order they are scheduled. No guarantees * are made about the relative execution order of jobs with unrelated or * null scheduling rules, or different priorities. *

* If this job is currently running, it will be rescheduled with the specified * delay as soon as it finishes. If this method is called multiple times * while the job is running, the job will still only be rescheduled once, * with the most recent delay value that was provided. *

* Scheduling a job that is waiting or sleeping has no effect. *

* * @param delay a time delay in milliseconds before the job should run * @see ISchedulingRule */ void Schedule(Poco::Timestamp::TimeDiff delay); /** * Changes the name of this job. If the job is currently running, waiting, * or sleeping, the new job name may not take effect until the next time the * job is scheduled. *

* The job name is a human-readable value that is displayed to users. The name * does not need to be unique, but it must not be null. * * @param name the name of the job. */ void SetName(const QString& name); /** * Sets the priority of the job. This will not affect the execution of * a running job, but it will affect how the job is scheduled while * it is waiting to be run. * * @param priority the new job priority. One of * INTERACTIVE, SHORT, LONG, BUILD, or DECORATE. */ void SetPriority(int priority); /** * Associates this job with a progress group. Progress feedback * on this job's next execution will be displayed together with other * jobs in that group. The provided monitor must be a monitor * created by the method IJobManager.createProgressGroup * and must have at least ticks units of available work. *

* The progress group must be set before the job is scheduled. * The group will be used only for a single invocation of the job's * run method, after which any association of this job to the * group will be lost. * * @see IJobManager#createProgressGroup() * @param group The progress group to use for this job * @param ticks the number of work ticks allocated from the * parent monitor, or {@link IProgressMonitor#UNKNOWN} */ void SetProgressGroup(IProgressMonitor::Pointer group, int ticks); /** * Sets the value of the property of this job identified * by the given key. If the supplied value is null, * the property is removed from this resource. *

* Properties are intended to be used as a caching mechanism * by ISV plug-ins. They allow key-object associations to be stored with * a job instance. These key-value associations are maintained in * memory (at all times), and the information is never discarded automatically. *

* The qualifier part of the property name must be the unique identifier * of the declaring plug-in (e.g. "com.example.plugin"). *

* * @param key the qualified name of the property * @param value the value of the property, * or null if the property is to be removed * @see #GetProperty(QualifiedName) */ //TODO QualifiedName SetProperty /// void SetProperty(QualifiedName key, Object value); /** * Sets the scheduling rule to be used when scheduling this job. This method * must be called before the job is scheduled. * * @param rule the new scheduling rule, or null if the job * should have no scheduling rule * @see #GetRule() */ void SetRule(ISchedulingRule::Pointer rule); /** * Sets whether or not this job is a system job. System jobs are typically not * revealed to users in any UI presentation of jobs. Other than their UI presentation, * system jobs act exactly like other jobs. If this value is not explicitly set, jobs * are treated as non-system jobs. This method must be called before the job * is scheduled. * * @param value true if this job should be a system job, and * false otherwise. * @see #IsSystem() */ void SetSystem(bool value); /** * Sets whether or not this job has been directly initiated by a UI end user. * These jobs may be presented differently in the UI. This method must be * called before the job is scheduled. * * @param value true if this job is a user-initiated job, and * false otherwise. * @see #IsUser() */ void SetUser(bool value); /** * Sets the thread that this job is currently running in, or null * if this job is not running or the thread is unknown. *

* Jobs that use the {@link #ASYNC_FINISH} return code should tell * the job what thread it is running in. This is used to prevent deadlocks. * * @param thread the thread that this job is running in. * * @see #ASYNC_FINISH * @see #Run(IProgressMonitor::Pointer) */ void SetThread(Poco::Thread* thread); /** * Returns whether this job should be run. * If false is returned, this job will be discarded by the job manager * without running. *

* This method is called immediately prior to calling the job's * run method, so it can be used for last minute pre-condition checking before * a job is run. This method must not attempt to schedule or change the * state of any other job. *

* Clients may override this method. This default implementation always returns * true. *

* * @return true if this job should be run * and false otherwise */ virtual bool ShouldRun(); /** * Returns whether this job should be scheduled. * If false is returned, this job will be discarded by the job manager * without being added to the queue. *

* This method is called immediately prior to adding the job to the waiting job * queue.,so it can be used for last minute pre-condition checking before * a job is scheduled. *

* Clients may override this method. This default implementation always returns * true. *

* * @return true if the job manager should schedule this job * and false otherwise */ - virtual bool ShouldSchedule() override; + bool ShouldSchedule() override; /** * Requests that this job be suspended. If the job is currently waiting to be run, it * will be removed from the queue move into the {@link #SLEEPING} state. * The job will remain asleep until either resumed or canceled. If this job is not * currently waiting to be run, this method has no effect. *

* Sleeping jobs can be resumed using wakeUp. * * @return false if the job is currently running (and thus cannot * be put to sleep), and true in all other cases * @see #WakeUp() */ bool Sleep(); /** * Puts this job immediately into the {@link #WAITING} state so that it is * eligible for immediate execution. If this job is not currently sleeping, * the request is ignored. *

* This is a convenience method, fully equivalent to * wakeUp(0L). *

* @see #Sleep() */ void WakeUp(); /** * Puts this job back into the {@link #WAITING} state after * the specified delay. This is equivalent to canceling the sleeping job and * rescheduling with the given delay. If this job is not currently sleeping, * the request is ignored. * * @param delay the number of milliseconds to delay * @see #Sleep() */ void WakeUp(long delay); protected: /** * A hook method indicating that this job is running and {@link #cancel()} * is being called for the first time. *

* Subclasses may override this method to perform additional work when * a cancellation request is made. This default implementation does nothing. */ - virtual void Canceling() override; + void Canceling() override; /** * Executes this job. Returns the result of the execution. *

* The provided monitor can be used to report progress and respond to * cancellation. If the progress monitor has been canceled, the job * should finish its execution at the earliest convenience and return a result * status of severity {@link IStatus#CANCEL}. The singleton * cancel status {@link Status#CANCEL_STATUS} can be used for * this purpose. The monitor is only valid for the duration of the invocation * of this method. *

* This method must not be called directly by clients. Clients should call * schedule, which will in turn cause this method to be called. *

* Jobs can optionally finish their execution asynchronously (in another thread) by * returning a result status of {@link #ASYNC_FINISH}. Jobs that finish * asynchronously must specify the execution thread by calling * setThread, and must indicate when they are finished by calling * the method done. * * @param monitor the monitor to be used for reporting progress and * responding to cancellation. The monitor is never null * @return resulting status of the run. The result must not be null * @see #ASYNC_FINISH * @see #Done(IStatus) */ - virtual IStatus::Pointer Run(IProgressMonitor::Pointer myProgressMonitor) override = 0; + IStatus::Pointer Run(IProgressMonitor::Pointer myProgressMonitor) override = 0; }; } #endif /* BERRY_JOB_H */ diff --git a/Plugins/org.blueberry.core.jobs/src/berryNullProgressMonitor.h b/Plugins/org.blueberry.core.jobs/src/berryNullProgressMonitor.h index 31ec88bc43..89a401e6c7 100644 --- a/Plugins/org.blueberry.core.jobs/src/berryNullProgressMonitor.h +++ b/Plugins/org.blueberry.core.jobs/src/berryNullProgressMonitor.h @@ -1,133 +1,133 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRY_nullptrPROGRESSMONITOR_H #define BERRY_nullptrPROGRESSMONITOR_H #include #include "berryIProgressMonitor.h" namespace berry { /** * A default progress monitor implementation suitable for * subclassing. *

* This implementation supports cancellation. The default * implementations of the other methods do nothing. *

* This class can be used without OSGi running. *

*/ class NullProgressMonitor: public IProgressMonitor { public: berryObjectMacro(NullProgressMonitor); /** * Constructs a new progress monitor. */ NullProgressMonitor(); /** * This implementation does nothing. * Subclasses may override this method to do interesting * processing when a task begins. * * @see IProgressMonitor#BeginTask(std::string, int) */ - virtual void BeginTask(const std::string& name, int totalWork) override; + void BeginTask(const std::string& name, int totalWork) override; /** * This implementation does nothing. * Subclasses may override this method to do interesting * processing when a task is done. * * @see IProgressMonitor#Done() */ - virtual void Done() override; + void Done() override; /** * This implementation does nothing. * Subclasses may override this method. * * @see IProgressMonitor#InternalWorked(double) */ - virtual void InternalWorked(double work) override; + void InternalWorked(double work) override; /** * This implementation returns the value of the internal * state variable set by setCanceled. * Subclasses which override this method should * override setCanceled as well. * * @see IProgressMonitor#IsCanceled() * @see IProgressMonitor#SetCanceled(bool) */ - virtual bool IsCanceled() override; + bool IsCanceled() override; /** * This implementation sets the value of an internal state variable. * Subclasses which override this method should override * isCanceled as well. * * @see IProgressMonitor#IsCanceled() * @see IProgressMonitor#SetCanceled(bool) */ - virtual void SetCanceled(bool cancelled) override; + void SetCanceled(bool cancelled) override; /** * This implementation does nothing. * Subclasses may override this method to do something * with the name of the task. * * @see IProgressMonitor#SetTaskName(const std::string&) */ - virtual void SetTaskName(const std::string& name) override; + void SetTaskName(const std::string& name) override; /** * This implementation does nothing. * Subclasses may override this method to do interesting * processing when a subtask begins. * * @see IProgressMonitor#SubTask(const std::string&) */ - virtual void SubTask(const std::string& name) override; + void SubTask(const std::string& name) override; /** * This implementation does nothing. * Subclasses may override this method to do interesting * processing when some work has been completed. * * @see IProgressMonitor#Worked(int) */ - virtual void Worked(int work) override; + void Worked(int work) override; private: /** * Indicates whether cancel has been requested. */ bool m_cancelled; }; } #endif /* BERRY_nullptrPROGRESSMONITOR_H */ diff --git a/Plugins/org.blueberry.ui.qt.objectinspector/src/internal/berryQtObjectTableModel.h b/Plugins/org.blueberry.ui.qt.objectinspector/src/internal/berryQtObjectTableModel.h index 2319ed8cce..1caf05e0aa 100644 --- a/Plugins/org.blueberry.ui.qt.objectinspector/src/internal/berryQtObjectTableModel.h +++ b/Plugins/org.blueberry.ui.qt.objectinspector/src/internal/berryQtObjectTableModel.h @@ -1,81 +1,81 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYQTOBJECTTABLEMODEL_H_ #define BERRYQTOBJECTTABLEMODEL_H_ #include #include #include #include #include "berryObjectItem.h" namespace berry { class QtObjectTableModel: public QAbstractItemModel { Q_OBJECT public: QtObjectTableModel(QObject* parent = nullptr); - ~QtObjectTableModel(); + ~QtObjectTableModel() override; QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex& index) const override; int rowCount(const QModelIndex&) const override; int columnCount(const QModelIndex&) const override; QVariant data(const QModelIndex& index, int) const override; QVariant headerData(int section, Qt::Orientation orientation, int) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; bool setData(const QModelIndex &index, const QVariant &value, int role) override; void ResetData(); protected: void ObjectCreated(const Object* obj); void ObjectDestroyed(const Object* obj); void SmartPointerCreated(unsigned int id, const Object* obj); void SmartPointerDestroyed(unsigned int id, const Object* obj); private slots: void UpdatePendingData(); private: ObjectItem* FindObjectItem(const ObjectItem& item, int& index); QList indexData; QList pendingData; QScopedPointer objectListener; friend class DebugObjectListener; }; } #endif /* BERRYQTOBJECTTABLEMODEL_H_ */ diff --git a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h index 011d410760..df81fa7a9f 100644 --- a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h +++ b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h @@ -1,121 +1,121 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkAICPRegistrationView_h #define QmitkAICPRegistrationView_h #include #include #include #include "ui_QmitkAICPRegistrationViewControls.h" // forwarddeclaration class AICPRegistrationViewData; /** * \brief Implemenation of a worker thread class. * * Worker class that runs the registration * in a seperate QThread to prevent the registration from blocking the * GUI. */ class UIWorker : public QObject { Q_OBJECT private: /** Pimpl with the registration data.*/ AICPRegistrationViewData* d; public slots: /** Method that runs the registration algorithm in a seperate QThread.*/ void RegistrationThreadFunc(); signals: /** Signal emitted when the registration was successful.*/ void RegistrationFinished(); public: /** Set the data used for the registration.*/ void SetRegistrationData(AICPRegistrationViewData* data); }; /** \brief QmitkAICPRegistrationView provides a simple UI to register two surfaces with the AnisotropicIterativeClosestPointRegistration algorithm. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkAICPRegistrationView : public QmitkAbstractView { // 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; QmitkAICPRegistrationView(); - ~QmitkAICPRegistrationView(); + ~QmitkAICPRegistrationView() override; protected slots: /** Starts the registration. When the method is called a seperate UIWorker * thread will be run in the background to prevent blocking the GUI. */ void OnStartRegistration(); /** Enables/disables the calculation of the Target Registration Error (TRE). */ void OnEnableTreCalculation(); /** Enables/disables the trimmed version of the A-ICP algorithm.*/ void OnEnableTrimming(); public slots: /** Method called when the algorithm is finishes. This method will setup * the GUI. */ void OnRegistrationFinished(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; Ui::QmitkAICPRegistrationViewControls m_Controls; private: AICPRegistrationViewData* d; /** Check for the correct input data.*/ bool CheckInput(); }; #endif // QmitkAICPRegistrationView_h diff --git a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h index 701e63cf51..4b46841ef2 100644 --- a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h +++ b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h @@ -1,187 +1,187 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QmitkBasicImageProcessingView_H__INCLUDED) #define QmitkBasicImageProcessingView_H__INCLUDED #include #include #include "ui_QmitkBasicImageProcessingViewControls.h" #include "QmitkStepperAdapter.h" #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. \class QmitkBasicImageProcessing \author Tobias Schwarz \version 1.0 (3M3) \date 2009-05-10 \ingroup Bundles */ class BASICIMAGEPROCESSING_EXPORT QmitkBasicImageProcessing : public QmitkAbstractView { Q_OBJECT public: /*! \brief default constructor */ QmitkBasicImageProcessing(); /*! \brief default destructor */ - virtual ~QmitkBasicImageProcessing(); + ~QmitkBasicImageProcessing() override; /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Invoked when the DataManager selection changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList& nodes) override; 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(); void SelectInterpolator(int interpolator); 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(); /** retrieve the tnc from renderwindow part */ void InternalGetTimeNavigationController(); /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkBasicImageProcessingViewControls *m_Controls; //mitk::DataNode* m_SelectedImageNode; mitk::DataStorageSelection::Pointer m_SelectedImageNode; QmitkStepperAdapter* m_TimeStepperAdapter; 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, FLIPPING, RESAMPLING, RESCALE, RESCALE2 } m_SelectedAction; enum OperationType{ TWOIMAGESNOACTIONSELECTED, CATEGORY_ARITHMETIC, ADD, SUBTRACT, MULTIPLY, DIVIDE, RESAMPLE_TO, CATEGORY_BOOLEAN, AND, OR, XOR } m_SelectedOperation; enum InterpolationType{ LINEAR, NEAREST } m_SelectedInterpolation; }; #endif // !defined(QmitkBasicImageProcessing_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTNormalizeView.h b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTNormalizeView.h index 0e5cd1f0b4..b80b563395 100644 --- a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTNormalizeView.h +++ b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTNormalizeView.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkCESTNormalizeView_h #define QmitkCESTNormalizeView_h #include #include #include #include "ui_QmitkCESTNormalizeViewControls.h" #include /*! * @brief Test Plugin for SUV calculations of PET images */ class QmitkCESTNormalizeView : public QmitkAbstractView { Q_OBJECT public: /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; QmitkCESTNormalizeView(); protected slots: void OnNormalizeButtonClicked(); /**Sets visibility and enabled state of the GUI depending on the settings and workflow state.*/ void UpdateGUIControls(); protected: using SelectedDataNodeVectorType = QList; // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - virtual void CreateQtPartControl(QWidget* parent) override; + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - virtual void SetFocus() override; + void SetFocus() override; // Variables /*! @brief The view's UI controls */ Ui::QmitkCESTNormalizeViewControls m_Controls; mitk::NodePredicateBase::Pointer m_IsCESTImagePredicate; }; #endif \ No newline at end of file diff --git a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h index e9c29ccd3e..885e07898b 100644 --- a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h +++ b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h @@ -1,139 +1,139 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkCESTStatisticsView_h #define QmitkCESTStatisticsView_h #include #include #include #include "ui_QmitkCESTStatisticsViewControls.h" #include #include #include /** \brief QmitkCESTStatisticsView \warning Basic statistics view for CEST data. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkCESTStatisticsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { // 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; /*! \brief default constructor */ QmitkCESTStatisticsView(QObject *parent = nullptr, const char *name = nullptr); /*! \brief default destructor */ - virtual ~QmitkCESTStatisticsView(); + ~QmitkCESTStatisticsView() override; protected slots: /// \brief Called when the user clicks the GUI button void OnThreeDimToFourDimPushButtonClicked(); /// \brief takes care of processing the computed data void OnThreadedStatisticsCalculationEnds(); /// \brief Toggle whether or not the plot uses a fixed x range void OnFixedRangeCheckBoxToggled(bool state); /// \brief Adapt axis scale when manual ranges are set void OnFixedRangeDoubleSpinBoxChanged(); /// \brief What to do if the crosshair moves void OnSliceChanged(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList& nodes ) override; /// parse string and set data vector returns true if succesfull bool SetZSpectrum(mitk::StringProperty* zSpectrumProperty); /** Checks whether the currently set data appears reasonable */ bool DataSanityCheck(); /** Fills the plot based on a point set * * This will only use the first timestep */ template void PlotPointSet(itk::Image* image); /** Deletes all data */ void Clear(); /** Remove MZeros * * Will remove the data for the M0 images from the given input */ void RemoveMZeros(QmitkPlotWidget::DataVector& xValues, QmitkPlotWidget::DataVector& yValues); void RemoveMZeros(QmitkPlotWidget::DataVector& xValues, QmitkPlotWidget::DataVector& yValues, QmitkPlotWidget::DataVector& stdDevs); /** Copies the first timestep of a segmentation to all others */ template void CopyTimesteps(itk::Image* image); Ui::QmitkCESTStatisticsViewControls m_Controls; QmitkImageStatisticsCalculationJob* m_CalculatorJob; QmitkPlotWidget::DataVector m_zSpectrum; mitk::Image::Pointer m_ZImage; mitk::Image::Pointer m_MaskImage; mitk::PlanarFigure::Pointer m_MaskPlanarFigure; mitk::PointSet::Pointer m_PointSet; mitk::PointSet::Pointer m_CrosshairPointSet; QmitkSliceNavigationListener m_SliceChangeListener; itk::TimeStamp m_selectedNodeTime; itk::TimeStamp m_currentPositionTime; /** @brief currently valid selected position in the inspector*/ mitk::Point3D m_currentSelectedPosition; /** @brief indicates if the currently selected position is valid for the currently selected fit. * This it is within the input image */ unsigned int m_currentSelectedTimeStep; }; #endif // QmitkCESTStatisticsView_h diff --git a/Plugins/org.mitk.gui.qt.cest/src/internal/org_mitk_gui_qt_cest_Activator.h b/Plugins/org.mitk.gui.qt.cest/src/internal/org_mitk_gui_qt_cest_Activator.h index f7060b83bc..13f38cd035 100644 --- a/Plugins/org.mitk.gui.qt.cest/src/internal/org_mitk_gui_qt_cest_Activator.h +++ b/Plugins/org.mitk.gui.qt.cest/src/internal/org_mitk_gui_qt_cest_Activator.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_cest_Activator_h #define org_mitk_gui_qt_cest_Activator_h #include namespace mitk { class org_mitk_gui_qt_cest_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_cest") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.chartExample/src/internal/ChartExample.h b/Plugins/org.mitk.gui.qt.chartExample/src/internal/ChartExample.h index cb2671a574..5f8484ccc4 100644 --- a/Plugins/org.mitk.gui.qt.chartExample/src/internal/ChartExample.h +++ b/Plugins/org.mitk.gui.qt.chartExample/src/internal/ChartExample.h @@ -1,91 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ChartExample_h #define ChartExample_h #include #include "ui_ChartExampleControls.h" /** \brief Basic example for use of module mitkChart \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class ChartExample : public QmitkAbstractView { // 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; protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; void CreateConnectionsForGUIElements(); - virtual void SetFocus() override; + void SetFocus() override; void CreateChart(); void UpdateChart(); void ClearChart(); void AddData(); void ShowXData(bool show); void ShowErrorOptions(bool show); void ShowXErrorOptions(bool show); void ShowYErrorOptions(bool show); void AdaptZoomX(); void AdaptZoomY(); void AdaptDataGUI(const QString &chartType); void ResetDataGUI(); private: void FillRandomDataValues(); std::vector GenerateRandomNumbers(unsigned int amount, double max) const; std::vector ConvertToDoubleVector(const QString &data, QChar delimiter = ';') const; std::vector ConvertToStringVector(const QString &data, QChar delimiter = ';') const; std::map CreateMap(std::vector keys, std::vector values) const; std::string ConvertToText(std::vector numbers, std::string delimiter = ";") const; std::string ConvertToText(std::map numbers, std::string delimiter = ";") const; QmitkChartWidget::ColorTheme GetColorTheme() const; void OnLegendPositionChanged(const QString &newPosition); void OnTitleChanged(); void OnXAxisLabelChanged(); void OnYAxisLabelChanged(); void OnYAxisScaleChanged(const QString &newYAxisScale); void OnShowLegendChanged(int newState); void OnStackedDataChanged(int newState); void OnShowDataPointsChanged(int newState); void OnShowSubchartChanged(int newState); std::map m_ChartNameToChartType; std::map m_LineNameToLineType; std::map m_AxisScaleNameToAxisScaleType; std::map m_LegendPositionNameToLegendPositionType; unsigned int countForUID = 0; Ui::ChartExampleControls m_Controls; }; #endif // ChartExample_h diff --git a/Plugins/org.mitk.gui.qt.chartExample/src/internal/org_mitk_gui_qt_chartExample_Activator.h b/Plugins/org.mitk.gui.qt.chartExample/src/internal/org_mitk_gui_qt_chartExample_Activator.h index cbe6d31332..88a0b4803c 100644 --- a/Plugins/org.mitk.gui.qt.chartExample/src/internal/org_mitk_gui_qt_chartExample_Activator.h +++ b/Plugins/org.mitk.gui.qt.chartExample/src/internal/org_mitk_gui_qt_chartExample_Activator.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_chartExample_Activator_h #define org_mitk_gui_qt_chartExample_Activator_h #include namespace mitk { class org_mitk_gui_qt_chartExample_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_chartExample") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext *context); - void stop(ctkPluginContext *context); + void start(ctkPluginContext *context) override; + void stop(ctkPluginContext *context) override; }; // org_mitk_gui_qt_chartExample_Activator } #endif // org_mitk_gui_qt_chartExample_Activator_h diff --git a/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationRegionGrow.h b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationRegionGrow.h index 527ee91eaf..4e46925121 100644 --- a/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationRegionGrow.h +++ b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationRegionGrow.h @@ -1,114 +1,114 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ClassificationRegionGrow_h #define ClassificationRegionGrow_h #include #include #include "ui_ClassificationRegionGrowControls.h" #include #include #include #include #include //#include //#include //#include #include #include #include #include "QmitkPointListViewWidget.h" #include #include /** \brief ClassificationRegionGrow \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ //class QmitkPointListWidget; class ctkSliderWidget; class ClassificationRegionGrow : public QmitkAbstractView { // 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; bool m_CalculateFeatures; std::vector m_FeatureImageVector; std::vector m_ResultImageVector; bool m_BlockManualSegmentation; QFutureWatcher> m_ManualSegmentationFutureWatcher; bool m_BlockPostProcessing; QFutureWatcher> m_PostProcessingFutureWatcher; public slots: /// \brief Called when the user clicks the GUI button void DoAutomSegmentation(); void AddInputField(); void RemoveItemFromLabelList(); void OnFeatureSettingsChanged(); void OnInitializeSession(const mitk::DataNode*); protected: std::vector > m_SegmentedLocations; std::vector > m_SegmentedOrganLocations; typedef float MeasurementType; typedef itk::Statistics::Histogram< MeasurementType, itk::Statistics::DenseFrequencyContainer2 > HistogramType; - virtual void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void CreateQtPartControl(QWidget *parent) override; + void SetFocus() override; mitk::DataNode::Pointer AddAsDataNode(const mitk::BaseData::Pointer & data_, const std::string & name ); void ProcessFeatureImages(const mitk::Image::Pointer & raw_image); void TrainClassifier(const mitk::Image::Pointer & raw_image, const mitk::Image::Pointer & mask_image); void PredictSegmentation(const mitk::Image::Pointer & raw_image, const mitk::Image::Pointer & mask_image); /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList& nodes ) override; Ui::ClassificationRegionGrowControls m_Controls; mitk::VigraRandomForestClassifier::Pointer m_Classifier; }; #endif // ClassificationRegionGrow_h diff --git a/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationSegmentation.h b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationSegmentation.h index c7d23a30ad..cae4a59347 100644 --- a/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationSegmentation.h +++ b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/ClassificationSegmentation.h @@ -1,145 +1,145 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ClassificationSegmentation_h #define ClassificationSegmentation_h #include #include #include "ui_ClassificationSegmentationControls.h" #include #include #include #include #include #include #include #include #include #include #include #include "QmitkPointListViewWidget.h" #include #include /** \brief ClassificationSegmentation \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ //class QmitkPointListWidget; class ctkSliderWidget; class ClassificationSegmentation : public QmitkAbstractView { // 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; QmitkPointListViewWidget * m_PointListWidget; std::vector m_PointSetList; bool m_CalculateFeatures; std::vector m_FeatureImageVector; std::vector m_ResultImageVector; std::vector m_PostProcessingImageVector; bool m_BlockManualSegmentation; QFutureWatcher> m_ManualSegmentationFutureWatcher; bool m_BlockPostProcessing; QFutureWatcher> m_PostProcessingFutureWatcher; protected slots: /// \brief Called when the user clicks the GUI button void DoAutomSegmentation(); void DoSavePointsAsMask(); void OnButtonCSFToggle(bool); void OnButtonLESToggle(bool); void OnButtonBRAToggle(bool); void OnButtonNoInteractionToggle(bool); void OnAddForestToDataManager(); void ManualSegmentationTrigger(); std::vector ManualSegmentationCallback(); void ManualSegmentationFinished(); void PostProcessingTrigger(); std::vector PostProcessingCallback(); void PostProcessingFinished(); void OnFeatureSettingsChanged(); void OnPostProcessingSettingsChanged(); void OnInitializeSession(const mitk::DataNode*); protected: typedef float MeasurementType; typedef itk::Statistics::Histogram< MeasurementType, itk::Statistics::DenseFrequencyContainer2 > HistogramType; // void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); // void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; mitk::DataNode::Pointer AddAsDataNode(const mitk::BaseData::Pointer & data_, const std::string & name ); void SampleClassMaskByPointSet(const mitk::Image::Pointer & ref_img, mitk::PointSet::Pointer & pointset, mitk::Image::Pointer & outimage); void ProcessFeatureImages(const mitk::Image::Pointer & raw_image, const mitk::Image::Pointer & mask_image); /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList& nodes ) override; mitk::Image::Pointer CreateClassMaskByPointsetList(std::map a_args); Ui::ClassificationSegmentationControls m_Controls; // Feature settings ctkSliderWidget * m_GaussSlider; ctkSliderWidget * m_HessianSlider; ctkSliderWidget * m_STInnerSlider; ctkSliderWidget * m_STOuterSlider; ctkSliderWidget * m_GaussCSFSlider; ctkSliderWidget * m_GaussLESSlider; ctkSliderWidget * m_GaussBRASlider; ctkSliderWidget * m_WeightCSFSlider; ctkSliderWidget * m_WeightLESSlider; ctkSliderWidget * m_WeightBRASlider; mitk::PointSetDataInteractor::Pointer m_PointSetDataInteractor; mitk::VigraRandomForestClassifier::Pointer m_TempClassifier; }; #endif // ClassificationSegmentation_h diff --git a/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/org_mitk_gui_qt_classificationsegmentation_Activator.h b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/org_mitk_gui_qt_classificationsegmentation_Activator.h index f6d899f134..d9c47656e9 100644 --- a/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/org_mitk_gui_qt_classificationsegmentation_Activator.h +++ b/Plugins/org.mitk.gui.qt.classificationsegmentation/src/internal/org_mitk_gui_qt_classificationsegmentation_Activator.h @@ -1,42 +1,42 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_classificationsegmentation_Activator_h #define org_mitk_gui_qt_classificationsegmentation_Activator_h #include namespace mitk { class org_mitk_gui_qt_classificationsegmentation_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_classificationsegmentation") // Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_classificationregiongrow") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; // org_mitk_gui_qt_classificationsegmentation_Activator } #endif // org_mitk_gui_qt_classificationsegmentation_Activator_h diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h index d7ac456495..881b532a81 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h @@ -1,67 +1,67 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKCMDLINEMODULEMENUCOMBOBOX_H #define QMITKCMDLINEMODULEMENUCOMBOBOX_H #include #include #include #include #include /** * \class QmitkCmdLineModuleMenuComboBox * \brief Subclass of ctkMenuComboBox to listen to ctkCmdLineModuleManager * moduleRegistered and moduleUnregistered signals, and update the menu accordingly. * \ingroup org_mitk_gui_qt_cmdlinemodules_internal * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \sa ctkMenuComboBox */ class QmitkCmdLineModuleMenuComboBox : public ctkMenuComboBox { Q_OBJECT public: QmitkCmdLineModuleMenuComboBox(QWidget* parent = nullptr); - virtual ~QmitkCmdLineModuleMenuComboBox(); + ~QmitkCmdLineModuleMenuComboBox() override; /** * \brief Inject the module manager, so that this widget can * still easily be used via widget promotion in Qt Designer, * as it will maintain the default constructor. */ void SetManager(ctkCmdLineModuleManager* manager); /** * \brief Returns the ctkCmdLineModuleManager. */ ctkCmdLineModuleManager* GetManager() const; private slots: void OnModuleRegistered(const ctkCmdLineModuleReference&); void OnModuleUnRegistered(const ctkCmdLineModuleReference&); private: void RebuildMenu(); void AddName(QList< QHash* >& listOfHashMaps, const int& depth, const QString& name, QMenu* menu); ctkCmdLineModuleManager* m_ModuleManager; }; #endif // QMITKCMDLINEMODULEMENUCOMBOBOX_H diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesPreferencesPage.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesPreferencesPage.h index 85dec17b64..118435bbec 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesPreferencesPage.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesPreferencesPage.h @@ -1,111 +1,111 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef COMMANDLINEMODULESPREFERENCESPAGE_H #define COMMANDLINEMODULESPREFERENCESPAGE_H #include "berryIQtPreferencePage.h" #include "berryIPreferences.h" #include class QWidget; class QGridLayout; class QCheckBox; class QComboBox; class QSpinBox; class QmitkDirectoryListWidget; class QmitkFileListWidget; class ctkDirectoryButton; /** * \class CommandLineModulesPreferencesPage * \brief Preference page for CommandLineModulesView * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \ingroup org_mitk_gui_qt_cmdlinemodules_internal */ class CommandLineModulesPreferencesPage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: CommandLineModulesPreferencesPage(); - ~CommandLineModulesPreferencesPage(); + ~CommandLineModulesPreferencesPage() override; /** * \brief Called by framework to initialise this preference page, but currently does nothing. * \param workbench The workbench. */ void Init(berry::IWorkbench::Pointer workbench) override; /** * \brief Called by framework to create the GUI, and connect signals and slots. * \param widget The Qt widget that acts as parent to all GUI components, as this class itself is not derived from QWidget. */ void CreateQtControl(QWidget* widget) override; /** * \brief Required by framework to get hold of the GUI. * \return QWidget* the top most QWidget for the GUI. */ QWidget* GetQtControl() const override; /** * \see IPreferencePage::PerformOk */ - virtual bool PerformOk() override; + bool PerformOk() override; /** * \see IPreferencePage::PerformCancel */ - virtual void PerformCancel() override; + void PerformCancel() override; /** * \see IPreferencePage::Update */ - virtual void Update() override; + void Update() override; public slots: protected: QWidget *m_MainControl; QCheckBox *m_DebugOutput; QCheckBox *m_ShowAdvancedWidgets; ctkDirectoryButton *m_OutputDirectory; ctkDirectoryButton *m_TemporaryDirectory; QmitkDirectoryListWidget *m_ModulesDirectories; QmitkFileListWidget *m_ModulesFiles; QGridLayout *m_GridLayoutForLoadCheckboxes; QCheckBox *m_LoadFromHomeDir; QCheckBox *m_LoadFromHomeDirCliModules; QCheckBox *m_LoadFromCurrentDir; QCheckBox *m_LoadFromCurrentDirCliModules; QCheckBox *m_LoadFromApplicationDir; QCheckBox *m_LoadFromApplicationDirCliModules; QCheckBox *m_LoadFromAutoLoadPathDir; QComboBox *m_ValidationMode; QSpinBox *m_XmlTimeoutInSeconds; QSpinBox *m_MaximumNumberProcesses; berry::IPreferences::Pointer m_CLIPreferencesNode; private: std::string ConvertToStdString(const QStringList& list); }; #endif // COMMANDLINEMODULESPREFERENCESPAGE_H diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.h index 8768bbee5d..c44f3865aa 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesView.h @@ -1,255 +1,255 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CommandLineModulesView_h #define CommandLineModulesView_h #include #include #include #include #include #include #include class ctkCmdLineModuleBackendLocalProcess; class ctkCmdLineModuleDirectoryWatcher; class CommandLineModulesViewControls; class QmitkCmdLineModuleRunner; class QAction; class QVBoxLayout; namespace berry { struct IBerryPreferences; } /*! * \class CommandLineModulesView * \brief Provides basic GUI interface to the CTK command line modules. * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \ingroup org_mitk_gui_qt_cmdlinemodules_internal * \sa QmitkAbstractView */ class CommandLineModulesView : public QmitkAbstractView { // 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: CommandLineModulesView(); - virtual ~CommandLineModulesView(); + ~CommandLineModulesView() override; /** * \brief Main method, called by framework to create the GUI at the right time. * \param parent The parent QWidget, as this class itself is not a QWidget subclass. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /** * \brief Called by the framework to indicate that the preferences have changed. * \param prefs not used, as we call RetrievePreferenceValues(). */ void OnPreferencesChanged(const berry::IBerryPreferences* prefs) override; protected Q_SLOTS: /** * \brief Called when the ctkMenuComboBox has the menu selection changed, * and causes the corresponding GUI to be displayed. */ void OnActionChanged(QAction*); /** * \brief Slot that is called when the restore defaults button is pressed, * to reset the current GUI form to the default values, if the XML specifies defaults. */ void OnRestoreButtonPressed(); /** * \brief Slot that is called when the Run button is pressed to run the current module. */ void OnRunButtonPressed(); /** * \brief Alerts the user of any errors comming out of the directory watcher. */ void OnDirectoryWatcherErrorsDetected(const QString&); protected: /** * \brief Called by framework to set the focus on the right widget * when this view has focus, so currently, thats the ctkMenuCombo box. */ - virtual void SetFocus() override; + void SetFocus() override; private slots: /** * \brief Called when the user clicks to close a tab, and removes the front end from m_ListOfModules */ void OnTabCloseRequested(int tabNumber); /** * \brief Called from QmitkCmdLineModuleProgressWidget to indicate a job has started. */ void OnJobStarted(); /** * \brief Called from QmitkCmdLineModuleProgressWidget to indicate a job has finished. */ void OnJobFinished(); /** * \brief Called when the user hits the 'clear XML cache' button. */ void OnClearCache(); /** * \brief Called when the user hits the 'reload modules' button. */ void OnReloadModules(); private: /** * \brief Called on startup and by OnPreferencesChanged to load all * preferences except the temporary folder into member variables. */ void RetrieveAndStorePreferenceValues(); /** * \brief Called on startup and by OnPreferencesChanged to load the temporary folder * preference into member variable m_TemporaryDirectoryName. */ void RetrieveAndStoreTemporaryDirectoryPreferenceValues(); /** * \brief Called on startup and by OnPreferencesChanged to set the validation mode, but will require a restart. */ void RetrieveAndStoreValidationMode(); /** * \brief Called to get hold of the actual preferences node. */ berry::IBerryPreferences::Pointer RetrievePreferences(); /** * \brief Search all modules for the one matching the given identifier. * \param fullName The "fullName" is the . from the XML. * \return ctkCmdLineModuleReference the reference corresponding to the fullName, or an invalid reference if non found. */ ctkCmdLineModuleReference GetReferenceByFullName(QString fullName); /** * \brief Raises a message box asking the user to select a module first. */ void AskUserToSelectAModule() const; /** * \brief Enables or Disables the Run Button. */ void UpdateRunButtonEnabledStatus(); /** * \brief The GUI controls contain a reset and run button, and a QWidget container, and the GUI component * for each command line module is added to the QWidget dynamically at run time. */ CommandLineModulesViewControls *m_Controls; /** * \brief We store the parent, passed in via CommandLineModulesView::CreateQtPartControl, * as this class itself is not a QWidget. */ QWidget *m_Parent; /** * \brief We keep a local layout, and arrange a display of QmitkCmdLineModuleProgressWidget, * where each QmitkCmdLineModuleProgressWidget represents a single running job. */ QVBoxLayout *m_Layout; /** * \brief The manager is responsible for loading and instantiating command line modules. */ ctkCmdLineModuleManager *m_ModuleManager; /** * \brief We are using a back-end that runs locally installed command line programs. */ ctkCmdLineModuleBackendLocalProcess *m_ModuleBackend; /** * \brief The ctkCmdLineModuleDirectoryWatcher maintains the list of directories * we are using to load modules, to provide automatic updates. */ ctkCmdLineModuleDirectoryWatcher *m_DirectoryWatcher; /** * \brief We store a temporary folder name, accessible via user preferences. */ QString m_TemporaryDirectoryName; /** * \brief We store an output folder name, accessible via user preferences for when * the file specified in a default output path is not within a writable directory. */ QString m_OutputDirectoryName; /** * \brief Cache the list of directory paths locally to avoid repeatedly trying to update Directory Watcher. */ QStringList m_DirectoryPaths; /** * \brief Cache the list of module/executable paths locally to avoid repeatedly trying to update Directory Watcher. */ QStringList m_ModulePaths; /** * \brief We store the validation mode, accessisble via user preferences. */ ctkCmdLineModuleManager::ValidationMode m_ValidationMode; /** * \brief We store the maximum number of concurrent processes, and disable the run button accordingly. */ int m_MaximumConcurrentProcesses; /** * \brief Counts the number of currently running processes. */ int m_CurrentlyRunningProcesses; /** * \brief Member variable, taken from preference page. */ bool m_DebugOutput; /** * \brief Member variable, taken from preferences page. */ int m_XmlTimeoutSeconds; /** * \brief We keep a list of front ends to match the m_TabWidget. */ QList<ctkCmdLineModuleFrontend*> m_ListOfModules; }; #endif // CommandLineModulesView_h diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesViewControls.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesViewControls.h index 230c615cb6..5f9f5fcb50 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesViewControls.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/CommandLineModulesViewControls.h @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef CommandLineModulesViewControls_h #define CommandLineModulesViewControls_h #include "ui_CommandLineModulesViewControls.h" class QHBoxLayout; /** * \class CommandLineModulesViewControls * \brief Class derived from Ui_CommandLineModulesViewControls to provide access to GUI widgets. * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \ingroup org_mitk_gui_qt_cmdlinemodules_internal */ class CommandLineModulesViewControls : public QWidget, public Ui_CommandLineModulesViewControls { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: CommandLineModulesViewControls(QWidget *parent = nullptr); - virtual ~CommandLineModulesViewControls(); + ~CommandLineModulesViewControls() override; void SetAdvancedWidgetsVisible(const bool& isVisible); protected: private: }; #endif // CommandLineModulesViewControls_h diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h index dc28f38f84..e4cd3ac66a 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h @@ -1,54 +1,54 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkCmdLineModuleFactoryGui_h #define QmitkCmdLineModuleFactoryGui_h #include <ctkCmdLineModuleFrontendFactoryQtGui.h> #include <ctkCmdLineModuleReference.h> namespace mitk { class DataStorage; } struct QmitkCmdLineModuleFactoryGuiPrivate; /** * \class QmitkCmdLineModuleFactoryGui * \brief Derived from ctkCmdLineModuleFactory to instantiate QmitkCmdLineModuleGui front ends. * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \ingroup org_mitk_gui_qt_cmdlinemodules_internal * \sa QmitkCmdLineModuleGui * \sa ctkCmdLineModuleFrontendFactoryQtGui */ class QmitkCmdLineModuleFactoryGui : public ctkCmdLineModuleFrontendFactoryQtGui { public: QmitkCmdLineModuleFactoryGui(const mitk::DataStorage* dataStorage); - virtual ~QmitkCmdLineModuleFactoryGui(); + ~QmitkCmdLineModuleFactoryGui() override; /** * \brief Simply creates QmitkCmdLineModuleGui which is an MITK specific Qt front end. */ ctkCmdLineModuleFrontendQtGui* create(const ctkCmdLineModuleReference& moduleRef) override; private: QScopedPointer<QmitkCmdLineModuleFactoryGuiPrivate> d; }; #endif // QmitkCmdLineModuleFactoryGui_h diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h index f0e6e46b0a..3948d04298 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h @@ -1,117 +1,117 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkCmdLineModuleGui_h #define QmitkCmdLineModuleGui_h #include <QBuffer> #include <QUiLoader> #include <ctkCmdLineModuleReference.h> #include <ctkCmdLineModuleFrontendQtGui.h> namespace mitk { class DataStorage; } struct QmitkCmdLineModuleGuiPrivate; class QWidget; /** * \class QmitkCmdLineModuleGui * \brief Derived from ctkCmdLineModuleQtGui to implement an MITK specific command line module, * that has access to the mitk::DataStorage, and also instantiates QmitkDataStorageComboBox * for any "imageInputWidget" type, and also provides QmitkDataStorageComboBox.xsl to override * the standard CTK xslt transformation. * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \ingroup org_mitk_gui_qt_cmdlinemodules_internal * \sa QmitkCmdLineModuleFactoryGui * \sa ctkCmdLineModuleFrontendQtGui */ class QmitkCmdLineModuleGui : public ctkCmdLineModuleFrontendQtGui { Q_OBJECT public: QmitkCmdLineModuleGui(const mitk::DataStorage* dataStorage, const ctkCmdLineModuleReference& moduleRef); - virtual ~QmitkCmdLineModuleGui(); + ~QmitkCmdLineModuleGui() override; /** * \brief Returns the top level widget containing the whole GUI, and * should be used in preference to ctkCmdLineModuleFrontend::guiHandle. */ QWidget* getGui(); /** * \brief Copies the visible parameters from another QmitkCmdLineModuleGui; * \param another a QmitkCmdLineModuleGui frontend. */ void copyParameters(QmitkCmdLineModuleGui& another); /** * \brief A custom method to enable access to a mitk::DataNode::Pointer for input images. * \param parameter The name of the parameter as specified in XML. * \param role The role, \see ctkCmdLineModuleFrontend. * \return QVariant * * If role==UserRole and the parameter specified by parameter name is an * input image, will return a mitk::DataNode::Pointer wrapped in a QVariant. * * If role==UserRole and the parameter specified is not an input image, * returns an Empty QVariant. * * For any other scenario, calls base class. * * \sa ctkCmdLineModuleFrontend::value */ - virtual QVariant value(const QString ¶meter, int role) const override; + QVariant value(const QString ¶meter, int role) const override; /** * \brief A custom method to enable the setting of mitk::DataNode::Pointer for input images. * \param parameter The name of the parameter as specified in XML. * \param value QVariant containing a mitk::DataNode::Pointer * \param role The role, \see ctkCmdLineModuleFrontend. * * If role==UserRole and the parameter specified by parameter name is an * input image, will set the value for that parameter. * * * For any other scenario, calls base class. * * \sa ctkCmdLineModuleFrontend::setValue */ - virtual void setValue(const QString& parameter, const QVariant& value, int role = DisplayRole) override; + void setValue(const QString& parameter, const QVariant& value, int role = DisplayRole) override; protected: /** * \brief Virtual getter. * \see ctkCmdLineModuleFrontendQtGui::uiLoader() */ - virtual QUiLoader* uiLoader() const override; + QUiLoader* uiLoader() const override; /** * \brief Virtual getter. * \see ctkCmdLineModuleFrontendQtGui::xslTransform() */ - virtual ctkCmdLineModuleXslTransform* xslTransform() const override; + ctkCmdLineModuleXslTransform* xslTransform() const override; private: QScopedPointer<QmitkCmdLineModuleGuiPrivate> d; }; // end class #endif // QmitkCmdLineModuleGui_h diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h index 3305fa5fcc..d1cdecfcef 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h @@ -1,235 +1,235 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKCMDLINEMODULERUNNER_H #define QMITKCMDLINEMODULERUNNER_H #include <QWidget> #include <QTimer> #include <QList> #include <ctkCmdLineModuleParameter.h> #include <mitkDataNode.h> class QVBoxLayout; class QTemporaryFile; class QmitkCmdLineModuleGui; class ctkCmdLineModuleManager; class ctkCmdLineModuleFutureWatcher; namespace Ui { class QmitkCmdLineModuleProgressWidget; } namespace mitk { class DataStorage; } /** * \class QmitkCmdLineModuleRunner * \brief Based on ctkCmdLineModuleExplorerProgressWidget, implements a progress widget * with console output, and space for storing the GUI widgets. * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \ingroup org_mitk_gui_qt_cmdlinemodules_internal * \sa ctkCmdLineModuleExplorerProgressWidget */ class QmitkCmdLineModuleRunner : public QWidget { Q_OBJECT public: QmitkCmdLineModuleRunner(QWidget *parent = nullptr); - virtual ~QmitkCmdLineModuleRunner(); + ~QmitkCmdLineModuleRunner() override; /** * \brief Sets the manager on this object, and must be called immediately * after construction, before using the widget. */ void SetManager(ctkCmdLineModuleManager* manager); /** * \brief Sets the DataStorage on this object, and must be called immediately * after construction, before using the widget. */ void SetDataStorage(mitk::DataStorage* dataStorage); /** * \brief Sets the Output Directory on this widget, and must be called * immediately after construction, before using the widget. */ void SetOutputDirectory(const QString& directoryName); /** * \brief Tells this widget, which module frontend it is running * \param frontEnd our QmitkCmdLineModuleGui class derived from ctkCmdLineModuleFrontend */ void SetFrontend(QmitkCmdLineModuleGui* frontEnd); /** * \brief Runs the module that this widget is currently referring to. */ void Run(); Q_SIGNALS: // These signals so that container classes such as CommandLineModuleView // can keep track of how many modules are running simultaneously. void started(); // emmitted when the module is started. void finished(); // emmitted when the module is completely finished. private Q_SLOTS: void OnCheckModulePaused(); void OnPauseButtonToggled(bool toggled); void OnRemoveButtonClicked(); void OnModuleStarted(); void OnModuleCanceled(); void OnModuleFinished(); void OnModuleResumed(); void OnModuleProgressRangeChanged(int progressMin, int progressMax); void OnModuleProgressTextChanged(const QString& progressText); void OnModuleProgressValueChanged(int progressValue); void OnOutputDataReady(); void OnErrorDataReady(); private: /** * \brief Simply returns true if this widget is considered as having been started. */ bool IsStarted() const; /** * \brief Used to write output to the console widget, and also to qDebug(). */ void PublishMessage(const QString& message); /** * \brief Used to write output to the console widget, and also to qDebug(). */ void PublishByteArray(const QByteArray& array); /** * \brief Destroys any images listed in m_TemporaryFileNames. */ void ClearUpTemporaryFiles(); /** * \brief Loads any data listed in m_OutputDataToLoad into the m_DataStorage. */ void LoadOutputData(); /** * \brief Saves temporary image to file. * \param[in] node non-nullptr pointer to node containing a non-nullptr mitk::Image. * \param[out] errorMessage which if not empty means an error occurred. * \return QTemporaryFile temporary file that the caller is responsible for deleting. * * If the returned QTemporaryFile is nullptr, check errorMessage. * If the returned QTemporaryFile is not-nullptr, there could still be data in the errorMessage. * It could be that this method tried n file extensions, before finding a successful one. * In this case, the returned QTemporaryFile is the successful one, and the errorMessage contains error messages of all the failed attempts. */ QTemporaryFile* SaveTemporaryImage(const ctkCmdLineModuleParameter& parameter, mitk::DataNode::ConstPointer node, QString& errorMessage) const; /** * \brief Utility method to look up the title from the description. */ QString GetTitle(); /** * \brief Returns <category>.<title>, derived from the ctkCmdLineModuleReference and * hence from the ctkCmdLineModuleDescription. */ QString GetFullName() const; /** * \brief Takes nodeName, and makes sure that it only contains A-Z, a-z, 0-9, hyphen and underscore, * and does not use hyphen as the first character. * * Inspired by <a href="http://www.boost.org/doc/libs/1_43_0/libs/filesystem/doc/portability_guide.htm">boost recommendations</a>. */ QString GetValidNodeName(const QString& nodeName) const; /** * \brief This must be injected before the Widget is used. */ ctkCmdLineModuleManager *m_ModuleManager; /** * \brief This must be injected before the Widget is used. */ mitk::DataStorage *m_DataStorage; /** * \brief This must be injected before the Widget is used. */ QString m_OutputDirectoryName; /** * \brief We instantiate the main widgets from this .ui file. */ Ui::QmitkCmdLineModuleProgressWidget *m_UI; /** * \brief The m_ParametersGroupBox needs a layout. */ QVBoxLayout *m_Layout; /** * \brief The QmitkCmdLineModuleGui is created by the QmitkCmdLineModuleFactoryGui outside * of this class and injected into this class before being run. */ QmitkCmdLineModuleGui *m_ModuleFrontEnd; /** * \brief Main object to keep track of a running command line module. */ ctkCmdLineModuleFutureWatcher *m_FutureWatcher; /** * \brief Due to Qt bug 12152, we use a timer to correctly check for a paused module. */ QTimer m_PollPauseTimer; /** * \brief We store a list of temporary file names that are saved to disk before * launching a command line app, and then must be cleared up when the command line * app successfully finishes. */ QList<QTemporaryFile*> m_TemporaryFiles; /** * \brief We store a list of output images, so that on successful completion of * the command line module, we automatically load the output data into the mitk::DataStorage. */ QStringList m_OutputDataToLoad; /** * \brief We track how many times the OnOutputDataReady is called. */ int m_OutputCount; /** * \brief We track how many times the OnErrorDataReady is called. */ int m_ErrorCount; }; #endif // QMITKCMDLINEMODULERUNNER_H diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h index ba43393d12..bcd225048c 100644 --- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h +++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h @@ -1,59 +1,59 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) University College London (UCL). All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkUiLoader_h #define QmitkUiLoader_h #include <ctkCmdLineModuleQtUiLoader.h> #include <QStringList> #include "mitkDataStorage.h" /** * \class QmitkUiLoader * \brief Derived from ctkCmdLineModuleQtGuiLoader to enable us to instantiate widgets from Qmitk at runtime, * and currently we instatiate QmitkDataStorageComboBoxWithSelectNone, used for image input widgets. * \author Matt Clarkson (m.clarkson@ucl.ac.uk) * \ingroup org_mitk_gui_qt_cmdlinemodules_internal * \sa ctkCmdLineModuleQtUiLoader */ class QmitkUiLoader : public ctkCmdLineModuleQtUiLoader { Q_OBJECT public: QmitkUiLoader(const mitk::DataStorage* dataStorage, QObject *parent=nullptr); - virtual ~QmitkUiLoader(); + ~QmitkUiLoader() override; /** * \brief Returns the list of available widgets in ctkCmdLineModuleQtGuiLoader and also QmitkDataStorageComboBoxWithSelectNone. * \see ctkCmdLineModuleQtGuiLoader::availableWidgets() */ QStringList availableWidgets () const; /** * \brief If className is QmitkDataStorageComboBox, instantiates QmitkDataStorageComboBoxWithSelectNone and * otherwise delegates to base class. * \see ctkCmdLineModuleQtGuiLoader::createWidget() */ - virtual QWidget* createWidget(const QString & className, QWidget * parent = nullptr, const QString & name = QString() ) override; + QWidget* createWidget(const QString & className, QWidget * parent = nullptr, const QString & name = QString() ) override; private: const mitk::DataStorage* m_DataStorage; }; // end class #endif // QmitkUiLoader_h diff --git a/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionality.h b/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionality.h index 7e46c84b1a..e0f4ab5813 100755 --- a/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionality.h +++ b/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionality.h @@ -1,400 +1,400 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKFUNCTIONALITY_H_ #define QMITKFUNCTIONALITY_H_ //# blueberry stuff #include <berryQtViewPart.h> #include <berryIPreferencesService.h> #include <berryISelectionListener.h> #include <berryIPreferences.h> //# mitk stuff #include <org_mitk_gui_qt_common_legacy_Export.h> #include "mitkDataNodeSelection.h" #include <mitkDataStorage.h> #include <mitkIDataStorageService.h> #include <mitkIDataStorageReference.h> #include <QmitkStdMultiWidget.h> // CTK Includes #include <ctkServiceTracker.h> //# forward declarations namespace mitk { class DataNode; struct IDataStorageService; } namespace berry { struct IBerryPreferences; } class QmitkFunctionalitySelectionProvider; /// /// \ingroup org_mitk_gui_qt_common_legacy /// /// \class QmitkFunctionality /// /// \brief The base class of all MITK related blueberry views (~ in the old version of MITK, this was called "Functionality") /// /// QmitkFunctionality provides several convenience methods that eases the introduction of a new view: /// /// <ol> /// <li> Access to the DataStorage (~ the shared data repository) /// <li> Access to the StdMultiWidget (the 2x2 RenderWindow arrangement) /// <li> Access to and update notification for the functionality/view preferences /// <li> Access to and update notification for the current DataNode selection / to DataNode selection events send through the SelectionService /// <li> Methods to send DataNode selections through the SelectionService /// <li> Some events for unproblematic inter-View communication (e.g. when to add/remove interactors) /// <li> Some minor important convenience methods (like changing the mouse cursor/exception handling) /// </ol> /// /// Please use the Activated/Deactivated method to add/remove interactors, disabling multiwidget crosshair or anything which may /// "affect" other functionalities. For further reading please have a look at QmitkFunctionality::IsExclusiveFunctionality(). /// class MITK_QT_COMMON_LEGACY QmitkFunctionality : public berry::QtViewPart { //# public virtual methods which can be overwritten public: /// /// Creates smartpointer typedefs /// berryObjectMacro(QmitkFunctionality); /// /// Nothing to do in the standard ctor. <b>Initiliaze your GUI in CreateQtPartControl(QWidget*)</b> /// \see berry::QtViewPart::CreateQtPartControl(QWidget*) /// QmitkFunctionality(); /// /// Disconnects all standard event listeners /// - virtual ~QmitkFunctionality(); + ~QmitkFunctionality() override override; /// /// Called, when the WorkbenchPart gets closed /// by the user directly or by closing the whole /// app (e.g. for removing event listeners) /// virtual void ClosePart(); /// /// Called when the selection in the workbench changed /// virtual void OnSelectionChanged(std::vector<mitk::DataNode*> /*nodes*/); /// /// Called when the preferences object of this view changed. /// \see GetPreferences() /// virtual void OnPreferencesChanged(const berry::IBerryPreferences*); /// /// Make this view manage multiple DataStorage. If set to true GetDataStorage() /// will return the currently active DataStorage (and not the default one). /// \see GetDataStorage() /// void SetHandleMultipleDataStorages(bool multiple); /// /// \return true if this view handles multiple DataStorages, false otherwise /// bool HandlesMultipleDataStorages() const; /// /// Called when a StdMultiWidget is available. Should not be used anymore, see GetActiveStdMultiWidget() /// \see GetActiveStdMultiWidget() /// virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget& stdMultiWidget); /// /// Called when a StdMultiWidget is available. Should not be used anymore, see GetActiveStdMultiWidget() /// \see GetActiveStdMultiWidget() /// virtual void StdMultiWidgetClosed(QmitkStdMultiWidget& stdMultiWidget); /// /// Called when no StdMultiWidget is available anymore. Should not be used anymore, see GetActiveStdMultiWidget() /// \see GetActiveStdMultiWidget() /// virtual void StdMultiWidgetNotAvailable(); /// /// Only called when IsExclusiveFunctionality() returns true. /// \see IsExclusiveFunctionality() /// virtual void Activated(); /// /// \return true if this view is currently activated, false otherwise /// bool IsActivated() const; /// /// Only called when IsExclusiveFunctionality() returns true. /// \see IsExclusiveFunctionality() /// virtual void Deactivated(); /// /// Some functionalities need to add special interactors, removes the crosshair from the stdmultiwidget, etc. /// In this case the functionality has to tidy up when changing to another functionality /// which also wants to change the "default configuration". In the old Qt3-based /// version of MITK, two functionalities could never be opened at the same time so that the /// methods Activated() and Deactivated() were the right place for the functionalitites to /// add/remove their interactors, etc. This is still true for the new MITK Workbench, /// but as there can be several functionalities visible at the same time, the behaviour concerning /// when Activated() and Deactivated() are called has changed: /// /// 1. Activated() and Deactivated() are only called if IsExclusiveFunctionality() returns true /// /// 2. If only one standalone functionality is or becomes visible, Activated() will be called on that functionality /// /// 3. If two or more standalone functionalities are visible, /// Activated() will be called on the functionality that receives focus, Deactivated() will be called /// on the one that looses focus, gets hidden or closed /// /// /// As a consequence of 1. if you overwrite IsExclusiveFunctionality() and let it return false, you /// signalize the MITK Workbench that this functionality does nothing to the "default configuration" /// and can easily be visible while other functionalities are also visible. /// /// By default the method returns true. /// /// \return true if this functionality is meant to work as a standalone view, false otherwise /// virtual bool IsExclusiveFunctionality() const; /// /// Informs other parts of the workbench that node is selected via the blueberry selection service. /// void FireNodeSelected(mitk::DataNode* node); /// /// Informs other parts of the workbench that the nodes are selected via the blueberry selection service. /// void FireNodesSelected(std::vector<mitk::DataNode*> nodes); /// /// Called when this functionality becomes visible ( no matter what IsExclusiveFunctionality() returns ) /// virtual void Visible(); /// /// \return true if this view is currently visible, false otherwise /// bool IsVisible() const; /// /// Called when this functionality is hidden ( no matter what IsExclusiveFunctionality() returns ) /// virtual void Hidden(); //# protected virtual methods which can be overwritten protected: /// /// Called when a DataStorage Add event was thrown. May be reimplemented /// by deriving classes. /// virtual void NodeAdded(const mitk::DataNode* node); /// /// Called when a DataStorage Changed event was thrown. May be reimplemented /// by deriving classes. /// virtual void NodeChanged(const mitk::DataNode* /*node*/); /// /// Called when a DataStorage Remove event was thrown. May be reimplemented /// by deriving classes. /// virtual void NodeRemoved(const mitk::DataNode* node); /// /// Called when a DataStorage add *or* remove *or* change event was thrown. May be reimplemented /// by deriving classes. /// virtual void DataStorageChanged(); /// /// \return the selection of the currently active part of the workbench or an empty vector /// if nothing is selected /// std::vector<mitk::DataNode*> GetCurrentSelection() const; /// /// Returns the current selection made in the datamanager bundle or an empty vector /// if nothing`s selected or if the bundle does not exist /// std::vector<mitk::DataNode*> GetDataManagerSelection() const; /// /// Returns the Preferences object for this Functionality. /// <b>Important</b>: When refering to this preferences, e.g. in a PreferencePage: The ID /// for this preferences object is "/<VIEW-ID>", e.g. "/org.mitk.views.datamanager" /// berry::IPreferences::Pointer GetPreferences() const; /// /// Returns the default <b>or</b> the currently active DataStorage if m_HandlesMultipleDataStorages /// is set to true /// \see SetHandleMultipleDataStorages(bool) /// \see HandlesMultipleDataStorages() /// mitk::DataStorage::Pointer GetDataStorage() const; /// /// \return always returns the default DataStorage /// mitk::DataStorage::Pointer GetDefaultDataStorage() const; mitk::IDataStorageReference::Pointer GetDataStorageReference() const; /// /// Returns the default and active StdMultiWidget. /// \param reCreateWidget a boolean flag to en-/disable the attept to re-create the StdWidget /// <b>If there is not StdMultiWidget yet a new one is /// created in this method when called with default parameter!</b> /// QmitkStdMultiWidget* GetActiveStdMultiWidget( bool reCreateWidget = true); /// /// Outputs an error message to the console and displays a message box containing /// the exception description. /// \param e the exception which should be handled /// \param showDialog controls, whether additionally a message box should be /// displayed to inform the user that something went wrong /// void HandleException( std::exception& e, QWidget* parent = nullptr, bool showDialog = true ) const; /// /// Calls HandleException ( std::exception&, QWidget*, bool ) internally /// \see HandleException ( std::exception&, QWidget*, bool ) /// void HandleException( const char* str, QWidget* parent = nullptr, bool showDialog = true ) const; /// /// Convenient method to set and reset a wait cursor ("hourglass") /// void WaitCursorOn(); /// /// Convenient method to restore the standard cursor /// void WaitCursorOff(); /// /// Convenient method to set and reset a busy cursor /// void BusyCursorOn(); /// /// Convenient method to restore the standard cursor /// void BusyCursorOff(); /// /// Convenient method to restore the standard cursor /// void RestoreOverrideCursor(); //# other public methods which should not be overwritten public: /// /// Creates a scroll area for this view and calls CreateQtPartControl then /// void CreatePartControl(QWidget* parent) override; /// /// Called when this view receives the focus. Same as Activated() /// \see Activated() /// void SetFocus() override; /// /// Called when a DataStorage Add Event was thrown. Sets /// m_InDataStorageChanged to true and calls NodeAdded afterwards. /// \see m_InDataStorageChanged /// void NodeAddedProxy(const mitk::DataNode* node); /// /// Called when a DataStorage remove event was thrown. Sets /// m_InDataStorageChanged to true and calls NodeRemoved afterwards. /// \see m_InDataStorageChanged /// void NodeRemovedProxy(const mitk::DataNode* node); /// /// Called when a DataStorage changed event was thrown. Sets /// m_InDataStorageChanged to true and calls NodeChanged afterwards. /// \see m_InDataStorageChanged /// void NodeChangedProxy(const mitk::DataNode* node); /// /// Toggles the visible flag m_Visible /// void SetVisible(bool visible); /// /// Toggles the activated flag m_Activated /// void SetActivated(bool activated); /// /// Called, when the WorkbenchPart gets closed for removing event listeners /// Internally this method calls ClosePart after it removed the listeners registered /// by QmitkFunctionality. By having this proxy method the user does not have to /// call QmitkFunctionality::ClosePart() when overwriting ClosePart() /// void ClosePartProxy(); //# other protected methods which should not be overwritten (or which are deprecated) protected: /// /// Called immediately after CreateQtPartControl(). /// Here standard event listeners for a QmitkFunctionality are registered /// void AfterCreateQtPartControl(); /// /// code to activate the last visible functionality /// void ActivateLastVisibleFunctionality(); /// /// reactions to selection events from data manager (and potential other senders) /// void BlueBerrySelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart, const berry::ISelection::ConstPointer& selection); /// /// Converts a mitk::DataNodeSelection to a std::vector<mitk::DataNode*> (possibly empty /// std::vector<mitk::DataNode*> DataNodeSelectionToVector(mitk::DataNodeSelection::ConstPointer currentSelection) const; //# protected fields protected: /// /// helper stuff to observe BlueBerry selections /// friend struct berry::SelectionChangedAdapter<QmitkFunctionality>; /// /// Saves the parent of this view (this is the scrollarea created in CreatePartControl(QWidget*) /// \see CreatePartControl(QWidget*) /// QWidget* m_Parent; /// /// Saves if this view is the currently active one. /// bool m_Active; /// /// Saves if this view is visible /// bool m_Visible; //# private fields: private: /// /// Holds the current selection (selection made by this Functionality !!!) /// QmitkFunctionalitySelectionProvider* m_SelectionProvider; /// /// object to observe BlueBerry selections /// QScopedPointer<berry::ISelectionListener> m_BlueBerrySelectionListener; ctkServiceTracker<mitk::IDataStorageService*> m_DataStorageServiceTracker; /// /// Saves if this view handles multiple datastorages /// bool m_HandlesMultipleDataStorages; /// /// Saves if this class is currently working on DataStorage changes. /// This is a protector variable to avoid recursive calls on event listener functions. bool m_InDataStorageChanged; /// /// saves all visible functionalities /// std::set<std::string> m_VisibleFunctionalities; }; #endif /*QMITKFUNCTIONALITY_H_*/ diff --git a/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionalityCoordinator.h b/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionalityCoordinator.h index 8bef04751d..34b7a2ee7b 100644 --- a/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionalityCoordinator.h +++ b/Plugins/org.mitk.gui.qt.common.legacy/src/QmitkFunctionalityCoordinator.h @@ -1,121 +1,121 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkFunctionalityCoordinator_h #define QmitkFunctionalityCoordinator_h #include <berryIPartListener.h> #include <berryIWindowListener.h> #include <berryIWorkbenchWindow.h> #include <set> #include <org_mitk_gui_qt_common_legacy_Export.h> class QmitkFunctionality; /// /// \ingroup org_mitk_gui_qt_common_legacy /// /// A class which coordinates active QmitkFunctionalities, e.g. calling activated and hidden on them. /// class MITK_QT_COMMON_LEGACY QmitkFunctionalityCoordinator : virtual public berry::IPartListener, virtual public berry::IWindowListener { public: QmitkFunctionalityCoordinator(); - virtual ~QmitkFunctionalityCoordinator(); + ~QmitkFunctionalityCoordinator() override; /// /// Add listener /// void Start(); /// /// Remove listener /// void Stop(); //#IPartListener methods (these methods internally call Activated() or other similar methods) /// /// \see IPartListener::GetPartEventTypes() /// berry::IPartListener::Events::Types GetPartEventTypes() const override; /// /// \see IPartListener::PartActivated() /// - virtual void PartActivated (const berry::IWorkbenchPartReference::Pointer& partRef) override; + void PartActivated (const berry::IWorkbenchPartReference::Pointer& partRef) override; /// /// \see IPartListener::PartDeactivated() /// - virtual void PartDeactivated(const berry::IWorkbenchPartReference::Pointer& /*partRef*/) override; + void PartDeactivated(const berry::IWorkbenchPartReference::Pointer& /*partRef*/) override; /// /// \see IPartListener::PartOpened() /// - virtual void PartOpened(const berry::IWorkbenchPartReference::Pointer& partRef) override; + void PartOpened(const berry::IWorkbenchPartReference::Pointer& partRef) override; /// /// \see IPartListener::PartClosed() /// - virtual void PartClosed (const berry::IWorkbenchPartReference::Pointer& partRef) override; + void PartClosed (const berry::IWorkbenchPartReference::Pointer& partRef) override; /// /// \see IPartListener::PartHidden() /// - virtual void PartHidden (const berry::IWorkbenchPartReference::Pointer& partRef) override; + void PartHidden (const berry::IWorkbenchPartReference::Pointer& partRef) override; /// /// \see IPartListener::PartVisible() /// - virtual void PartVisible (const berry::IWorkbenchPartReference::Pointer& partRef) override; + void PartVisible (const berry::IWorkbenchPartReference::Pointer& partRef) override; /** * Notifies this listener that the given window has been closed. */ - virtual void WindowClosed(const berry::IWorkbenchWindow::Pointer& window) override; + void WindowClosed(const berry::IWorkbenchWindow::Pointer& window) override; /** * Notifies this listener that the given window has been opened. */ - virtual void WindowOpened(const berry::IWorkbenchWindow::Pointer& /*window*/) override; + void WindowOpened(const berry::IWorkbenchWindow::Pointer& /*window*/) override; protected: /// /// Activates the standalone functionality /// void ActivateStandaloneFunctionality(berry::IWorkbenchPartReference *partRef); /// /// Deactivates the standalone functionality /// void DeactivateStandaloneFunctionality(berry::IWorkbenchPartReference *functionality, berry::IWorkbenchPartReference *newRef); /// /// Saves the workbench window /// berry::IWorkbenchWindow::WeakPtr m_Window; /// /// Saves the last part that added interactors /// berry::IWorkbenchPartReference* m_StandaloneFuntionality; /// /// Saves all opened QmitkFclassunctionalities /// std::set<QmitkFunctionality*> m_Functionalities; /// /// Saves all visible QmitkFunctionalities /// std::set<berry::IWorkbenchPartReference*> m_VisibleStandaloneFunctionalities; }; #endif // QmitkFunctionalityCoordinator_h diff --git a/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h b/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h index 80013e5cd8..86c952e934 100644 --- a/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h +++ b/Plugins/org.mitk.gui.qt.common.legacy/src/internal/QmitkFunctionalityUtil.h @@ -1,83 +1,83 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKFUNCTIONALITYUTIL_H #define QMITKFUNCTIONALITYUTIL_H #include <berryISelectionProvider.h> class QmitkFunctionality; #include <mitkDataNode.h> #include <mitkDataNodeSelection.h> /// /// Internal class for selection providing /// class QmitkFunctionalitySelectionProvider: public berry::ISelectionProvider { public: /// /// Creates smartpointer typedefs /// berryObjectMacro(QmitkFunctionalitySelectionProvider) QmitkFunctionalitySelectionProvider(QmitkFunctionality* _Functionality); - virtual ~QmitkFunctionalitySelectionProvider(); + ~QmitkFunctionalitySelectionProvider() override; //# ISelectionProvider methods /// /// \see ISelectionProvider::AddSelectionChangedListener() /// - virtual void AddSelectionChangedListener(berry::ISelectionChangedListener* listener) override; + void AddSelectionChangedListener(berry::ISelectionChangedListener* listener) override; /// /// \see ISelectionProvider::GetSelection() /// - virtual berry::ISelection::ConstPointer GetSelection() const override; + berry::ISelection::ConstPointer GetSelection() const override; /// /// \see ISelectionProvider::RemoveSelectionChangedListener() /// - virtual void RemoveSelectionChangedListener(berry::ISelectionChangedListener* listener) override; + void RemoveSelectionChangedListener(berry::ISelectionChangedListener* listener) override; /// /// \see ISelectionProvider::SetSelection() /// - virtual void SetSelection(const berry::ISelection::ConstPointer& selection) override; + void SetSelection(const berry::ISelection::ConstPointer& selection) override; /// /// Sends the nodes as selected to the workbench /// void FireNodesSelected(const std::vector<mitk::DataNode::Pointer>& nodes ); protected: /// /// the functionality parent /// QmitkFunctionality* m_Functionality; /// /// Holds the current selection (selection made by m_Functionality !!!) /// mitk::DataNodeSelection::ConstPointer m_CurrentSelection; /// /// The selection events other parts can listen too /// berry::ISelectionChangedListener::Events m_SelectionEvents; }; #endif // QMITKFUNCTIONALITYUTIL_H diff --git a/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h b/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h index c15691e0de..b1cdae0b3f 100644 --- a/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h +++ b/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h @@ -1,91 +1,91 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDataManagerLightView_H_ #define QmitkDataManagerLightView_H_ /// Qmitk #include <QmitkAbstractView.h> struct QmitkDataManagerLightViewData; /// /// \brief Data management view with reduced functions ("light") /// class QmitkDataManagerLightView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; // = "org.mitk.extapp.defaultperspective" /// /// \brief Standard ctor. /// QmitkDataManagerLightView(); /// /// \brief Standard dtor. /// - virtual ~QmitkDataManagerLightView(); + ~QmitkDataManagerLightView() override; /// /// add the node to the list ... /// - virtual void NodeAdded(const mitk::DataNode* node) override; + void NodeAdded(const mitk::DataNode* node) override; /// /// remove the node /// - virtual void NodeRemoved(const mitk::DataNode* node) override; + void NodeRemoved(const mitk::DataNode* node) override; /** * Called when a DataStorage Changed event was thrown. May be reimplemented * by deriving classes. */ - virtual void NodeChanged(const mitk::DataNode* node) override; + void NodeChanged(const mitk::DataNode* node) override; protected slots: void on_DataItemList_currentRowChanged ( int currentRow ); void on_Remove_pressed(); void on_Load_pressed(); protected: /// /// \brief Create the view here. /// - virtual void CreateQtPartControl(QWidget* parent) override; + void CreateQtPartControl(QWidget* parent) override; /// /// evaluate the new label string /// void ListSelectionChanged(); void FileOpen(const char *fileName, mitk::DataNode *parentNode); void RemoveNode(mitk::DataNode *node); void GlobalReinit(); void ToggleVisibility(); /// /// focus on load image /// void SetFocus() override; private: QmitkDataManagerLightViewData* d; }; #endif /*QmitkDataManagerLightView_H_*/ diff --git a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h index 157775f528..71d697cbee 100644 --- a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h +++ b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATASTORAGEVIEWERTESTVIEW_H #define QMITKDATASTORAGEVIEWERTESTVIEW_H // mitk gui qt common plugin #include <QmitkAbstractView.h> #include "QmitkModelViewSelectionConnector.h" #include "QmitkSelectionServiceConnector.h" // data storage viewer test plugin #include "ui_QmitkDataStorageViewerTestControls.h" // qt widgets module #include "QmitkDataStorageDefaultListModel.h" /** * @brief DataStorageViewerTestView */ class QmitkDataStorageViewerTestView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; protected: - virtual void SetFocus() override; + void SetFocus() override; - virtual void CreateQtPartControl(QWidget* parent) override; + void CreateQtPartControl(QWidget* parent) override; private Q_SLOTS: void SetAsSelectionProvider1(bool checked); void SetAsSelectionProvider2(bool checked); void SetAsSelectionProvider3(bool checked); void SetAsSelectionProvider4(bool checked); void SetAsSelectionListener1(bool checked); void SetAsSelectionListener2(bool checked); void SetAsSelectionListener3(bool checked); void SetAsSelectionListener4(bool checked); void OnOnlyImages(bool checked); void OnOnlyImages2(bool checked); void OnOnlyUneven(bool checked); private: Ui::QmitkDataStorageViewerTestControls m_Controls; QmitkDataStorageDefaultListModel* m_DataStorageDefaultListModel; QmitkDataStorageDefaultListModel* m_DataStorageDefaultListModel2; std::unique_ptr<QmitkModelViewSelectionConnector> m_ModelViewSelectionConnector; std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector; std::unique_ptr<QmitkModelViewSelectionConnector> m_ModelViewSelectionConnector2; std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector2; std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector3; std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector4; }; #endif // QMITKDATASTORAGEVIEWERTESTVIEW_H diff --git a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h index 9c33d4dad7..d65a6cdf1c 100644 --- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h +++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h @@ -1,162 +1,162 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkDicomInspectorView_h #define QmitkDicomInspectorView_h // Blueberry //#include <berryISelectionListener.h> #include <berryIPartListener.h> // mitk #include <QmitkAbstractView.h> #include <mitkIRenderWindowPartListener.h> #include <mitkDICOMTag.h> #include <mitkDICOMProperty.h> // Qt #include "ui_QmitkDicomInspectorViewControls.h" /** * @brief View class defining the UI part of the ModelFitVisualization plug-in. */ class QmitkDicomInspectorView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { // 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: QmitkDicomInspectorView(); - ~QmitkDicomInspectorView(); + ~QmitkDicomInspectorView() override; static const std::string VIEW_ID; protected slots: /** * @brief Triggered when the voxel or time step selection changes. * Calculates the curve and points for the current fit if the visualization is running. */ void OnSliceChangedDelayed(); protected: - virtual void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; - virtual void SetFocus(); + void SetFocus() override; /** @brief called by QmitkFunctionality when DataManager's selection has changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& nodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& nodes) override; /** @brief Calls OnSliceChangedDelayed so the event isn't triggered multiple times. */ void OnSliceChanged(const itk::EventObject& e); void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/); - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; /** Initializes and sets the observers that are used to monitor changes in the selected position or time point in order to actualize the view.h*/ bool InitObservers(); void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer); /** Removes all observers of the deletedPart. If null pointer is passed all observers will be removed.*/ void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr); /** Sets m_currentSelectedPosition to the current selection and validates if this position is valid * for the input image of the currently selected fit. If it is valid, m_validSelectedPosition is set to true. * If the fit, his input image or geometry is not specified, it will also handled as invalid.*/ void ValidateAndSetCurrentPosition(); Ui::DicomInspectorViewControls m_Controls; mitk::IRenderWindowPart* m_renderWindowPart; // Needed for observing the events for when a slice or time step is changed. bool m_PendingSliceChangedEvent; /**Helper structure to manage the registered observer events.*/ struct ObserverInfo { mitk::SliceNavigationController* controller; int observerTag; std::string renderWindowName; mitk::IRenderWindowPart* renderWindowPart; ObserverInfo(mitk::SliceNavigationController* controller, int observerTag, const std::string& renderWindowName, mitk::IRenderWindowPart* part); }; typedef std::multimap<const mitk::SliceNavigationController*, ObserverInfo> ObserverMapType; ObserverMapType m_ObserverMap; /** @brief currently valid selected position in the inspector*/ mitk::Point3D m_currentSelectedPosition; /** @brief indicates if the currently selected position is valid for the currently selected fit. * This it is within the input image */ bool m_validSelectedPosition; unsigned int m_currentSelectedTimeStep; itk::IndexValueType m_currentSelectedZSlice; /** @brief currently selected node for the visualization logic*/ mitk::DataNode::ConstPointer m_currentSelectedNode; mitk::BaseData::ConstPointer m_currentSelectedData; /** @brief Is a visualization currently running? */ bool m_internalUpdateFlag; /** @brief Number of interpolation steps between two x values */ static const unsigned int INTERPOLATION_STEPS; /*************************************/ /* Members for visualizing the model */ itk::TimeStamp m_selectedNodeTime; itk::TimeStamp m_currentFitTime; itk::TimeStamp m_currentPositionTime; itk::TimeStamp m_lastRefreshTime; /**Helper structure to manage the registered observer events.*/ struct TagInfo { mitk::DICOMTag tag; mitk::DICOMProperty::ConstPointer prop; TagInfo(const mitk::DICOMTag& aTag, mitk::DICOMProperty::ConstPointer aProp) : tag(aTag), prop(aProp) { }; }; typedef std::map<std::string, TagInfo> TagMapType; TagMapType m_Tags; void RenderTable(); /** (re)initializes the headers of the data table*/ void UpdateData(); void UpdateLabels(); }; #endif // QmitkDicomInspectorView_h diff --git a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h index 578658edba..1163b576c1 100644 --- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h +++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkDicomInspectorActivator_h #define mitkDicomInspectorActivator_h #include <ctkPluginActivator.h> class mitkDicomInspectorActivator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_dicominspector") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; // mitkDicomInspectorActivator #endif // mitkDicomInspectorActivator_h diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.h b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.h index 2bc4b249ea..33192534ae 100644 --- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/DoseVisualizationPreferencePage.h @@ -1,125 +1,125 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __DOSE_VISUALIZATION_PREFERENCE_PAGE_H #define __DOSE_VISUALIZATION_PREFERENCE_PAGE_H #include "berryIQtPreferencePage.h" #include "berryIPreferences.h" #include "ui_DoseVisualizationPreferencePageControls.h" #include <mitkIsoDoseLevelCollections.h> #include "mitkDoseVisPreferenceHelper.h" /*forward declarations*/ class QmitkIsoDoseLevelSetModel; class QmitkDoseColorDelegate; class QmitkDoseValueDelegate; class QmitkDoseVisualStyleDelegate; class QWidget; /** * \class DoseVisualizationPreferencePage * \brief Preference page for RT Dose visualization */ class DoseVisualizationPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: DoseVisualizationPreferencePage(); - ~DoseVisualizationPreferencePage(); + ~DoseVisualizationPreferencePage() override; /** * \brief Called by framework to initialize this preference page, but currently does nothing. * \param workbench The workbench. */ - void Init(berry::IWorkbench::Pointer workbench); + void Init(berry::IWorkbench::Pointer workbench) override; /** * \brief Called by framework to create the GUI, and connect signals and slots. * \param widget The Qt widget that acts as parent to all GUI components, as this class itself is not derived from QWidget. */ - void CreateQtControl(QWidget* widget); + void CreateQtControl(QWidget* widget) override; /** * \brief Required by framework to get hold of the GUI. * \return QWidget* the top most QWidget for the GUI. */ - QWidget* GetQtControl() const; + QWidget* GetQtControl() const override; /** * \see IPreferencePage::PerformOk */ - virtual bool PerformOk(); + bool PerformOk() override; /** * \see IPreferencePage::PerformCancel */ - virtual void PerformCancel(); + void PerformCancel() override; /** * \see IPreferencePage::Update */ - virtual void Update(); + void Update() override; public slots: void OnCurrentItemChanged ( QListWidgetItem * currentItem, QListWidgetItem * previousItem); void OnShowContextMenuIsoSet(const QPoint& pos); void OnAddPresetClicked(bool checked); void OnDelPresetClicked(bool checked); void OnResetPresetClicked(bool checked); void OnAddLevelClicked(bool checked); void OnDelLevelClicked(bool checked); void OnReferenceDoseChanged(double dose); void OnGlobalVisChanged(bool vis); protected: /** Method updates the presets widgets according to the internal members*/ void UpdatePresetsWidgets(); /** Method actualizes the level set model and edit buttons according to the currently selected item in the presets list view*/ void UpdateLevelSetWidgets(); /** Method returns the iso dose level set selected in the preset lists. May return nullptr if no preset is selected.*/ mitk::IsoDoseLevelSet* GetSelectedIsoLevelSet(); QWidget *m_MainControl; Ui::DoseVisualizationPreferencePageControls* m_Controls; berry::IPreferences::Pointer m_DoseVisNode; typedef mitk::PresetMapType PresetMapType; PresetMapType m_Presets; std::string m_selectedPresetName; bool m_referenceDoseChanged; bool m_presetMapChanged; bool m_globalVisChanged; QmitkIsoDoseLevelSetModel* m_LevelSetModel; QmitkDoseColorDelegate* m_DoseColorDelegate; QmitkDoseValueDelegate* m_DoseValueDelegate; QmitkDoseVisualStyleDelegate* m_DoseVisualDelegate; }; #endif diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.h b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.h index 8cc40f7556..75eefd2a0c 100644 --- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.h +++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTDoseVisualizer.h @@ -1,177 +1,177 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef RTDoseVisualizer_h #define RTDoseVisualizer_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_RTDoseVisualizerControls.h" #include <mitkIsoDoseLevelCollections.h> #include <mitkImage.h> #include <mitkNodePredicateBase.h> #include "mitkDoseVisPreferenceHelper.h" // Shader #include <mitkCoreServices.h> #include <vtkSmartPointer.h> #include <mitkRenderingModeProperty.h> #include <vtkContourFilter.h> #include <mitkIRenderingManager.h> #include <mitkIRenderWindowPart.h> /*forward declarations*/ class QmitkIsoDoseLevelSetModel; class QmitkDoseColorDelegate; class QmitkDoseValueDelegate; class QmitkDoseVisualStyleDelegate; class ctkEvent; /** \brief RTDoseVisualizer \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class RTDoseVisualizer : public QmitkAbstractView { // 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: RTDoseVisualizer(); - virtual ~RTDoseVisualizer(); + ~RTDoseVisualizer() override; static const std::string VIEW_ID; static const std::string ISO_LINE_NODE_NAME; void OnSliceChanged(itk::Object *sender, const itk::EventObject &e); protected slots: void OnAddFreeValueClicked(); void OnRemoveFreeValueClicked(); void OnUsePrescribedDoseClicked(); void OnDataChangedInIsoLevelSetView(); void OnAbsDoseToggled(bool); void OnGlobalVisColorWashToggled(bool); void OnGlobalVisIsoLineToggled(bool); void OnShowContextMenuIsoSet(const QPoint&); void OnCurrentPresetChanged(const QString&); void OnReferenceDoseChanged(double); void OnHandleCTKEventReferenceDoseChanged(const ctkEvent& event); void OnHandleCTKEventPresetsChanged(const ctkEvent& event); void OnHandleCTKEventGlobalVisChanged(const ctkEvent& event); void ActualizeFreeIsoLine(); protected: - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& nodes ); + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& nodes ) override; void PrepareDoseNode(mitk::DataNode* doseNode) const; /** Update the transfer funtion property for the color wash*/ void UpdateColorWashTransferFunction(); /** Method updates the list widget according to the current free iso values.*/ void UpdateFreeIsoValues(); /** Update the members according to the currently selected node */ void UpdateBySelectedNode(); /** Update the member widgets according to the information stored in the application preferences*/ void UpdateByPreferences(); /**helper function that iterates throug all data nodes and sets there iso level set property according to the selected preset. @TODO: should be moved outside the class, to be available for other classes at well.*/ void ActualizeIsoLevelsForAllDoseDataNodes(); /**helper function that iterates throug all data nodes and sets there reference dose value according to the preference. @TODO: should be moved outside the class, to be available for other classes at well.*/ void ActualizeReferenceDoseForAllDoseDataNodes(); /**helper function that iterates through all data nodes and sets there dose display style (relative/absolute) according to the preference. @TODO: should be moved outside the class, to be available for other classes at well.*/ void ActualizeDisplayStyleForAllDoseDataNodes(); void NodeRemoved(const mitk::DataNode* node) override; void NodeChanged(const mitk::DataNode *node) override; Ui::RTDoseVisualizerControls m_Controls; mitk::DataNode::Pointer m_selectedNode; unsigned int m_freeIsoValuesCount; mitk::PresetMapType m_Presets; std::string m_selectedPresetName; /** Prescribed Dose of the selected data.*/ mitk::DoseValueAbs m_PrescribedDose_Data; QmitkIsoDoseLevelSetModel* m_LevelSetModel; QmitkDoseColorDelegate* m_DoseColorDelegate; QmitkDoseValueDelegate* m_DoseValueDelegate; QmitkDoseVisualStyleDelegate* m_DoseVisualDelegate; bool m_internalUpdate; /**Predicate for dose nodes (excluding iso line nodes)*/ mitk::NodePredicateBase::Pointer m_isDosePredicate; /**Predicate for dose nodes and all iso line nodes*/ mitk::NodePredicateBase::Pointer m_isDoseOrIsoPredicate; /**Predicate for iso line nodes*/ mitk::NodePredicateBase::Pointer m_isIsoPredicate; private: mitk::DataNode::Pointer GetIsoDoseNode(mitk::DataNode::Pointer doseNode) const; }; #endif // RTDoseVisualizer_h diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePage.h b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePage.h index 208a41773f..cf16606c5f 100644 --- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/RTUIPreferencePage.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __RT_UI_PREFERENCE_PAGE_H #define __RT_UI_PREFERENCE_PAGE_H #include "berryIQtPreferencePage.h" #include "berryIPreferences.h" #include "ui_RTUIPreferencePageControls.h" class QWidget; /** * \class RTUIPreferencePage * \brief Preference page for general RT visualization settings. */ class RTUIPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: RTUIPreferencePage(); - ~RTUIPreferencePage(); + ~RTUIPreferencePage() override; /** * \brief Called by framework to initialize this preference page, but currently does nothing. * \param workbench The workbench. */ - void Init(berry::IWorkbench::Pointer workbench); + void Init(berry::IWorkbench::Pointer workbench) override; /** * \brief Called by framework to create the GUI, and connect signals and slots. * \param widget The Qt widget that acts as parent to all GUI components, as this class itself is not derived from QWidget. */ - void CreateQtControl(QWidget* widget); + void CreateQtControl(QWidget* widget) override; /** * \brief Required by framework to get hold of the GUI. * \return QWidget* the top most QWidget for the GUI. */ - QWidget* GetQtControl() const; + QWidget* GetQtControl() const override; /** * \see IPreferencePage::PerformOk */ - virtual bool PerformOk(); + bool PerformOk() override; /** * \see IPreferencePage::PerformCancel */ - virtual void PerformCancel(); + void PerformCancel() override; /** * \see IPreferencePage::Update */ - virtual void Update(); + void Update() override; public slots: protected: QWidget *m_MainControl; Ui::RTUIPreferencePageControls* m_Controls; berry::IPreferences::Pointer m_PreferencesNode; }; #endif diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/org_mitk_gui_qt_dosevisualization_Activator.h b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/org_mitk_gui_qt_dosevisualization_Activator.h index 18cbb90b2d..0f720a9853 100644 --- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/org_mitk_gui_qt_dosevisualization_Activator.h +++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/org_mitk_gui_qt_dosevisualization_Activator.h @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_dosevisualization_Activator_h #define org_mitk_gui_qt_dosevisualization_Activator_h #include <ctkPluginActivator.h> namespace mitk { class org_mitk_gui_qt_dosevisualization_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_dosevisualization") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_dosevisualization_Activator } #endif // org_mitk_gui_qt_dosevisualization_Activator_h diff --git a/Plugins/org.mitk.gui.qt.eventrecorder/src/internal/InteractionEventRecorder.h b/Plugins/org.mitk.gui.qt.eventrecorder/src/internal/InteractionEventRecorder.h index 6daad2a737..36ca689c95 100644 --- a/Plugins/org.mitk.gui.qt.eventrecorder/src/internal/InteractionEventRecorder.h +++ b/Plugins/org.mitk.gui.qt.eventrecorder/src/internal/InteractionEventRecorder.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef InteractionEventRecorder_h #define InteractionEventRecorder_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_InteractionEventRecorderControls.h" #include "mitkInteractionEventObserver.h" #include "mitkEventRecorder.h" /** \brief InteractionEventRecorder Demontrates the use of InteractionOversers. Allows to record all mouse interaction in the renderwindows save it as XML file. And also replay the interaction. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class InteractionEventRecorder : public QmitkAbstractView { // 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; protected slots: /// \brief Called when the user clicks the GUI button void StartRecording(); void StopRecording(); void OpenFile(); void RotatePlanes(); void RotateView(); void Play(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; Ui::InteractionEventRecorderControls m_Controls; private: mitk::EventRecorder* m_CurrentObserver; us::ServiceRegistration<mitk::InteractionEventObserver> m_ServiceRegistration; }; #endif // InteractionEventRecorder_h diff --git a/Plugins/org.mitk.gui.qt.fit.demo/src/internal/FitGeneratorDemoView.h b/Plugins/org.mitk.gui.qt.fit.demo/src/internal/FitGeneratorDemoView.h index bd18351721..474cb81418 100644 --- a/Plugins/org.mitk.gui.qt.fit.demo/src/internal/FitGeneratorDemoView.h +++ b/Plugins/org.mitk.gui.qt.fit.demo/src/internal/FitGeneratorDemoView.h @@ -1,93 +1,93 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef FitGeneratorDemoView_h #define FitGeneratorDemoView_h #include <QString> #include <QmitkAbstractView.h> #include <itkCommand.h> #include "ui_FitGeneratorDemoView.h" #include <mitkModelBase.h> #include <mitkModelFactoryBase.h> #include <QmitkParameterFitBackgroundJob.h> #include <mitkModelFitResultHelper.h> /*! * @brief Test Plugin for generation of model parameter images */ class FitGeneratorDemoView : public QmitkAbstractView { Q_OBJECT public: /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; FitGeneratorDemoView(); protected slots: void OnModellingButtonClicked(); void OnGenerateTestDataButtonClicked(); void OnJobFinished(); void OnJobError(QString err); void OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType results, const ParameterFitBackgroundJob* pJob); void OnJobProgress(double progress); void OnJobStatusChanged(QString info); protected: // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - void SetFocus(); + void SetFocus() override; void Generate(); /*! \brief called by QmitkFunctionality when DataManager's selection has changed */ - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& nodes); + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& nodes) override; Ui::FitGeneratorDemoViewControls m_Controls; mitk::DataNode::Pointer m_selectedNode; mitk::Image::Pointer m_selectedImage; mitk::DataNode::Pointer m_selectedMaskNode; mitk::Image::Pointer m_selectedMask; mitk::ModelFactoryBase::Pointer m_ModelFactory; }; #endif diff --git a/Plugins/org.mitk.gui.qt.fit.demo/src/internal/org_mitk_FitGeneratorDemo_Activator.h b/Plugins/org.mitk.gui.qt.fit.demo/src/internal/org_mitk_FitGeneratorDemo_Activator.h index 1185560c0f..feda2f439d 100644 --- a/Plugins/org.mitk.gui.qt.fit.demo/src/internal/org_mitk_FitGeneratorDemo_Activator.h +++ b/Plugins/org.mitk.gui.qt.fit.demo/src/internal/org_mitk_FitGeneratorDemo_Activator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_fit_demo_Activator_h #define org_mitk_gui_qt_fit_demo_Activator_h #include <ctkPluginActivator.h> class org_mitk_gui_qt_fit_demo_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_fit_demo") Q_INTERFACES(ctkPluginActivator) public: /*! * @brief Registers the plug-in. Gets called by the framework when the plug-in is * first loaded. * @param context The corresponding CTK plug-in context in which the plug-in is loaded. */ - void start(ctkPluginContext* context); + void start(ctkPluginContext* context) override; /*! * @brief Deregisters the plug-in. Gets called by the framework when the plug-in * is unloaded. * @param context The corresponding CTK plug-in context in which the plug-in was loaded. */ - void stop(ctkPluginContext* context); + void stop(ctkPluginContext* context) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.h b/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.h index 88d5b40577..c2ab96a93b 100644 --- a/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.h +++ b/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/GenericDataFittingView.h @@ -1,157 +1,157 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef GenericDataFittingView_h #define GenericDataFittingView_h #include <QString> #include "QmitkAbstractView.h" #include "itkCommand.h" #include "ui_GenericDataFittingViewControls.h" #include "mitkModelBase.h" #include "QmitkParameterFitBackgroundJob.h" #include "mitkModelFitResultHelper.h" #include "mitkModelFactoryBase.h" #include "mitkLevenbergMarquardtModelFitFunctor.h" #include "mitkSimpleBarrierConstraintChecker.h" #include <mitkNodePredicateBase.h> /*! * @brief Plugin for generic dynamic image data fitting */ class GenericDataFittingView : public QmitkAbstractView { Q_OBJECT public: /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; GenericDataFittingView(); protected slots: void OnModellingButtonClicked(); void OnJobFinished(); void OnJobError(QString err); void OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType results, const ParameterFitBackgroundJob* pJob); void OnJobProgress(double progress); void OnJobStatusChanged(QString info); void OnModellSet(int); void OnNrOfParamsChanged(); /**Sets visibility and enabled state of the GUI depending on the settings and workflow state.*/ void UpdateGUIControls(); protected: typedef QList<mitk::DataNode*> SelectedDataNodeVectorType; // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - void SetFocus(); + void SetFocus() override; template <typename TParameterizer> void GenerateModelFit_ROIBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); template <typename TParameterizer> void GenerateModelFit_PixelBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); /** Helper function that configures the initial parameter strategy of a parameterizer according to the settings of the GUI.*/ void ConfigureInitialParametersOfParameterizer(mitk::ModelParameterizerBase* parameterizer) const; void PrepareFitConfiguration(); bool IsGenericParamFactorySelected() const; /*! Starts the fitting job with the passed generator and session info*/ void DoFit(const mitk::modelFit::ModelFitInfo* fitSession, mitk::ParameterFitImageGeneratorBase* generator); /**Checks if the settings in the GUI are valid for the chosen model.*/ bool CheckModelSettings() const; void InitModelComboBox() const; /*! \brief called by QmitkFunctionality when DataManager's selection has changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& selectedNodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& selectedNodes) override; // Variables /*! @brief The view's UI controls */ Ui::GeneralDataFittingViewControls m_Controls; /* Nodes selected by user/ui for the fit */ mitk::DataNode::Pointer m_selectedNode; mitk::DataNode::Pointer m_selectedMaskNode; /* Images selected by user/ui for the fit */ mitk::Image::Pointer m_selectedImage; mitk::Image::Pointer m_selectedMask; mitk::ModelFactoryBase::Pointer m_selectedModelFactory; mitk::SimpleBarrierConstraintChecker::Pointer m_modelConstraints; private: bool m_FittingInProgress; typedef std::vector<mitk::ModelFactoryBase::Pointer> ModelFactoryStackType; ModelFactoryStackType m_FactoryStack; /**Helper function that generates a default fitting functor * default is a levenberg marquart based optimizer with all scales set to 1.0. * Constraint setter will be set based on the gui setting and a evaluation parameter * "sum of squared differences" will always be set.*/ mitk::ModelFitFunctorBase::Pointer CreateDefaultFitFunctor(const mitk::ModelParameterizerBase* parameterizer) const; /**Returns the default fit name, derived from the current GUI settings.*/ std::string GetDefaultFitName() const; /**Returns the current set name of the fit (either default name or use defined name).*/ std::string GetFitName() const; mitk::NodePredicateBase::Pointer m_IsNotABinaryImagePredicate; mitk::NodePredicateBase::Pointer m_IsBinaryImagePredicate; }; #endif diff --git a/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/org_mitk_GenericDataFittingView_Activator.h b/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/org_mitk_GenericDataFittingView_Activator.h index a86a8072ca..67f1239c7a 100644 --- a/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/org_mitk_GenericDataFittingView_Activator.h +++ b/Plugins/org.mitk.gui.qt.fit.genericfitting/src/internal/org_mitk_GenericDataFittingView_Activator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_GenericDataFittingView_Activator_h #define org_mitk_GenericDataFittingView_Activator_h #include <ctkPluginActivator.h> class org_mitk_GenericDataFittingView_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_fit_genericfitting") Q_INTERFACES(ctkPluginActivator) public: /*! * @brief Registers the plug-in. Gets called by the framework when the plug-in is * first loaded. * @param context The corresponding CTK plug-in context in which the plug-in is loaded. */ - void start(ctkPluginContext* context); + void start(ctkPluginContext* context) override; /*! * @brief Deregisters the plug-in. Gets called by the framework when the plug-in * is unloaded. * @param context The corresponding CTK plug-in context in which the plug-in was loaded. */ - void stop(ctkPluginContext* context); + void stop(ctkPluginContext* context) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp index a851bc57c8..a2833d3f93 100644 --- a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp +++ b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.cpp @@ -1,909 +1,909 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // Blueberry #include <berryISelectionService.h> #include <berryIWorkbenchWindow.h> #include <berryIWorkbenchPage.h> // mitk #include <QmitkRenderWindow.h> // Qt #include <QMessageBox> #include <QFileDialog> #include <QTableWidget> #include <qwt_plot_marker.h> #include "QmitkPlotWidget.h" #include "mitkNodePredicateFunction.h" #include "mitkScalarListLookupTableProperty.h" #include "mitkModelFitConstants.h" #include "mitkExtractTimeGrid.h" #include "mitkModelGenerator.h" #include "mitkModelFitException.h" #include "mitkModelFitParameterValueExtraction.h" #include "mitkTimeGridHelper.h" #include "mitkModelFitPlotDataHelper.h" #include "ModelFitInspectorView.h" const std::string ModelFitInspectorView::VIEW_ID = "org.mitk.gui.gt.fit.inspector"; const unsigned int ModelFitInspectorView::INTERPOLATION_STEPS = 10; const std::string DEFAULT_X_AXIS = "Time [s]"; ModelFitInspectorView::ModelFitInspectorView() : m_renderWindowPart(nullptr), m_internalUpdateFlag(false), m_currentFit(nullptr), m_currentModelParameterizer(nullptr), m_currentModelProviderService(nullptr), m_currentSelectedTimeStep(0), m_currentSelectedNode(nullptr) { m_currentSelectedPosition.Fill(0.0); m_modelfitList.clear(); } ModelFitInspectorView::~ModelFitInspectorView() { } void ModelFitInspectorView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) { if (m_renderWindowPart != renderWindowPart) { m_renderWindowPart = renderWindowPart; } this->m_SliceChangeListener.RenderWindowPartActivated(renderWindowPart); } void ModelFitInspectorView::RenderWindowPartDeactivated( mitk::IRenderWindowPart* renderWindowPart) { m_renderWindowPart = nullptr; this->m_SliceChangeListener.RenderWindowPartDeactivated(renderWindowPart); } void ModelFitInspectorView::CreateQtPartControl(QWidget* parent) { m_Controls.setupUi(parent); m_SelectionServiceConnector = std::make_unique<QmitkSelectionServiceConnector>(); m_SelectionServiceConnector->AddPostSelectionListener(this->GetSite()->GetWorkbenchWindow()->GetSelectionService()); m_Controls.inputNodeSelector->SetDataStorage(GetDataStorage()); m_Controls.inputNodeSelector->SetEmptyInfo(QString("Please select input data to be viewed.")); m_Controls.inputNodeSelector->SetInvalidInfo(QString("<b><font color=\"red\">No input data is selected</font></b>")); m_Controls.inputNodeSelector->SetPopUpTitel(QString("Choose 3D+t input data that should be viewed!")); m_Controls.inputNodeSelector->SetSelectionIsOptional(false); m_Controls.inputNodeSelector->SetSelectOnlyVisibleNodes(true); auto predicate = mitk::NodePredicateFunction::New([](const mitk::DataNode *node) { bool isModelFitNode = node->GetData() && node->GetData()->GetProperty(mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME().c_str()).IsNotNull(); return isModelFitNode || (node && node->GetData() && node->GetData()->GetTimeSteps() > 1); }); m_Controls.inputNodeSelector->SetNodePredicate(predicate); connect(m_SelectionServiceConnector.get(), &QmitkSelectionServiceConnector::ServiceSelectionChanged, m_Controls.inputNodeSelector, &QmitkSingleNodeSelectionWidget::SetCurrentSelection); connect(m_Controls.inputNodeSelector, SIGNAL(CurrentSelectionChanged(QList<mitk::DataNode::Pointer>)), this, SLOT(OnInputChanged(const QList<mitk::DataNode::Pointer>&))); this->m_SliceChangeListener.RenderWindowPartActivated(this->GetRenderWindowPart()); connect(&m_SliceChangeListener, SIGNAL(SliceChanged()), this, SLOT(OnSliceChanged())); connect(m_Controls.cmbFit, SIGNAL(currentIndexChanged(int)), this, SLOT(OnFitSelectionChanged(int))); connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.sbFixMin, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.sbFixMax, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.labelFixMin, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.labelFixMax, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), m_Controls.btnScaleToData, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed, SIGNAL(toggled(bool)), this, SLOT(OnScaleFixedYChecked(bool))); connect(m_Controls.btnScaleToData, SIGNAL(clicked()), this, SLOT(OnScaleToDataYClicked())); connect(m_Controls.sbFixMax, SIGNAL(valueChanged(double)), this, SLOT(OnFixedScalingYChanged(double))); connect(m_Controls.sbFixMin, SIGNAL(valueChanged(double)), this, SLOT(OnFixedScalingYChanged(double))); connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.sbFixMin_x, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.sbFixMax_x, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.labelFixMin_x, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.labelFixMax_x, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), m_Controls.btnScaleToData_x, SLOT(setEnabled(bool))); connect(m_Controls.radioScaleFixed_x, SIGNAL(toggled(bool)), this, SLOT(OnScaleFixedXChecked(bool))); connect(m_Controls.btnScaleToData_x, SIGNAL(clicked()), this, SLOT(OnScaleToDataXClicked())); connect(m_Controls.sbFixMax_x, SIGNAL(valueChanged(double)), this, SLOT(OnFixedScalingXChanged(double))); connect(m_Controls.sbFixMin_x, SIGNAL(valueChanged(double)), this, SLOT(OnFixedScalingXChanged(double))); connect(m_Controls.btnFullPlot, SIGNAL(clicked(bool)), this, SLOT(OnFullPlotClicked(bool))); this->EnsureBookmarkPointSet(); m_Controls.inspectionPositionWidget->SetPositionBookmarkNode(m_PositionBookmarksNode.Lock()); connect(m_Controls.inspectionPositionWidget, SIGNAL(PositionBookmarksChanged()), this, SLOT(OnPositionBookmarksChanged())); // For some reason this needs to be called to set the plot widget's minimum width to an // acceptable level (since Qwt 6). // Otherwise it tries to keep both axes equal in length, resulting in a minimum width of // 400-500px which is way too much. m_Controls.widgetPlot->GetPlot()->updateAxes(); m_Controls.cmbFit->clear(); mitk::IRenderWindowPart* renderWindowPart = GetRenderWindowPart(); RenderWindowPartActivated(renderWindowPart); } void ModelFitInspectorView::SetFocus() { } void ModelFitInspectorView::NodeRemoved(const mitk::DataNode* node) { if (node == this->m_currentSelectedNode) { QmitkSingleNodeSelectionWidget::NodeList emptylist; this->m_Controls.inputNodeSelector->SetCurrentSelection(emptylist); } } void ModelFitInspectorView::OnScaleFixedYChecked(bool checked) { m_Controls.widgetPlot->GetPlot()->setAxisAutoScale(QwtPlot::yLeft, !checked); if (checked) { OnScaleToDataYClicked(); } m_Controls.widgetPlot->GetPlot()->replot(); }; void ModelFitInspectorView::OnScaleFixedXChecked(bool checked) { m_Controls.widgetPlot->GetPlot()->setAxisAutoScale(QwtPlot::xBottom, !checked); if (checked) { OnScaleToDataXClicked(); } m_Controls.widgetPlot->GetPlot()->replot(); }; void ModelFitInspectorView::OnScaleToDataYClicked() { auto minmax = this->m_PlotCurves.GetYMinMax(); - auto min = minmax.first - abs(minmax.first) * 0.01; - auto max = minmax.second + abs(minmax.second) * 0.01; + auto min = minmax.first - std::abs(minmax.first) * 0.01; + auto max = minmax.second + std::abs(minmax.second) * 0.01; m_Controls.sbFixMin->setValue(min); m_Controls.sbFixMax->setValue(max); }; void ModelFitInspectorView::OnScaleToDataXClicked() { auto minmax = this->m_PlotCurves.GetXMinMax(); - auto min = minmax.first - abs(minmax.first) * 0.01; - auto max = minmax.second + abs(minmax.second) * 0.01; + auto min = minmax.first - std::abs(minmax.first) * 0.01; + auto max = minmax.second + std::abs(minmax.second) * 0.01; m_Controls.sbFixMin_x->setValue(min); m_Controls.sbFixMax_x->setValue(max); }; void ModelFitInspectorView::OnFixedScalingYChanged(double /*value*/) { m_Controls.widgetPlot->GetPlot()->setAxisScale(QwtPlot::yLeft, m_Controls.sbFixMin->value(), m_Controls.sbFixMax->value()); m_Controls.widgetPlot->GetPlot()->replot(); }; void ModelFitInspectorView::OnFixedScalingXChanged(double /*value*/) { m_Controls.widgetPlot->GetPlot()->setAxisScale(QwtPlot::xBottom, m_Controls.sbFixMin_x->value(), m_Controls.sbFixMax_x->value()); m_Controls.widgetPlot->GetPlot()->replot(); }; void ModelFitInspectorView::OnFullPlotClicked(bool checked) { m_Controls.tabWidget->setVisible(!checked); }; int ModelFitInspectorView::ActualizeFitSelectionWidget() { mitk::NodeUIDType selectedFitUD = ""; bool isModelFitNode = this->m_currentSelectedNode->GetData()->GetPropertyList()->GetStringProperty( mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME().c_str(), selectedFitUD); mitk::DataStorage::Pointer storage = this->GetDataStorage(); mitk::modelFit::NodeUIDSetType fitUIDs = mitk::modelFit::GetFitUIDsOfNode( this->m_currentSelectedNode, storage); this->m_modelfitList.clear(); this->m_Controls.cmbFit->clear(); for (const auto & fitUID : fitUIDs) { mitk::modelFit::ModelFitInfo::ConstPointer info = mitk::modelFit::CreateFitInfoFromNode(fitUID, storage).GetPointer(); if (info.IsNotNull()) { this->m_modelfitList.insert(std::make_pair(info->uid, info)); std::ostringstream nameStrm; if (info->fitName.empty()) { nameStrm << info->uid; } else { nameStrm << info->fitName; } nameStrm << " (" << info->modelName << ")"; QVariant data(info->uid.c_str()); m_Controls.cmbFit->addItem(QString::fromStdString(nameStrm.str()), data); } else { MITK_ERROR << "Was not able to extract model fit information from storage. Node properties in storage may be invalid. Failed fit UID:" << fitUID; } } int cmbIndex = 0; if (m_modelfitList.empty()) { cmbIndex = -1; }; if (isModelFitNode) { //model was selected, thus select this one in combobox QVariant data(selectedFitUD.c_str()); cmbIndex = m_Controls.cmbFit->findData(data); if (cmbIndex == -1) { MITK_WARN << "Model fit Inspector in invalid state. Selected fit seems to be not avaible in plugin selection. Failed fit UID:" << selectedFitUD; } }; m_Controls.cmbFit->setCurrentIndex(cmbIndex); return cmbIndex; } void ModelFitInspectorView::OnInputChanged(const QList<mitk::DataNode::Pointer>& nodes) { if (nodes.size() > 0) { if (nodes.front() != this->m_currentSelectedNode) { m_internalUpdateFlag = true; this->m_currentSelectedNode = nodes.front(); mitk::NodeUIDType selectedFitUD = ""; bool isModelFitNode = this->m_currentSelectedNode->GetData()->GetPropertyList()->GetStringProperty( mitk::ModelFitConstants::FIT_UID_PROPERTY_NAME().c_str(), selectedFitUD); if (isModelFitNode) { this->m_currentSelectedNode = this->GetParentNode(this->m_currentSelectedNode); } auto cmbIndex = ActualizeFitSelectionWidget(); m_internalUpdateFlag = false; m_selectedNodeTime.Modified(); if (cmbIndex == -1) { //only raw 4D data selected. Just update plots for current position m_currentFit = nullptr; m_currentFitTime.Modified(); OnSliceChanged(); m_Controls.plotDataWidget->SetXName(DEFAULT_X_AXIS); } else { //refresh fit selection (and implicitly update plots) OnFitSelectionChanged(cmbIndex); } } } else { if (this->m_currentSelectedNode.IsNotNull()) { m_internalUpdateFlag = true; this->m_currentSelectedNode = nullptr; this->m_currentFit = nullptr; this->m_modelfitList.clear(); this->m_Controls.cmbFit->clear(); m_internalUpdateFlag = false; m_selectedNodeTime.Modified(); OnFitSelectionChanged(0); RefreshPlotData(); m_Controls.plotDataWidget->SetPlotData(&(this->m_PlotCurves)); m_Controls.fitParametersWidget->setFits(QmitkFitParameterModel::FitVectorType()); RenderPlot(); } } } mitk::DataNode::ConstPointer ModelFitInspectorView::GetParentNode(mitk::DataNode::ConstPointer node) { if (node.IsNotNull()) { mitk::DataStorage::SetOfObjects::ConstPointer parentNodeList = GetDataStorage()->GetSources(node); if (parentNodeList->size() > 0) { return parentNodeList->front().GetPointer(); } } return mitk::DataNode::ConstPointer(); } void ModelFitInspectorView::ValidateAndSetCurrentPosition() { mitk::Point3D currentSelectedPosition = GetRenderWindowPart()->GetSelectedPosition(nullptr); unsigned int currentSelectedTimestep = m_renderWindowPart->GetTimeNavigationController()->GetTime()-> GetPos(); if (m_currentSelectedPosition != currentSelectedPosition || m_currentSelectedTimeStep != currentSelectedTimestep || m_selectedNodeTime > m_currentPositionTime) { //the current position has been changed or the selected node has been changed since the last position validation -> check position m_currentSelectedPosition = currentSelectedPosition; m_currentSelectedTimeStep = currentSelectedTimestep; m_currentPositionTime.Modified(); m_validSelectedPosition = false; mitk::Image::Pointer inputImage = this->GetCurrentInputImage(); if (inputImage.IsNull()) { return; } mitk::BaseGeometry::Pointer geometry = inputImage->GetTimeGeometry()->GetGeometryForTimeStep( m_currentSelectedTimeStep); // check for invalid time step if (geometry.IsNull()) { geometry = inputImage->GetTimeGeometry()->GetGeometryForTimeStep(0); } if (geometry.IsNull()) { return; } m_validSelectedPosition = geometry->IsInside(m_currentSelectedPosition); } } mitk::Image::Pointer ModelFitInspectorView::GetCurrentInputImage() const { mitk::Image::Pointer result = nullptr; if (this->m_currentFit.IsNotNull()) { result = m_currentFit->inputImage; } else if (this->m_currentSelectedNode.IsNotNull()) { result = dynamic_cast<mitk::Image*>(this->m_currentSelectedNode->GetData()); if (result.IsNotNull() && result->GetTimeSteps() <= 1) { //if the image is not dynamic, we can't use it. result = nullptr; } } return result; }; const mitk::ModelBase::TimeGridType ModelFitInspectorView::GetCurrentTimeGrid() const { if (m_currentModelProviderService && m_currentFit.IsNotNull()) { return m_currentModelProviderService->GetVariableGrid(m_currentFit); } else { //fall back if there is no model provider we assume to use the normal time grid. return ExtractTimeGrid(GetCurrentInputImage()); } }; void ModelFitInspectorView::OnSliceChanged() { ValidateAndSetCurrentPosition(); m_Controls.widgetPlot->setEnabled(m_validSelectedPosition); if (m_currentSelectedNode.IsNotNull()) { m_Controls.inspectionPositionWidget->SetCurrentPosition(m_currentSelectedPosition); if (RefreshPlotData()) { RenderPlot(); m_Controls.plotDataWidget->SetPlotData(&m_PlotCurves); RenderFitInfo(); } } } void ModelFitInspectorView::OnPositionBookmarksChanged() { if (RefreshPlotData()) { RenderPlot(); m_Controls.plotDataWidget->SetPlotData(&m_PlotCurves); RenderFitInfo(); } } void ModelFitInspectorView::OnFitSelectionChanged(int index) { if (!m_internalUpdateFlag) { MITK_DEBUG << "selected fit index: " << index; std::string uid = ""; if (m_Controls.cmbFit->count() > index) { uid = m_Controls.cmbFit->itemData(index).toString().toStdString(); } mitk::modelFit::ModelFitInfo::ConstPointer newFit = nullptr; ModelFitInfoListType::iterator finding = m_modelfitList.find(uid); if (finding != m_modelfitList.end()) { newFit = finding->second; } if (m_currentFit != newFit) { m_currentModelParameterizer = nullptr; m_currentModelProviderService = nullptr; if (newFit.IsNotNull()) { m_currentModelParameterizer = mitk::ModelGenerator::GenerateModelParameterizer(*newFit); m_currentModelProviderService = mitk::ModelGenerator::GetProviderService(newFit->functionClassID); } m_currentFit = newFit; m_currentFitTime.Modified(); auto name = m_currentFit->xAxisName; if (!m_currentFit->xAxisUnit.empty()) { name += " [" + m_currentFit->xAxisUnit + "]"; } m_Controls.plotDataWidget->SetXName(name); OnSliceChanged(); } } } mitk::PlotDataCurveCollection::Pointer ModelFitInspectorView::RefreshPlotDataCurveCollection(const mitk::Point3D& position, const mitk::Image* input, const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::ModelBase::TimeGridType& timeGrid, mitk::ModelParameterizerBase* parameterizer) { mitk::PlotDataCurveCollection::Pointer result = mitk::PlotDataCurveCollection::New(); //sample curve if (input) { result->InsertElement(mitk::MODEL_FIT_PLOT_SAMPLE_NAME(), GenerateImageSamplePlotData(position, input, timeGrid)); } //model signal curve if (fitInfo) { // Interpolate time grid (x values) so the curve looks smooth const mitk::ModelBase::TimeGridType interpolatedTimeGrid = mitk::GenerateSupersampledTimeGrid(timeGrid, INTERPOLATION_STEPS); auto hires_curve = mitk::GenerateModelSignalPlotData(position, fitInfo, interpolatedTimeGrid, parameterizer); result->InsertElement(mitk::MODEL_FIT_PLOT_INTERPOLATED_SIGNAL_NAME(), hires_curve); auto curve = mitk::GenerateModelSignalPlotData(position, fitInfo, timeGrid, parameterizer); result->InsertElement(mitk::MODEL_FIT_PLOT_SIGNAL_NAME(), curve); } return result; }; bool ModelFitInspectorView::RefreshPlotData() { bool changed = false; if (m_currentSelectedNode.IsNull()) { this->m_PlotCurves = mitk::ModelFitPlotData(); changed = m_selectedNodeTime > m_lastRefreshTime; m_lastRefreshTime.Modified(); } else { assert(GetRenderWindowPart() != NULL); const mitk::Image* input = GetCurrentInputImage(); const mitk::ModelBase::TimeGridType timeGrid = GetCurrentTimeGrid(); if (m_currentFitTime > m_lastRefreshTime || m_currentPositionTime > m_lastRefreshTime) { if (m_validSelectedPosition) { m_PlotCurves.currentPositionPlots = RefreshPlotDataCurveCollection(m_currentSelectedPosition,input,m_currentFit, timeGrid, m_currentModelParameterizer); } else { m_PlotCurves.currentPositionPlots = mitk::PlotDataCurveCollection::New(); } changed = true; } auto bookmarks = m_PositionBookmarks.Lock(); if (bookmarks.IsNotNull()) { if (m_currentFitTime > m_lastRefreshTime || bookmarks->GetMTime() > m_lastRefreshTime) { m_PlotCurves.positionalPlots.clear(); auto endIter = bookmarks->End(); for (auto iter = bookmarks->Begin(); iter != endIter; iter++) { auto collection = RefreshPlotDataCurveCollection(iter.Value(), input, m_currentFit, timeGrid, m_currentModelParameterizer); m_PlotCurves.positionalPlots.emplace(iter.Index(), std::make_pair(iter.Value(), collection)); } changed = true; } } else { m_PlotCurves.positionalPlots.clear(); } // input data curve if (m_currentFitTime > m_lastRefreshTime) { m_PlotCurves.staticPlots->clear(); if (m_currentFit.IsNotNull()) { m_PlotCurves.staticPlots = GenerateAdditionalModelFitPlotData(m_currentSelectedPosition, m_currentFit, timeGrid); } changed = true; } m_lastRefreshTime.Modified(); } return changed; } void ModelFitInspectorView::RenderFitInfo() { assert(m_renderWindowPart != nullptr); // configure fit information if (m_currentFit.IsNull()) { m_Controls.lFitType->setText(""); m_Controls.lFitUID->setText(""); m_Controls.lModelName->setText(""); m_Controls.lModelType->setText(""); } else { m_Controls.lFitType->setText(QString::fromStdString(m_currentFit->fitType)); m_Controls.lFitUID->setText(QString::fromStdString(m_currentFit->uid)); m_Controls.lModelName->setText(QString::fromStdString(m_currentFit->modelName)); m_Controls.lModelType->setText(QString::fromStdString(m_currentFit->modelType)); } // print results std::stringstream infoOutput; m_Controls.fitParametersWidget->setVisible(false); m_Controls.groupSettings->setVisible(false); if (m_currentFit.IsNull()) { infoOutput << "No fit selected. Only raw image data is plotted."; } else if (!m_validSelectedPosition) { infoOutput << "Current position is outside of the input image of the selected fit.\nInspector is deactivated."; } else { m_Controls.fitParametersWidget->setVisible(true); m_Controls.fitParametersWidget->setFits({ m_currentFit }); m_Controls.fitParametersWidget->setPositionBookmarks(m_PositionBookmarks.Lock()); m_Controls.fitParametersWidget->setCurrentPosition(m_currentSelectedPosition); } // configure data table m_Controls.tableInputData->clearContents(); if (m_currentFit.IsNull()) { infoOutput << "No fit selected. Only raw image data is plotted."; } else { m_Controls.groupSettings->setVisible(true); m_Controls.tableInputData->setRowCount(m_PlotCurves.staticPlots->size()); unsigned int rowIndex = 0; for (mitk::PlotDataCurveCollection::const_iterator pos = m_PlotCurves.staticPlots->begin(); pos != m_PlotCurves.staticPlots->end(); ++pos, ++rowIndex) { QColor dataColor; if (pos->first == "ROI") { dataColor = QColor(0, 190, 0); } else { //Use HSV schema of QColor to calculate a different color depending on the //number of already existing free iso lines. dataColor.setHsv(((rowIndex + 1) * 85) % 360, 255, 255); } QTableWidgetItem* newItem = new QTableWidgetItem(QString::fromStdString(pos->first)); m_Controls.tableInputData->setItem(rowIndex, 0, newItem); newItem = new QTableWidgetItem(); newItem->setBackgroundColor(dataColor); m_Controls.tableInputData->setItem(rowIndex, 1, newItem); } } m_Controls.lInfo->setText(QString::fromStdString(infoOutput.str())); } void ModelFitInspectorView::RenderPlotCurve(const mitk::PlotDataCurveCollection* curveCollection, const QColor& sampleColor, const QColor& signalColor, const std::string& posString) { auto sampleCurve = mitk::ModelFitPlotData::GetSamplePlot(curveCollection); if (sampleCurve) { std::string name = mitk::MODEL_FIT_PLOT_SAMPLE_NAME() + posString; unsigned int curveId = m_Controls.widgetPlot->InsertCurve(name.c_str()); m_Controls.widgetPlot->SetCurveData(curveId, sampleCurve->GetValues()); m_Controls.widgetPlot->SetCurvePen(curveId, QPen(Qt::NoPen)); // QwtSymbol needs to passed as a real pointer from MITK v2013.09.0 on // (QwtPlotCurve deletes it on destruction and assignment). QwtSymbol* dataSymbol = new QwtSymbol(QwtSymbol::Diamond, sampleColor, sampleColor, QSize(8, 8)); m_Controls.widgetPlot->SetCurveSymbol(curveId, dataSymbol); // Again, there is no way to set a curve's legend attributes via QmitkPlotWidget so this // gets unnecessarily complicated. QwtPlotCurve* measurementCurve = dynamic_cast<QwtPlotCurve*>(m_Controls.widgetPlot-> GetPlot()->itemList(QwtPlotItem::Rtti_PlotCurve).back()); measurementCurve->setLegendAttribute(QwtPlotCurve::LegendShowSymbol); measurementCurve->setLegendIconSize(QSize(8, 8)); } //draw model curve auto signalCurve = mitk::ModelFitPlotData::GetInterpolatedSignalPlot(curveCollection); if (signalCurve) { std::string name = mitk::MODEL_FIT_PLOT_SIGNAL_NAME() + posString; QPen pen; pen.setColor(signalColor); pen.setWidth(2); unsigned int curveId = m_Controls.widgetPlot->InsertCurve(name.c_str()); m_Controls.widgetPlot->SetCurveData(curveId, signalCurve->GetValues()); m_Controls.widgetPlot->SetCurvePen(curveId, pen); // Manually set the legend attribute to use the symbol as the legend icon and alter its // size. Otherwise it would revert to default which is drawing a square which is the color // of the curve's pen, so in this case none which defaults to black. // Unfortunately, QmitkPlotWidget offers no way to set the legend attribute and icon size so // this looks a bit hacky. QwtPlotCurve* fitCurve = dynamic_cast<QwtPlotCurve*>(m_Controls.widgetPlot->GetPlot()-> itemList(QwtPlotItem::Rtti_PlotCurve).back()); fitCurve->setLegendAttribute(QwtPlotCurve::LegendShowLine); } } void ModelFitInspectorView::RenderPlot() { m_Controls.widgetPlot->Clear(); std::string xAxis = DEFAULT_X_AXIS; std::string yAxis = "Intensity"; std::string plotTitle = "Raw data plot: no data"; if (m_currentSelectedNode.IsNotNull()) { plotTitle = "Raw data plot: " + m_currentSelectedNode->GetName(); } if (m_currentFit.IsNotNull()) { plotTitle = m_currentFit->modelName.c_str(); xAxis = m_currentFit->xAxisName; if (!m_currentFit->xAxisUnit.empty()) { xAxis += " [" + m_currentFit->xAxisUnit + "]"; } yAxis = m_currentFit->yAxisName; if (!m_currentFit->yAxisUnit.empty()) { yAxis += " [" + m_currentFit->yAxisUnit + "]"; } } m_Controls.widgetPlot->SetAxisTitle(QwtPlot::xBottom, xAxis.c_str()); m_Controls.widgetPlot->SetAxisTitle(QwtPlot::yLeft, yAxis.c_str()); m_Controls.widgetPlot->SetPlotTitle(plotTitle.c_str()); // Draw static curves unsigned int colorIndex = 0; for (mitk::PlotDataCurveCollection::const_iterator pos = m_PlotCurves.staticPlots->begin(); pos != m_PlotCurves.staticPlots->end(); ++pos) { QColor dataColor; unsigned int curveId = m_Controls.widgetPlot->InsertCurve(pos->first.c_str()); m_Controls.widgetPlot->SetCurveData(curveId, pos->second->GetValues()); if (pos->first == "ROI") { dataColor = QColor(0, 190, 0); QPen pen; pen.setColor(dataColor); pen.setStyle(Qt::SolidLine); m_Controls.widgetPlot->SetCurvePen(curveId, pen); } else { //Use HSV schema of QColor to calculate a different color depending on the //number of already existing curves. dataColor.setHsv((++colorIndex * 85) % 360, 255, 150); m_Controls.widgetPlot->SetCurvePen(curveId, QPen(Qt::NoPen)); } // QwtSymbol needs to passed as a real pointer from MITK v2013.09.0 on // (QwtPlotCurve deletes it on destruction and assignment). QwtSymbol* dataSymbol = new QwtSymbol(QwtSymbol::Triangle, dataColor, dataColor, QSize(8, 8)); m_Controls.widgetPlot->SetCurveSymbol(curveId, dataSymbol); // Again, there is no way to set a curve's legend attributes via QmitkPlotWidget so this // gets unnecessarily complicated. QwtPlotCurve* measurementCurve = dynamic_cast<QwtPlotCurve*>(m_Controls.widgetPlot-> GetPlot()->itemList(QwtPlotItem::Rtti_PlotCurve).back()); measurementCurve->setLegendAttribute(QwtPlotCurve::LegendShowSymbol); measurementCurve->setLegendIconSize(QSize(8, 8)); } // Draw positional curves for (const auto& posIter : this->m_PlotCurves.positionalPlots) { QColor dataColor; dataColor.setHsv((++colorIndex * 85) % 360, 255, 150); this->RenderPlotCurve(posIter.second.second, dataColor, dataColor, " @ "+mitk::ModelFitPlotData::GetPositionalCollectionName(posIter)); } // Draw current pos curve this->RenderPlotCurve(m_PlotCurves.currentPositionPlots, QColor(Qt::red), QColor(Qt::black), ""); QwtLegend* legend = new QwtLegend(); legend->setFrameShape(QFrame::Box); legend->setFrameShadow(QFrame::Sunken); legend->setLineWidth(1); m_Controls.widgetPlot->SetLegend(legend, QwtPlot::BottomLegend); m_Controls.widgetPlot->Replot(); } void ModelFitInspectorView::EnsureBookmarkPointSet() { if (m_PositionBookmarks.IsExpired() || m_PositionBookmarksNode.IsExpired()) { const char* nodeName = "org.mitk.gui.qt.fit.inspector.positions"; mitk::DataNode::Pointer node = this->GetDataStorage()->GetNamedNode(nodeName); if (!node) { node = mitk::DataNode::New(); node->SetName(nodeName); node->SetBoolProperty("helper object", true); this->GetDataStorage()->Add(node); } m_PositionBookmarksNode = node; mitk::PointSet::Pointer pointSet = dynamic_cast<mitk::PointSet*>(node->GetData()); if (pointSet.IsNull()) { pointSet = mitk::PointSet::New(); node->SetData(pointSet); } m_PositionBookmarks = pointSet; } } diff --git a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.h b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.h index 8be8155ee7..baad94dd8c 100644 --- a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.h +++ b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/ModelFitInspectorView.h @@ -1,205 +1,205 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ModelFitInspectorView_h #define ModelFitInspectorView_h // Blueberry //#include <berryISelectionListener.h> #include <berryIPartListener.h> // mitk #include <QmitkAbstractView.h> #include <mitkIRenderWindowPartListener.h> #include "QmitkSliceNavigationListener.h" #include "mitkModelFitStaticParameterMap.h" #include "mitkModelParameterizerBase.h" #include "mitkModelFitInfo.h" #include "mitkIModelFitProvider.h" #include "mitkModelFitPlotDataHelper.h" #include "QmitkSelectionServiceConnector.h" #include "QmitkFitParameterModel.h" // Qt #include "ui_ModelFitInspectorViewControls.h" /** * @brief View class defining the UI part of the ModelFitInspector plug-in. */ class ModelFitInspectorView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { // 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: ModelFitInspectorView(); - ~ModelFitInspectorView(); + ~ModelFitInspectorView() override; static const std::string VIEW_ID; protected slots: void OnSliceChanged(); /** * @brief Triggered when the selection of the "Modelfit" combo box changes. * Sets the selected fit as the current one. * @param index The index (in the combo box) of the selected item. */ void OnFitSelectionChanged(int index); void OnInputChanged(const QList<mitk::DataNode::Pointer>& nodes); void OnPositionBookmarksChanged(); /** Triggered when the selection of "fixed" y axis scaling changes*/ void OnScaleFixedYChecked(bool checked); void OnScaleToDataYClicked(); void OnFixedScalingYChanged(double value); /** Triggered when the selection of "fixed" x axis scaling changes*/ void OnScaleFixedXChecked(bool checked); void OnScaleToDataXClicked(); void OnFixedScalingXChanged(double value); void OnFullPlotClicked(bool checked); protected: - virtual void CreateQtPartControl(QWidget* parent) override; + void CreateQtPartControl(QWidget* parent) override; - virtual void SetFocus() override; + void SetFocus() override; - virtual void NodeRemoved(const mitk::DataNode* node) override; + void NodeRemoved(const mitk::DataNode* node) override; /** Helper that actualizes the fit selection widget and returns the index of the currently selected * fit.*/ int ActualizeFitSelectionWidget(); - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; /** * @brief Calculates the curve data using the current fit's model and parameterizer. * @param position Indicating the point in the input image for which the model curve should be calculated. * @return A vector of points for the curve data. */ QmitkPlotWidget::XYDataVector CalcCurveFromModel(const mitk::Point3D& position); /** * @brief Calculates the curve data using the current fit's function string. * @param timeGrid The time grid containing the (interpolated) x values for the curve data. * @return A vector of points for the curve data. */ QmitkPlotWidget::XYDataVector CalcCurveFromFunction(const mitk::Point3D& position, const mitk::ModelBase::TimeGridType& timeGrid); /** * @brief Returns the parent node of the given node if it exists. * @param node The node whose parent node should be returned. * @return The parent node of the given node or NULL if it doesn't exist. */ mitk::DataNode::ConstPointer GetParentNode(mitk::DataNode::ConstPointer node); /** Sets m_currentSelectedPosition to the current selection and validates if this position is valid * for the input image of the currently selected fit. If it is valid, m_validSelectedPosition is set to true. * If the fit, his input image or geometry is not specified, it will also handled as invalid.*/ void ValidateAndSetCurrentPosition(); /** Returns the current input image. If a current fit is set it will be its input image. * Otherwise it will be the image stored in the currently selected node. If the node is not set, contains no image * or the image is not 4D, NULL will be returned.*/ mitk::Image::Pointer GetCurrentInputImage() const; /** Returns the variable/time grid of the GetCurrentInputImage(). If a model fit is selected its provider will be used to get the correct grid, otherwise just a simple time grid will be extracted.*/ const mitk::ModelBase::TimeGridType GetCurrentTimeGrid() const; Ui::ModelFitInspectorViewControls m_Controls; mitk::IRenderWindowPart* m_renderWindowPart; /** @brief Is a visualization currently running? */ bool m_internalUpdateFlag; /** @brief List of modelfits currently in the data manager */ typedef std::map<const mitk::modelFit::ModelFitInfo::UIDType, mitk::modelFit::ModelFitInfo::ConstPointer> ModelFitInfoListType; ModelFitInfoListType m_modelfitList; /** @brief The currently selected modelfit */ mitk::modelFit::ModelFitInfo::ConstPointer m_currentFit; /** @brief Pointer to the instance of the model parameterizer for the current fit */ mitk::ModelParameterizerBase::Pointer m_currentModelParameterizer; mitk::IModelFitProvider* m_currentModelProviderService; /** @brief currently valid selected position in the inspector*/ mitk::Point3D m_currentSelectedPosition; /** @brief indicates if the currently selected position is valid for the currently selected fit. * This it is within the input image */ bool m_validSelectedPosition; /** @brief currently selected time step of the selected node for the visualization logic*/ unsigned int m_currentSelectedTimeStep; /** @brief currently selected node for the visualization logic*/ mitk::DataNode::ConstPointer m_currentSelectedNode; mitk::WeakPointer<mitk::DataNode> m_PositionBookmarksNode; mitk::WeakPointer<mitk::PointSet> m_PositionBookmarks; /** @brief Number of interpolation steps between two x values */ static const unsigned int INTERPOLATION_STEPS; /*************************************/ /* Members for visualizing the model */ itk::TimeStamp m_selectedNodeTime; itk::TimeStamp m_currentFitTime; itk::TimeStamp m_currentPositionTime; itk::TimeStamp m_lastRefreshTime; mitk::ModelFitPlotData m_PlotCurves; std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector; QmitkFitParameterModel* m_FitParameterModel; QmitkSliceNavigationListener m_SliceChangeListener; /** Check and updates the plot data if needed. * @return indicates if something was refreshed (true)*/ bool RefreshPlotData(); void RenderPlot(); void RenderPlotCurve(const mitk::PlotDataCurveCollection* curveCollection, const QColor& sampleColor, const QColor& signalColor, const std::string& posString); void RenderFitInfo(); void EnsureBookmarkPointSet(); static mitk::PlotDataCurveCollection::Pointer RefreshPlotDataCurveCollection(const mitk::Point3D& position, const mitk::Image* input, const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::ModelBase::TimeGridType& timeGrid, mitk::ModelParameterizerBase* parameterizer); }; #endif // ModelFitInspectorView_h diff --git a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/org_mitk_gui_qt_fit_inspector_Activator.h b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/org_mitk_gui_qt_fit_inspector_Activator.h index ad2d19a956..29164dbb34 100644 --- a/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/org_mitk_gui_qt_fit_inspector_Activator.h +++ b/Plugins/org.mitk.gui.qt.fit.inspector/src/internal/org_mitk_gui_qt_fit_inspector_Activator.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_fit_inspector_Activator_h #define org_mitk_gui_qt_fit_inspector_Activator_h #include <ctkPluginActivator.h> class org_mitk_gui_qt_fit_inspector_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_guit_qt_fit_inspector") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; // org_mitk_modelfit_visualization_Activator #endif // org_mitk_modelfit_visualization_Activator_h diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h index 517618529a..e1ef6ec8fa 100644 --- a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h +++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkGeometryToolsView_h #define QmitkGeometryToolsView_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <mitkAffineBaseDataInteractor3D.h> #include "ui_QmitkGeometryToolsViewControls.h" /** \brief QmitkGeometryToolsView to modify geometry of mitkBaseData via interaction. \warning This is an experimental view to play with the geometry of all mitkBaseDatas. The current implementation allows to translate, rotate and scale objects with the keyboard. \warning Scaling is not supported for images, yet. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkGeometryToolsView : public QmitkAbstractView { // 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; public slots: protected slots: /** * @brief Add/remove the affine interactor. */ void AddInteractor(); void RemoveInteractor(); /** * @brief Slots to adapt the step size for interaction. */ void OnRotationSpinBoxChanged(double step); void OnScaleSpinBoxChanged(double factor); void OnTranslationSpinBoxChanged(double step); /** * @brief OnUsageInfoBoxChanged show help. * @param flag yes/no. */ void OnUsageInfoBoxChanged(bool flag); /** * @brief OnCustomPointRadioButtonToggled hide/show custom anchor point * */ void OnCustomPointRadioButtonToggled(bool status); /** * @brief OnAnchorPointChanged sets the anchor point for rotation or translation. */ void OnAnchorPointChanged(double); /** * @brief OnOriginPointRadioButton sets the anchor point to the origin of the * mitk::DataNode mitk::BaseGeometry. */ void OnOriginPointRadioButton(bool); /** * @brief OnCenterPointRadioButton sets the anchor point to the center of the * mitk::DataNode mitk::BaseGeometry. */ void OnCenterPointRadioButton(bool); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /// \brief called by QmitkAbstractView when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer>& nodes ) override; Ui::QmitkGeometryToolsViewControls m_Controls; }; #endif // QmitkGeometryToolsView_h diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h index 28271da295..f17462c71e 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h +++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h @@ -1,142 +1,142 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkIGTTrackingDataEvaluationView_h #define QmitkIGTTrackingDataEvaluationView_h #include <berryISelectionListener.h> #include <QmitkFunctionality.h> #include "ui_QmitkIGTTrackingDataEvaluationViewControls.h" #include "mitkHummelProtocolEvaluation.h" #include <mitkNavigationDataEvaluationFilter.h> #include "mitkNavigationDataCSVSequentialPlayer.h" /*! \brief QmitkIGTTrackingDataEvaluationView \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 QmitkIGTTrackingDataEvaluationView : 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; QmitkIGTTrackingDataEvaluationView(); - virtual ~QmitkIGTTrackingDataEvaluationView(); + ~QmitkIGTTrackingDataEvaluationView() override; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; - virtual void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget); - virtual void StdMultiWidgetNotAvailable(); + void StdMultiWidgetAvailable (QmitkStdMultiWidget &stdMultiWidget) override; + void StdMultiWidgetNotAvailable() override; protected slots: void OnLoadFileList(); void OnAddToCurrentList(); void OnEvaluateData(); void OnEvaluateDataAll(); void OnGeneratePointSet(); void OnGeneratePointSetsOfSinglePositions(); void OnGenerateRotationLines(); void OnGenerateGroundTruthPointSet(); void OnConvertCSVtoXMLFile(); void OnCSVtoXMLLoadInputList(); void OnCSVtoXMLLoadOutputList(); void OnPerfomGridMatching(); void OnComputeRotation(); /** Reads in exactly three position files als reference. */ void OnOrientationCalculation_CalcRef(); /** Uses always three positions (1,2,3: first orientation; 4,5,6: second orientation; and so on) in every file to calcualte a orientation. */ void OnOrientationCalculation_CalcOrientandWriteToFile(); protected: Ui::QmitkIGTTrackingDataEvaluationViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; std::vector<std::string> m_FilenameVector; void MessageBox(std::string s); std::fstream m_CurrentWriteFile; void WriteHeader(); void WriteDataSet(mitk::NavigationDataEvaluationFilter::Pointer evaluationFilter, std::string dataSetName); //members for orientation calculation mitk::Point3D m_RefPoint1; mitk::Point3D m_RefPoint2; mitk::Point3D m_RefPoint3; double m_scalingfactor; //scaling factor for visualization, 1 by default //angle diffrences: seperated file std::fstream m_CurrentAngleDifferencesWriteFile; void CalculateDifferenceAngles(); void WriteDifferenceAnglesHeader(); void WriteDifferenceAnglesDataSet(std::string pos1, std::string pos2, int idx1, int idx2, double angle); void writeToFile(std::string filename, std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> values); //different help methods to read a csv logging file std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename); std::vector<std::string> GetFileContentLineByLine(std::string filename); mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line); //help method to sonstruct the NavigationDataCSVSequentialPlayer filled with all the options from the UI mitk::NavigationDataCSVSequentialPlayer::Pointer ConstructNewNavigationDataPlayer(); //CSV to XML members std::vector<std::string> m_CSVtoXMLInputFilenameVector; std::vector<std::string> m_CSVtoXMLOutputFilenameVector; //returns the number of converted lines int ConvertOneFile(std::string inputFilename, std::string outputFilename); /** @brief calculates the angle in the plane perpendicular to the rotation axis of the two quaterions. */ double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b); /** @brief calculates the slerp average of a set of quaternions which is stored in the navigation data evaluation filter */ mitk::Quaternion GetSLERPAverage(mitk::NavigationDataEvaluationFilter::Pointer); /** @brief Stores the mean positions of all evaluated data */ mitk::PointSet::Pointer m_PointSetMeanPositions; /** @return returns the mean orientation of all given data */ std::vector<mitk::Quaternion> GetMeanOrientationsOfAllData(std::vector<mitk::NavigationDataEvaluationFilter::Pointer> allData, bool useSLERP = false); /** @return returns all data read from the data list as NavigationDataEvaluationFilters */ std::vector<mitk::NavigationDataEvaluationFilter::Pointer> GetAllDataFromUIList(); }; #endif // _QMITKIGTTRACKINGDATAEVALUATIONVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h index 3ec59713ba..10d51a111a 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h +++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h @@ -1,132 +1,132 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkIGTTrackingSemiAutomaticMeasurementView_h #define QmitkIGTTrackingSemiAutomaticMeasurementView_h #include <berryISelectionListener.h> #include <QmitkFunctionality.h> //QT #include <QTimer> //MITK #include <mitkNavigationToolStorage.h> #include <mitkTrackingDeviceSource.h> #include <mitkNavigationDataObjectVisualizationFilter.h> #include <mitkNavigationDataRecorderDeprecated.h> #include <mitkNavigationDataEvaluationFilter.h> #include "ui_QmitkIGTTrackingSemiAutomaticMeasurementViewControls.h" /*! \brief QmitkIGTTrackingSemiAutomaticMeasurementView \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 QmitkIGTTrackingSemiAutomaticMeasurementView : 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; QmitkIGTTrackingSemiAutomaticMeasurementView(); - virtual ~QmitkIGTTrackingSemiAutomaticMeasurementView(); + ~QmitkIGTTrackingSemiAutomaticMeasurementView() override; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; - virtual void StdMultiWidgetAvailable(QmitkStdMultiWidget &stdMultiWidget); - virtual void StdMultiWidgetNotAvailable(); + void StdMultiWidgetAvailable(QmitkStdMultiWidget &stdMultiWidget) override; + void StdMultiWidgetNotAvailable() override; protected slots: void OnLoadMeasurementStorage(); void OnLoadReferenceStorage(); void OnStartTracking(); void OnStopTracking(); void OnMeasurementLoadFile(); void OnSetReference(); void StartNextMeasurement(); void RepeatLastMeasurement(); void UpdateTimer(); void CreateResults(); void OnUseReferenceToggled(bool state); protected: Ui::QmitkIGTTrackingSemiAutomaticMeasurementViewControls* m_Controls; QmitkStdMultiWidget* m_MultiWidget; //the tool storages mitk::NavigationToolStorage::Pointer m_MeasurementStorage; mitk::NavigationToolStorage::Pointer m_ReferenceStorage; //members for the filter pipeline mitk::TrackingDeviceSource::Pointer m_MeasurementTrackingDeviceSource; mitk::NavigationDataObjectVisualizationFilter::Pointer m_MeasurementToolVisualizationFilter; mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterXML; mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterCSV; mitk::TrackingDeviceSource::Pointer m_ReferenceTrackingDeviceSource; mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterXML; mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterCSV; //members for file name list std::vector<std::string> m_FilenameVector; int m_NextFile; //help methods mitk::NavigationToolStorage::Pointer ReadStorage(std::string file); void MessageBox(std::string s); void DisableAllButtons(); void EnableAllButtons(); void FinishMeasurement(); void StartLoggingAdditionalCSVFile(std::string filePostfix); void LogAdditionalCSVFile(); void StopLoggingAdditionalCSVFile(); //timer QTimer* m_Timer; //memebers for reference checking std::vector<mitk::Point3D> m_ReferenceStartPositions; bool m_referenceValid; //logging members int m_loggedFrames; bool m_logging; std::fstream m_logFileCSV; //event filter for key presses - bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(QObject *obj, QEvent *ev) override; //results members mitk::PointSet::Pointer m_MeanPoints; std::vector<double> m_RMSValues; mitk::NavigationDataEvaluationFilter::Pointer m_EvaluationFilter; bool m_tracking; }; #endif // _QMITKIGTTRACKINGSEMIAUTOMATICMEASUREMENTVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h index 6976f05997..e41e125915 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h +++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h @@ -1,154 +1,154 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_ #define MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_ #include <mitkNavigationDataPlayerBase.h> #include "tinyxml.h" namespace mitk { /**Documentation * \brief This class is a NavigationDataPlayer which can play CSV formatted * files in sequential order, which means it doesn't care about timestamps and just * outputs the navigationdatas in their sequential order. * * It is thought to interpret custom csv files. To do so please adapt the column * numbers of position and orientation in the internal method GetNavigationDataOutOfOneLine(). * * So far only one (the first) tool is read in as required for the hummel protocol measurements. * * This class can also interpret MITK style csv files (set filetype to NavigationDataCSV), but * you can also use the MITK navigation data player class inside the MITK-IGT module which * is newer and better maintained. * * \ingroup IGT */ class NavigationDataCSVSequentialPlayer : public NavigationDataPlayerBase { public: mitkClassMacro(NavigationDataCSVSequentialPlayer, NavigationDataPlayerBase); itkNewMacro(Self); /** * \brief sets the file name and path (if XMLString is set, this is neglected) */ void SetFileName(const std::string& _FileName); /** * @brief SetOptions sets the options for reading out the data out of the correct postions of the file. They need to be set before using the player * @param rightHanded true if the used coordinate System is right handed, false if it is left handed * @param seperatorSign symbol that is used to separate the values in the .csv file * @param sampleCount every n-th sample in the file that should be used * @param headerRow true if the .csv file has a header row otherwise false * @param xPos number of the colum in the .csv file for the x-coordinates of the position * @param yPos number of the colum in the .csv file for the y-coordinates of the position * @param zPos number of the colum in the .csv file for the z-coordinates of the position * @param useQuats true if Quaternions are used to construct the orientation, false if Euler Angles are used * @param qx number of the column in the .csv file for the x component of the quaternion * @param qy number of the column in the .csv file for the y component of the quaternion * @param qz number of the column in the .csv file for the z component of the quaternion * @param qr number of the column in the .csv file for the r component of the quaternion * @param azimuth number of the colum in the .csv file for Azimuth (Euler Angles). Set < 0 if angle is not defined * @param elevatino number of the colum in the .csv file for Elevation (Euler Angles) Set < 0 if angle is not defined * @param roll number of the colum in the .csv file for Roll (Euler Angles) Set < 0 if angle is not defined * @param eulerInRadiants true if the Euler Angles in the .csv file are in radiants, false if they are in degrees * @param minNumberOfColumns */ void SetOptions(bool rightHanded, char seperatorSign, int sampleCount, bool headerRow, int xPos, int yPos, int zPos, bool useQuats, int qx, int qy, int qz, int qr, int azimuth, int elevatino, int roll, bool eulerInRadiants, int minNumberOfColums); /** * \brief returns the file name and path */ itkGetStringMacro(FileName); enum Filetype { NavigationDataCSV, //for csv files from the MITK navigation data player ManualLoggingCSV //for custum csv files }; /** * \brief Sets the file type. ManualLoggingCSV is default and is thought for your * custom csv files. You can also set it to NavigationDataCSV, then this * player interprets MITK style csv files. */ itkSetMacro(Filetype, Filetype); /** * \return Returns true if the player reached the end of the file. */ bool IsAtEnd(); /** * \brief Used for pipeline update just to tell the pipeline * that we always have to update */ - virtual void UpdateOutputInformation(); + void UpdateOutputInformation() override; int GetNumberOfSnapshots(); protected: NavigationDataCSVSequentialPlayer(); - virtual ~NavigationDataCSVSequentialPlayer(); + ~NavigationDataCSVSequentialPlayer() override; /// /// do the work here /// - virtual void GenerateData(); + void GenerateData() override; std::string m_FileName; int m_CurrentPos; Filetype m_Filetype; //member for the navigation datas which were read (only one output is supported at the moment) std::vector<mitk::NavigationData::Pointer> m_NavigationDatas; std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename); std::vector<std::string> GetFileContentLineByLine(std::string filename); mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line); void FillOutputEmpty(int number); mitk::NavigationData::Pointer GetEmptyNavigationData(); bool m_RightHanded; //true if the used coordinate System is right handed, false if it is left handed char m_SeparatorSign; //symbol that is used to separate the values in the .csv file int m_SampleCount; //every n-th sample in the file that should be used bool m_HeaderRow; //true if the .csv file has a header row otherwise false int m_XPos; //number of the colum in the .csv file for the x-coordinates of the position int m_YPos; //number of the colum in the .csv file for the y-coordinates of the position int m_ZPos; //number of the colum in the .csv file for the z-coordinates of the position bool m_UseQuats; //true if Quaternions are used to construct the orientation, false if Euler Angles are used int m_Qx; //number of the column in the .csv file for the x component of the quaternion int m_Qy; //number of the column in the .csv file for the y component of the quaternion int m_Qz; //number of the column in the .csv file for the z component of the quaternion int m_Qr; //number of the column in the .csv file for the r component of the quaternion int m_Azimuth; //number of the colum in the .csv file for Azimuth (Euler Angles) int m_Elevation; //number of the colum in the .csv file for Elevation (Euler Angles) int m_Roll; //number of the colum in the .csv file for Roll (Euler Angles) bool m_EulersInRadiants; // true if the Euler Angles in the .csv file are in radiants, false if they are in degrees int m_MinNumberOfColumns; //minimal number of columns the file has to have (e.g. if you read data from column 8 the file has to have at least 8 columns) }; } // namespace mitk #endif /* MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_ */ diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h index 6c09619a44..40d97dfdd1 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h +++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_igtapphummelprotocolmeasurements_Activator_h #define org_mitk_gui_qt_igtapphummelprotocolmeasurements_Activator_h #include <ctkPluginActivator.h> namespace mitk { class PluginActivator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_igtapphummelprotocolmeasurements") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h index 84ba1c5763..98fd8f30de 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h @@ -1,94 +1,94 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H #define MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H #include "mitkCommon.h" #include "mitkNumericTypes.h" #include "itkObjectFactory.h" #include "vtkSmartPointer.h" #include "vtkPolyData.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { class Surface; class PointSet; /** * \brief Calculates the intersection between a mitk::Surface and a line. * Surface and line have to be set by SetTargetSurface() and SetLine. * CalculateIntersection() can be called then to calculate the intersection. * The results can be got afterwards by GetIsIntersecting(), * GetIntersectionPoint(), GetIntersectionNearestSurfacePointId() and * GetDistanceToIntersection(). */ class USNavigationTargetIntersectionFilter : public itk::Object { public: mitkClassMacroItkParent(USNavigationTargetIntersectionFilter, itk::Object) itkNewMacro(Self) itkSetMacro(TargetSurface, itk::SmartPointer<mitk::Surface>) void SetLine(itk::SmartPointer<mitk::PointSet> line); /** * \return if line and surface are intersecting */ itkGetMacro(IsIntersecting, bool) /** * \return the position where the intersection occured, the result is not defined if no intersection occured */ mitk::Point3D GetIntersectionPoint(); /** * \return id of the nearest vertex of the target to the interseciont, the result is not defined if no intersection occured */ int GetIntersectionNearestSurfacePointId(); /** * \return distance between the first line point and the intersection point */ double GetDistanceToIntersection(); /** * \brief Does the intersection calculation. * SetTargetSurface() and SetLine() have to be called before. */ void CalculateIntersection(); protected: USNavigationTargetIntersectionFilter(); - virtual ~USNavigationTargetIntersectionFilter(); + ~USNavigationTargetIntersectionFilter() override override; itk::SmartPointer<mitk::Surface> m_TargetSurface; vtkSmartPointer<vtkPolyData> m_TargetSurfaceVtk; double m_LinePoint1[3]; double m_LinePoint2[3]; bool m_IsIntersecting; double m_IntersectionPoint[3]; int m_IntersectionCellId; double m_Distance; }; } #endif // MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h index cf295c1c78..fd2d51378d 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef USNAVIGATIONTARGETOCCLUSIONFILTER_H #define USNAVIGATIONTARGETOCCLUSIONFILTER_H #include "mitkNavigationDataPassThroughFilter.h" #include "mitkDataStorage.h" namespace itk { template<class T> class SmartPointer; } class vtkPolyData; template<class T> class vtkSmartPointer; namespace mitk { class DataNode; /** * \brief NavigationData filter calcuting occluded positions on a target surface. * The occlusion caused by obstacle structures is calculated between the current * NavigationData position and a given target surface. */ class USNavigationTargetOcclusionFilter : public NavigationDataPassThroughFilter { public: mitkClassMacro(USNavigationTargetOcclusionFilter, NavigationDataPassThroughFilter) itkNewMacro(Self) /** * \brief Sets the target structure for which the occluded positions should be calculated. * \param targetStructure DataNode conatining a mitk::Surface */ void SetTargetStructure(itk::SmartPointer<DataNode> targetStructure); /** * \brief Sets the obstacle structures which can occlude the target structure. * \param obstacleStructures Set of DataNodes containing a mitk::Surface each */ void SetObstacleStructures(DataStorage::SetOfObjects::ConstPointer obstacleStructures); /** * \brief Sets the index of the input which is used for occlusion calculation. * The occlusion will be calculated between the NavigationData position of * this input and the target structure. */ void SelectStartPositionInput(unsigned int n); protected: USNavigationTargetOcclusionFilter(); - virtual ~USNavigationTargetOcclusionFilter(); + ~USNavigationTargetOcclusionFilter() override override; - virtual void GenerateData(); + void GenerateData() override override; /** * \brief Returns the vtk poly data of the target structure. * \return vtkPolyData if the target structure data node contains one, returns null otherwise */ vtkSmartPointer<vtkPolyData> GetVtkPolyDataOfTarget(); DataStorage::SetOfObjects::ConstPointer m_ObstacleStructures; itk::SmartPointer<DataNode> m_TargetStructure; unsigned int m_StartPositionInput; std::vector<bool> m_OccludedPositions; }; } // namespace mitk #endif // USNAVIGATIONTARGETOCCLUSIONFILTER_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h index 5e7ff4caff..332749a845 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h @@ -1,140 +1,140 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef USNAVIGATIONTARGETUPDATEFILTER_H #define USNAVIGATIONTARGETUPDATEFILTER_H #include "itkObjectFactory.h" #include "mitkCommon.h" #include "mitkNumericTypes.h" #include "mitkDataStorage.h" namespace itk { template<class T> class SmartPointer; } class vtkPolyData; template<class T> class vtkSmartPointer; namespace mitk { class DataNode; class LookupTableProperty; class BaseGeometry; /** * \brief Calculates a score for target placement for every vertex of a given surface. * The scores are calculated for placing the targets equally on the surface. It * is assumed that the surface approximates a sphere. For every vertex of the * surface a score between 0 and 1 is calculated. The scores are stored in the * vtkSurface as a vtkFloatArray. The name of this array can be set by calling * SetScalarArrayIdentifier(). * * The target surface and the number of targets (between zero and four) or an * optimal angle between the targets must be set first. The scores are then * updated every time a target node is added by SetControlNode() or removed by * RemovePositionOfTarget(). * */ class USNavigationTargetUpdateFilter : public itk::Object { public: mitkClassMacroItkParent(USNavigationTargetUpdateFilter, itk::Object) itkFactorylessNewMacro(Self) itkCloneMacro(Self) /** * \brief Set the target surface for which the scores should be calculated. * \param targetStructure DataNode containing a mitk::Surface for the target structure */ void SetTargetStructure(itk::SmartPointer<DataNode> targetStructure); /** * \brief Setter for the number of targets to be placed on the target surface. * The optimal angle for placing the targets is calculated based on this number. * * \return false if the number of targets is smaller than one or larger than four */ bool SetNumberOfTargets(unsigned int numberOfTargets); /** * \brief Setter for the optimal angle between to targets on the target surface. * This value overwrites the value calculated by a previous call to * SetNumberOfTargets() and will be overwritten when SetNumberOfTargets() is * called afterwards. */ void SetOptimalAngle(double optimalAngle); /** * \return Angle calculated by SetNumberOfTargets() or explicitly set by SetOptimalAngle() */ double GetOptimalAngle(); /** * \brief Sets the identifier for the vtkFloatArray of scores. * This array is stored as scalars of the vtkPolyData of the target surface. */ void SetScalarArrayIdentifier(std::string scalarArrayIdentifier); /** * \brief Set whether the maximum score or the minimum score between the targets should be used. * Whenever more then one target position is already set, the scores to every * target position are calculated. The resulting score is the the minimum of * this scores (default) or the maximum. * */ void SetUseMaximumScore(bool useMaximumScore); /** * \brief Sets the origin of the given node for the filter. * This origin is the position of an already placed target and is used to * calculate the scores for the surface vertices. * * \param id number of the node which position should be set or updated * \param controlNode DataNode which origin should be set into the filter */ void SetControlNode(unsigned int id, itk::SmartPointer<DataNode> controlNode); /** * \brief Removes the position of the target with the current id from the filter. */ void RemovePositionOfTarget(unsigned int id); /** * \brief Removes all target positions from the filter and resets the scores. */ void Reset(); protected: USNavigationTargetUpdateFilter(); - virtual ~USNavigationTargetUpdateFilter(); + ~USNavigationTargetUpdateFilter() override override; void UpdateTargetScores(); vtkSmartPointer<vtkPolyData> GetVtkPolyDataOfTarget(); itk::SmartPointer<mitk::BaseGeometry> GetGeometryOfTarget(); itk::SmartPointer<DataNode> m_TargetStructure; unsigned int m_NumberOfTargets; double m_OptimalAngle; std::string m_ScalarArrayIdentifier; bool m_UseMaximumScore; std::vector<itk::SmartPointer<DataNode> > m_ControlNodesVector; }; } // namespace mitk #endif // USNAVIGATIONTARGETUPDATEFILTER_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h index 1d5a032f6a..0fdec9ba10 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h @@ -1,89 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef USCOMBINEDMODALITYPERSISTENCE_H #define USCOMBINEDMODALITYPERSISTENCE_H #include <itkObjectFactory.h> #include "mitkCommon.h" #include "mitkUSCombinedModality.h" #include "mitkNavigationDataSource.h" // Microservices #include <usModuleContext.h> namespace mitk { /** * \brief Persistence for the mitk::CombinedModality micro services. * The micro services are saved into QSettings on destruction of this objects * and they are loaded again when their NavigationDataSource and USDevice will * become registered as a micro service. * * The NavigationDataSources are identified by their name and the USDevices are * identified by their manufacturer, model and comment. * * For using this persistence class for combined modalites an object of this * class has to be created an held as long as newly created combined modalities * should be made persistent. */ class USNavigationCombinedModalityPersistence : public itk::Object { public: mitkClassMacroItkParent(USNavigationCombinedModalityPersistence, itk::Object) itkNewMacro(Self) protected: /** * \brief Restores combined modality from QSettings and registers on service events. * Combined modalities are registered as a micro service as soon as their * NavigationDataSource and USDevice are available. The constructor adds * mitk::USNavigationCombinedModalityPersistence::OnServiceEvent() as a * listener to the module context to be notified when micro services become * available. */ USNavigationCombinedModalityPersistence(); /** * \brief The destructor stores combined modalities by calling mitk::USNavigationCombinedModalityPersistence::StoreCurrentDevices(). */ - ~USNavigationCombinedModalityPersistence(); + ~USNavigationCombinedModalityPersistence() override; private: void OnServiceEvent(const us::ServiceEvent event); void StoreCurrentDevices(); void LoadStoredDevices(); /** * \brief Try to get combined modality with given properties from the service registry. * \return the combined modality if it was found, null otherwise */ mitk::USCombinedModality::Pointer GetCombinedModality(std::string manufacturer, std::string model); /** * \brief Try to get ultrasound device with given properties from the service registry. * \return the ultrasound device if it was found, null otherwise */ mitk::USDevice::Pointer GetUSDevice(std::string manufacturer, std::string model, std::string comment); /** * \brief Try to get navigation data source with given properties from the service registry. * \return the navigation data source if it was found, null otherwise */ mitk::NavigationDataSource::Pointer GetNavigationDataSource(std::string name); }; } // namespace mitk #endif // USCOMBINEDMODALITYPERSISTENCE_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h index cae872b4a5..90ce8d9e5e 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h @@ -1,112 +1,112 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSNAVIGATIONEXPERIMENTLOGGING_H #define MITKUSNAVIGATIONEXPERIMENTLOGGING_H #include <mitkCommon.h> #include <itkObjectFactory.h> #include <Poco/DOM/AutoPtr.h> #include <ostream> namespace itk { template<class T> class SmartPointer; class RealTimeClock; } namespace mitk { class DataNode; } namespace Poco { namespace XML { class Document; class Element; } } namespace mitk { /** * \brief Logs data node properties to an XML file. */ class USNavigationExperimentLogging : public itk::Object { public: mitkClassMacroItkParent(USNavigationExperimentLogging, itk::Object) itkNewMacro(USNavigationExperimentLogging) /** * \brief Clears the XML tree. * Can be used to start logging a new experiment. Make sure that the output * file name was changed by calling SetFileName() before setting a new result * by calling SetResult() if you do not want your previous results to be * overwritten. * * The real time clock is restarted, too. */ void Reset(); /** * \brief Setter for the file path and name of the XML file. */ void SetFileName(const std::string& fileName); /** * \brief The properties of the given node are appended to the XML tree. * The data node gets its own XML node under the root of the XML tree and the * XML node will get the name of the data node as its name. The properties of * the data node are stored as nodes under this XML node. The current tree is * written to the output file on every call of this method. * * If a key prefix is set by SetKeyPrefix, only properties which keys that are * starting with this prefix are stored in the XML tree. The prefix is cut from * the resulting key for the XML tree. */ void SetResult(const itk::SmartPointer<mitk::DataNode> resultNode); /** * \brief Only properties with this prefix are written into the output file. */ itkSetMacro(KeyPrefix, std::string) itkGetMacro(KeyPrefix, std::string) protected: /** * \brief Constructs an empty XML tree and starts the real time clock. */ USNavigationExperimentLogging(); - virtual ~USNavigationExperimentLogging(); + ~USNavigationExperimentLogging() override; void AddCurrentTimeAttributes(Poco::AutoPtr<Poco::XML::Element>); /** * \brief Does the actual writing of the complete XML tree to the file system. */ void WriteXmlToFile(); std::string m_KeyPrefix; std::string m_FileName; unsigned int m_CurrentResultNumber; itk::SmartPointer<itk::RealTimeClock> m_RealTimeClock; double m_StartTime; Poco::AutoPtr<Poco::XML::Document> m_OutputXML; Poco::AutoPtr<Poco::XML::Element> m_OutputXMLRoot; }; } // namespace mitk #endif // MITKUSNAVIGATIONEXPERIMENTLOGGING_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h index da978a0fc1..4c2d313b21 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h @@ -1,74 +1,74 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSNAVIGATIONLOGGINGBACKEND_H #define MITKUSNAVIGATIONLOGGINGBACKEND_H #include <fstream> #include <vector> #include "mbilogExports.h" #include "mbilogTextBackendBase.h" #include "mbilogLogMessage.h" #include "mbilogLoggingTypes.h" namespace mitk { /** * \brief Backend for the mbi logging mechanism. This backend writes all messages to the given file. */ class USNavigationLoggingBackend : public mbilog::TextBackendBase { public: USNavigationLoggingBackend(); - virtual ~USNavigationLoggingBackend(); + ~USNavigationLoggingBackend() override override; /** \brief Set file path und name for the output file. * The file will be opened and all log messages will be directed there from then on. * * \throws mitk::Exception if the file cannot be opened */ void SetOutputFileName(std::string filename); /** \brief This method is called by the mbi logging mechanism if the object is registered in * the mbi logging mechanism and a logging message is emitted. The method formats the * logging messages to a normal string (depending on formatting mode) and writes it to std::cout. * * \param logMessage Logging message. */ - virtual void ProcessMessage(const mbilog::LogMessage &logMessage ); + void ProcessMessage(const mbilog::LogMessage &logMessage ) override override; /** @return Returns all messages of the category "USNavigationLogging" since the last call of ClearNavigationMessages(). */ std::vector<std::string> GetNavigationMessages(); /** Writes a CSV file containing all stored navigation messages to the given output filename. */ void WriteCSVFileWithNavigationMessages(std::string filename); /** Clears the internally stored navigation messages of the category "USNavigationLogging". */ void ClearNavigationMessages(); - mbilog::OutputType GetOutputType(void) const; + mbilog::OutputType GetOutputType(void) const override override; private: std::ofstream m_OutputStream; std::vector<std::string> m_lastNavigationMessages; std::vector<std::string> m_allNavigationMessages; }; } // namespace mitk #endif // MITKUSNAVIGATIONLOGGINGBACKEND_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h index 195de32abf..65e908a892 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h @@ -1,113 +1,113 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSNAVIGATIONSTEPTIMER_H #define MITKUSNAVIGATIONSTEPTIMER_H #include <mitkCommon.h> #include <itkObjectFactory.h> #include <itkTimeProbe.h> namespace mitk { /** * \brief Timer for measureing the durations of navigation steps. * The different steps are identified by indices. To measure the duraion of a * step it can be activated by calling SetActiveIndex(). The duration is * measured until another step is activated by calling SetActiveIndex() with an * other index or Stop() is called. * * If a file name for an output file was set (SetOutputFileName()), the results * are written to this file, every time a new duration was measured. If a file * name is set later on, the results are written to the file at the moment of * setting the file name. */ class USNavigationStepTimer : public itk::Object { public: mitkClassMacroItkParent(USNavigationStepTimer, itk::Object) itkNewMacro(USNavigationStepTimer) /** * \brief Stops the timer for the current index. * The measured time to if written to the output file if a file path was * already set. */ void Stop(); /** * \brief Removes all measured durations. */ void Reset(); /** * \brief Sets the name of the output file. * If there are already measurements of durations, they are written to this * file immediately. */ void SetOutputFileName(std::string filename); /** * \brief Starts measurement for the step with the given index. */ void SetActiveIndex(unsigned int index, std::string description = ""); /** * \brief Returns the sum of all durations. */ double GetTotalDuration(); /** * \brief Returns measured duration for the step with the given index. * All measurements of this index are summed up. */ double GetDurationForIndex(unsigned int index); /** * \brief Read durations from the file of the given file name. * This file must have exactly the same format as it is written by this class. */ void ReadFromFile(std::string filename); protected: USNavigationStepTimer(); - virtual ~USNavigationStepTimer(); + ~USNavigationStepTimer() override; struct DurationForIndex { unsigned int index; double duration; std::string description; DurationForIndex(unsigned int index, double duration) : index(index), duration(duration) {} DurationForIndex(unsigned int index, double duration, std::string description) : index(index), duration(duration), description(description) {} }; void FinishCurrentIndex(); void WriteLineToFile(const DurationForIndex& element); void WriteEverythingToFile(); typedef std::vector<DurationForIndex> DurationsVector; DurationsVector m_Durations; unsigned int m_CurrentIndex; std::string m_CurrentDescription; itk::TimeProbe m_TimeProbe; std::string m_OutputFileName; }; } // namespace mitk #endif // MITKUSNAVIGATIONSTEPTIMER_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h index d877851010..4d34dc7c46 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSPOINTMARKINTERACTOR_H #define MITKUSPOINTMARKINTERACTOR_H #include "mitkDataInteractor.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { /** * \brief Simple interactor for getting just one position on mouse click. */ class USPointMarkInteractor : public DataInteractor { public: mitkClassMacro(USPointMarkInteractor, DataInteractor) itkNewMacro(Self) typedef Message1<DataNode*> PointMarkInteractorEvent; PointMarkInteractorEvent CoordinatesChangedEvent; protected: static void UpdateSurface(itk::SmartPointer<mitk::DataNode>); USPointMarkInteractor(); - virtual ~USPointMarkInteractor(); + ~USPointMarkInteractor() override override; /** * \brief Connects the functions from the state machine to methods of this class. */ - virtual void ConnectActionsAndFunctions() override; + void ConnectActionsAndFunctions() override; /** * \brief Sets empty surface as data for the new data node. * This is necessary as data nodes without data do not work * with data interactors. */ - virtual void DataNodeChanged() override; + void DataNodeChanged() override; /** * \brief Set current position as origin to the data node. */ void AddPoint(StateMachineAction*, InteractionEvent*); }; } // namespace mitk #endif // MITKUSPOINTMARKINTERACTOR_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h index 77d4251f23..dbad33dee1 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h @@ -1,111 +1,111 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSZONESINTERACTOR_H #define MITKUSZONESINTERACTOR_H #include "mitkDataInteractor.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { class Surface; class DataNode; /** * \brief DataInteractor for creating a sphere at a specific coordinate. * The origin is set by mitk::USZonesInteractor::AddCenter() and then the * radius can be updated by mitk::USZonesInteractor::ChangeRadius(). An * updated sphere is rendered every time the radius changes. * * DataNode attributes set by this class: * * zone.size (float) - the radius of the sphere * * zone.created (bool) - determines if the interactor reached its final state * * Two state machines for this interactor are available as resources of the * USNavigation module. * * USZoneInteractions.xml: Create a sphere by clicking left, moving the mouse * and clicking left againg. Aborting is possible by right mouse click. * * USZoneInteractionsHold.xml: Create a sphere by pressing the left mouse button, * moving the mouse while holding it pressed and finally release the button. * Aborting is possible by right mouse click. */ class USZonesInteractor : public DataInteractor { public: static const char* DATANODE_PROPERTY_SIZE; static const char* DATANODE_PROPERTY_CREATED; mitkClassMacro(USZonesInteractor, DataInteractor) itkNewMacro(Self) /** * \brief Creates Vtk Sphere according to current radius. * The radius is gotten from the float property "zone.size" of the * data node. */ static void UpdateSurface(itk::SmartPointer<mitk::DataNode>); protected: USZonesInteractor(); - virtual ~USZonesInteractor(); + ~USZonesInteractor() override override override; /** * \brief Connects the functions from the state machine to methods of this class. */ - virtual void ConnectActionsAndFunctions(); + void ConnectActionsAndFunctions() override override override; /** * \brief Sets empty surface as data for the new data node. * This is necessary as data nodes without data do not work * with data interactors. */ - virtual void DataNodeChanged(); + void DataNodeChanged() override override override; /** * \brief Sets origin of the data node to the coordinates of the position event. * \return false if interaction event isn't a position event, true otherwise */ void AddCenter(StateMachineAction*, InteractionEvent*); /** * \brief Updates radius attribute according to position event. * Calculates distance between the data node origin and the current position * event and updates the data node attribue "zone.size" accordingly. The * mitk::USZonesInteractor::UpdateSurface() function is called then. * * \return false if interaction event isn't a position event, true otherwise */ void ChangeRadius(StateMachineAction*, InteractionEvent*); /** * \brief Sets the property "zone.created" of the data node to true. * \return always true */ void EndCreation(StateMachineAction*, InteractionEvent*); /** * \brief Removes Vtk Sphere from data node. * \return always true */ void AbortCreation(StateMachineAction*, InteractionEvent*); }; } // namespace mitk #endif // MITKUSZONESINTERACTOR_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h index 02d663a7c9..1704cea49d 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h @@ -1,311 +1,311 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSABSTRACTNAVIGATIONSTEP_H #define QMITKUSABSTRACTNAVIGATIONSTEP_H #include <QWidget> #include "mitkDataStorage.h" #include "mitkAbstractUltrasoundTrackerDevice.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { class NavigationDataToNavigationDataFilter; } /** * \brief Abstract base class for navigation step widgets. * * This class defines a life cycle for navigation steps. Steps can be activated * and deactivated. The first time a step is activated, it is started before * the activation. Steps can be stopped, finished and restarted, too. * * On every state change, the corresponding virtual On... method is called * (OnStartStep(), OnActivateStep(), OnFinishStep(), ...). These methods are * to implement by concrete navigation step widgets. While a step is in the * "active" state, its OnUpdate() method is called periodically. */ class QmitkUSAbstractNavigationStep : public QWidget { Q_OBJECT signals: /** * \brief Signals that all necessary actions where done. * The user can proceed with the next stept after this was signaled. */ void SignalReadyForNextStep(); /** * \brief Signals that it is no longer possible to proceed with following steps. * This signal is emmited when the result data of the step was removed or * changed, so that the old results are invalid for following steps. */ void SignalNoLongerReadyForNextStep(); /** * \brief Signals that the combined modality was changed by this step. * This signal is mainly for steps which creates the combined modality. The * new combined modality is given as a parameter. */ void SignalCombinedModalityChanged(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice>); /** * \brief Signals that an intermediate result was produced. * The properties of the given data node must contain the results. This signal * can be used to log the intermediate results of an experiment, for example * by using the mitk::USNavigationExperimentLogging. */ void SignalIntermediateResult(const itk::SmartPointer<mitk::DataNode>); /** * \brief Signals that the settings node was changed. * This signal must not be emited in an OnSettingsChanged() method. */ void SignalSettingsNodeChanged(itk::SmartPointer<mitk::DataNode>); public: typedef std::vector< itk::SmartPointer<mitk::NavigationDataToNavigationDataFilter> > FilterVector; enum NavigationStepState { State_Stopped, State_Started, State_Active }; static const char* DATANAME_SETTINGS; static const char* DATANAME_IMAGESTREAM; static const char* DATANAME_BASENODE; explicit QmitkUSAbstractNavigationStep(QWidget *parent = 0); - ~QmitkUSAbstractNavigationStep(); + ~QmitkUSAbstractNavigationStep() override; /** * \brief Getter for the title of the navigation step. * This title should be human readable and can be used to display the * available steps and the currently active step to the user. * The method has to be implemented by a concrete subclass. */ virtual QString GetTitle() = 0; /** * \brief Indicates if it makes sense to be able to restart the step. * This method must be implemented by concrete subclasses if it should not be * possible to restart them. * * \return true for the default implementation */ virtual bool GetIsRestartable(); /** * \brief Called every time the settings for the navigation process where changed. * This method may be implemented by a concrete subclass. The default * implementation does nothing. */ virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> /*settingsNode*/) { } /** * \brief Getter for navigation data filters of the navigation step. * This method may be implemented by a concrete subclass. The default * implementation returns an empty vector. * * \return all navigation data filters that should be updated during the navigation process */ virtual FilterVector GetFilter(); /** * \brief Sets the data storage for the exchange of results between navigation steps. */ void SetDataStorage(itk::SmartPointer<mitk::DataStorage> dataStorage); /** * \brief Sets the combined modality for the navigation step. * OnSetCombinedModality() is called internal. */ void SetCombinedModality(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> combinedModality); /** * \brief Should be called to start the navigation step. * \return true if the state was 'stopped' before and OnStartStep() returns true */ bool StartStep(); /** * \brief Should be called to stop the navigation step. * \return true if the state was 'started' (or 'active') and OnStopStep() (and OnDeactivateStep()) return true */ bool StopStep(); /** * \brief Should be called to restart the navigation step. * \return true if OnRestartStep() returns true */ bool RestartStep(); /** * \brief Should be called to finish the navigation step. * The state has to be 'active' before and is 'started' afterwards. * * \return true if the state was 'active' and DeactivateStep() and OnFinishStep() return true */ bool FinishStep(); /** * \brief Should be called to activate the navigation step. * The step gets started before if it was stopped. * * \return true if the state wasn't 'activated' and OnActivateStep() returns true */ bool ActivateStep(); /** * \brief Should be called to deactivate the navigation step. * \return true if the state was 'activated' and OnDeactivateStep() returns true */ bool DeactivateStep(); /** * \brief Should be called periodically while the navigation step is active. * Internal, the method OnUpdate() is called. */ void Update(); /** * \brief Get the current state of the navigation step. * \return State_Stopped, State_Started or State_Active */ NavigationStepState GetNavigationStepState(); protected: /** * \brief Called when the navigation step gets started. * This method has to be implemented by a concrete subclass to handle actions * necessary for starting the step (e.g. initializing that has only to be done * once). * * \return if the actions were done successfully */ virtual bool OnStartStep() = 0; /** * \brief Callen when the navigation step gets stopped. * This method may be implemented by a concrete subclass to handle actions * necessary for stopping the step (e.g. cleanup). The default implementation * does nothing. * * \return if the actions were done successfully; true on every call for the default implementation */ virtual bool OnStopStep() { return true; } /** * \brief Called when restarting a navigation step. * This method may be implemented by a concrete subclass to handle actions * necessary for restarting the navigation step. The default implementations * calls OnStopStep() followed by OnStartStep(). * * \return if the actions were done successfully */ virtual bool OnRestartStep(); /** * \brief Called when all necessary actions for the step where done. * This method has to be implemented by a concrete subclass to handle actions * necessary for finishing the navigation step. * * \return if the actions were done successfully */ virtual bool OnFinishStep() = 0; /** * \brief Called when the navigation step gets activated. * This method has to be implemented by a concrete subclass to handle actions * necessary on activating the navigation step. * * \return if the actions were done successfully */ virtual bool OnActivateStep() = 0; /** * \brief Called when the navigation step gets deactivated (-> state started). * This method may be implemented by a concrete subclass to handle actions * necessary on deactivating the navigation step, which means switching to * another step. * * \return if the actions were done successfully; true on every call for the default implementation */ virtual bool OnDeactivateStep() { return true; } /** * \brief Called periodically while a navigation step is active. * This method has to be implemented by a concrete subclass to handle all * periodic actions during the navigation step. */ virtual void OnUpdate() = 0; /** * \brief Called every time SetCombinedModality() was called. * This method may be implemented by a concrete subclass to handle this event. * The default implementation does nothing. */ virtual void OnSetCombinedModality() { } /** * \brief Returns the data storage set for the navigation step. * * \param throwNull if this method should throw an exception when the data storage is null (default: true) * \return the data storage set by SetDataStorage(); can only be null if the parameter throwNull is set to false * \throws mitk::Exception if the data storage is null and the parameter throwNull is set to true */ itk::SmartPointer<mitk::DataStorage> GetDataStorage(bool throwNull = true); /** * \brief Returns the combined modality set for the navigation step. * * \param throwNull if this method should throw an exception when the combined modality is null (default: true) * \return the combined modality set by SetCombinedModality(); can only be null if the parameter throwNull is set to false * \throws mitk::Exception if the combined modality is null and the parameter throwNull is set to true */ itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> GetCombinedModality(bool throwNull = true); /** * \brief Returns node with the given name and the given source node (parent) from the data storage. * * \param name the name of the node which should be got from the data storage * \param sourceName name of the source node under which the node should be searched * \return node with the given name or null if no node with the given name and source node could be found * \throws mitk::Exception if the data storage (can be set by SetDataStorage()) is null */ itk::SmartPointer<mitk::DataNode> GetNamedDerivedNode(const char* name, const char* sourceName); /** * \brief Returns node with the given name and the given source node (parent) from the data storage. * The node is created if no matching node was found. * * \param name the name of the node which should be got from the data storage * \param sourceName name of the source node under which the node should be searched * \return node with the given name * \throws mitk::Exception if the data storage (can be set by SetDataStorage()) is null */ itk::SmartPointer<mitk::DataNode> GetNamedDerivedNodeAndCreate(const char* name, const char* sourceName); private: itk::SmartPointer<mitk::DataStorage> m_DataStorage; itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality; NavigationStepState m_NavigationStepState; }; #endif // QMITKUSABSTRACTNAVIGATIONSTEP_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h index 2df8b2dd3a..0cf4295dcf 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h @@ -1,122 +1,122 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONSTEPCOMBINEDMODALITY_H #define QMITKUSNAVIGATIONSTEPCOMBINEDMODALITY_H #include "QmitkUSAbstractNavigationStep.h" namespace Ui { class QmitkUSNavigationStepCombinedModality; } /** * \brief Navigation step for creating and selecting a combined modality. * Already created combined modalities can be selected from a service list * widget and calibrations can be loaded for them. New combined modalities can * be created from two service list widgets of NavigationDataSources and * USDevices. */ class QmitkUSNavigationStepCombinedModality : public QmitkUSAbstractNavigationStep { Q_OBJECT protected slots: /** * \brief Triggered, when the selection in the service list widget has changed. */ void OnDeviceSelectionChanged(); /** * \brief Triggered, when the user has clicked "Load Calibration". * Opens a file open dialog and sets the selected calibration for the selected * combined modality. */ void OnLoadCalibration(); /** * \brief Triggered, when the button for creating a new combined modality was clicked. */ void OnCombinedModalityCreateNewButtonClicked(); /** * \brief Triggered, when the dialog for creating a new combined modality was closed. */ void OnCombinedModalityCreationExit(); void OnCombinedModalityEditExit(); /** * \brief Triggered, when the button for deleting a combined modality was clicked. * Unregisters the combined modality from the microservice and removes it. */ void OnDeleteButtonClicked(); void OnCombinedModalityEditButtonClicked(); void OnActivateButtonClicked(); /** * \brief Triggered, when the button for disconnecting a combined modality was clicked. * The state of the combined modality is changed to 'initialized'. */ void OnDisconnectButtonClicked(); public: explicit QmitkUSNavigationStepCombinedModality(QWidget *parent = 0); - ~QmitkUSNavigationStepCombinedModality(); + ~QmitkUSNavigationStepCombinedModality() override; - virtual bool OnStartStep(); - virtual bool OnRestartStep(); - virtual bool OnFinishStep(); + bool OnStartStep() override; + bool OnRestartStep() override; + bool OnFinishStep() override; - virtual bool OnActivateStep(); - virtual void OnUpdate(); + bool OnActivateStep() override; + void OnUpdate() override; - virtual QString GetTitle(); - virtual bool GetIsRestartable(); + QString GetTitle() override; + bool GetIsRestartable() override; mitk::AbstractUltrasoundTrackerDevice::Pointer GetSelectedCombinedModality(); void SetCalibrationLoadedNecessary(bool); void OnDevicePropertyChanged(const std::string&, const std::string&); protected: void SetCombinedModalityCreateWidgetEnabled(bool enabled); void SetCombinedModalityEditWidgetEnabled(bool enabled); void CreateCombinedModalityResultAndSignalIt(); bool UpdateCalibrationState(); void UpdateTrackingToolNames(); /** * \brief The Combined Modality which was selected by the user. */ itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality; std::string m_LoadedCalibration; //<<< Temporary saving point for loaded calibration data. std::string m_LastCalibrationFilename; //<<< saves the filename last loaded calibration bool m_CalibrationLoadedNecessary; private: mitk::MessageDelegate2<QmitkUSNavigationStepCombinedModality, const std::string&, const std::string&> m_ListenerDeviceChanged; Ui::QmitkUSNavigationStepCombinedModality *ui; }; #endif // QMITKUSNAVIGATIONSTEPCOMBINEDMODALITY_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h index aa34b0edd0..f1ce1a52df 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h @@ -1,237 +1,237 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONSTEPCTUSREGISTRATION_H #define QMITKUSNAVIGATIONSTEPCTUSREGISTRATION_H #include "QmitkUSAbstractNavigationStep.h" #include <mitkNodePredicateDataType.h> #include <mitkNodePredicateAnd.h> #include <mitkNodePredicateOr.h> #include <mitkPointSet.h> #include <mitkImage.h> #include <mitkPlaneFit.h> #include <itkImage.h> #include <itkThresholdImageFilter.h> #include <itkBinaryThresholdImageFilter.h> #include <itkGradientMagnitudeImageFilter.h> #include <itkLaplacianRecursiveGaussianImageFilter.h> #include "itkVotingBinaryIterativeHoleFillingImageFilter.h" #include <itkBinaryImageToShapeLabelMapFilter.h> namespace itk { template<class T> class SmartPointer; } namespace mitk { class NodeDisplacementFilter; class NavigationDataSource; class PlaneFit; class FloatingImageToUltrasoundRegistrationFilter; } namespace Ui { class QmitkUSNavigationStepCtUsRegistration; } // Declare typedefs: typedef itk::Image<int, 3> ImageType; typedef itk::ThresholdImageFilter<ImageType> ThresholdImageFilterType; typedef itk::BinaryThresholdImageFilter <ImageType, ImageType> BinaryThresholdImageFilterType; typedef itk::LaplacianRecursiveGaussianImageFilter<ImageType, ImageType> LaplacianRecursiveGaussianImageFilterType; typedef itk::VotingBinaryIterativeHoleFillingImageFilter<ImageType> VotingBinaryIterativeHoleFillingImageFilterType; typedef itk::BinaryImageToShapeLabelMapFilter<ImageType> BinaryImageToShapeLabelMapFilterType; /** * \brief Navigation step for marking risk structures. * The user can add risk structures by interacting with the render windows. The * risk structures are organized in an embedded table view. * * The risk structures are stored under DATANAME_BASENODE -> DATANAME_ZONES. * * This step is ready for the next step directly after activating. All actions * to be done in this step are optional. */ class QmitkUSNavigationStepCtUsRegistration : public QmitkUSAbstractNavigationStep { Q_OBJECT public: explicit QmitkUSNavigationStepCtUsRegistration(QWidget *parent = 0); - ~QmitkUSNavigationStepCtUsRegistration(); + ~QmitkUSNavigationStepCtUsRegistration() override; /** * \brief Initialization of the data storage nodes. * \return always true */ - virtual bool OnStartStep(); + bool OnStartStep() override; /** * \brief Resets widget and filter and removes nodes from the data storage. * \return always true */ - virtual bool OnStopStep(); + bool OnStopStep() override; /** * \brief There is nothing to be done. * \return always true */ - virtual bool OnFinishStep(); + bool OnFinishStep() override; /** * \brief Selects input for the node displacement filter and emits "ReadyForNextStep" signal. * The input selection cannot be done earlier. * \return */ - virtual bool OnActivateStep(); + bool OnActivateStep() override; - virtual bool OnDeactivateStep(); + bool OnDeactivateStep() override; /** * \brief Updates the tracking validity status and the combined modality. */ - virtual void OnUpdate(); + void OnUpdate() override; /** * The property "settings.interaction-concept" is used. */ - virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode); + void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override; - virtual QString GetTitle(); + QString GetTitle() override; /** * @return a node displacement filter for the zone surfaces */ - virtual FilterVector GetFilter(); + FilterVector GetFilter() override; void OnCalculateTRE(mitk::Point3D centroidOfTargetInUSImage); signals: void ActualizeCtToUsRegistrationWidget(); void GetCursorPosition(); protected: - virtual void OnSetCombinedModality(); + void OnSetCombinedModality() override; void UnsetFloatingImageGeometry(); void SetFloatingImageGeometryInformation(mitk::Image* image); double GetVoxelVolume(); double GetFiducialVolume(double radius); bool FilterFloatingImage(); void InitializeImageFilters(); double GetCharacteristicDistanceAWithUpperMargin(); double GetCharacteristicDistanceBWithLowerMargin(); double GetCharacteristicDistanceBWithUpperMargin(); double GetMinimalFiducialConfigurationDistance(); void CreateMarkerModelCoordinateSystemPointSet(); //Methods for Ground-Truth-Fiducial-Localization-Protocol-Evaluation void InitializePointsToTransformForGroundTruthProtocol(); void CreatePointsToTransformForGroundTruthProtocol(); void TransformPointsGroundTruthProtocol(); void AddTransformedPointsToDataStorage(); double CalculateMeanFRE(); double CalculateStandardDeviationOfFRE(double meanFRE); void CalculateGroundTruthProtocolTRE(); // End methods Ground-Truth-Protocol void EliminateTooSmallLabeledObjects( ImageType::Pointer binaryImage); bool EliminateFiducialCandidatesByEuclideanDistances(); void ClassifyFiducialCandidates(); void GetCentroidsOfLabeledObjects(); void NumerateFiducialMarks(); void CalculateDistancesBetweenFiducials(std::vector<std::vector<double>> &distanceVectorsFiducials); bool FindFiducialNo1(std::vector<std::vector<double>> &distanceVectorsFiducials); bool FindFiducialNo2And3(); bool FindFiducialNo4(std::vector<std::vector<double>> &distanceVectorsFiducials); bool FindFiducialNo5(); bool FindFiducialNo6(); bool FindFiducialNo7(); bool FindFiducialNo8(); void DefineDataStorageImageFilter(); void CreateQtPartControl(QWidget *parent); protected slots: void OnFloatingImageComboBoxSelectionChanged(const mitk::DataNode* node); void OnRegisterMarkerToFloatingImageCS(); void OnLocalizeFiducials(); void OnVisualizeCTtoUSregistration(); void OnFreeze(); void OnActualizeSegmentationSurfacePointSetData(); void OnGetCursorPosition(); void OnCalculateCenter(); //Methods for Ground-Truth-Fiducial-Localization-Protocol-Evaluation void OnAddCtImageClicked(); void OnRemoveCtImageClicked(); void OnEvaluateGroundTruthFiducialLocalizationProtocol(); private: Ui::QmitkUSNavigationStepCtUsRegistration *ui; mitk::NodePredicateAnd::Pointer m_IsOfTypeImagePredicate; mitk::NodePredicateOr::Pointer m_IsASegmentationImagePredicate; mitk::NodePredicateAnd::Pointer m_IsAPatientImagePredicate; mitk::TNodePredicateDataType<mitk::PointSet>::Pointer m_IsAPointSetPredicate; mitk::NodePredicateDataType::Pointer m_IsASurfacePredicate; itk::SmartPointer<mitk::NavigationDataSource> m_NavigationDataSource; mitk::Image::Pointer m_FloatingImage; mitk::PointSet::Pointer m_MarkerModelCoordinateSystemPointSet; mitk::PointSet::Pointer m_MarkerFloatingImageCoordinateSystemPointSet; std::vector<mitk::Image::Pointer> m_ImagesGroundTruthProtocol; bool m_PerformingGroundTruthProtocolEvaluation; std::vector<double> m_GroundTruthProtocolFRE; std::map<int, double> m_GroundTruthProtocolTRE; std::map<int, mitk::Point3D> m_PointsToTransformGroundTruthProtocol; std::map<int, mitk::PointSet::Pointer> m_GroundTruthProtocolTransformedPoints; ThresholdImageFilterType::Pointer m_ThresholdFilter; BinaryThresholdImageFilterType::Pointer m_BinaryThresholdFilter; LaplacianRecursiveGaussianImageFilterType::Pointer m_LaplacianFilter1; LaplacianRecursiveGaussianImageFilterType::Pointer m_LaplacianFilter2; VotingBinaryIterativeHoleFillingImageFilterType::Pointer m_HoleFillingFilter; BinaryImageToShapeLabelMapFilterType::Pointer m_BinaryImageToShapeLabelMapFilter; itk::SmartPointer<mitk::FloatingImageToUltrasoundRegistrationFilter> m_FloatingImageToUltrasoundRegistrationFilter; std::vector<mitk::Vector3D> m_CentroidsOfFiducialCandidates; std::map<double, mitk::Vector3D> m_EigenVectorsFiducialCandidates; std::vector<double> m_EigenValuesFiducialCandidates; mitk::Vector3D m_MeanCentroidFiducialCandidates; std::map<int, mitk::Vector3D> m_FiducialMarkerCentroids; mitk::AffineTransform3D::Pointer m_TransformMarkerCSToFloatingImageCS; /*! \brief The 3D dimension of the CT image given in index size. */ mitk::Vector3D m_ImageDimension; mitk::Vector3D m_ImageSpacing; bool m_FreezeCombinedModality; mitk::Point3D m_CentroidOfTargetInUSImage; }; #endif // QMITKUSNAVIGATIONSTEPCTUSREGISTRATION_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h index dc94ab612c..56ce3399a5 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h @@ -1,167 +1,167 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONSTEPMARKERINTERVENTION_H #define QMITKUSNAVIGATIONSTEPMARKERINTERVENTION_H #include "QmitkUSAbstractNavigationStep.h" namespace mitk { class DataNode; class NeedleProjectionFilter; class NodeDisplacementFilter; class USNavigationGrabCutSegmentationUpdateFilter; class USNavigationTargetUpdateFilter; class USNavigationTargetOcclusionFilter; class USNavigationTargetIntersectionFilter; class USPointMarkInteractor; class LookupTableProperty; class Surface; class TextAnnotation2D; class USTargetPlacementQualityCalculator; } namespace Ui { class QmitkUSNavigationStepMarkerIntervention; } class QmitkZoneProgressBar; /** * \brief Navigation step for the actual marker placement. */ class QmitkUSNavigationStepMarkerIntervention : public QmitkUSAbstractNavigationStep { Q_OBJECT signals: void TargetReached(int); void TargetLeft(int); protected slots: void OnTargetReached(); void OnTargetLeft(); void OnBackToLastTargetClicked(); void OnFreeze(bool); void OnShowPlanningView(bool); void OnRiskZoneViolated(const mitk::DataNode *, mitk::Point3D); public: explicit QmitkUSNavigationStepMarkerIntervention(QWidget *parent = 0); - ~QmitkUSNavigationStepMarkerIntervention(); + ~QmitkUSNavigationStepMarkerIntervention() override; - virtual bool OnStartStep(); - virtual bool OnStopStep(); - virtual bool OnFinishStep(); + bool OnStartStep() override; + bool OnStopStep() override; + bool OnFinishStep() override; - virtual bool OnActivateStep(); - virtual bool OnDeactivateStep(); - virtual void OnUpdate(); + bool OnActivateStep() override; + bool OnDeactivateStep() override; + void OnUpdate() override; - virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode); + void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override; - virtual QString GetTitle(); - virtual bool GetIsRestartable(); + QString GetTitle() override; + bool GetIsRestartable() override; - virtual FilterVector GetFilter(); + FilterVector GetFilter() override; protected: - virtual void OnSetCombinedModality(); + void OnSetCombinedModality() override; void ClearZones(); void UpdateTargetCoordinates(mitk::DataNode *); void UpdateBodyMarkerStatus(mitk::NavigationData::Pointer bodyMarker); void GenerateTargetColorLookupTable(); void UpdateTargetColors(); /** * \brief */ void UpdateTargetScore(); /** * \brief Updates display showing the number of the currently active target. */ void UpdateTargetProgressDisplay(); /** * \brief Updates color and distance of the progress bar for the planned target. * The intersection between needle path and target surface is calculated and * the color is got from the intersection point. */ void UpdatePlannedTargetProgressDisplay(); /** * \brief Tests for target violation and updates the display accordingly. * This method tests if the needle tip is inside the target surface. */ void UpdateTargetViolationStatus(); /** * \brief Calculates and display quality metrics if all three markers are placed. */ void CalculateTargetPlacementQuality(); void UpdateSensorsNames(); unsigned int m_NumberOfTargets; QVector<itk::SmartPointer<mitk::DataNode>> m_PlannedTargetsNodes; QVector<itk::SmartPointer<mitk::DataNode>> m_ReachedTargetsNodes; QmitkZoneProgressBar *m_TargetProgressBar; QmitkZoneProgressBar *m_PlannedTargetProgressBar; int m_CurrentTargetIndex; bool m_CurrentTargetReached; mitk::ScalarType m_ActiveTargetColor[3]; mitk::ScalarType m_InactiveTargetColor[3]; mitk::ScalarType m_ReachedTargetColor[3]; bool m_ShowPlanningColors; itk::SmartPointer<mitk::USPointMarkInteractor> m_PointMarkInteractor; itk::SmartPointer<mitk::DataNode> m_TargetNode; itk::SmartPointer<mitk::LookupTableProperty> m_TargetColorLookupTableProperty; itk::SmartPointer<mitk::Surface> m_TargetSurface; itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter; itk::SmartPointer<mitk::NodeDisplacementFilter> m_NodeDisplacementFilter; itk::SmartPointer<mitk::USNavigationTargetUpdateFilter> m_TargetUpdateFilter; itk::SmartPointer<mitk::USNavigationTargetOcclusionFilter> m_TargetOcclusionFilter; itk::SmartPointer<mitk::USNavigationTargetIntersectionFilter> m_TargetIntersectionFilter; itk::SmartPointer<mitk::USTargetPlacementQualityCalculator> m_PlacementQualityCalculator; itk::SmartPointer<mitk::TextAnnotation2D> m_TargetStructureWarnOverlay; std::string m_ReferenceSensorName; std::string m_NeedleSensorName; unsigned int m_ReferenceSensorIndex; unsigned int m_NeedleSensorIndex; private: mitk::MessageDelegate1<QmitkUSNavigationStepMarkerIntervention, mitk::DataNode *> m_ListenerTargetCoordinatesChanged; Ui::QmitkUSNavigationStepMarkerIntervention *ui; }; #endif // QMITKUSNAVIGATIONSTEPMARKERINTERVENTION_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h index 05b320bf36..e404e5fb8f 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h @@ -1,148 +1,148 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONSTEPPLACEMENTPLANNING_H #define QMITKUSNAVIGATIONSTEPPLACEMENTPLANNING_H #include "QmitkUSAbstractNavigationStep.h" namespace Ui { class QmitkUSNavigationStepPlacementPlanning; } namespace mitk { class USNavigationTargetUpdateFilter; class USNavigationTargetIntersectionFilter; class USPointMarkInteractor; class NodeDisplacementFilter; class NeedleProjectionFilter; class LookupTableProperty; class TextAnnotation3D; class Surface; class PointSet; class USTargetPlacementQualityCalculator; } /** * \brief Navigation step for planning the positions for implanting markers. * * The planned targets are stored in the data storage under DATANAME_BASENODE -> * DATANAME_TARGETS and the needle path to the planned targets are stored under * DATANAME_BASENODE -> DATANAME_TARGETS_PATHS. The target structure is expected * to be stored under DATANAME_BASENODE -> DATANAME_TUMOR -> * DATANAME_TARGETSURFACE. * */ class QmitkUSNavigationStepPlacementPlanning : public QmitkUSAbstractNavigationStep { Q_OBJECT protected slots: /** * \brief Freezes or unfreezes the combined modality. * In freeze state an interactor is activated in the render window, so the * position of the currently active target can be planned by clicking into the * render window. */ void OnFreeze(bool freezed); /** * \brief Plan target position at the intersection between needle path and target surface. */ void OnPlaceTargetButtonClicked(); /** * \brief Selects the previous target as active target. */ void OnGoToPreviousTarget(); /** * \brief Selects the next target as active target. */ void OnGoToNextTarget(); /** * \brief The currently active target is removed from the data storage. */ void OnRemoveCurrentTargetClicked(); public: explicit QmitkUSNavigationStepPlacementPlanning(QWidget *parent = 0); - ~QmitkUSNavigationStepPlacementPlanning(); + ~QmitkUSNavigationStepPlacementPlanning() override; - virtual QString GetTitle(); - virtual FilterVector GetFilter(); + QString GetTitle() override; + FilterVector GetFilter() override; protected: - virtual bool OnStartStep(); - virtual bool OnStopStep(); - virtual bool OnRestartStep(); - virtual bool OnFinishStep(); + bool OnStartStep() override; + bool OnStopStep() override; + bool OnRestartStep() override; + bool OnFinishStep() override; - virtual bool OnActivateStep(); - virtual bool OnDeactivateStep(); - virtual void OnUpdate(); + bool OnActivateStep() override; + bool OnDeactivateStep() override; + void OnUpdate() override; - virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode); - virtual void OnSetCombinedModality(); + void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override; + void OnSetCombinedModality() override; void CreateTargetNodesIfNecessary(); void UpdateTargetCoordinates(mitk::DataNode *); void UpdateTargetColors(); void UpdateTargetDescriptions(); void GenerateTargetColorLookupTable(); void ReinitNodeDisplacementFilter(); void CalculatePlanningQuality(); itk::SmartPointer<mitk::DataNode> CalculatePlanningQuality(itk::SmartPointer<mitk::Surface> targetSurface, itk::SmartPointer<mitk::PointSet>); itk::SmartPointer<mitk::Surface> CreateSphere(float radius); void UpdateBodyMarkerStatus(mitk::NavigationData::Pointer bodyMarker); void UpdateSensorsNames(); int m_NumberOfTargets; int m_CurrentTargetIndex; bool m_BodyMarkerValid; itk::SmartPointer<mitk::USPointMarkInteractor> m_PointMarkInteractor; itk::SmartPointer<mitk::USNavigationTargetUpdateFilter> m_TargetUpdateFilter; itk::SmartPointer<mitk::NodeDisplacementFilter> m_NodeDisplacementFilter; itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter; itk::SmartPointer<mitk::USNavigationTargetIntersectionFilter> m_TargetIntersectionFilter; itk::SmartPointer<mitk::USTargetPlacementQualityCalculator> m_PlacementQualityCalculator; itk::SmartPointer<mitk::LookupTableProperty> m_TargetColorLookupTableProperty; itk::SmartPointer<mitk::DataNode> m_TargetNode; QVector<itk::SmartPointer<mitk::DataNode>> m_PlannedTargetNodes; QVector<itk::SmartPointer<mitk::DataNode>> m_PlannedNeedlePaths; itk::SmartPointer<mitk::TextAnnotation3D> m_CurrentTargetNodeOverlay; std::string m_ReferenceSensorName; std::string m_NeedleSensorName; unsigned int m_ReferenceSensorIndex; unsigned int m_NeedleSensorIndex; private: mitk::MessageDelegate1<QmitkUSNavigationStepPlacementPlanning, mitk::DataNode *> m_ListenerTargetCoordinatesChanged; Ui::QmitkUSNavigationStepPlacementPlanning *ui; }; #endif // QMITKUSNAVIGATIONSTEPPLACEMENTPLANNING_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h index c7e30d322a..d99b0899ee 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h @@ -1,123 +1,123 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONSTEPPUNCTUATIONINTERVENTION_H #define QMITKUSNAVIGATIONSTEPPUNCTUATIONINTERVENTION_H #include "QmitkUSAbstractNavigationStep.h" #include <mitkPointSet.h> #include <mitkNavigationTool.h> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkLine.h> #include <vtkOBBTree.h> namespace mitk { class DataNode; class NeedleProjectionFilter; class NodeDisplacementFilter; class USNavigationGrabCutSegmentationUpdateFilter; class USNavigationTargetUpdateFilter; class USNavigationTargetOcclusionFilter; class USPointMarkInteractor; class LookupTableProperty; class Surface; } namespace Ui { class QmitkUSNavigationStepPunctuationIntervention; } class QmitkZoneProgressBar; /** * \brief Navigations step for the actual punctuation intervention. * The needle path is projected onto the image plane and the distances to all * risk structures are displayed in the widget. * * The risk structures are expected to be in the data storage under * DATANAME_BASENODE -> DATANAME_ZONES. They should contain a property named * "zone.size" and it is assumed that they are spherical. */ class QmitkUSNavigationStepPunctuationIntervention : public QmitkUSAbstractNavigationStep { Q_OBJECT public: /** Sets the navigation tool of the needle for the meta data (tool axis etc.)*/ void SetNeedleMetaData(mitk::NavigationTool::Pointer needleNavigationTool); explicit QmitkUSNavigationStepPunctuationIntervention(QWidget *parent = 0); - ~QmitkUSNavigationStepPunctuationIntervention(); + ~QmitkUSNavigationStepPunctuationIntervention() override; - virtual bool OnStartStep(); - virtual bool OnRestartStep(); - virtual bool OnFinishStep(); + bool OnStartStep() override; + bool OnRestartStep() override; + bool OnFinishStep() override; - virtual bool OnActivateStep(); - virtual void OnUpdate(); + bool OnActivateStep() override; + void OnUpdate() override; - virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode>); + void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode>) override; - virtual QString GetTitle(); - virtual bool GetIsRestartable(); + QString GetTitle() override; + bool GetIsRestartable() override; - virtual FilterVector GetFilter(); + FilterVector GetFilter() override; signals: void AddAblationZoneClicked(int); void AblationZoneChanged(int,int); protected slots: void OnAddAblationZoneClicked(); void OnEnableAblationZoneMarkingClicked(); void OnAblationZoneSizeSliderChanged(int size); void OnShowToolAxisEnabled(int enabled); protected: - virtual void OnSetCombinedModality(); + void OnSetCombinedModality() override; void ClearZones(); void UpdateBodyMarkerStatus(mitk::NavigationData::Pointer bodyMarker); /** Updates the critical structures which means that the distance to the needle tip is updated and also the color changes to red if the path projection intersects the critical structure. */ void UpdateCriticalStructures(mitk::NavigationData::Pointer needle, mitk::PointSet::Pointer path); /** Checks if the given line intersects the given sphere. */ bool CheckSphereLineIntersection(mitk::Point3D& sphereOrigin, float& sphereRadius, mitk::Point3D& lineStart, mitk::Point3D& lineEnd); private: Ui::QmitkUSNavigationStepPunctuationIntervention *m_Ui; mitk::DataStorage::SetOfObjects::ConstPointer m_ZoneNodes; /** \brief Creates a Pointset that projects the needle's path */ itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter; /** holds the navigation tool of the needle for the meta data (tool axis etc.)*/ mitk::NavigationTool::Pointer m_NeedleNavigationTool; std::map<mitk::DataNode::Pointer,mitk::Color> m_OldColors; //stores the original color of the critical structrue nodes //some help variables for the CheckSphereLineIntersection()-Method vtkSmartPointer<vtkSphereSource> m_SphereSource; vtkSmartPointer<vtkOBBTree> m_OBBTree; vtkSmartPointer<vtkPoints> m_IntersectPoints; }; #endif // QMITKUSNAVIGATIONSTEPPUNCTUATIONINTERVENTION_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h index 9d7a7f814a..5d48b063e0 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h @@ -1,168 +1,168 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONSTEPTUMOURSELECTION_H #define QMITKUSNAVIGATIONSTEPTUMOURSELECTION_H #include "QmitkUSAbstractNavigationStep.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { class NavigationDataSource; class DataStorage; class DataNode; class USZonesInteractor; class NodeDisplacementFilter; class Surface; } namespace Ui { class QmitkUSNavigationStepTumourSelection; } class USNavigationMarkerPlacement; class QmitkUSNavigationStepCombinedModality; /** * \brief Navigation step for marking the tumor position and extent. * The user can mark the position by interacting with the render windows. The * tumor size can be changed afterwards and the tumor can be removed. */ class QmitkUSNavigationStepTumourSelection : public QmitkUSAbstractNavigationStep { Q_OBJECT protected slots: /** * \brief Activates or deactivates the ineractor for tumour creation. */ void OnFreeze(bool freezed); /** * \brief Updates the surface of the tumor node according to the new size. */ void OnTumourSizeChanged(int); /** * \brief Just restarts the navigation step for deleting the tumour. */ void OnDeleteButtonClicked(); public: explicit QmitkUSNavigationStepTumourSelection(QWidget* parent = 0); - ~QmitkUSNavigationStepTumourSelection(); + ~QmitkUSNavigationStepTumourSelection() override; void SetTargetSelectionOptional (bool t); /** * \brief Initializes tumour and target surface. * \return always true */ - virtual bool OnStartStep(); + bool OnStartStep() override; /** * \brief Removes target surface and tumour node from the data storage. * Additionally an unfreeze is done and the node displacement filter is * resetted. * \return always true */ - virtual bool OnStopStep(); + bool OnStopStep() override; /** * \brief Reinitializes buttons and sliders in addition of calling the default implementation. * \return result of the superclass implementation */ - virtual bool OnRestartStep(); + bool OnRestartStep() override; /** * \brief (Re)creates the target surface. * \return always true */ - virtual bool OnFinishStep(); + bool OnFinishStep() override; /** * \brief Initializes (but not activates) the interactor for tumour selection. * \return always true */ - virtual bool OnActivateStep(); + bool OnActivateStep() override; /** * \brief Deactivates the interactor for tumour selection * and removes data of the tumour node if selection wasn't finished yet. * * \return always true */ - virtual bool OnDeactivateStep(); + bool OnDeactivateStep() override; /** * \brief Updates tracking validity status and checks tumour node for the end of tumour creation. */ - virtual void OnUpdate(); + void OnUpdate() override; /** * The properties "settings.security-distance" and * "settings.interaction-concept" are used. */ - virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode); + void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override; - virtual QString GetTitle(); + QString GetTitle() override; /** * @return a node displacement filter for tumour and target surfaces */ - virtual FilterVector GetFilter(); + FilterVector GetFilter() override; void SetTumorColor(mitk::Color c); /** @return Returns the current NodeDisplacementFilter which ist used for updating the targets pose. */ itk::SmartPointer<mitk::NodeDisplacementFilter> GetTumourNodeDisplacementFilter(); protected: - virtual void OnSetCombinedModality(); + void OnSetCombinedModality() override; void TumourNodeChanged(const mitk::DataNode*); itk::SmartPointer<mitk::Surface> CreateTargetSurface(); void UpdateReferenceSensorName(); itk::SmartPointer<mitk::NavigationDataSource> m_NavigationDataSource; bool m_targetSelectionOptional; float m_SecurityDistance; itk::SmartPointer<mitk::USZonesInteractor> m_Interactor; itk::SmartPointer<mitk::DataNode> m_TumourNode; itk::SmartPointer<mitk::DataNode> m_TargetSurfaceNode; itk::SmartPointer<mitk::NodeDisplacementFilter> m_NodeDisplacementFilter; std::string m_StateMachineFilename; std::string m_ReferenceSensorName; unsigned int m_ReferenceSensorIndex; mitk::Color m_SphereColor; private: mitk::MessageDelegate1<QmitkUSNavigationStepTumourSelection, const mitk::DataNode*> m_ListenerChangeNode; Ui::QmitkUSNavigationStepTumourSelection *ui; }; #endif // QMITKUSNAVIGATIONSTEPTUMOURSELECTION_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h index 6bdf3ded4e..2aed3668a0 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h @@ -1,134 +1,134 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONSTEPZONEMARKING_H #define QMITKUSNAVIGATIONSTEPZONEMARKING_H #include "QmitkUSAbstractNavigationStep.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { class NodeDisplacementFilter; class NavigationDataSource; } namespace Ui { class QmitkUSNavigationStepZoneMarking; } /** * \brief Navigation step for marking risk structures. * The user can add risk structures by interacting with the render windows. The * risk structures are organized in an embedded table view. * * The risk structures are stored under DATANAME_BASENODE -> DATANAME_ZONES. * * This step is ready for the next step directly after activating. All actions * to be done in this step are optional. */ class QmitkUSNavigationStepZoneMarking : public QmitkUSAbstractNavigationStep { Q_OBJECT protected slots: void OnFreeze(bool freezed); /** * \brief Triggered when a risk zone was added. * Adds the zone to a member variable and to the node displacement filter. */ void OnZoneAdded(); /** * \brief Triggered when a risk zone was removed. * Removes the zone from a member variable and from the node displacement * filter. */ void OnZoneRemoved(); void OnShowListClicked(int state); public: explicit QmitkUSNavigationStepZoneMarking(QWidget *parent = 0); - ~QmitkUSNavigationStepZoneMarking(); + ~QmitkUSNavigationStepZoneMarking() override; /** * \brief Initialization of the data storage nodes. * \return always true */ - virtual bool OnStartStep(); + bool OnStartStep() override; /** * \brief Resets widget and filter and removes nodes from the data storage. * \return always true */ - virtual bool OnStopStep(); + bool OnStopStep() override; /** * \brief There is nothing to be done. * \return always true */ - virtual bool OnFinishStep(); + bool OnFinishStep() override; /** * \brief Selects input for the node displacement filter and emits "ReadyForNextStep" signal. * The input selection cannot be done earlier. * \return */ - virtual bool OnActivateStep(); + bool OnActivateStep() override; - virtual bool OnDeactivateStep(); + bool OnDeactivateStep() override; /** * \brief Updates just the tracking validity status. */ - virtual void OnUpdate(); + void OnUpdate() override; /** * The property "settings.interaction-concept" is used. */ - virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode); + void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override; - virtual QString GetTitle(); + QString GetTitle() override; /** * @return a node displacement filter for the zone surfaces */ - virtual FilterVector GetFilter(); + FilterVector GetFilter() override; protected: - virtual void OnSetCombinedModality(); + void OnSetCombinedModality() override; void UpdateReferenceSensorName(); itk::SmartPointer<mitk::NavigationDataSource> m_NavigationDataSource; itk::SmartPointer<mitk::NodeDisplacementFilter> m_ZoneDisplacementFilter; std::vector<itk::SmartPointer<mitk::DataNode> > m_ZoneNodes; std::string m_StateMachineFilename; std::string m_ReferenceSensorName; unsigned int m_ReferenceSensorIndex; bool m_CurrentlyAddingZone; private: Ui::QmitkUSNavigationStepZoneMarking *ui; }; #endif // QMITKUSNAVIGATIONSTEPZONEMARKING_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h index d4edbebe94..94b3fa5f44 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONCALIBRATIONREMOVEDELEGATE_H #define QMITKUSNAVIGATIONCALIBRATIONREMOVEDELEGATE_H #include <QStyledItemDelegate> /** * \brief QStyledItemDelegate that provides a QColorDialog as editor. */ class QmitkUSNavigationCalibrationRemoveDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit QmitkUSNavigationCalibrationRemoveDelegate(QObject* parent = 0); - ~QmitkUSNavigationCalibrationRemoveDelegate(); + ~QmitkUSNavigationCalibrationRemoveDelegate() override override; /** * \brief A QColorDialog is opened on double click events. */ - bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index); + bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override override; }; #endif // QMITKUSNAVIGATIONCALIBRATIONREMOVEDELEGATE_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h index 8d1f16594e..9fdebce387 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONCALIBRATIONUPDATEDEPTHDELEGATE_H #define QMITKUSNAVIGATIONCALIBRATIONUPDATEDEPTHDELEGATE_H #include <QStyledItemDelegate> #include <mitkUSControlInterfaceBMode.h> /** * \brief QStyledItemDelegate that changes the current depth of the ultasound image on double click. */ class QmitkUSNavigationCalibrationUpdateDepthDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit QmitkUSNavigationCalibrationUpdateDepthDelegate(QObject* parent = 0); - ~QmitkUSNavigationCalibrationUpdateDepthDelegate(); + ~QmitkUSNavigationCalibrationUpdateDepthDelegate() override override; void SetControlInterfaceBMode(mitk::USControlInterfaceBMode::Pointer controlInterfaceBMode); /** * \brief The depth of the b mode ultrasound is changed on double click. * A mitk::USControlInterfaceBMode has to be set before by calling * SetControlInterfaceBMode(). If no control interface was set (or it is * null) the QEvent gets ignored. */ - bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index); + bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override override; private: mitk::USControlInterfaceBMode::Pointer m_ControlInterfaceBMode; }; #endif // QMITKUSNAVIGATIONCALIBRATIONUPDATEDEPTHDELEGATE_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h index db16f09fcd..5d1cc7a985 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h @@ -1,74 +1,74 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONCALIBRATIONSDATAMODEL_H #define QMITKUSNAVIGATIONCALIBRATIONSDATAMODEL_H #include <QAbstractTableModel> #include <mitkMessage.h> #include <itkSmartPointer.h> namespace mitk { class AbstractUltrasoundTrackerDevice; class USControlInterfaceBMode; class USControlInterfaceProbes; } class QmitkUSNavigationCalibrationsDataModel : public QAbstractTableModel { Q_OBJECT public: explicit QmitkUSNavigationCalibrationsDataModel(QObject *parent = 0); - virtual ~QmitkUSNavigationCalibrationsDataModel(); + ~QmitkUSNavigationCalibrationsDataModel() override override; void SetCombinedModality(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> combinedModality); void OnDeviceChanged(const std::string&, const std::string&); /** \brief Return number of rows of the model. */ - virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const; + int rowCount ( const QModelIndex & parent = QModelIndex() ) const override override; /** \brief Return number of columns (3) of the model. */ - virtual int columnCount ( const QModelIndex & parent = QModelIndex() ) const; + int columnCount ( const QModelIndex & parent = QModelIndex() ) const override override; /** \brief Return names for the columns, numbers for the rows and invalid for DisplayRole. */ - virtual QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; + QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override override; /** \brief Return selectable and enabled for column 1 (size); selectable, enabled and editable for every other column. */ - virtual Qt::ItemFlags flags ( const QModelIndex & index ) const; + Qt::ItemFlags flags ( const QModelIndex & index ) const override override; /** \brief Return model data of the selected cell. */ - virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const; + QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const override override; /** \brief Set model data for the selected cell. */ - virtual bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ); + bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) override override; using QAbstractTableModel::removeRows; /** \brief Remove given rows from the model. * \param removeFromDataStorage zone nodes are removed from the data storage too, if this is set to true */ virtual bool removeRows ( int row, int count, const QModelIndex& parent, bool removeFromDataStorage ); private: itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality; itk::SmartPointer<mitk::USControlInterfaceBMode> m_ControlInterfaceBMode; mitk::MessageDelegate2<QmitkUSNavigationCalibrationsDataModel, const std::string&, const std::string&> m_ListenerDeviceChanged; }; #endif // QMITKUSNAVIGATIONCALIBRATIONSDATAMODEL_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h index d2a811e5be..ebae9d04dc 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h @@ -1,213 +1,213 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkUSNAVIGATIONMARKERPLACEMENT_H #define QmitkUSNAVIGATIONMARKERPLACEMENT_H #include <QmitkAbstractView.h> #include "IO/mitkUSNavigationLoggingBackend.h" #include "mitkNavigationDataRecorder.h" #include "mitkNodeDisplacementFilter.h" #include "mitkUSImageLoggingFilter.h" #include <mitkMessage.h> #include <mitkTextAnnotation2D.h> #include <mitkAbstractUltrasoundTrackerDevice.h> #include <mitkNavigationToolStorage.h> #include <mitkNavigationDataObjectVisualizationFilter.h> namespace itk { template <class T> class SmartPointer; } namespace mitk { class USNavigationStepTimer; } namespace Ui { class QmitkUSNavigationMarkerPlacement; } class QmitkUSAbstractNavigationStep; class QmitkUSNavigationStepPunctuationIntervention; class QmitkStdMultiWidget; class QTimer; class QSignalMapper; /** * \brief View for navigated marker placement using the combined modality. * This view utilizes the QmitkUSNavigationProcessWidget to do the navigation * process. It can be switched between widgets for marker placement and widgets * for punctuation. * * An experiment mode allows for logging results, durations and the ultrasound * images. */ class QmitkUSNavigationMarkerPlacement : public QmitkAbstractView { Q_OBJECT protected slots: void OnGetCursorPosition(); void OnActualizeCtToUsRegistrationWidget(); void OnInitializeCtToUsRegistration(); void OnInitializeTargetMarking(); void OnInitializeCriticalStructureMarking(); void OnInitializeNavigation(); /** * \brief Called periodically to update the rendering. * The standard multi widget is changed to fit the navigation process once it * is available and a reinit on the ultrasound image is done for a new image * node. */ void OnTimeout(); /** * \brief Called periodically during an experiment for logging the ultrasound images. */ void OnImageAndNavigationDataLoggingTimeout(); /** * \brief Initializes anything neccessary for an experiment. * The user is asked for a directory for storing the results and the logging * is started. */ void OnStartExperiment(); /** * \brief Stops logging and saves everything to the file system. */ void OnFinishExperiment(); /** * \brief Switches the navigation step widgets if the navigation application was changed. */ void OnSettingsChanged(itk::SmartPointer<mitk::DataNode>); void OnAddAblationZone(int size); void OnEnableNavigationLayout(); void OnResetStandardLayout(); void OnChangeLayoutClicked(); void OnChangeAblationZone(int id, int newSize); void OnRenderWindowSelection(); void OnRefreshView(); public: static const char *DATANAME_TUMOUR; static const char *DATANAME_TARGETSURFACE; static const char *DATANAME_ZONES; static const char *DATANAME_TARGETS; static const char *DATANAME_TARGETS_PATHS; static const char *DATANAME_REACHED_TARGETS; explicit QmitkUSNavigationMarkerPlacement(); - ~QmitkUSNavigationMarkerPlacement(); + ~QmitkUSNavigationMarkerPlacement() override override; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override override; static const std::string VIEW_ID; void OnCombinedModalityPropertyChanged(const std::string &, const std::string &); protected: /** * \brief A reinit on the ultrasound image is performed every time the view gets the focus. */ - virtual void SetFocus(); + void SetFocus() override override; /** * \brief Helper function which performs a reinit on the ultrasound image. */ void ReinitOnImage(); /** * \brief Sets the multiwidget to two windows, axial on top and 3D render window on the bottom. */ virtual void SetTwoWindowView(); /** * \brief Helper function for being able to serialize the 2d ultrasound image. */ void Convert2DImagesTo3D(mitk::DataStorage::SetOfObjects::ConstPointer nodes); void ReInitializeSettingsNodesAndImageStream(); void UpdateToolStorage(); void CreateOverlays(); void InitImageStream(); QWidget *m_Parent; QTimer *m_UpdateTimer; QTimer *m_ImageAndNavigationDataLoggingTimer; QmitkStdMultiWidget *m_StdMultiWidget; itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality; itk::SmartPointer<mitk::DataNode> m_SettingsNode; bool m_ReinitAlreadyDone; bool m_IsExperimentRunning; std::string m_CurrentApplicationName; itk::SmartPointer<mitk::USNavigationStepTimer> m_NavigationStepTimer; QPixmap m_IconRunning; QPixmap m_IconNotRunning; QString m_ResultsDirectory; QString m_ExperimentName; QString m_ExperimentResultsSubDirectory; std::vector<QString> m_NavigationStepNames; // stores the names of the navigation steps which are currently used (for logging purposes) mitk::USNavigationLoggingBackend m_LoggingBackend; mitk::USImageLoggingFilter::Pointer m_USImageLoggingFilter; mitk::NavigationDataRecorder::Pointer m_NavigationDataRecorder; // records navigation data files mitk::NodeDisplacementFilter::Pointer m_TargetNodeDisplacementFilter; mitk::NodeDisplacementFilter::Pointer m_AblationZonesDisplacementFilter; mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter; mitk::DataNode::Pointer m_InstrumentNode; std::vector<mitk::DataNode::Pointer> m_AblationZonesVector; int m_NeedleIndex; int m_MarkerIndex; int m_SceneNumber; itk::SmartPointer<mitk::TextAnnotation2D> m_WarnOverlay; //To get tool storage mitk::NavigationDataSource::Pointer m_NavigationDataSource; mitk::NavigationToolStorage::Pointer m_CurrentStorage; itk::SmartPointer<mitk::DataNode> m_BaseNode; itk::SmartPointer<mitk::DataNode> m_ImageStreamNode; private: Ui::QmitkUSNavigationMarkerPlacement *ui; }; #endif // USNAVIGATIONMARKERPLACEMENT_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h index 9322f4f51a..6c148ec931 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h @@ -1,40 +1,40 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONPERSPECTIVE_H #define QMITKUSNAVIGATIONPERSPECTIVE_H #include <QObject> #include <berryIPerspectiveFactory.h> /** * \brief Perspective for the ultrasound navigation process. * This perspective displays the IGT tracking toolbox and the ultrasound * support view on the left and the us navigation view on the right. The data * manager is not shown by default. */ class QmitkUSNavigationPerspective : public QObject, public berry::IPerspectiveFactory { Q_OBJECT Q_INTERFACES(berry::IPerspectiveFactory) public: QmitkUSNavigationPerspective(); - virtual void CreateInitialLayout (berry::IPageLayout::Pointer layout); + void CreateInitialLayout (berry::IPageLayout::Pointer layout) override; }; #endif // QMITKUSNAVIGATIONPERSPECTIVE_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h index 60f8bb0a04..410c4532ed 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSZONEMANAGEMENTCOLORDIALOGDELEGATE_H #define QMITKUSZONEMANAGEMENTCOLORDIALOGDELEGATE_H #include <QStyledItemDelegate> /** * \brief QStyledItemDelegate that provides a QColorDialog as editor. */ class QmitkUSZoneManagementColorDialogDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit QmitkUSZoneManagementColorDialogDelegate(QObject* parent = 0); - ~QmitkUSZoneManagementColorDialogDelegate(); + ~QmitkUSZoneManagementColorDialogDelegate() override override; /** * \brief A QColorDialog is opened on double click events. */ - bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index); + bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override override; }; #endif // QMITKUSZONEMANAGEMENTCOLORDIALOGDELEGATE_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h index d884406485..99415bcc3b 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h @@ -1,97 +1,97 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSZONESDATAMODEL_H #define QMITKUSZONESDATAMODEL_H #include <mitkCommon.h> #include <mitkDataNode.h> #include <mitkDataStorage.h> #include <mitkNumericTypes.h> #include <QAbstractTableModel> /** * \brief Implementation of the QAbstractTableModel for ultrasound risk zones. * This class manages the data model for the QmitkUSZoneManagementWidget. It provides * consistency between the table in QmitkUSZoneManagementWidget and the DataStorage. */ class QmitkUSZonesDataModel : public QAbstractTableModel { Q_OBJECT public: typedef std::vector<mitk::DataNode::Pointer> DataNodeVector; explicit QmitkUSZonesDataModel(QObject *parent = 0); - virtual ~QmitkUSZonesDataModel(); + ~QmitkUSZonesDataModel() override override; /** * \brief Set data storage and base node for the zone nodes of this model. * The node event listeners will only recognize nodes which are children * of the given base node. * * \param dataStorage DataStorage where the zone nodes will be contained * \param baseNode DataNode which is source node of the zone nodes */ void SetDataStorage(mitk::DataStorage::Pointer dataStorage, mitk::DataNode::Pointer baseNode); void AddNode(const mitk::DataNode*); void RemoveNode(const mitk::DataNode*); void ChangeNode(const mitk::DataNode*); /** \brief Return number of rows of the model. */ - virtual int rowCount ( const QModelIndex & parent = QModelIndex() ) const; + int rowCount ( const QModelIndex & parent = QModelIndex() ) const override override; /** \brief Return number of columns (3) of the model. */ - virtual int columnCount ( const QModelIndex & parent = QModelIndex() ) const; + int columnCount ( const QModelIndex & parent = QModelIndex() ) const override override; /** \brief Return names for the columns, numbers for the rows and invalid for DisplayRole. */ - virtual QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; + QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override override; /** \brief Return selectable and enabled for column 1 (size); selectable, enabled and editable for every other column. */ - virtual Qt::ItemFlags flags ( const QModelIndex & index ) const; + Qt::ItemFlags flags ( const QModelIndex & index ) const override override; /** \brief Return model data of the selected cell. */ - virtual QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const; + QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const override override; /** \brief Set model data for the selected cell. */ - virtual bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ); + bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) override override; /** \brief Insert empty rows into the model (creates zone nodes). */ - virtual bool insertRows ( int row, int count, const QModelIndex& parent = QModelIndex() ); + bool insertRows ( int row, int count, const QModelIndex& parent = QModelIndex() ) override override; /** \brief Remove given rows from the model. */ - virtual bool removeRows ( int row, int count, const QModelIndex& parent = QModelIndex() ); + bool removeRows ( int row, int count, const QModelIndex& parent = QModelIndex() ) override override; /** \brief Remove given rows from the model. * \param removeFromDataStorage zone nodes are removed from the data storage too, if this is set to true */ virtual bool removeRows ( int row, int count, const QModelIndex& parent, bool removeFromDataStorage ); protected: DataNodeVector m_ZoneNodes; mitk::DataStorage::Pointer m_DataStorage; mitk::DataNode::Pointer m_BaseNode; private: mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerAddNode; mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerChangeNode; mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerRemoveNode; }; #endif // QMITKUSZONESDATAMODEL_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h index 8e3ebedf2e..d68c638420 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h @@ -1,388 +1,388 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkUltrasoundCalibration_h #define QmitkUltrasoundCalibration_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> // MITK #include <mitkIGTLClient.h> #include <mitkNavigationDataToIGTLMessageFilter.h> #include <mitkNeedleProjectionFilter.h> #include <mitkPointSet.h> #include <mitkPointSetDifferenceStatisticsCalculator.h> #include <mitkUSCombinedModality.h> // Microservices #include "ui_QmitkUltrasoundCalibrationControls.h" #include <vtkLandmarkTransform.h> #include <vtkPolyData.h> #include <vtkSmartPointer.h> #include <ctkServiceEvent.h> /*! \brief QmitkUltrasoundCalibration \warning This view provides a simple calibration process. \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkUltrasoundCalibration : public QmitkAbstractView { // 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: QmitkUltrasoundCalibration(); - ~QmitkUltrasoundCalibration(); + ~QmitkUltrasoundCalibration() override; static const std::string VIEW_ID; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; void OnUSDepthChanged(const std::string &, const std::string &); protected slots: /** * \brief Triggered, whenever the user switches Tabs * */ void OnTabSwitch(int index); /** * \brief Triggered, when the user has clicked "select Devices". * */ void OnDeviceSelected(); void OnDeviceDeselected(); /** * \brief Triggered, when the user clicks "Add Point" * */ void OnAddCalibPoint(); /** * \brief Triggered, when the user clicks "Calibrate" * */ void OnCalibration(); /** * \brief Triggered, when the user clicks "Add Target Points". * * Adds an image point and an tracking point to their respective evaluation pointsets */ void OnAddEvalTargetPoint(); /** * \brief Triggered, when the user clicks "Add Point". * * Adds a projected point to the projected point evaluation set. */ void OnAddEvalProjectedPoint(); /** * \brief Triggered when the user clicks "Save Results" in the Evaluation tab. */ void OnSaveEvaluation(); /** * \brief Triggered when the user clicks "Save Calibration" in the Calibration tab. */ void OnSaveCalibration(); /** * \brief Triggered when the user clicks "Run Next Round". Also used as a reset mechanism. */ void OnReset(); /** * \brief Triggered in regular intervals by a timer, when live view is enabled. * */ void Update(); /** * \brief Freezes or unfreezes the image. */ void SwitchFreeze(); /** * */ void OnStartCalibrationProcess(); /** *\brief Method to use the PLUS-Toolkoit for Calibration of EchoTrack */ void OnStartPlusCalibration(); void OnStopPlusCalibration(); /** *\ brief Starts the Streaming of USImage and Navigation Data when PLUS is connected */ void OnStartStreaming(); void OnNewConnection(); /** \*brief Get the Calibration from the PLUS-Toolkit once Calibration with fCal is done */ void OnGetPlusCalibration(); /** \*brief Convert the recieved igtl::Matrix into an mitk::AffineTransform3D which can be used to calibrate the CombinedModality */ void ProcessPlusCalibration(igtl::Matrix4x4 &imageToTracker); void OnStreamingTimerTimeout(); /** * */ void OnStopCalibrationProcess(); void OnAddCurrentTipPositionToReferencePoints(); void OnStartVerification(); void OnAddCurrentTipPositionForVerification(); void OnDeviceServiceEvent(const ctkServiceEvent event); void OnFreezeClicked(); void OnAddSpacingPoint(); void OnCalculateSpacing(); /* * \brief load the configuration of the phantom fiducials which have to be saved as points in the sensor coordinate * system of the tracking sensor attached to the phantom */ void OnLoadPhantomConfiguration(); /* * \brief match the annotation pointset with the geometry of the phantom configuration */ void OnMatchAnnotationToPhantomConfiguration(); /* * \brief move the annotation pointset up */ void OnMovePhantomAnnotationsUp(); /* * \brief move the annotation pointset down */ void OnMovePhantomAnnotationsDown(); /* * \brief move the annotation pointset left */ void OnMovePhantomAnnotationsLeft(); /* * \brief move the annotation pointset right */ void OnMovePhantomAnnotationsRight(); /* * \brief rotate the annotation pointset right */ void OnRotatePhantomAnnotationsRight(); /* * \brief rotate the annotation pointset left */ void OnRotatePhantomAnnotationsLeft(); /* * \brief add a calibration point to be used for phantom based calibration */ void OnPhantomCalibPointsChanged(); /* * \brief perform phantom based calibration */ void OnPhantomBasedCalibration(); signals: /** * \brief used for thread seperation, the worker thread must not call OnNewConnection directly. * QT signals are thread safe and separate the threads */ void NewConnectionSignal(); protected: - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer> &nodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer> &nodes) override; void UpdatePhantomAnnotationPointVisualization(int index = -1); /*! \brief translate the annotated image feature m_CalibPoints image by the specified translation vector */ void TranslatePhantomAnnotations(double tx, double ty, double tz); /*! \brief rotate the annotated image feature m_CalibPoints image by the specified angle */ void RotatePhantomAnnotations(double angle); Ui::QmitkUltrasoundCalibrationControls m_Controls; /** * \brief Internal function that activates display of the needle path. */ void ShowNeedlePath(); /** * \brief Clears all member attributes which are holding intermediate results for the calibration. */ void ClearTemporaryMembers(); void OnPlusConnected(); /** * \brief The combined modality used for imaging and tracking. */ mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality; /** * \brief NavigationDataSource used for tracking data. * This will be gotten by the combined modality. */ mitk::NavigationDataSource::Pointer m_Tracker; QTimer *m_Timer; mitk::DataNode::Pointer m_Node; mitk::DataNode::Pointer m_CalibNode; mitk::DataNode::Pointer m_WorldNode; // IGTL Servers and Devices needed for the communication with PLUS mitk::IGTLServer::Pointer m_USServer; mitk::IGTLMessageProvider::Pointer m_USMessageProvider; mitk::ImageToIGTLMessageFilter::Pointer m_USImageToIGTLMessageFilter; mitk::IGTLServer::Pointer m_TrackingServer; mitk::IGTLMessageProvider::Pointer m_TrackingMessageProvider; mitk::NavigationDataToIGTLMessageFilter::Pointer m_TrackingToIGTLMessageFilter; mitk::IGTLClient::Pointer m_TransformClient; mitk::IGTLDeviceSource::Pointer m_TransformDeviceSource; QTimer *m_StreamingTimer; unsigned long m_NewConnectionObserverTag; /** * \brief The current Ultrasound Image. */ mitk::Image::Pointer m_Image; /** * \brief Current point when the image was last frozen. */ mitk::Point3D m_FreezePoint; /** * \brief Pointset containing all tool points. */ mitk::PointSet::Pointer m_CalibPointsImage; /** * \brief Pointset containing corresponding points on the image. */ mitk::PointSet::Pointer m_CalibPointsTool; mitk::PointSet::Pointer m_PhantomConfigurationPointSet; ///< pointset holding the feature position of the phantom in tool coordinates /** * \brief Pointset containing Projected Points (aka "where we thought the needle was gonna land") */ mitk::PointSet::Pointer m_EvalPointsProjected; /** * \brief Pointset containing the evaluated points on the image. */ mitk::PointSet::Pointer m_EvalPointsImage; /** * \brief Pointset containing tracked evaluation points. */ mitk::PointSet::Pointer m_EvalPointsTool; /** * \brief Pointset containing tracked evaluation points. */ mitk::PointSet::Pointer m_VerificationReferencePoints; mitk::DataNode::Pointer m_VerificationReferencePointsDataNode; int m_currentPoint; std::vector<mitk::Point3D> m_allReferencePoints; std::vector<double> m_allErrors; /** * \brief Creates a Pointset that projects the needle's path */ mitk::NeedleProjectionFilter::Pointer m_NeedleProjectionFilter; /** * \brief Total number of calibration points set. */ int m_CalibPointsCount; QString m_CurrentDepth; /** * \brief StatisticsRegarding Projection Accuracy. * (Compares m_EvalPointsProjected to m_EvalPointsImage) */ mitk::PointSetDifferenceStatisticsCalculator::Pointer m_ProjectionStatistics; /** * \brief StatisticsRegarding Evaluation Accuracy. * (Compares m_EvalPointsTool to m_EvalPointsImage) */ mitk::PointSetDifferenceStatisticsCalculator::Pointer m_EvaluationStatistics; /** * \brief StatisticsRegarding Calibration Accuracy. * (Compares m_CalibPointsTool to a transformed copy of m_CalibPointsImage). */ mitk::PointSetDifferenceStatisticsCalculator::Pointer m_CalibrationStatistics; /** * \brief Result of the Calibration. */ mitk::AffineTransform3D::Pointer m_Transformation; /** * This method is copied from PointSetModifier which is part of MBI. It should be replaced * by external method call as soon as this functionality will be available in MITK. */ vtkSmartPointer<vtkPolyData> ConvertPointSetToVtkPolyData(mitk::PointSet::Pointer PointSet); double ComputeFRE(mitk::PointSet::Pointer imageFiducials, mitk::PointSet::Pointer realWorldFiducials, vtkSmartPointer<vtkLandmarkTransform> transform = nullptr); void ApplyTransformToPointSet(mitk::PointSet::Pointer pointSet, vtkSmartPointer<vtkAbstractTransform> transform); mitk::PointSet::Pointer m_SpacingPoints; mitk::DataNode::Pointer m_SpacingNode; int m_SpacingPointsCount; private: mitk::MessageDelegate2<QmitkUltrasoundCalibration, const std::string &, const std::string &> m_USDeviceChanged; }; #endif // UltrasoundCalibration_h diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h index 28fcaddb74..63f3df9739 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h @@ -1,103 +1,103 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONABSTRACTSETTINGSWIDGET_H #define QMITKUSNAVIGATIONABSTRACTSETTINGSWIDGET_H #include <QWidget> #include "mitkDataNode.h" /** * \brief Abstract class of settings widgets used by the QmitkUSNavigationProcessWidget. * This class handles the emitting of Saved(), Canceled() and SettingsChanged() * signals and provides slots for save and cancel buttons. * * The actual saving and loading of settings is delegated to concrete subclasses * which should therefore implement OnSetSettingsNode(), OnSaveProcessing(), * OnCancelProcessing(), OnLoadSettingsProcessing(). */ class QmitkUSNavigationAbstractSettingsWidget : public QWidget { Q_OBJECT signals: void Saved(); void Canceled(); void SettingsChanged(itk::SmartPointer<mitk::DataNode>); protected slots: /** * \brief Triggers the saving of the current settings. * OnSaveProcessing() is called and the Saved() signal is emitted afterwards. */ void OnSave(); /** * \brief Ends the settings changing process without saving the changes. * OnCancelProcessing() is called and the Canceled() signal is emitted * afterwards. */ void OnCancel(); public: explicit QmitkUSNavigationAbstractSettingsWidget(QWidget *parent = 0); - ~QmitkUSNavigationAbstractSettingsWidget(); + ~QmitkUSNavigationAbstractSettingsWidget() override; /** * \brief Loads the settings. * The actual loading is done by calling the OnLoadSettingsProcessing() * method. */ void LoadSettings(); /** * \brief Setter for the data node in which the settings are loaded. * The settings are made available as properties of this data node. */ void SetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues = false); itk::SmartPointer<mitk::DataNode> GetSettingsNode(); protected: /** * \brief Method for handling the setting of a new settings node. * This method has to be implemented by a concrete subclass. */ virtual void OnSetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues) = 0; /** * \brief Method for actually saving the settings. * This method has to be implemented by a concrete subclass. */ virtual void OnSaveProcessing() = 0; /** * \brief Method for handling the cancel process. * This method can be implemented by a concrete subclass. An empty default * implementation exists. */ virtual void OnCancelProcessing() {} /** * \brief Method for acutally loading the settings. * This method has to be implemented by a concrete subclass. */ virtual void OnLoadSettingsProcessing() = 0; private: mitk::DataNode::Pointer m_SettingsNode; }; #endif // QMITKUSNAVIGATIONABSTRACTSETTINGSWIDGET_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h index 0150da4b10..32692345c0 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONCOMBINEDSETTINGSWIDGET_H #define QMITKUSNAVIGATIONCOMBINEDSETTINGSWIDGET_H #include "QmitkUSNavigationAbstractSettingsWidget.h" #include "mitkDataNode.h" namespace Ui { class QmitkUSNavigationCombinedSettingsWidget; } /** * \brief Settings widget for the USNavigationMarkerPlacement. * This widgets allows for configuring the experiment mode and for changing the * application between marker placement and punctuation. */ class QmitkUSNavigationCombinedSettingsWidget : public QmitkUSNavigationAbstractSettingsWidget { Q_OBJECT protected slots: void OnApplicationChanged(int); public: explicit QmitkUSNavigationCombinedSettingsWidget(QWidget *parent = 0); - ~QmitkUSNavigationCombinedSettingsWidget(); - virtual void OnSetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues); + ~QmitkUSNavigationCombinedSettingsWidget() override; + void OnSetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues) override; protected: - virtual void OnSaveProcessing(); - virtual void OnLoadSettingsProcessing(); + void OnSaveProcessing() override; + void OnLoadSettingsProcessing() override; QString InteractionNameToFile(const QString& name) const; private: Ui::QmitkUSNavigationCombinedSettingsWidget *ui; }; #endif // QMITKUSNAVIGATIONCOMBINEDSETTINGSWIDGET_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h index 1b43d5ea25..8ff71a5178 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h @@ -1,64 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSCOMBINEDMODALITYCREATIONWIDGET_H #define QMITKUSCOMBINEDMODALITYCREATIONWIDGET_H #include <QWidget> #include "mitkUSCombinedModality.h" namespace Ui { class QmitkUSCombinedModalityCreationWidget; } /** * \brief Widget that enables the user to create a mitk::USCombinedModality of a mitk::NavigationDataSource and a mitk::USDevice. * A mitk::NavigationDataSource and a mitk::USDevice can be picked from two lists, showing * the corresponding micro service objects. The combined modality is registered as a micro * service as well during the creation process. */ class QmitkUSCombinedModalityCreationWidget : public QWidget { Q_OBJECT signals: /** \brief Emmited when the user clicks the "Cancel" button. */ void SignalAborted(); /** \brief Emmited when the user clicked the "Create" button and the creation is successfull. */ void SignalCreated(mitk::USCombinedModality::Pointer combinedModality); /** \brief Emmited when the user clicked the "Create" button and the creation is successfull. */ void SignalCreated(); protected slots: /** \brief Creates a combined modility of the selected mitk::NavigationDataSource and mitk::USDevice. **/ void OnCreation(); /** \brief Handles the enabled state of the "Create" button. **/ void OnSelectedUltrasoundOrTrackingDevice(); public: explicit QmitkUSCombinedModalityCreationWidget(QWidget *parent = 0); - ~QmitkUSCombinedModalityCreationWidget(); + ~QmitkUSCombinedModalityCreationWidget() override; private: Ui::QmitkUSCombinedModalityCreationWidget *ui; itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality; }; #endif // QMITKUSCOMBINEDMODALITYCREATIONWIDGET_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h index e1a822a14b..2f158a27e4 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h @@ -1,61 +1,61 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSCOMBINEDMODALITYEDITWIDGET_H #define QMITKUSCOMBINEDMODALITYEDITWIDGET_H #include <QWidget> #include "mitkUSCombinedModality.h" namespace Ui { class QmitkUSCombinedModalityEditWidget; } class QmitkUSNavigationCalibrationsDataModel; class QmitkUSNavigationCalibrationUpdateDepthDelegate; class QmitkUSCombinedModalityEditWidget : public QWidget { Q_OBJECT signals: void SignalSaved(); void SignalAborted(); protected slots: void OnSaveButtonClicked(); void OnCancelButtonClicked(); void OnCalibrationsSaveButtonClicked(); void OnCalibrationsLoadButtonClicked(); public: explicit QmitkUSCombinedModalityEditWidget(QWidget *parent = 0); - ~QmitkUSCombinedModalityEditWidget(); + ~QmitkUSCombinedModalityEditWidget() override override; void SetCombinedModality(mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality); private: mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality; std::string m_LastCalibrations; QmitkUSNavigationCalibrationsDataModel* m_CalibrationsDataModel; QmitkUSNavigationCalibrationUpdateDepthDelegate* m_CalibrationUpdateDepthDelegate; Ui::QmitkUSCombinedModalityEditWidget* ui; }; #endif // QMITKUSCOMBINEDMODALITYEDITWIDGET_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h index 6fe9e97ac0..75195ba02b 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONFREEZEBUTTON_H #define QMITKUSNAVIGATIONFREEZEBUTTON_H #include <QPushButton> #include "mitkUSCombinedModality.h" /** * \brief QPushButton for freezing and unfreezing a combined modality. * The button already has an icon and a text. On every successfull * freeze or unfreeze the signal SignalFrezzed() is emitted. One should * listen to this signal rather than to the clicked() signal of the * QPushButton as the combined modality may not be freezed after * clicked() was emitted. */ class QmitkUSNavigationFreezeButton : public QPushButton { Q_OBJECT signals: /** * \brief Emitted every time the freeze state of the combined modality changed. * True if the combined modality is freezed now, false if it isn't. */ void SignalFreezed(bool); protected slots: void OnButtonClicked(bool checked); void OnFreezeButtonToggle(); public: explicit QmitkUSNavigationFreezeButton(QWidget* parent = 0); - ~QmitkUSNavigationFreezeButton(); + ~QmitkUSNavigationFreezeButton() override; /** * \brief Setter for the combined modality to be freezed by this button. * An index may be specified for a tracking data output. The combined * modality will only be freezed then, if the current tracking data of * this output is valid. */ void SetCombinedModality(mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality, int outputIndex = -1); /** * \brief Try to freeze the combined modality. * This does the same as clicking the button while the combined * modality isn't freezed. If the combined modality is already * freezed this method does nothing. */ void Freeze(); /** * \brief Unfreeze the combined modality. * This does the same as clicking the button while the combined * modality is freezed. If the combined modality isn't freezed * this method does nothing. */ void Unfreeze(); private: mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality; int m_OutputIndex; bool m_FreezeButtonToggle; }; #endif // QMITKUSNAVIGATIONFREEZEBUTTON_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h index a0cf45cc12..38f69aa988 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h @@ -1,77 +1,77 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSNAVIGATIONZONEDISTANCESWIDGET_H #define QMITKUSNAVIGATIONZONEDISTANCESWIDGET_H #include <QWidget> #include "mitkNumericTypes.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { class NavigationData; class DataNode; } class QmitkZoneProgressBar; /** * \brief Widget for showing distances to given zones using instances of QmitkZoneProgressBar. * The zones can be added by AddZone() and removed by ClearZones(). To update * the progress bars, UpdateDistancesToNeedlePosition() has to be called with * a navigation data. */ class QmitkUSNavigationZoneDistancesWidget : public QWidget { Q_OBJECT signals: /** \brief Emmited whenever a the distance to a zone falls below zero. */ void SignalZoneViolated(const mitk::DataNode*, mitk::Point3D); public: explicit QmitkUSNavigationZoneDistancesWidget(QWidget *parent = 0); - ~QmitkUSNavigationZoneDistancesWidget(); + ~QmitkUSNavigationZoneDistancesWidget() override; /** * \brief Set the key for the data node float property holding the radius of a zone. * The default value of this attribute is "zone.size". */ void SetSizePropertyKey(const std::string& sizePropertyKey); /** \brief Get the key for the data node float property holding the radius of a zone. */ const std::string& GetSizePropertyKey() const; /** \brief Adds a zone to the widget. */ void AddZone(itk::SmartPointer<mitk::DataNode> zoneNode); /** \brief Removes all zones from the widget. */ void ClearZones(); /** \brief Updates color and label of each zone distance bar according to the given needle position. */ void UpdateDistancesToNeedlePosition(itk::SmartPointer<mitk::NavigationData> needle); protected: std::string m_SizePropertyKey; QVector<itk::SmartPointer<mitk::DataNode> > m_ZoneNodes; QVector<QmitkZoneProgressBar*> m_ZoneProgressBars; }; #endif // QMITKUSNAVIGATIONZONEDISTANCESWIDGET_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h index 6ea506e811..4b09d35960 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h @@ -1,154 +1,154 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKUSZONEMANAGEMENTWIDGET_H #define QMITKUSZONEMANAGEMENTWIDGET_H #include <QWidget> #include "mitkDataStorage.h" namespace itk { template<class T> class SmartPointer; } namespace mitk { class USZonesInteractor; } namespace Ui { class QmitkUSZoneManagementWidget; } class QmitkUSZonesDataModel; class QItemSelection; class QModelIndex; /** * \brief Shows a table of the zone nodes and allows to change properties and add and delete zone nodes. * * A data node interactor (mitk::USZonesInteractor) is used for creating new zone nodes and a QTableModel * (QmitkUSZonesDataModel) is used for handling the zones data. * * When using the widget, one has to call OnStartAddingZone() every time he wants the interaction for adding * new zone nodes to be active. */ class QmitkUSZoneManagementWidget : public QWidget { Q_OBJECT signals: /** * \brief Emmited whenever a new zone was added to the data model. */ void ZoneAdded(); /** * \brief Emmited whenever a new zone was removed from the data mode. */ void ZoneRemoved(); public slots: /** * \brief Removes all rows from the data model which are selected in the table. */ void RemoveSelectedRows(); /** * \brief Creates a new zone node and activates the data interactor on this node. * This slot has to be called whenever a new zone should be added. Interactions are active * then, so the user can create the zone. */ void OnStartAddingZone(); /** * \brief Aborts the creation of a new zone and deletes the corresponding node. */ void OnAbortAddingZone(); /** * \brief Removes all nodes from the data model. */ void OnResetZones(); protected slots: void OnSelectionChanged(const QItemSelection& selected, const QItemSelection & deselected); /** * \brief Updates zone radius according to the value of the zone size slider. * \param value new radius of the zone */ void OnZoneSizeSliderValueChanged(int value); /** * \brief Updates maximum number of added zones and selects the last row of the table. * It is called every time a row was added to the data model. */ void OnRowInsertion(const QModelIndex& parent, int start, int end); /** * \brief Updates the zone size slider when data was changed. * It is called every time a row was changed in the data model. */ void OnDataChanged(const QModelIndex& topLeft, const QModelIndex& /*bottomRight*/); public: explicit QmitkUSZoneManagementWidget(QWidget* parent = 0); - ~QmitkUSZoneManagementWidget(); + ~QmitkUSZoneManagementWidget() override; /** * \brief Sets the state machine file for being used by the mitk::USZonesInteractor * \param filename name of the state machine file */ void SetStateMachineFilename(const std::string& filename); /** * \brief Setter for the DataStorage where the zone nodes will be stored. * The nodes will be derivates of the node specified by the base node name. * * \param dataStorage data storage where the zone nodes will be stored * \param baseNodeName optional name of the node which will be the source node of all zone nodes (defaults "Zones") */ void SetDataStorage(mitk::DataStorage::Pointer dataStorage, const char* baseNodeName = "Zones"); /** * \brief Setter for the DataStorage where the zone nodes will be stored. * The nodes will be derivates of the base nodes. * * \param dataStorage data storage where the zone nodes will be strored * \param baseNode data node which will be the source node of all zone nodes */ void SetDataStorage(mitk::DataStorage::Pointer dataStorage, itk::SmartPointer<mitk::DataNode> baseNode); /** * \brief Get all zone nodes from the data storage. */ mitk::DataStorage::SetOfObjects::ConstPointer GetZoneNodes(); protected: QmitkUSZonesDataModel* m_ZonesDataModel; itk::SmartPointer<mitk::USZonesInteractor> m_Interactor; mitk::DataStorage::Pointer m_DataStorage; mitk::DataNode::Pointer m_BaseNode; std::string m_StateMachineFileName; private: Ui::QmitkUSZoneManagementWidget* ui; unsigned int m_CurMaxNumOfZones; }; #endif // QMITKUSZONEMANAGEMENTWIDGET_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h index e15c69a9d0..00ae5ebfd8 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h @@ -1,93 +1,93 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H #define MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H #include <mitkCommon.h> #include <mitkNumericTypes.h> #include <itkObjectFactory.h> template<class T> class vtkSmartPointer; class vtkPolyData; namespace itk { template<class T> class SmartPointer; } namespace mitk { class Surface; class PointSet; /** * \brief Calculates qualitiy metrics for given target positions. * The calculated metrics are: * - the distance of the centers of mass of the target surface and the target * points * - the differences of the angles between the target points to the given * optimal angle * - the mean of the angle differences */ class USTargetPlacementQualityCalculator : public itk::Object { public: mitkClassMacroItkParent(USTargetPlacementQualityCalculator, itk::Object) itkNewMacro(Self) /** * \brief Setter for the surface where the targets are placed around. */ itkSetMacro(TargetSurface, itk::SmartPointer<Surface>) /** * \brief Setter for the target points which are placed around the target surface. */ itkSetMacro(TargetPoints, itk::SmartPointer<PointSet>) /** * \brief Setter for the optimal angle of the target placement. * This angle is subtracted from the target angles when calculating the angle * differences. */ itkSetMacro(OptimalAngle, double) /** * \brief Calculates the quality metrics. * This method should be called before calling the getters for the metrics. */ void Update(); itkGetMacro(CentersOfMassDistance, double) itkGetMacro(MeanAngleDifference, double) itkGetMacro(AngleDifferences, mitk::VnlVector) protected: USTargetPlacementQualityCalculator(); - virtual ~USTargetPlacementQualityCalculator(); + ~USTargetPlacementQualityCalculator() override override; vtkSmartPointer<vtkPolyData> GetTransformedPolydata(); itk::SmartPointer<Surface> m_TargetSurface; itk::SmartPointer<PointSet> m_TargetPoints; double m_OptimalAngle; double m_CentersOfMassDistance; double m_MeanAngleDifference; mitk::VnlVector m_AngleDifferences; }; } // namespace mitk #endif // MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/org_mbi_gui_qt_usnavigation_Activator.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/org_mbi_gui_qt_usnavigation_Activator.h index 56266b5e86..615b02bbe2 100644 --- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/org_mbi_gui_qt_usnavigation_Activator.h +++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/org_mbi_gui_qt_usnavigation_Activator.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mbi_gui_qt_usnavigation_Activator_h #define org_mbi_gui_qt_usnavigation_Activator_h #include <ctkPluginActivator.h> #include "mitkTrackingDeviceSource.h" #include "IO/mitkUSNavigationCombinedModalityPersistence.h" namespace mitk { class org_mbi_gui_qt_usnavigation_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mbi_gui_qt_usnavigation") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; TrackingDeviceSource::Pointer m_VirtualTrackingDeviceSource; USNavigationCombinedModalityPersistence::Pointer m_USCombinedModalityPersistence; }; typedef org_mbi_gui_qt_usnavigation_Activator PluginActivator; } #endif diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkExample.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkExample.h index 4dfaf5a11c..976abe3a3f 100644 --- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkExample.h +++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkExample.h @@ -1,79 +1,79 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef OpenIGTLinkExample_h #define OpenIGTLinkExample_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_OpenIGTLinkExampleControls.h" #include "mitkIGTLClient.h" #include "mitkIGTLServer.h" #include "mitkIGTLDeviceSource.h" #include "mitkNavigationDataObjectVisualizationFilter.h" #include "mitkIGTLMessageToNavigationDataFilter.h" #include "qtimer.h" /** \brief OpenIGTLinkExample \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class OpenIGTLinkExample : public QmitkAbstractView { // 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: - ~OpenIGTLinkExample(); + ~OpenIGTLinkExample() override; static const std::string VIEW_ID; protected slots: void Start(); void UpdatePipeline(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; void CreatePipeline(); void DestroyPipeline(); void ResizeBoundingBox(); Ui::OpenIGTLinkExampleControls m_Controls; mitk::IGTLClient::Pointer m_IGTLClient; mitk::IGTLDeviceSource::Pointer m_IGTLDeviceSource; mitk::IGTLMessageToNavigationDataFilter::Pointer m_IGTLMsgToNavDataFilter; mitk::NavigationDataObjectVisualizationFilter::Pointer m_VisFilter; QList<mitk::DataNode::Pointer> m_DemoNodes; QTimer m_Timer; }; #endif // OpenIGTLinkExample_h diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkPlugin.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkPlugin.h index 4b8bd73f1f..6357825905 100644 --- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkPlugin.h +++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkPlugin.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef OpenIGTLinkPlugin_h #define OpenIGTLinkPlugin_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_OpenIGTLinkPluginControls.h" #include "qtimer.h" //OIGTL #include "mitkIGTLClient.h" #include "mitkIGTL2DImageDeviceSource.h" #include "mitkIGTL3DImageDeviceSource.h" #include "mitkIGTLTrackingDataDeviceSource.h" //mitk #include "mitkNavigationDataObjectVisualizationFilter.h" #include "mitkIGTLMessageToNavigationDataFilter.h" #include "mitkIGTLMessageToUSImageFilter.h" #include <mitkSurface.h> #include <mitkDataNode.h> //vtk #include <vtkSphereSource.h> /** \brief OpenIGTLinkPlugin \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class OpenIGTLinkPlugin : public QmitkAbstractView { // 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; protected slots: void ConnectButtonClicked(); void ReceivingButtonClicked(); void UpdatePipeline(); protected: enum State{ IDLE, CONNECTED, RECEIVING }; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer>& nodes) override; Ui::OpenIGTLinkPluginControls m_Controls; mitk::IGTL2DImageDeviceSource::Pointer m_IGTL2DImageDeviceSource; mitk::IGTL3DImageDeviceSource::Pointer m_IGTL3DImageDeviceSource; mitk::IGTLTrackingDataDeviceSource::Pointer m_IGTLTransformDeviceSource; mitk::IGTLClient::Pointer m_IGTLClient; QTimer m_Timer; mitk::IGTLMessageToNavigationDataFilter::Pointer m_IGTLMessageToNavigationDataFilter; mitk::NavigationDataObjectVisualizationFilter::Pointer m_NavigationDataObjectVisualizationFilter; mitk::IGTLMessageToUSImageFilter::Pointer m_ImageFilter3D; mitk::IGTLMessageToUSImageFilter::Pointer m_ImageFilter2D; mitk::DataNode::Pointer m_Image2dNode; private: void StateChanged(State newState); State m_State; }; #endif // OpenIGTLinkPlugin_h diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkProviderExample.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkProviderExample.h index 9a89221fa6..995171c18e 100644 --- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkProviderExample.h +++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/OpenIGTLinkProviderExample.h @@ -1,85 +1,85 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef OpenIGTLinkProviderExample_h #define OpenIGTLinkProviderExample_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <QmitkIGTLStreamingConnector.h> #include "ui_OpenIGTLinkProviderExampleControls.h" #include "mitkIGTLServer.h" #include "mitkIGTLMessageProvider.h" #include "mitkNavigationDataToIGTLMessageFilter.h" #include "mitkNavigationDataSequentialPlayer.h" #include "mitkNavigationDataObjectVisualizationFilter.h" #include "qtimer.h" /** \brief OpenIGTLinkProviderExample \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class OpenIGTLinkProviderExample : public QmitkAbstractView { // 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: - ~OpenIGTLinkProviderExample(); + ~OpenIGTLinkProviderExample() override; static const std::string VIEW_ID; protected slots: void Start(); void OnOpenFile(); void UpdateVisualization(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; void CreatePipeline(); void DestroyPipeline(); void ResizeBoundingBox(); Ui::OpenIGTLinkProviderExampleControls m_Controls; mitk::IGTLServer::Pointer m_IGTLServer; mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider; mitk::NavigationDataToIGTLMessageFilter::Pointer m_NavDataToIGTLMsgFilter; mitk::NavigationDataSequentialPlayer::Pointer m_NavDataPlayer; mitk::NavigationDataObjectVisualizationFilter::Pointer m_NavDataVisualizer; QList<mitk::DataNode::Pointer> m_DemoNodes; mitk::NavigationDataSet::Pointer m_NavDataSet; QmitkIGTLStreamingConnector m_StreamingConnector; QTimer m_VisualizerTimer; }; #endif // OpenIGTLinkProviderExample_h diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h index ae4d3d16b6..383ca89fb0 100644 --- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h +++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h @@ -1,213 +1,213 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkIGTTrackingLabView_h #define QmitkIGTTrackingLabView_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_QmitkIGTTrackingLabViewControls.h" #include <mitkNavigationDataToPointSetFilter.h> #include <mitkNavigationDataLandmarkTransformFilter.h> #include <mitkNavigationDataReferenceTransformFilter.h> #include <mitkNavigationDataObjectVisualizationFilter.h> #include <mitkNavigationDataToPointSetFilter.h> #include <mitkTrackingDeviceSource.h> #include <mitkSurface.h> #include <mitkCameraVisualization.h> #include <QToolBox> #include <QCheckBox> #include <QComboBox> #include <QPushButton> #include <QLabel> #include <QSpinBox> #include <QTimer> #include <vtkLandmarkTransform.h> #include <vtkSmartPointer.h> /*! \brief QmitkIGTTrackingLabView \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \ingroup ${plugin_target}_internal */ class QmitkIGTTrackingLabView : public QmitkAbstractView { // 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; /** \brief default constructor */ QmitkIGTTrackingLabView(); /** \brief default destructor */ -virtual ~QmitkIGTTrackingLabView(); +~QmitkIGTTrackingLabView() override; -virtual void CreateQtPartControl(QWidget *parent) override; +void CreateQtPartControl(QWidget *parent) override; -virtual void SetFocus() override; +void SetFocus() override; protected slots: /** This timer updates the IGT pipline, when nessecary: * 1: if permanent registration is activated, then the permanent * registration filter has to be updated * 2: if the camera view is on it also must be updated * 3: point set recording is based on another filter which needs to be * updated when activated */ void UpdateTimer(); //############## Configuration Step ##################### /** \brief This method sets up the navigation pipeline during initialization. */ void OnSetupNavigation(); /** This method is called when the instrument is selected. * It stores the navigation data of the instrument. */ void OnInstrumentSelected(); /** This method is called when the object marker is selected. * It stores the navigation data of the object marker. */ void OnObjectmarkerSelected(); //############## Initial Registration Step ############## /** \brief This method calls the initial fiducial registration. */ void OnInitialRegistration(); /** \brief This method adds a new fiducial to the tracker fiducials PointSet. */ void OnAddRegistrationTrackingFiducial(); /** \brief This method initializes the registration for the FiducialRegistrationWidget. */ void InitializeRegistration(); //############## Permanent Registration Step ############ /** \brief This method activates the permanent registration based on one tool's position. */ void OnPermanentRegistration(bool on); //############## Pointset Recording Step ################ /** \brief This method starts the PointSet recording. */ void OnPointSetRecording(bool record); //############## Camera View Step ####################### /** \brief This method activates the virtual camera. */ void OnVirtualCamera(bool on); protected: Ui::QmitkIGTTrackingLabViewControls m_Controls; /** \brief This method creates all widgets this bundle needs. */ void CreateBundleWidgets(); /** \brief This method creates the SIGNAL SLOT connections. */ void CreateConnections(); /** * Checks if everything is initialized for registration. Gives error messages and returns false if not. */ bool CheckRegistrationInitialization(); /** \brief This method destroys the filter pipeline. */ void DestroyIGTPipeline(); //####################### Members for the IGT pipeline ###################################### // The IGT pipeline is basically initialized in the method OnSetupNavigation(). Further initialization // is done in the methods OnPermanentRegistration(), OnPointSetRecording() and OnVirtualCamera(). // The pipline is updated in the method UpdateTimer(). When the complete pipeline is active, it is // structured as follows: // ,-> m_PermanentRegistrationFilter // m_Source -> m_Visualizer // `-> m_VirtualView mitk::TrackingDeviceSource::Pointer m_Source; ///< source that connects to the tracking device mitk::NavigationDataObjectVisualizationFilter::Pointer m_PermanentRegistrationFilter; ///< this filter transforms from tracking coordinates into mitk world coordinates if needed it is interconnected before the FiducialEegistrationFilter mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; ///< visualization filter mitk::CameraVisualization::Pointer m_VirtualView; ///< filter to update the vtk camera according to the reference navigation data //in addition to the pipeline objects, pointers to the navigation data objects are stored for fast access: mitk::NavigationData::Pointer m_InstrumentNavigationData; ///< navigation data of instrument mitk::NavigationData::Pointer m_ObjectmarkerNavigationData; ///< navigation data of object marker //####################### other members ###################################### QTimer* m_Timer; ///< central timer which updates the IGT pipeline //members for the point set recording mitk::NavigationData::Pointer m_PointSetRecordingNavigationData; mitk::PointSet::Pointer m_PSRecordingPointSet; bool m_PointSetRecording; bool m_PermanentRegistration; bool m_CameraView; //members for initial registration mitk::DataNode::Pointer m_ImageFiducialsDataNode; mitk::DataNode::Pointer m_TrackerFiducialsDataNode; //members for permanent registration mitk::PointSet::Pointer m_PermanentRegistrationSourcePoints; mitk::NavigationData::Pointer m_T_MarkerRel; mitk::NavigationData::Pointer m_T_ObjectReg; mitk::AffineTransform3D::Pointer m_T_ImageReg; mitk::AffineTransform3D::Pointer m_T_ImageGeo; mitk::NavigationData::Pointer m_ObjectmarkerNavigationDataLastUpdate; ///< this is the position of the object marker from the last call of update(); it is used to check the difference and decide if the visualization must be updated //######################## some internal help methods ############################ /** * Checks if the difference between two given transformations is high which means the method returns * true if the difference exeeds the given position and angular threshold. */ bool IsTransformDifferenceHigh(mitk::NavigationData::Pointer transformA, mitk::NavigationData::Pointer transformB, double euclideanDistanceThreshold = .8, double angularDifferenceThreshold = .8); }; #endif // QmitkIGTTrackingLabView_h diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h index 843dadad33..6f382832d1 100644 --- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h +++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h @@ -1,89 +1,89 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKIGTTUTORIALVIEW_H_INCLUDED #define _QMITKIGTTUTORIALVIEW_H_INCLUDED #include <QmitkAbstractView.h> #include <string> #include "ui_QmitkIGTTutorialViewControls.h" #include "mitkTrackingDeviceSource.h" #include "mitkNavigationDataObjectVisualizationFilter.h" /** * \brief QmitkIGTTutorial shows a small typically navigation MITK view * * 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 render window part. * * \sa also take a look at the CMakeLists.txt of this view to see how to * link to the mitkIGT library. */ class QmitkIGTTutorialView : public QmitkAbstractView { // 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; QmitkIGTTutorialView(); - virtual ~QmitkIGTTutorialView(); + ~QmitkIGTTutorialView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); - virtual void SetFocus() override; + void SetFocus() override; 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::QmitkIGTTutorialViewControls* m_Controls; 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 // _QMITKIGTTUTORIALVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h index 6b8d731200..82d46cc90c 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h @@ -1,72 +1,72 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkIGTFiducialRegistration_h #define QmitkIGTFiducialRegistration_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_QmitkIGTFiducialRegistrationControls.h" #include <ctkServiceEvent.h> /*! \brief QmitkIGTFiducialRegistration \sa QmitkFunctionality \ingroup ${plugin_target}_internal */ class QmitkIGTFiducialRegistration : public QmitkAbstractView { // 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: - virtual void SetFocus() override; + void SetFocus() override; static const std::string VIEW_ID; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; QmitkIGTFiducialRegistration(); - virtual ~QmitkIGTFiducialRegistration(); + ~QmitkIGTFiducialRegistration() override; public slots: protected slots: void PointerSelectionChanged(); void ImageSelectionChanged(); protected: void InitializeRegistration(); Ui::IGTFiducialRegistrationControls m_Controls; mitk::NavigationData::Pointer m_TrackingPointer; }; #endif // IGTFiducialRegistration_h diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h index d88cdd940e..e2e21874fc 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h @@ -1,143 +1,143 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkIGTNavigationToolCalibration_h #define QmitkIGTNavigationToolCalibration_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <mitkNavigationData.h> #include "QmitkInteractiveTransformationWidget.h" #include "ui_QmitkIGTNavigationToolCalibrationControls.h" #include <mitkNavigationDataRecorder.h> //QT headers #include <QTimer> /*! \brief IGTNavigationToolCalibration \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \ingroup ${plugin_target}_internal */ class QmitkIGTNavigationToolCalibration : public QmitkAbstractView { // 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: QmitkIGTNavigationToolCalibration(); - virtual ~QmitkIGTNavigationToolCalibration(); + ~QmitkIGTNavigationToolCalibration() override; static const std::string VIEW_ID; - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; protected slots: void OnAddPivotPose(); void OnComputePivot(); void OnUseComputedPivotPoint(); void SetToolToCalibrate(); void SetCalibrationPointer(); void UpdateTrackingTimer(); void AddLandmark(); void SaveCalibratedTool(); void OnToolCalibrationMethodChanged(int index); void OnStartManualToolTipCalibration(); void OnRunSingleRefToolCalibrationClicked(); void OnLoginSingleRefToolNavigationDataClicked(); void OnSetNewToolTipPosButtonClicked(); void OnGetPositions(); void OnCalibrateToolAxis(); void OnToolAxisSpinboxChanged(); void OnManualEditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip); protected: - virtual void SetFocus(); + void SetFocus() override; void UpdateOffsetCoordinates(); int m_IndexCurrentCalibrationMethod; Ui::IGTNavigationToolCalibrationControls m_Controls; //some general members mitk::NavigationTool::Pointer m_ToolToCalibrate; //<<< tool that will be calibrated int m_IDToolToCalibrate; //<<< id of tool that will be calibrated (of the navigation data source) mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfToolToCalibrate; //<<< navigation data source of the tool that will be calibrated mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfCalibrationPointer; //<<< navigation data source of the calibration pointer mitk::DataNode::Pointer m_ToolSurfaceInToolCoordinatesDataNode; //<<< holds the tool surface in tool coordinates (for preview purposes) int m_IDCalibrationPointer; //<<< id of the calibration pointer (of the corresponding navigation data source) QTimer* m_TrackingTimer; //<<< tracking timer that updates the status widgets void ApplyToolTipTransform(mitk::NavigationData::Pointer ToolTipTransformInToolCoordinates, std::string message = "Tool was updated with the calibrated tool tip!"); //<<< applys the given tool tip transform to the tool to calibrate bool CheckInitialization(bool CalibrationPointerRequired = true); //<<< checks if the tool to calibrate and (if required) the calibration pointer is initialized. Displays a warning and returns false if not. mitk::NavigationData::Pointer m_ComputedToolTipTransformation; //<<< holds the new tooltip transformation after it was computed to write it into the tool later // members and helper methods for pivot tool calibration std::vector<mitk::NavigationData::Pointer> m_PivotPoses; void AddPivotPose(); void ClearOldPivot(); void UpdatePivotCount(); bool m_OnAddPivotPoseClicked; int PivotCount; // members and helper methods for manual tool calibration void UpdateManualToolTipCalibrationView(); QmitkInteractiveTransformationWidget* m_ToolTransformationWidget; // members and helper methods for single reference tool calibration void LoginSingleRefToolNavigationData(); std::vector< mitk::Point3D > m_LoggedNavigationDataOffsets; std::vector< mitk::NavigationData::Pointer > m_LoggedNavigationDataDifferences; bool m_OnLoginSingleRefToolNavigationDataClicked; int m_NumberOfNavigationData; int m_NumberOfNavigationDataCounter; mitk::Point3D m_ResultOffsetVector; // members and helper methods for tool tip preview mitk::DataNode::Pointer m_ToolTipPointPreview; //<<< Data node of the tool tip preview void ShowToolTipPreview(mitk::NavigationData::Pointer ToolTipInTrackingCoordinates); //<<< Adds a preview of the tool tip into the data storage void RemoveToolTipPreview(); //<<< Removes the preview // members for the tool landmark calibration mitk::PointSet::Pointer m_CalibrationLandmarks; mitk::DataNode::Pointer m_CalibrationLandmarksNode; mitk::PointSet::Pointer m_RegistrationLandmarks; mitk::DataNode::Pointer m_RegistrationLandmarksNode; //members and helper methods for tool axis calibration mitk::Vector3D m_CalibratedToolAxis; mitk::NavigationData::Pointer m_AxisCalibration_ToolToCalibrate; mitk::NavigationData::Pointer m_AxisCalibration_NavDataCalibratingTool; }; #endif // IGTNavigationToolCalibration_h diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h index b84f1edce6..63f135382b 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h @@ -1,63 +1,63 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMITKIGTNavigationToolManagerView_h #define QmitkMITKIGTNavigationToolManagerView_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <usServiceReference.h> #include "ui_QmitkMITKIGTNavigationToolManagerViewControls.h" /*! \brief QmitkMITKIGTNavigationToolManagerView \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation. */ class QmitkMITKIGTNavigationToolManagerView : public QmitkAbstractView { // 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; QmitkMITKIGTNavigationToolManagerView(); - virtual ~QmitkMITKIGTNavigationToolManagerView(); + ~QmitkMITKIGTNavigationToolManagerView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; protected slots: void NewStorageByWidget(mitk::NavigationToolStorage::Pointer storage); void ToolStorageSelected(mitk::NavigationToolStorage::Pointer); protected: Ui::QmitkMITKIGTNavigationToolManagerViewControls* m_Controls; /** Someone needs to hold the smart pointers of new storages, otherwise the objects will be lost although they are listed as microservice. */ std::vector<mitk::NavigationToolStorage::Pointer> m_AllStoragesHandledByThisWidget; }; #endif // _QMITKMITKIGTNAVIGATIONTOOLMANAGERVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h index f1a9d8cc52..ae2491bba6 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h @@ -1,270 +1,270 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMITKIGTTrackingToolboxView_h #define QmitkMITKIGTTrackingToolboxView_h #include <berryISelectionListener.h> #include <ctkServiceReference.h> #include <ctkServiceEvent.h> #include <QmitkAbstractView.h> #include "ui_QmitkMITKIGTTrackingToolboxViewControls.h" //mitk headers #include <mitkNavigationToolStorage.h> #include <mitkNavigationDataObjectVisualizationFilter.h> #include <mitkNavigationDataRecorder.h> #include <mitkNavigationDataToIGTLMessageFilter.h> #include <mitkIGTLServer.h> #include <mitkIGTLMessageProvider.h> //QT headers #include <QTimer> #include "QmitkMITKIGTTrackingToolboxViewWorker.h" //Forward declaration of MITK classes namespace mitk { class NeedleProjectionFilter; } /*! \brief QmitkMITKIGTTrackingToolboxView This is the view of the bundle IGT Tracking Toolbox. The IGT Tracking Toolbox can be used to access tracking devices with MITK-IGT. The Tracking Toolbox can be used to log tracking data in XML or CSV format for measurement purposes. The Tracking Toolbox further allows for visualization of tools with given surfaces in combination with the NaviagtionToolManager. */ class QmitkMITKIGTTrackingToolboxView : public QmitkAbstractView { // 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; QmitkMITKIGTTrackingToolboxView(); - virtual ~QmitkMITKIGTTrackingToolboxView(); + ~QmitkMITKIGTTrackingToolboxView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; protected slots: /** @brief changes name of the filename when switching fileextension by radio button */ void OnToggleFileExtension(); /** @brief This slot is called if the user wants to load a new tool file. A new window opens where the user can choose a file. If the chosen file is corrupt or not valid the user gets an error message. If the file was loaded successfully the tools are show in the tool status widget. */ void OnLoadTools(); /** Starts tracking if tracking is stopped / stops tracking if tracking is started. */ void OnStartStopTracking(); /** Connects the device if it is disconnected / disconnects the device if it is connected. */ void OnConnectDisconnect(); /** Freezes the device if it is not frozen / unfreezes the device if it is frozen. */ void OnFreezeUnfreezeTracking(); /** @brief Shows or hides the tool projection of the standard tool axis. */ void OnShowHideToolProjectionClicked(); /** @brief Shows or hides the standard tool axis. */ void OnShowHideToolAxisClicked(); /** @brief This slot connects to the device. In status "connected" configuration of the device is disabled. */ void OnConnect(); /** @brief This slot disconnects from the device. */ void OnDisconnect(); /** @brief This slot tries to start tracking with the current device. If start tracking fails the user gets an error message and tracking stays off.*/ void OnStartTracking(); /** @brief This slot stops tracking. If tracking is not strated it does nothing.*/ void OnStopTracking(); /** @brief This slot is called if the user want's to choose a file name for logging. A new windows to navigate through the file system and choose a file opens.*/ void OnChooseFileClicked(); /** @brief This slot starts logging. Logging is only possible if a device is tracking. If not the logging mechanism start when the start tracking is called.*/ void StartLogging(); /** @brief This slot stops logging. If logging is not running it does nothing.*/ void StopLogging(); /** @brief This slot enables / disables UI elements depending on the tracking device after a device is changed.*/ void OnTrackingDeviceChanged(); /** @brief This slot selects the Tracking Volume appropriate for a given model */ void OnTrackingVolumeChanged(QString qstr); /** @brief Shows or hides the tracking volume according to the checkboxe's state */ void OnShowTrackingVolumeChanged(); /** @brief This slot auto detects tools of a NDI Aurora tracking device. If tools where found they will be stored internally as a tool storage. The user is also asked if he wants to save this tool storage to load it later. Only call it if a Aurora device was configured because other devices don't support auto detection.*/ void OnAutoDetectTools(); /** @brief Slot for tracking timer. The timer updates the IGT pipline and also the logging filter if logging is activated.*/ void UpdateRenderTrackingTimer(); void UpdateLoggingTrackingTimer(); /** @brief Slot for showing the rendering disabled warning label*/ void OnChangeRenderUpdateRate(); /** @brief Resets the Tracking Tools: this means all tools are removed. */ void OnResetTools(); /** @brief Opens a dialog where a new navigation tool can be created. */ void OnAddSingleTool(); /** @brief This slot is called if the user finishes the creation of a new tool. */ void OnAddSingleToolFinished(); /** @brief This slot is called if the user cancels the creation of a new tool. */ void OnAddSingleToolCanceled(); void OnTimeOut(); /** * \brief This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool. * ServiceListener is connected in the QmitkMITKIGTTrackingToolboxView. */ void OnToolStorageChanged(const ctkServiceEvent event); /* This slot enables selction of tool for projection*/ void SelectToolProjection(int idx); protected slots: //help slots for enable/disable buttons void DisableLoggingButtons(); void EnableLoggingButtons(); void DisableOptionsButtons(); void EnableOptionsButtons(); void EnableTrackingConfigurationButtons(); void DisableTrackingConfigurationButtons(); void EnableTrackingControls(); void DisableTrackingControls(); void EnableDisableTimerButtons(int enable); void OnToggleAdvancedSimpleMode(); void OnToggleDifferentUpdateRates(); //slots for worker thread void OnAutoDetectToolsFinished(bool success, QString errorMessage); void OnConnectFinished(bool success, QString errorMessage); void OnStartTrackingFinished(bool success, QString errorMessage); void OnStopTrackingFinished(bool success, QString errorMessage); void OnDisconnectFinished(bool success, QString errorMessage); protected: Ui::QmitkMITKIGTTrackingToolboxViewControls* m_Controls; bool m_tracking; ///> bool which is true if tracking is running, false if not bool m_connected; ///> bool that is true when a tracking device is connected bool m_logging; ///> bool which is true if logging is running, false if not bool m_ShowHideToolAxis; ///> bool, which will be true, if the tool axis is visible during tracking int m_loggedFrames; ///> stores the current number of logged frames if logging is on mitk::NavigationToolStorage::Pointer m_toolStorage; ///>stores the loaded tools mitk::DataNode::Pointer m_TrackingVolumeNode; ///>holds the data node of the tracking volume if volume is visualized bool lastTrackingVolumeState; ///>temporary holds the state of the tracking volume (activated/not activated) during some methods QString m_ToolStorageFilename; ///>stores the filename of the current tool storage QString m_AutoSaveFilename; ///>a filename for auto saving tools if no m_ToolStorageFilename was given by the user /** @brief Shows a message box with the text given as parameter. */ void MessageBox(std::string s); /** @brief reinits the view globally. */ void GlobalReinit(); //members for the filter pipeline mitk::TrackingDeviceData m_TrackingDeviceData; ///> stores the tracking device data as long as this is not handled by the tracking device configuration widget mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter; ///> holds the tool visualization filter (second filter of the IGT pipeline) mitk::NavigationDataRecorder::Pointer m_loggingFilter; ///> holds the logging filter if logging is on (third filter of the IGT pipeline) itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter; ///> Contains the needle projection filter which is used for displaying the tool projection and the tool axis during tracking (optional third filter of the IGT pipeline). The filter is updated in the method UpdateRenderTrackingTimer(). //members for open IGT link server mitk::NavigationDataToIGTLMessageFilter::Pointer m_IGTLConversionFilter; ///> Converts the navigation data as open IGT link message and makes this filter available as microservice mitk::IGTLServer::Pointer m_IGTLServer; mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider; /** @brief This timer updates the IGT pipline and also the logging filter if logging is activated.*/ QTimer* m_TrackingRenderTimer; QTimer* m_TrackingLoggingTimer; QTimer* m_TimeoutTimer; bool m_SimpleModeEnabled; ///>Stores if simple UI mode is enabled /** Replaces the current navigation tool storage which is stored in m_toolStorage. * Basically handles the microservice stuff: unregisteres the old storage, then * replaces the storage and registers the new one. */ void ReplaceCurrentToolStorage(mitk::NavigationToolStorage::Pointer newStorage, std::string newStorageName); /** * \brief Stores the properties of some QWidgets (and the tool storage file name) to QSettings. */ void StoreUISettings(); /** * \brief Loads the properties of some QWidgets (and the tool storage file name) from QSettings. */ void LoadUISettings(); /** * Help method for updating the tool label */ void UpdateToolStorageLabel(QString pathOfLoadedStorage); /** * Auto saves the current tool storage to a temporary file. This ist used for persistence. */ void AutoSaveToolStorage(); /** * Shows the projection of the tool along the tool axis for the given tool index */ void ShowToolProjection(int index); /** * Removes all the tool projections from the data storage */ void RemoveAllToolProjections(); //members for worker thread QThread* m_WorkerThread; QmitkMITKIGTTrackingToolboxViewWorker* m_Worker; private: ctkServiceReference m_DeviceTypeServiceReference; mitk::TrackingDeviceTypeCollection* m_DeviceTypeCollection; mitk::DataNode::Pointer m_ToolProjectionNode; }; #endif // _QMITKMITKIGTTRACKINGTOOLBOXVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h index 97460b7824..187501646e 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h @@ -1,98 +1,98 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkMITKIGTTrackingToolboxViewWorker_h #define QmitkMITKIGTTrackingToolboxViewWorker_h #include <berryISelectionListener.h> //mitk headers #include <mitkNavigationToolStorage.h> #include <mitkTrackingDeviceSource.h> #include <mitkNavigationDataObjectVisualizationFilter.h> //QT headers #include <QTimer> /** * Worker thread class for QmitkMITKIGTTrackingToolboxView view. */ class QmitkMITKIGTTrackingToolboxViewWorker : public QObject { Q_OBJECT public: enum WorkerMethod{ eAutoDetectTools = 0, eConnectDevice = 1, eStartTracking = 2, eStopTracking = 3, eDisconnectDevice = 4 }; QmitkMITKIGTTrackingToolboxViewWorker(); - ~QmitkMITKIGTTrackingToolboxViewWorker(); + ~QmitkMITKIGTTrackingToolboxViewWorker() override; void SetWorkerMethod(WorkerMethod w); void SetTrackingDevice(mitk::TrackingDevice::Pointer t); void SetDataStorage(mitk::DataStorage::Pointer d); void SetInverseMode(bool mode); void SetTrackingDeviceData(mitk::TrackingDeviceData d); void SetNavigationToolStorage(mitk::NavigationToolStorage::Pointer n); itkGetMacro(NavigationToolStorage, mitk::NavigationToolStorage::Pointer); mitk::TrackingDeviceSource::Pointer GetTrackingDeviceSource(); itkGetMacro(TrackingDeviceData, mitk::TrackingDeviceData); itkGetMacro(ToolVisualizationFilter, mitk::NavigationDataObjectVisualizationFilter::Pointer); public slots: void ThreadFunc(); signals: void AutoDetectToolsFinished(bool success, QString errorMessage); void ConnectDeviceFinished(bool success, QString errorMessage); void StartTrackingFinished(bool success, QString errorMessage); void StopTrackingFinished(bool success, QString errorMessage); void DisconnectDeviceFinished(bool success, QString errorMessage); protected: mitk::TrackingDevice::Pointer m_TrackingDevice; WorkerMethod m_WorkerMethod; mitk::DataStorage::Pointer m_DataStorage; mitk::NavigationToolStorage::Pointer m_NavigationToolStorage; //members for the filter pipeline which is created in the worker thread during ConnectDevice() mitk::TrackingDeviceSource::Pointer m_TrackingDeviceSource; ///> member for the source of the IGT pipeline mitk::TrackingDeviceData m_TrackingDeviceData; ///> stores the tracking device data as long as this is not handled by the tracking device configuration widget mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter; ///> holds the tool visualization filter (second filter of the IGT pipeline) //members some internal flags bool m_InverseMode; //flag that is true when the inverse mode is enabled //stores the original colors of the tracking tools std::map<mitk::DataNode::Pointer, mitk::Color> m_OriginalColors; //internal methods void AutoDetectTools(); void ConnectDevice(); void StartTracking(); void StopTracking(); void DisconnectDevice(); }; #endif // _QMITKMITKIGTTRACKINGTOOLBOXVIEWWorker_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h index f582bf67d6..ea1239e20e 100644 --- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h +++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h @@ -1,124 +1,124 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkNavigationDataPlayerView_h #define QmitkNavigationDataPlayerView_h //Qmitk #include <QmitkAbstractView.h> // ui #include "ui_QmitkNavigationDataPlayerViewControls.h" //mitk #include <mitkNavigationDataObjectVisualizationFilter.h> #include <mitkNavigationToolStorage.h> /*! \brief QmitkNavigationDataPlayerView \warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation. */ class QmitkNavigationDataPlayerView : public QmitkAbstractView { // 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; QmitkNavigationDataPlayerView(); - virtual ~QmitkNavigationDataPlayerView(); + ~QmitkNavigationDataPlayerView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; void SetFocus() override; /** \brief This method creates this bundle's SIGNAL and SLOT connections */ void CreateConnections(); protected slots: /*! \brief loads a file and triggers creation of players and the pipeline */ void OnOpenFile(); /*! \brief Creates the correct player and displays the according widget */ void OnSelectPlayer(); /*! \brief Changes the repeat mode of the selected player */ void OnSetRepeat(int); /*! \brief Registers or unregisters a virtual tracking device for the player. */ void OnSetMicroservice(); /*! \brief Triggers the creation and destruction of the rendering pipeline */ void OnSetDisplay(); /*! \brief Updates the visualization */ void OnUpdate(); protected: /** * \brief configures the player according to the checkboxes set in the GUI */ void ConfigurePlayer(); /** * \brief Creates the Rendering Pipeline necessary to Render the images */ void CreatePipeline(); /** * \brief Destroys the Rendering Pipeline (but not the player) */ void DestroyPipeline(); /** * \brief Makes player component active or inactive. * * Used to activate all components once data is loaded */ void SetInteractionComponentsEnabledState(bool isActive); Ui::QmitkNavigationDataPlayerViewControls* m_Controls; mitk::NavigationDataObjectVisualizationFilter::Pointer m_VisFilter; std::vector<mitk::DataNode::Pointer> m_RenderingNodes; mitk::NavigationDataPlayerBase::Pointer m_Player; mitk::NavigationDataSet::Pointer m_Data; mitk::NavigationToolStorage::Pointer m_ToolStorage; private: }; #endif // _QMITKNAVIGATIONDATAPLAYERVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h index 74afb22de7..d4746f0697 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/QmitkMatchPointBatchProcessor.h @@ -1,203 +1,203 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef __Q_MITK_MATCHPOINT_BATCH_PROCESSOR_H #define __Q_MITK_MATCHPOINT_BATCH_PROCESSOR_H #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_QmitkMatchPointBatchProcessor.h" // MatchPoint #include <mapDeploymentDLLInfo.h> #include <mapDeploymentDLLHandle.h> #include <mapRegistrationAlgorithmBase.h> #include <mapIterativeAlgorithmInterface.h> #include <mapMultiResRegistrationAlgorithmInterface.h> #include <mapStoppableAlgorithmInterface.h> #include <mitkMAPRegistrationWrapper.h> class QmitkRegistrationJob; class QmitkMappingJob; /*! \brief View for registration batch processing based on MatchPoint This view composes the GUI and implements the business logic needed to allow registration batch processing (one target, many moving images). \ingroup ${plugin_target}_internal */ class QmitkMatchPointBatchProcessor : public QmitkAbstractView { // 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; /** * Creates smartpointer typedefs */ berryObjectMacro(QmitkMatchPointBatchProcessor) QmitkMatchPointBatchProcessor(); - ~QmitkMatchPointBatchProcessor(); + ~QmitkMatchPointBatchProcessor() override; protected slots: /** * @brief Connect all GUI elements to its corresponding slots */ virtual void CreateConnections(); /// \brief Called when the user clicks the GUI button void OnLoadAlgorithmButtonPushed(); void OnSelectedAlgorithmChanged(); void OnLockMovingButtonPushed(); void OnLockTargetButtonPushed(); void OnStartRegBtnPushed(); void OnStopRegBtnPushed(); void OnRegJobError(QString err); void OnRegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration, const QmitkRegistrationJob* pRegJob); void OnRegJobFinished(); void OnMapJobError(QString err); void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job); void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration); void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel); void OnAlgorithmStatusChanged(QString info); void OnAlgorithmInfo(QString info); protected: - virtual void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& nodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& nodes) override; private: typedef QList<mitk::DataNode::Pointer> NodeListType; /** Spawns a registration job for the next selected moving node (see m_nextNodeToSpawn). * If no nodes are left, no job will be spawned and false is returned. * If at least one node is left, a job will be spawned, m_nextNodeToSpawn will be incremented * and true will be returned.*/ bool SpawnNextJob(); /** * @brief Adapt the visibility of GUI elements depending on the current data loaded */ void UpdateAlgorithmSelectionGUI(); void Error(QString msg); void UpdateAlgorithmList(); /** * checks if appropriated nodes are selected in the data manager. If nodes are selected, * they are stored in m_spSelectedTargetNode and m_selectedMovingNodes. It also sets the info labels accordingly.*/ void CheckInputs(); /** * Updates the state of registration control buttons. Regarding to selected * inputs, loaded algorithm and its state.*/ void ConfigureRegistrationControls(); /** * Configures the progress bars according to the chosen algorithm. */ void ConfigureProgressInfos(); /** Methods returns a list of all nodes selected in the data manager that do * NOT contain registration wrappers. The list may be empty if nothing is * selected or no appropriate data node is selected.*/ NodeListType GetSelectedDataNodes(); /** Methods returns a list of all nodes in the data manager containing a registration wrapper. * The list may be empty.*/ mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const; /** Returns a proposal for a (unique) default reg job name */ std::string GetDefaultRegJobName() const; /** Returns the Pointer to the DLL info of the algorithm currently selected by the system. The info is received via m_SelectionListener. @return If there is no item selected the returning pointer will be null. */ const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const; //! [Qt Selection Listener method and pointer] /** * @brief Method of berry::ISelectionListener that implements the selection listener functionality. * @param sourcepart The workbench part responsible for the selection change. * @param selection This parameter holds the current selection. * * @see ISelectionListener */ void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart, const berry::ISelection::ConstPointer& selection); void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection); friend struct berry::SelectionChangedAdapter<QmitkMatchPointBatchProcessor>; QWidget* m_Parent; /** @brief this pointer holds the algorithm selection listener */ QScopedPointer<berry::ISelectionListener> m_AlgorithmSelectionListener; ::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle; ::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm; ::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo; typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm; typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm; typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm; /**All selected nodes stored by OnSelectionChanged()*/ NodeListType m_currentlySelectedNodes; mitk::DataNode::Pointer m_spSelectedTargetNode; NodeListType m_selectedMovingNodes; /**indicates the next selected moving nodes that should be spawned as job.*/ unsigned int m_nextNodeToSpawn; // boolean variables to control visibility of GUI elements bool m_CanLoadAlgorithm; bool m_ValidInputs; bool m_Working; Ui::MatchPointAdvancedControls m_Controls; }; #endif // MatchPoint_h diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/org_mitk_gui_qt_matchpoint_algorithm_batch_Activator.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/org_mitk_gui_qt_matchpoint_algorithm_batch_Activator.h index a278e18769..05ef1324c4 100644 --- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/org_mitk_gui_qt_matchpoint_algorithm_batch_Activator.h +++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.batch/src/internal/org_mitk_gui_qt_matchpoint_algorithm_batch_Activator.h @@ -1,43 +1,43 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_matchpoint_algorithm_batchprocessing_Activator_h #define org_mitk_gui_qt_matchpoint_algorithm_batchprocessing_Activator_h #include <ctkPluginActivator.h> class org_mitk_gui_qt_matchpoint_algorithm_batchprocessing_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_matchpoint_algorithm_batchprocessing") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static ctkPluginContext* GetContext(); private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_matchpoint_algorithm_batchprocessing_Activator #endif // org_mitk_gui_qt_matchpoint_algorithm_batchprocessing_Activator_h diff --git a/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h b/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h index 4df318e7b6..fb68855097 100644 --- a/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h +++ b/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h @@ -1,113 +1,113 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED #define _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED #include <QmitkAbstractView.h> #include <berryIStructuredSelection.h> #include <string> #include "ui_QmitkMITKSurfaceMaterialEditorViewControls.h" /* #include <QtCore/QVariant> #include <QtGui/QAction> #include <QtGui/QApplication> #include <QtGui/QButtonGroup> #include <QtGui/QVBoxLayout> #include <QtGui/QWidget> #include "QtGui/QMenubarUpdatedEvent" */ #include "QmitkRenderWindow.h" #include "mitkCommon.h" #include "mitkDataStorage.h" #include "mitkDataNode.h" #include "mitkSurface.h" #include "vtkRenderer.h" #include "vtkTextActor.h" /*! \brief QmitkMITKSurfaceMaterialEditorView */ class QmitkMITKSurfaceMaterialEditorView : public QmitkAbstractView { // 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(); + ~QmitkMITKSurfaceMaterialEditorView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// \brief Creation of the connections of main and control widget virtual void CreateConnections(); /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; protected slots: void SurfaceSelected(); protected: Ui::QmitkMITKSurfaceMaterialEditorViewControls* m_Controls; private: mitk::Surface::Pointer m_Surface; mitk::DataStorage::Pointer m_DataTree; mitk::DataNode::Pointer m_DataNode; mitk::DataNode::Pointer m_SelectedDataNode; std::list<std::string> fixedProperties; std::list<std::string> shaderProperties; unsigned long observerIndex; bool observerAllocated; void InitPreviewWindow(); int usedTimer; void timerEvent( QTimerEvent *e ) override; void RefreshPropertiesList(); void postRefresh(); void shaderEnumChange(const itk::Object *caller, const itk::EventObject &event); berry::IStructuredSelection::ConstPointer m_CurrentSelection; }; #endif // _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h index 08b617db8d..cbe79e2eb0 100644 --- a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h +++ b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h @@ -1,121 +1,121 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical Image Computing. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKMXNMULTIWIDGETEDITOR_H #define QMITKMXNMULTIWIDGETEDITOR_H #include <QmitkAbstractRenderEditor.h> #include <mitkILinkedRenderWindowPart.h> #include <org_mitk_gui_qt_mxnmultiwidgeteditor_Export.h> // berry #include <berryIPartListener.h> #include <mitkInteractionSchemeSwitcher.h> #include <memory> class QmitkMxNMultiWidget; class MXNMULTIWIDGETEDITOR_EXPORT QmitkMxNMultiWidgetEditor final : public QmitkAbstractRenderEditor, public berry::IPartListener { Q_OBJECT public: berryObjectMacro(QmitkMxNMultiWidgetEditor) static const QString EDITOR_ID; QmitkMxNMultiWidgetEditor(); - virtual ~QmitkMxNMultiWidgetEditor(); + ~QmitkMxNMultiWidgetEditor() override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual QmitkRenderWindow* GetActiveQmitkRenderWindow() const override; + QmitkRenderWindow* GetActiveQmitkRenderWindow() const override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual QHash<QString, QmitkRenderWindow*> GetQmitkRenderWindows() const override; + QHash<QString, QmitkRenderWindow*> GetQmitkRenderWindows() const override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual QmitkRenderWindow* GetQmitkRenderWindow(const QString& id) const override; + QmitkRenderWindow* GetQmitkRenderWindow(const QString& id) const override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual mitk::Point3D GetSelectedPosition(const QString& id = QString()) const override; + mitk::Point3D GetSelectedPosition(const QString& id = QString()) const override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual void SetSelectedPosition(const mitk::Point3D& pos, const QString& id = QString()) override; + void SetSelectedPosition(const mitk::Point3D& pos, const QString& id = QString()) override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual void EnableDecorations(bool enable, const QStringList& decorations = QStringList()) override; + void EnableDecorations(bool enable, const QStringList& decorations = QStringList()) override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual bool IsDecorationEnabled(const QString& decoration) const override; + bool IsDecorationEnabled(const QString& decoration) const override; /** * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart */ - virtual QStringList GetDecorations() const override; + QStringList GetDecorations() const override; /** * @brief Overridden from berry::IPartListener */ berry::IPartListener::Events::Types GetPartEventTypes() const override; /** * @brief Overridden from berry::IPartListener */ void PartOpened(const berry::IWorkbenchPartReference::Pointer& partRef) override; /** * @brief Overridden from berry::IPartListener */ void PartClosed(const berry::IWorkbenchPartReference::Pointer& partRef) override; /** * @brief Return the current MxN multi widget of this editor. */ QmitkMxNMultiWidget* GetMxNMultiWidget(); private Q_SLOTS: void OnLayoutSet(int row, int column); void OnSynchronize(bool synchronized); void OnInteractionSchemeChanged(mitk::InteractionSchemeSwitcher::InteractionScheme scheme); private: /** * @brief Overridden from QmitkAbstractRenderEditor */ - virtual void SetFocus() override; + void SetFocus() override; /** * @brief Overridden from QmitkAbstractRenderEditor */ - virtual void CreateQtPartControl(QWidget* parent) override; + void CreateQtPartControl(QWidget* parent) override; /** * @brief Overridden from QmitkAbstractRenderEditor */ - virtual void OnPreferencesChanged(const berry::IBerryPreferences* preferences) override; + void OnPreferencesChanged(const berry::IBerryPreferences* preferences) override; class Impl; const std::unique_ptr<Impl> m_Impl; }; #endif // QMITKMXNMULTIWIDGETEDITOR_H diff --git a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h index 3dfa1e002b..8eb7d973c2 100644 --- a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h @@ -1,80 +1,80 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H #define QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H #include "ui_QmitkMxNMultiWidgetEditorPreferencePage.h" #include <berryIPreferences.h> #include <berryIQtPreferencePage.h> #include <QProcess> #include <QScopedPointer> #include <QPushButton> class QmitkMxNMultiWidgetEditorPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkMxNMultiWidgetEditorPreferencePage(); - ~QmitkMxNMultiWidgetEditorPreferencePage(); + ~QmitkMxNMultiWidgetEditorPreferencePage() override; void Init(berry::IWorkbench::Pointer) override; void CreateQtControl(QWidget* parent) override; QWidget* GetQtControl() const override; bool PerformOk() override; void PerformCancel() override; void Update() override; public slots: /** * @brief ResetColors set default colors and refresh the GUI. */ void ResetPreferencesAndGUI(); /** * @brief ChangeRenderingMode slot to chose the rendering mode via QComboBox. * @param i index of the box. */ void ChangeRenderingMode(int i); void ChangeColormap(int i); protected: /** * @brief m_CurrentRenderingMode String for the rendering mode. */ std::string m_CurrentRenderingMode; std::string m_CurrentColormap; /** * @brief m_Preferences the berry preferences. */ berry::IPreferences::Pointer m_Preferences; private: Ui::QmitkMxNMultiWidgetEditorPreferencePage m_Ui; QWidget* m_MainControl; }; #endif // QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H diff --git a/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h b/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h index 65989cdbed..e78430694b 100644 --- a/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h +++ b/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h @@ -1,73 +1,73 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkOpenIGTLinkManager_h #define QmitkOpenIGTLinkManager_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_QmitkOpenIGTLinkManagerControls.h" #include "mitkIGTLClient.h" #include "mitkIGTLDeviceSource.h" /** \brief OpenIGTLinkManager \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkOpenIGTLinkManager : public QmitkAbstractView { // 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; QmitkOpenIGTLinkManager(); - virtual ~QmitkOpenIGTLinkManager(); + ~QmitkOpenIGTLinkManager() override; public slots: void NewSourceByWidget(mitk::IGTLDeviceSource::Pointer source, std::string); void SourceSelected(mitk::IGTLDeviceSource::Pointer source); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; void CreatePipeline(); void DestroyPipeline(); Ui::QmitkOpenIGTLinkManagerControls m_Controls; /** Someone needs to hold the smart pointers of new sources, otherwise the * objects will be lost although they are listed as microservice. */ std::vector<mitk::IGTLDeviceSource::Pointer> m_AllSourcesHandledByThisWidget; mitk::IGTLDevice::Pointer m_CurrentIGTLDevice; }; #endif // OpenIGTLinkManager_h diff --git a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkAddNewPropertyDialog.h b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkAddNewPropertyDialog.h index d50a89c1d1..ccf660fe41 100644 --- a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkAddNewPropertyDialog.h +++ b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkAddNewPropertyDialog.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkAddNewPropertyDialog_h #define QmitkAddNewPropertyDialog_h #include <QDialog> #include <mitkAnnotation.h> #include <mitkBaseProperty.h> #include <mitkBaseRenderer.h> #include <ui_QmitkAddNewPropertyDialog.h> class QmitkAddNewPropertyDialog : public QDialog { Q_OBJECT public: explicit QmitkAddNewPropertyDialog(mitk::Annotation::Pointer overlay, mitk::BaseRenderer::Pointer renderer = nullptr, QWidget *parent = nullptr); - ~QmitkAddNewPropertyDialog(); + ~QmitkAddNewPropertyDialog() override; private slots: void AddNewProperty(); void ShowAdequateValueWidget(const QString &type); bool ValidateValue(); private: mitk::BaseProperty::Pointer CreateProperty() const; void Initialize(); Ui::QmitkAddNewPropertyDialog m_Controls; mitk::Annotation::Pointer m_Overlay; mitk::BaseRenderer::Pointer m_Renderer; }; #endif diff --git a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h index 46cc49b709..f1112ee23f 100644 --- a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h +++ b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h @@ -1,125 +1,125 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkOverlayManagerView_h #define QmitkOverlayManagerView_h #include <berryISelectionListener.h> #include "mitkAnnotation.h" #include "mitkILifecycleAwarePart.h" #include "ui_QmitkOverlayManagerViewControls.h" #include <QmitkAbstractView.h> #include <mitkIRenderWindowPartListener.h> class QmitkPropertyItemDelegate; class QmitkPropertyItemModel; class QSortFilterProxyModel; namespace mitk { class IPropertyAliases; class IPropertyDescriptions; class IPropertyPersistence; } /** \brief QmitkOverlayManagerView allows to view all overlays added to the mitk::OverlayManager. Properties of these overlays can be modified. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkOverlayManagerView : public QmitkAbstractView, public mitk::IRenderWindowPartListener, public mitk::ILifecycleAwarePart { // 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: typedef std::map<std::string, mitk::Annotation::Pointer> OverlayMapType; static const std::string VIEW_ID; QmitkOverlayManagerView(); - ~QmitkOverlayManagerView(); + ~QmitkOverlayManagerView() override; protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override; void RenderWindowPartDeactivated(mitk::IRenderWindowPart *) override; Ui::QmitkOverlayManagerViewControls m_Controls; void OnFocusChanged(itk::Object *, const itk::EventObject &event); private slots: void OnCurrentRowChanged(const QModelIndex ¤t, const QModelIndex &previous); void OnPropertyListChanged(int index); void OnAddNewProperty(); void OnActivateOverlayList(); void OnOverlaySelectionChanged(QListWidgetItem *current, QListWidgetItem *); void OnDelete(); void OnAddOverlay(); private: mitk::Annotation::Pointer CreateTextOverlay2D(); mitk::Annotation::Pointer CreateTextOverlay3D(); mitk::Annotation::Pointer CreateLabelOverlay(); mitk::Annotation::Pointer CreateColorBarOverlay(); mitk::Annotation::Pointer CreateScaleLegendOverlay(); mitk::Annotation::Pointer CreateLogoOverlay(); QString GetPropertyNameOrAlias(const QModelIndex &index); void OnPropertyNameChanged(const itk::EventObject &event); void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes) override; void InitializeAddOverlayMenu(); /** \see berry::IPartListener::PartActivated */ - virtual void Activated(); + void Activated() override; /** \see berry::IPartListener::PartDeactivated */ - virtual void Deactivated(); + void Deactivated() override; /** \see berry::IPartListener::PartVisible */ - virtual void Visible(); + void Visible() override; /** \see berry::IPartListener::PartHidden */ - virtual void Hidden(); + void Hidden() override; QWidget *m_Parent; unsigned long m_PropertyNameChangedTag; unsigned long m_OverlayManagerObserverTag; std::string m_SelectionClassName; mitk::IPropertyAliases *m_PropertyAliases; mitk::IPropertyDescriptions *m_PropertyDescriptions; mitk::IPropertyPersistence *m_PropertyPersistence; QSortFilterProxyModel *m_ProxyModel; QmitkPropertyItemModel *m_Model; QmitkPropertyItemDelegate *m_Delegate; mitk::Annotation::Pointer m_SelectedOverlay; mitk::BaseRenderer *m_Renderer; QMenu *m_AddOverlayMenu; unsigned long m_RenderWindowFocusObserverTag; OverlayMapType m_OverlayMap; }; #endif // QmitkOverlayManagerView_h diff --git a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/org_mitk_gui_qt_overlaymanager_Activator.h b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/org_mitk_gui_qt_overlaymanager_Activator.h index 41ef3c946a..ef72685019 100644 --- a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/org_mitk_gui_qt_overlaymanager_Activator.h +++ b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/org_mitk_gui_qt_overlaymanager_Activator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_overlaymanager_Activator_h #define org_mitk_gui_qt_overlaymanager_Activator_h #include <ctkPluginActivator.h> namespace mitk { class org_mitk_gui_qt_overlaymanager_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_overlaymanager") Q_INTERFACES(ctkPluginActivator) public: static ctkPluginContext* GetContext(); - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; private: static ctkPluginContext* m_Context; }; // org_mitk_gui_qt_overlaymanager_Activator } #endif // org_mitk_gui_qt_overlaymanager_Activator_h diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/ConcentrationCurveConverterView.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/ConcentrationCurveConverterView.h index 0574104ef8..f6e7b8d0cf 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/ConcentrationCurveConverterView.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/ConcentrationCurveConverterView.h @@ -1,103 +1,103 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ConcentrationCurveConverterView_h #define ConcentrationCurveConverterView_h #include <QString> #include <QmitkAbstractView.h> #include "ui_ConcentrationCurveConverterViewControls.h" #include <mitkImage.h> /*! * @brief Test Plugin for SUV calculations of PET images */ class ConcentrationCurveConverterView : public QmitkAbstractView { Q_OBJECT public: // typedef itk::Image<unsigned short,3> ImageType; typedef itk::Image<double,3> ConvertedImageType; /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; ConcentrationCurveConverterView(); protected slots: /*! * @brief Is triggered of the update button is clicked and the selected node should get the (new) iso level set. */ void OnConvertToConcentrationButtonClicked(); void OnSettingChanged(); bool CheckSettings() const; protected: // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - void SetFocus(); + void SetFocus() override; /*! Helper method that adds an concentration image as child node to the current m_selectedNode and returns this new child node.*/ mitk::DataNode::Pointer AddConcentrationImage(mitk::Image* image, std::string nodeName) const; /*! \brief called by QmitkFunctionality when DataManager's selection has changed */ - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& nodes); + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& nodes) override; // Variables /*! @brief The view's UI controls */ Ui::ConcentrationCurveConverterViewControls m_Controls; mitk::DataNode::Pointer m_selectedNode; mitk::Image::Pointer m_selectedImage; mitk::DataNode::Pointer m_selectedBaselineNode; mitk::Image::Pointer m_selectedBaselineImage; private: /**Converts the selected image to a concentration image based on the given gui settings.*/ mitk::Image::Pointer Convert4DConcentrationImage(mitk::Image::Pointer inputImage); mitk::Image::Pointer Convert3DConcentrationImage(mitk::Image::Pointer inputImage, mitk::Image::Pointer baselineImage); mitk::Image::Pointer ConvertT2ConcentrationImgage(mitk::Image::Pointer inputImage); }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/org_mitk_ConcentrationCurveConverterView_Activator.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/org_mitk_ConcentrationCurveConverterView_Activator.h index 85b05bf091..497f394402 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/org_mitk_ConcentrationCurveConverterView_Activator.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.concentration.mri/src/internal/org_mitk_ConcentrationCurveConverterView_Activator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_ConcentrationCurveConverterView_Activator_h #define org_mitk_ConcentrationCurveConverterView_Activator_h #include <ctkPluginActivator.h> class org_mitk_ConcentrationCurveConverterView_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pharmacokinetics_concentration_mri") Q_INTERFACES(ctkPluginActivator) public: /*! * @brief Registers the plug-in. Gets called by the framework when the plug-in is * first loaded. * @param context The corresponding CTK plug-in context in which the plug-in is loaded. */ - void start(ctkPluginContext* context); + void start(ctkPluginContext* context) override; /*! * @brief Deregisters the plug-in. Gets called by the framework when the plug-in * is unloaded. * @param context The corresponding CTK plug-in context in which the plug-in was loaded. */ - void stop(ctkPluginContext* context); + void stop(ctkPluginContext* context) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/PerfusionCurveDescriptionParameterView.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/PerfusionCurveDescriptionParameterView.h index b7ef3c55b0..3769bca8b9 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/PerfusionCurveDescriptionParameterView.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/PerfusionCurveDescriptionParameterView.h @@ -1,110 +1,110 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PerfusionCurveDescriptionParameterView_h #define PerfusionCurveDescriptionParameterView_h #include <QString> #include <QmitkAbstractView.h> #include "ui_PerfusionCurveDescriptionParameterViewControls.h" #include "mitkCurveDescriptionParameterBase.h" #include <QmitkDescriptionParameterBackgroundJob.h> #include <mitkImage.h> namespace mitk { class CurveParameterFunctor; } /*! * @brief Test Plugin for SUV calculations of PET images */ class PerfusionCurveDescriptionParameterView : public QmitkAbstractView { Q_OBJECT public: typedef mitk::CurveDescriptionParameterBase::CurveDescriptionParameterNameType ParameterNameType; /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; PerfusionCurveDescriptionParameterView(); protected slots: void InitParameterList(); void OnJobFinished(); void OnJobError(QString err); void OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType results, const DescriptionParameterBackgroundJob* pJob); void OnJobProgress(double progress); void OnJobStatusChanged(QString info); /*! * @brief Is triggered of the update button is clicked and the selected node should get the (new) iso level set. */ void OnCalculateParametersButtonClicked(); protected: // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - void SetFocus(); + void SetFocus() override; /** Configures the passed functor according to the selected image and parameters*/ void ConfigureFunctor(mitk::CurveParameterFunctor* functor) const; /*! \brief called by QmitkFunctionality when DataManager's selection has changed */ - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer>& nodes) override; // Variables /*! @brief The view's UI controls */ Ui::PerfusionCurveDescriptionParameterViewControls m_Controls; mitk::DataNode::Pointer m_selectedNode; private: typedef std::map<ParameterNameType, mitk::CurveDescriptionParameterBase::Pointer > ParameterMapType; ParameterMapType m_ParameterMap; mitk::Image::Pointer m_selectedImage; mitk::Image::Pointer m_selectedMask; }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/org_mitk_PerfusionCurveDescriptionParameterView_Activator.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/org_mitk_PerfusionCurveDescriptionParameterView_Activator.h index 7f9c25b53c..9066329ee5 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/org_mitk_PerfusionCurveDescriptionParameterView_Activator.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.curvedescriptor/src/internal/org_mitk_PerfusionCurveDescriptionParameterView_Activator.h @@ -1,53 +1,53 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_PerfusionCurveDescriptionParameterView_Activator_h #define org_mitk_PerfusionCurveDescriptionParameterView_Activator_h #include <ctkPluginActivator.h> namespace mitk { /*! * @brief Activator class for the @ref CurveDescriptorParameterView. * @details This small helper class is necessary for the integration as a CTK plug-in. * @author Sascha Diatschuk */ class org_mitk_PerfusionCurveDescriptionParameterView_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pharmacokinetics_curvedescriptor") Q_INTERFACES(ctkPluginActivator) public: /*! * @brief Registers the plug-in. Gets called by the framework when the plug-in is * first loaded. * @param context The corresponding CTK plug-in context in which the plug-in is loaded. */ - void start(ctkPluginContext* context); + void start(ctkPluginContext* context) override; /*! * @brief Deregisters the plug-in. Gets called by the framework when the plug-in * is unloaded. * @param context The corresponding CTK plug-in context in which the plug-in was loaded. */ - void stop(ctkPluginContext* context); + void stop(ctkPluginContext* context) override; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.h index 7a67e7400b..f3e5094cfb 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/MRPerfusionView.h @@ -1,212 +1,212 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MRPerfusionView_h #define MRPerfusionView_h #include <QString> #include "QmitkAbstractView.h" #include "itkCommand.h" #include "ui_MRPerfusionViewControls.h" #include "mitkModelBase.h" #include "QmitkParameterFitBackgroundJob.h" #include "mitkModelFitResultHelper.h" #include "mitkModelFactoryBase.h" #include "mitkLevenbergMarquardtModelFitFunctor.h" #include "mitkSimpleBarrierConstraintChecker.h" #include "mitkAIFBasedModelBase.h" /*! * @brief Test Plugin for SUV calculations of PET images */ class MRPerfusionView : public QmitkAbstractView { Q_OBJECT public: /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; MRPerfusionView(); protected slots: void OnModellingButtonClicked(); void OnJobFinished(); void OnJobError(QString err); void OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType results, const ParameterFitBackgroundJob* pJob); void OnJobProgress(double progress); void OnJobStatusChanged(QString info); void OnModellSet(int); void LoadAIFfromFile(); /**Sets visibility and enabled state of the GUI depending on the settings and workflow state.*/ void UpdateGUIControls(); protected: typedef QList<mitk::DataNode*> SelectedDataNodeVectorType; // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - void SetFocus(); + void SetFocus() override; /*! @brief Generates a configured fit generator and the corresponding modelinfo for a descriptive brix model with pixel based strategy. * @remark add GenerateFunction for each model in the Combo box*/ void GenerateDescriptiveBrixModel_PixelBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); void GenerateDescriptiveBrixModel_ROIBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); void Generate3StepLinearModelFit_PixelBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); void Generate3StepLinearModelFit_ROIBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); template <typename TParameterizer> void GenerateAIFbasedModelFit_ROIBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); template <typename TParameterizer> void GenerateAIFbasedModelFit_PixelBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); /** Helper function that configures the initial parameter strategy of a parameterizer according to the settings of the GUI.*/ void ConfigureInitialParametersOfParameterizer(mitk::ModelParameterizerBase* parameterizer) const; /*! Starts the fitting job with the passed generator and session info*/ void DoFit(const mitk::modelFit::ModelFitInfo* fitSession, mitk::ParameterFitImageGeneratorBase* generator); /**Checks if the settings in the GUI are valid for the chosen model.*/ bool CheckModelSettings() const; void InitModelComboBox() const; /*! Helper method that generates a node for the passed concentration image.*/ mitk::DataNode::Pointer GenerateConcentrationNode(mitk::Image* image, const std::string& nodeName) const; /*! \brief called by QmitkFunctionality when DataManager's selection has changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& selectedNodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& selectedNodes) override; // Variables /*! @brief The view's UI controls */ Ui::MRPerfusionViewControls m_Controls; /* Nodes selected by user/ui for the fit */ mitk::DataNode::Pointer m_selectedNode; mitk::DataNode::Pointer m_selectedMaskNode; mitk::DataNode::Pointer m_selectedAIFMaskNode; mitk::DataNode::Pointer m_selectedAIFImageNode; /* Images selected by user/ui for the fit */ mitk::Image::Pointer m_selectedImage; mitk::Image::Pointer m_selectedMask; mitk::Image::Pointer m_selectedAIFMask; mitk::Image::Pointer m_selectedAIFImage; mitk::ModelFactoryBase::Pointer m_selectedModelFactory; mitk::SimpleBarrierConstraintChecker::Pointer m_modelConstraints; private: bool IsTurboFlashSequenceFlag() const; bool m_FittingInProgress; typedef std::vector<mitk::ModelFactoryBase::Pointer> ModelFactoryStackType; ModelFactoryStackType m_FactoryStack; /**Converts the selected image to a concentration image based on the given gui settings. AIFMode controls if the concentration image for the fit input or the AIF will be converted.*/ mitk::Image::Pointer ConvertConcentrationImage(bool AIFMode); /**Helper function that (depending on the gui settings) prepares m_inputNode and m_inputImage. Either by directly pass back the selected image/node or the newly generated concentration image/node. After calling this method m_inputImage are always what should be used as input image for the fitting.*/ void PrepareConcentrationImage(); /**Helper function that (depending on the gui settings) prepares m_inputAIFNode and m_inputAIFImage. Either by directly pass back the selected image/node or the newly generated concentration image/node. After calling this method m_inputAIFImage are always what should be used as AIF image for the fitting.*/ void PrepareAIFConcentrationImage(); /**Helper function that (depending on the gui settings) generates and passes back the AIF and its time grid that should be used for fitting. @remark the parameters aif and aifTimeGrid will be initialized accordingly if the method returns.*/ void GetAIF(mitk::AIFBasedModelBase::AterialInputFunctionType& aif, mitk::AIFBasedModelBase::AterialInputFunctionType& aifTimeGrid); /**Helper function that generates a default fitting functor * default is a levenberg marquart based optimizer with all scales set to 1.0. * Constraint setter will be set based on the gui setting and a evaluation parameter * "sum of squared differences" will always be set.*/ mitk::ModelFitFunctorBase::Pointer CreateDefaultFitFunctor(const mitk::ModelParameterizerBase* parameterizer) const; /**Returns the default fit name, derived from the current GUI settings.*/ std::string GetDefaultFitName() const; /**Returns the current set name of the fit (either default name or use defined name).*/ std::string GetFitName() const; std::vector<double> AIFinputGrid; std::vector<double> AIFinputFunction; mitk::NodePredicateBase::Pointer m_IsNoMaskImagePredicate; mitk::NodePredicateBase::Pointer m_IsMaskPredicate; /* Node used for the fit (my be the selected image or converted ones (depending on the ui settings */ mitk::DataNode::Pointer m_inputNode; mitk::DataNode::Pointer m_inputAIFNode; bool m_HasGeneratedNewInput; bool m_HasGeneratedNewInputAIF; /* Image used for the fit (my be the selected image or converted ones (depending on the ui settings */ mitk::Image::Pointer m_inputImage; mitk::Image::Pointer m_inputAIFImage; }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/org_mitk_MRPerfusionView_Activator.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/org_mitk_MRPerfusionView_Activator.h index 9fb289d5b9..3955a20625 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/org_mitk_MRPerfusionView_Activator.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.mri/src/internal/org_mitk_MRPerfusionView_Activator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_MRPerfusionView_Activator_h #define org_mitk_MRPerfusionView_Activator_h #include <ctkPluginActivator.h> class org_mitk_MRPerfusionView_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pharmacokinetics_mri") Q_INTERFACES(ctkPluginActivator) public: /*! * @brief Registers the plug-in. Gets called by the framework when the plug-in is * first loaded. * @param context The corresponding CTK plug-in context in which the plug-in is loaded. */ - void start(ctkPluginContext* context); + void start(ctkPluginContext* context) override; /*! * @brief Deregisters the plug-in. Gets called by the framework when the plug-in * is unloaded. * @param context The corresponding CTK plug-in context in which the plug-in was loaded. */ - void stop(ctkPluginContext* context); + void stop(ctkPluginContext* context) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.h index ababc97ded..e59e3dd316 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/PETDynamicView.h @@ -1,176 +1,176 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PETDynamicView_h #define PETDynamicView_h #include <QString> #include "QmitkAbstractView.h" #include "itkCommand.h" #include "ui_PETDynamicViewControls.h" #include "mitkModelBase.h" #include "QmitkParameterFitBackgroundJob.h" #include "mitkModelFitResultHelper.h" #include "mitkModelFactoryBase.h" #include "mitkLevenbergMarquardtModelFitFunctor.h" #include "mitkSimpleBarrierConstraintChecker.h" #include "mitkAIFBasedModelBase.h" /*! * @brief Test Plugin for SUV calculations of PET images */ class PETDynamicView : public QmitkAbstractView { Q_OBJECT public: /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; PETDynamicView(); protected slots: void OnModellingButtonClicked(); void OnJobFinished(); void OnJobError(QString err); void OnJobResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType results, const ParameterFitBackgroundJob* pJob); void OnJobProgress(double progress); void OnJobStatusChanged(QString info); void OnModellSet(int); void LoadAIFfromFile(); // void OnModelSettingChanged(); void UpdateGUIControls(); protected: typedef QList<mitk::DataNode*> SelectedDataNodeVectorType; // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - void SetFocus(); + void SetFocus() override; /*! @brief Generates a configured fit generator and the corresponding modelinfo for a descriptive brix model with pixel based strategy. * @remark add GenerateFunction for each model in the Combo box*/ template <typename TParameterizer> void GenerateModelFit_ROIBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); template <typename TParameterizer> void GenerateModelFit_PixelBased(mitk::modelFit::ModelFitInfo::Pointer& modelFitInfo, mitk::ParameterFitImageGeneratorBase::Pointer& generator); /** Helper function that configures the initial parameter strategy of a parameterizer according to the settings of the GUI.*/ void ConfigureInitialParametersOfParameterizer(mitk::ModelParameterizerBase* parameterizer) const; /*! Starts the fitting job with the passed generator and session info*/ void DoFit(const mitk::modelFit::ModelFitInfo* fitSession, mitk::ParameterFitImageGeneratorBase* generator); bool CheckModelSettings() const; void InitModelComboBox() const; /*! \brief called by QmitkFunctionality when DataManager's selection has changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& selectedNodes); + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& selectedNodes) override; /*! @brief The view's UI controls */ Ui::PETDynamicViewControls m_Controls; mitk::DataNode::Pointer m_selectedNode; mitk::DataNode::Pointer m_selectedMaskNode; mitk::DataNode::Pointer m_selectedAIFMaskNode; mitk::DataNode::Pointer m_selectedAIFImageNode; mitk::Image::Pointer m_selectedImage; mitk::Image::Pointer m_selectedMask; mitk::Image::Pointer m_selectedAIFMask; mitk::Image::Pointer m_selectedAIFImage; /* Node used for the fit (my be the selected image or converted ones (depending on the ui settings */ mitk::DataNode::Pointer m_inputNode; mitk::DataNode::Pointer m_inputAIFNode; /* Image used for the fit (my be the selected image or converted ones (depending on the ui settings */ mitk::Image::Pointer m_inputImage; mitk::Image::Pointer m_inputAIFImage; mitk::ModelFactoryBase::Pointer m_selectedModelFactory; mitk::SimpleBarrierConstraintChecker::Pointer m_modelConstraints; private: bool m_FittingInProgress; typedef std::vector<mitk::ModelFactoryBase::Pointer> ModelFactoryStackType; ModelFactoryStackType m_FactoryStack; /**Helper function that (depending on the gui settings) generates and passes back the AIF and its time grid that should be used for fitting. @remark the parameters aif and aifTimeGrid will be initialized accordingly if the method returns.*/ void GetAIF(mitk::AIFBasedModelBase::AterialInputFunctionType& aif, mitk::AIFBasedModelBase::AterialInputFunctionType& aifTimeGrid); /**Helper function that generates a default fitting functor * default is a levenberg marquart based optimizer with all scales set to 1.0. * Constraint setter will be set based on the gui setting and a evaluation parameter * "sum of squared differences" will always be set.*/ mitk::ModelFitFunctorBase::Pointer CreateDefaultFitFunctor(const mitk::ModelParameterizerBase* parameterizer) const; /**Returns the default fit name, derived from the current GUI settings.*/ std::string GetDefaultFitName() const; /**Returns the current set name of the fit (either default name or use defined name).*/ std::string GetFitName() const; std::vector<double> AIFinputGrid; std::vector<double> AIFinputFunction; mitk::NodePredicateBase::Pointer m_IsNoMaskImagePredicate; mitk::NodePredicateBase::Pointer m_IsMaskPredicate; }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/org_mitk_PETDynamicView_Activator.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/org_mitk_PETDynamicView_Activator.h index 8d365615ee..910c82acfc 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/org_mitk_PETDynamicView_Activator.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.pet/src/internal/org_mitk_PETDynamicView_Activator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_PETDynamicView_Activator_h #define org_mitk_PETDynamicView_Activator_h #include <ctkPluginActivator.h> class org_mitk_PETDynamicView_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pharmacokinetics_pet") Q_INTERFACES(ctkPluginActivator) public: /*! * @brief Registers the plug-in. Gets called by the framework when the plug-in is * first loaded. * @param context The corresponding CTK plug-in context in which the plug-in is loaded. */ - void start(ctkPluginContext* context); + void start(ctkPluginContext* context) override; /*! * @brief Deregisters the plug-in. Gets called by the framework when the plug-in * is unloaded. * @param context The corresponding CTK plug-in context in which the plug-in was loaded. */ - void stop(ctkPluginContext* context); + void stop(ctkPluginContext* context) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h index 3c90e4fd22..5b3a6b2e82 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/PerfusionDataSimulationView.h @@ -1,133 +1,133 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PerfusionDataSimulationView_h #define PerfusionDataSimulationView_h #include <QString> #include <QmitkAbstractView.h> #include "ui_PerfusionDataSimulationViewControls.h" #include "mitkModelBase.h" #include <mitkModelFactoryBase.h> #include "itkArray.h" #include "mitkImage.h" #include <mitkImage.h> /*! * @brief Test Plugin for SUV calculations of PET images */ class PerfusionDataSimulationView : public QmitkAbstractView { Q_OBJECT public: /*! @brief The view's unique ID - required by MITK */ static const std::string VIEW_ID; PerfusionDataSimulationView(); protected slots: /*! * @brief Is triggered of the update button is clicked and the selected node should get the (new) iso level set. */ void OnGenerateDataButtonClicked(); void LoadAIFFile(); void OnModellSet(int); void OnSimulationConfigurationChanged(); void UpdateDataSelection(); protected: typedef std::map<std::string, mitk::Image::Pointer> ParameterMapType; // Overridden base class functions /*! * @brief Sets up the UI controls and connects the slots and signals. Gets * called by the framework to create the GUI at the right time. * @param[in,out] parent The parent QWidget, as this class itself is not a QWidget * subclass. */ - void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /*! * @brief Sets the focus to the plot curve button. Gets called by the framework to set the * focus on the right widget. */ - void SetFocus(); + void SetFocus() override; void InitModelComboBox() const; mitk::Image::Pointer Generate2CXModelData(); mitk::Image::Pointer GenerateNumeric2CXModelData(); mitk::Image::Pointer GenerateETModelData(); void FillParameterMap2CXM(); void FillParameterMapNumeric2CXM(); void FillParameterMapETM(); ///////////////////// dynamic PET Models/////////////// mitk::Image::Pointer Generate2TCModelData(); mitk::Image::Pointer Generate1TCModelData(); void FillParameterMap2TCM(); void FillParameterMap1TCM(); bool CheckModelSettings(); /*! \brief called by QmitkFunctionality when DataManager's selection has changed */ // virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, // const QList<mitk::DataNode::Pointer>& selectedNodes); // Variables /*! @brief The view's UI controls */ Ui::PerfusionDataSimulationViewControls m_Controls; mitk::DataNode::Pointer m_selectedNode; ParameterMapType m_ParameterImageMap; itk::Array<double> m_AterialInputFunction; itk::Array<double> m_TimeGrid; mitk::ModelFactoryBase::Pointer m_selectedModelFactory; private: typedef std::vector<mitk::ModelFactoryBase::Pointer> ModelFactoryStackType; ModelFactoryStackType m_FactoryStack; mitk::NodePredicateBase::Pointer m_IsNotABinaryImagePredicate; double m_CNR, m_MaxConcentration, m_Sigma; }; #endif diff --git a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/org_mitk_PerfusionDataSimulationView_Activator.h b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/org_mitk_PerfusionDataSimulationView_Activator.h index faa534d6db..ffdfcefb3b 100644 --- a/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/org_mitk_PerfusionDataSimulationView_Activator.h +++ b/Plugins/org.mitk.gui.qt.pharmacokinetics.simulation/src/internal/org_mitk_PerfusionDataSimulationView_Activator.h @@ -1,45 +1,45 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_PerfusionDataSimulationView_Activator_h #define org_mitk_PerfusionDataSimulationView_Activator_h #include <ctkPluginActivator.h> class org_mitk_PerfusionDataSimulationView_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pharmacokinetics_simulation") Q_INTERFACES(ctkPluginActivator) public: /*! * @brief Registers the plug-in. Gets called by the framework when the plug-in is * first loaded. * @param context The corresponding CTK plug-in context in which the plug-in is loaded. */ - void start(ctkPluginContext* context); + void start(ctkPluginContext* context) override; /*! * @brief Deregisters the plug-in. Gets called by the framework when the plug-in * is unloaded. * @param context The corresponding CTK plug-in context in which the plug-in was loaded. */ - void stop(ctkPluginContext* context); + void stop(ctkPluginContext* context) override; }; #endif diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/PAImageProcessing.h b/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/PAImageProcessing.h index 95d9e878f3..5776d1283a 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/PAImageProcessing.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/PAImageProcessing.h @@ -1,247 +1,247 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PAImageProcessing_h #define PAImageProcessing_h #include <mitkPhotoacousticFilterService.h> #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <qthread.h> #include "ui_PAImageProcessingControls.h" #include "mitkBeamformingFilter.h" #include "mitkBeamformingSettings.h" Q_DECLARE_METATYPE(mitk::Image::Pointer) Q_DECLARE_METATYPE(std::string) /*! * \brief Plugin implementing an interface for the Photoacoustic Algorithms Module * * Beamforming, Image processing as B-Mode filtering, cropping, resampling, as well as batch processing can be performed using this plugin. */ class PAImageProcessing : public QmitkAbstractView { // 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; PAImageProcessing(); protected slots: void UpperSliceBoundChanged(); void LowerSliceBoundChanged(); void SliceBoundsEnabled(); void ChangedProbe(); void UseResampling(); void UseLogfilter(); void SetResampling(); void UseImageSpacing(); void UpdateImageInfo(); void UseSignalDelay(); /** \brief Beamforming is being performed in a separate thread to keep the workbench from freezing. */ void StartBeamformingThread(); /** \brief B-mode filtering is being performed in a separate thread to keep the workbench from freezing. */ void StartBmodeThread(); /** \brief Cropping is being performed in a separate thread to keep the workbench from freezing. */ void StartCropThread(); /** \brief Method called when the bandpass thread finishes; * it adds the image to a new data node and registers it to the worbench's data storage */ void HandleResults(mitk::Image::Pointer image, std::string nameExtension); /** \brief Bandpassing is being performed in a separate thread to keep the workbench from freezing. */ void StartBandpassThread(); void UpdateProgress(int progress, std::string progressInfo); void PAMessageBox(std::string message); void BatchProcessing(); void UpdateSaveBoxes(); void ChangedSOSBandpass(); void ChangedSOSBeamforming(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /** \brief called by QmitkFunctionality when DataManager's selection has changed. * On a change some parameters are internally updated to calculate bounds for GUI elements as the slice selector for beamforming or * the bandpass filter settings. */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer>& nodes) override; /** \brief Instance of the GUI controls */ Ui::PAImageProcessingControls m_Controls; float m_ResampleSpacing; bool m_UseLogfilter; std::string m_OldNodeName; /** \brief Method for updating the BFconfig by using a selected image and the GUI configuration. */ mitk::BeamformingSettings::Pointer CreateBeamformingSettings(mitk::Image::Pointer image); void EnableControls(); void DisableControls(); /** \brief Class through which the filters are called. */ mitk::PhotoacousticFilterService::Pointer m_FilterBank; }; class BeamformingThread : public QThread { Q_OBJECT void run() Q_DECL_OVERRIDE; signals: void result(mitk::Image::Pointer, std::string nameExtension); void updateProgress(int, std::string); void message(std::string); public: BeamformingThread() : m_SignalDelay(0) {} void setConfig(mitk::BeamformingSettings::Pointer BFconfig); void setSignalDelay(float delay); void setInputImage(mitk::Image::Pointer image); void setFilterBank(mitk::PhotoacousticFilterService::Pointer filterBank) { m_FilterBank = filterBank; } protected: mitk::BeamformingSettings::Pointer m_BFconfig; mitk::Image::Pointer m_InputImage; int m_Cutoff; float m_SignalDelay; // [us] mitk::PhotoacousticFilterService::Pointer m_FilterBank; }; class BmodeThread : public QThread { Q_OBJECT void run() Q_DECL_OVERRIDE; signals: void result(mitk::Image::Pointer, std::string nameExtension); public: enum BModeMethod { ShapeDetection, Abs }; void setConfig(bool useLogfilter, double resampleSpacing, mitk::PhotoacousticFilterService::BModeMethod method, bool useGPU); void setInputImage(mitk::Image::Pointer image); void setFilterBank(mitk::PhotoacousticFilterService::Pointer filterBank) { m_FilterBank = filterBank; } protected: mitk::Image::Pointer m_InputImage; mitk::PhotoacousticFilterService::BModeMethod m_Method; bool m_UseLogfilter; double m_ResampleSpacing; bool m_UseGPU; mitk::PhotoacousticFilterService::Pointer m_FilterBank; }; class CropThread : public QThread { Q_OBJECT void run() Q_DECL_OVERRIDE; signals: void result(mitk::Image::Pointer, std::string nameExtension); public: void setConfig(unsigned int CutAbove, unsigned int CutBelow, unsigned int CutRight, unsigned int CutLeft, unsigned int CutSliceFirst, unsigned int CutSliceLast); void setInputImage(mitk::Image::Pointer image); void setFilterBank(mitk::PhotoacousticFilterService::Pointer filterBank) { m_FilterBank = filterBank; } protected: mitk::Image::Pointer m_InputImage; unsigned int m_CutAbove; unsigned int m_CutBelow; unsigned int m_CutRight; unsigned int m_CutLeft; unsigned int m_CutSliceLast; unsigned int m_CutSliceFirst; mitk::PhotoacousticFilterService::Pointer m_FilterBank; }; class BandpassThread : public QThread { Q_OBJECT void run() Q_DECL_OVERRIDE; signals: void result(mitk::Image::Pointer, std::string nameExtension); public: void setConfig(float BPHighPass, float BPLowPass, float TukeyAlphaHighPass, float TukeyAlphaLowPass, float TimeSpacing, float SpeedOfSound, bool IsBFImage); void setInputImage(mitk::Image::Pointer image); void setFilterBank(mitk::PhotoacousticFilterService::Pointer filterBank) { m_FilterBank = filterBank; } protected: mitk::Image::Pointer m_InputImage; float m_BPHighPass; float m_BPLowPass; float m_TukeyAlphaHighPass; float m_TukeyAlphaLowPass; float m_TimeSpacing; float m_SpeedOfSound; bool m_IsBFImage; mitk::PhotoacousticFilterService::Pointer m_FilterBank; }; #endif // PAImageProcessing_h diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/org_mitk_gui_qt_photoacoustics_imageprocessing_Activator.h b/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/org_mitk_gui_qt_photoacoustics_imageprocessing_Activator.h index 149114d452..9124d3d40b 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/org_mitk_gui_qt_photoacoustics_imageprocessing_Activator.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.imageprocessing/src/internal/org_mitk_gui_qt_photoacoustics_imageprocessing_Activator.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_photoacoustics_imageprocessing_Activator_h #define org_mitk_gui_qt_photoacoustics_imageprocessing_Activator_h #include <ctkPluginActivator.h> namespace mitk { class org_mitk_gui_qt_photoacoustics_imageprocessing_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_photoacoustics_imageprocessing") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/PAUSMotionCompensation.h b/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/PAUSMotionCompensation.h index d47836b4b1..ce3746a2d6 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/PAUSMotionCompensation.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/PAUSMotionCompensation.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PAUSMotionCompensation_h #define PAUSMotionCompensation_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_PAUSMotionCompensationControls.h" #include "mitkPhotoacousticMotionCorrectionFilter.h" /** \brief PAUSMotionCompensation Photoacoustic and ultrasound image motion correction can be performed with this plugin. Internally OpenCV2 calc OpticalFlowFarneback is used. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class PAUSMotionCompensation : public QmitkAbstractView { // 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; protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer> &nodes) override; /// \brief Called when the user clicks the GUI button void DoImageProcessing(); void DoUpdateParameters(); Ui::PAUSMotionCompensationControls m_Controls; mitk::PhotoacousticMotionCorrectionFilter::Pointer m_Filter = mitk::PhotoacousticMotionCorrectionFilter::New(); }; #endif // PAUSMotionCompensation_h diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator.h b/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator.h index 5321560399..287326f8d6 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.pausmotioncompensation/src/internal/org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator_h #define org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator_h #include <ctkPluginActivator.h> namespace mitk { class org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_photoacoustics_pausmotioncompensation") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext *context); - void stop(ctkPluginContext *context); + void start(ctkPluginContext *context) override; + void stop(ctkPluginContext *context) override; }; // org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator } #endif // org_mitk_gui_qt_photoacoustics_pausmotioncompensation_Activator_h diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.pausviewer/src/QmitkPAUSViewerView.h b/Plugins/org.mitk.gui.qt.photoacoustics.pausviewer/src/QmitkPAUSViewerView.h index f9c4d43a96..2aa2e07dfa 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.pausviewer/src/QmitkPAUSViewerView.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.pausviewer/src/QmitkPAUSViewerView.h @@ -1,74 +1,74 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKPAUSVIEWERVIEW_H_INCLUDED #define QMITKPAUSVIEWERVIEW_H_INCLUDED #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <mitkStandaloneDataStorage.h> #include <mitkBaseRenderer.h> #include "QmitkRenderWindow.h" #include "ui_QmitkPAUSViewerViewControls.h" #include "org_mitk_gui_qt_photoacoustics_pausviewer_Export.h" #include "mitkCommon.h" class PHOTOACOUSTICS_PAUSVIEWER_EXPORTS QmitkPAUSViewerView : public QmitkAbstractView { // 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; QmitkPAUSViewerView(); - virtual ~QmitkPAUSViewerView(); + ~QmitkPAUSViewerView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; void InitWindows(); void SetPADataStorage(mitk::StandaloneDataStorage::Pointer paStore); void SetUSDataStorage(mitk::StandaloneDataStorage::Pointer usStore); vtkRenderWindow* GetPARenderWindow(); vtkRenderWindow* GetUSRenderWindow(); void SetUltrasoundReference(QmitkPAUSViewerView** ultrasoundReference); protected: void AddOverlays(); void RemoveOverlays(); mitk::StandaloneDataStorage::Pointer m_PADataStorage; mitk::StandaloneDataStorage::Pointer m_USDataStorage; mitk::BaseRenderer::Pointer m_PARenderer; mitk::BaseRenderer::Pointer m_USRenderer; - virtual void SetFocus() override; + void SetFocus() override; - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>&) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>&) override; Ui::QmitkPAUSViewerViewControls* m_Controls; QmitkPAUSViewerView** m_UltrasoundReference; }; #endif // QMITKPAUSVIEWERVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/PASimulator.h b/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/PASimulator.h index d6f8492faa..95e699c42e 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/PASimulator.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/PASimulator.h @@ -1,76 +1,76 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PASimulator_h #define PASimulator_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_PASimulatorControls.h" #include "mitkPATissueGenerator.h" #include "mitkPATissueGeneratorParameters.h" #include "mitkPAInSilicoTissueVolume.h" #include "mitkPAPropertyCalculator.h" #include "mitkPASimulationBatchGenerator.h" /** \brief PASimulator \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class PASimulator : public QmitkAbstractView { // 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; protected slots: /// \brief Called when the user clicks the GUI button void DoImageProcessing(); void ClickedCheckboxFixedSeed(); void ClickedRandomizePhysicalParameters(); void OpenFolder(); void OpenBinary(); void UpdateVisibilityOfBatchCreation(); void UpdateParametersAccordingToWavelength(); protected: - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; Ui::PASimulatorControls m_Controls; mitk::pa::PropertyCalculator::Pointer m_PhotoacousticPropertyCalculator; private: mitk::pa::TissueGeneratorParameters::Pointer GetParametersFromUIInput(); }; #endif // PASimulator_h diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/org_mitk_gui_qt_photoacousticsimulation_Activator.h b/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/org_mitk_gui_qt_photoacousticsimulation_Activator.h index deb9da09c3..f17fee4823 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/org_mitk_gui_qt_photoacousticsimulation_Activator.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.simulation/src/internal/org_mitk_gui_qt_photoacousticsimulation_Activator.h @@ -1,36 +1,36 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_photoacousticsimulation_Activator_h #define org_mitk_gui_qt_photoacousticsimulation_Activator_h #include <ctkPluginActivator.h> namespace mitk { class org_mitk_gui_qt_photoacousticsimulation_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_photoacousticsimulation") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; } #endif diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h index a2e43654b8..5421581b3b 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/SpectralUnmixing.h @@ -1,201 +1,201 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef SpectralUnmixing_h #define SpectralUnmixing_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <mitkPASpectralUnmixingFilterBase.h> #include <mitkPASpectralUnmixingSO2.h> #include <chrono> #include "ui_SpectralUnmixingControls.h" /** * \brief The spectral unmixing plugin provides a GUI tool to perform spectral unmixing of multispectral MITK images. * It was designed to unmix beamformed photoacoustic imgaes. The outputs are as well MITK images for every chosen absorber * (endmember). Furthermore it is possible to calculate the oxygen saturation of the multispectral input if the endmembers * oxy- and deoxyhemoglobin are selected in the GUI. * * For further information look at the documentation of the mitkPASpectralUnmixingFilterBase.h * * @exeption if the GenerateOutput method throws a exception the plugin will show a QMessageBox with the exception * message at the GUI */ class SpectralUnmixing : public QmitkAbstractView { // 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; protected: - virtual void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void CreateQtPartControl(QWidget *parent) override; + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer> &nodes) override; /** * \brief Called when the user clicks the GUI button. Checks if the selected data is an image. Then passen on the GUI * information using the Settings method. Afterwards it performs spectral unmixing via the WorkingThreadUpdateFilter * method in a own thread. The spectral unmixing is based on the spectral unmixing filter base and its subclasses. * @exception if nothing is selected. Inform the user and return * @exception if settings fails. Informs with the mitkthorw information of the filter as QMessageBox */ void DoImageProcessing(); /** * \brief slots are there to show/hide input tables for weights-, relative error and SO2 settings ig they are not needed */ public slots: void EnableGUIWeight(); void EnableGUISO2(); void EnableGUIError(); /** * \brief slot waits for finishSignal of the working thread and starts storeOutputs */ public slots: /** * \brief slot does the image post processing * - GetOutput from m_SpectralUnmixingFilter * - calles WriteOutputToDataStorage * - if (true) calls CalculateSO2 * - does the rendering * - if (true) shows the chrono result * - switches the GUI back on */ void storeOutputs(); signals: void finishSignal(); public slots: void EnableGUIControl(); signals: void enableSignal(); /** * \brief slot waits for crashSignal and if neccessary ends working thread and shows QMessageBox with the error message */ public slots: void crashInfo(); signals: void crashSignal(); protected: Ui::SpectralUnmixingControls m_Controls; /** * \brief passes the algorithm information from the GUI on to the spectral unmixing filter base subclass method * "SetAlgortihm" and initializes the subclassFilter::Pointer. * @param algorithm has to be a string which can be assigned to the mitk::pa::LinearSpectralUnmixingFilter::AlgortihmType * @throws if the algorithm string doesn't match to an implemented algorithm */ mitk::pa::SpectralUnmixingFilterBase::Pointer GetFilterInstance(std::string algorithm); bool PluginVerbose = true; mitk::pa::SpectralUnmixingFilterBase::Pointer m_SpectralUnmixingFilter; std::vector<std::string> outputNameVec; std::vector<bool> boolVec; std::string Algorithm; bool sO2Bool; mitk::Image *image; std::chrono::steady_clock::time_point _start; std::string errorMessage; private: /** * \brief thread * - disables GUI * - tries Filter->Update() method * - gives finishSignal which calls storeOutputs * - cathes by enables GUI and gives crashSignal */ void WorkingThreadUpdateFilter(mitk::pa::SpectralUnmixingFilterBase::Pointer m_SpectralUnmixingFilter); /** * \brief takes an MITK image as input and performs spectral unmixing based on the spectral unmixing filter base and its subclasses. * Therefor it first passes all information from the GUI into the filter by using the "set"methods of the plugin, which then are calling * the "add" methods of the filter(base). * @param image has to be an MITK image (pointer). For the request on the image look at the docu of the mitkPASpectralUnmixngFilterBase.h */ virtual void Settings(mitk::Image::Pointer image); /** * \brief The method takes a image pointer and a file name which then will get to the data storage. * @param m_Image is a mitk_::Image::Pointer pointing at the output which one wants to get stored * @param name has to be a string and will be the file name */ virtual void WriteOutputToDataStorage(mitk::Image::Pointer m_Image, std::string name); /** * \brief passes the algorithm information if verbose mode is requested from the GUI on to the spectral unmixing filter * @param m_SpectralUnmixingFilter is a pointer of the spectral unmixing filter base * @param PluginVerbose is the GUI information bool */ virtual void SetVerboseMode(mitk::pa::SpectralUnmixingFilterBase::Pointer m_SpectralUnmixingFilter, bool PluginVerbose); /** * \brief passes the wavelength information from the GUI on to the spectral unmixing filter base method "AddWavelength". * @param m_SpectralUnmixingFilter is a pointer of the spectral unmixing filter base */ virtual void SetWavlength(mitk::pa::SpectralUnmixingFilterBase::Pointer m_SpectralUnmixingFilter); /** * \brief passes the chromophore information from the GUI on to the spectral unmixing filter base method "AddChromophore". * @param m_SpectralUnmixingFilter is a pointer of the spectral unmixing filter base * @param boolVec is a vector which contains the information which chromophore was checked in the GUI * @param chromophoreNameVec contains the names of all chromophores as strings * @throws "PRESS 'IGNORE' AND CHOOSE A CHROMOPHORE!" if no chromophore was chosen */ virtual void SetChromophore(mitk::pa::SpectralUnmixingFilterBase::Pointer m_SpectralUnmixingFilter, std::vector<bool> boolVec, std::vector<std::string> chromophoreNameVec); /** * \brief passes the SetRelativeErrorSettings information from the GUI on to the spectral unmixing filter base method "AddRelativeErrorSettings". * @param m_SpectralUnmixingFilter is a pointer of the spectral unmixing filter base# */ virtual void SetRelativeErrorSettings(mitk::pa::SpectralUnmixingFilterBase::Pointer m_SpectralUnmixingFilter); /** * \brief passes the SetSO2Settings information from the GUI on to the spectral unmixing SO2 filter method "AddSO2Settings". * @param m_sO2 is a pointer of the spectral unmixing SO2 filter */ virtual void SetSO2Settings(mitk::pa::SpectralUnmixingSO2::Pointer m_sO2); /** * \brief calcultes out of two identical sized MITK images the oxygen saturation and stores the result in an image. Herein the two * input images are the output for oxy- and deoxyhemoglobin from the GenerateOutput method (spectral unmixing filter results). * @param m_SpectralUnmixingFilter is a pointer of the spectral unmixing filter base to get the filter output images as sO2 input * @param boolVec is a vector which contains the information which chromophore was checked in the GUI * @throws if oxy- or deoxyhemoglobin was not selected in the GUI */ virtual void CalculateSO2(mitk::pa::SpectralUnmixingFilterBase::Pointer m_SpectralUnmixingFilter, std::vector<bool> boolVec); /** * \brief enables/disables GUI * @param change true means GUI buttons enabled, false disabled respectively */ virtual void SwitchGUIControl(bool change); }; #endif // SpectralUnmixing_h diff --git a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator.h b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator.h index 08d0614225..2dd29d0979 100644 --- a/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator.h +++ b/Plugins/org.mitk.gui.qt.photoacoustics.spectralunmixing/src/internal/org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator.h @@ -1,38 +1,38 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator_h #define org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator_h #include <ctkPluginActivator.h> namespace mitk { class org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_photoacoustics_spectralunmixing") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext *context); - void stop(ctkPluginContext *context); + void start(ctkPluginContext *context) override; + void stop(ctkPluginContext *context) override; }; // org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator } #endif // org_mitk_gui_qt_photoacoustics_spectralunmixing_Activator_h diff --git a/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.h b/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.h index 093a4890c4..692836d43e 100644 --- a/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.h +++ b/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/PointSetInteractionMultispectrum.h @@ -1,94 +1,94 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef PointSetInteractionMultispectrum_h #define PointSetInteractionMultispectrum_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include <qwt_plot.h> #include "ui_PointSetInteractionMultispectrumControls.h" /////////////added from the regiongrowing plugin////////////// #include "mitkPointSet.h" /////// #include "mitkIRenderWindowPartListener.h" /////// #include <itkImage.h> /////// ////////////////////////////////////////////////////////////// /** \brief PointSetInteractionMultispectrum \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \sa QmitkAbstractView \ingroup ${plugin_target}_internal */ class QmitkPointListWidget; class PointSetInteractionMultispectrum : public QmitkAbstractView { // 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; PointSetInteractionMultispectrum(); protected slots: /// \brief Called when the user clicks the GUI button void DoImageProcessing(); protected: void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart); void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart); - virtual void CreateQtPartControl(QWidget *parent); + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus(); + void SetFocus() override; /// \brief called by QmitkFunctionality when DataManager's selection has changed - virtual void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, - const QList<mitk::DataNode::Pointer>& nodes ); + void OnSelectionChanged( berry::IWorkbenchPart::Pointer source, + const QList<mitk::DataNode::Pointer>& nodes ) override; Ui::PointSetInteractionMultispectrumControls m_Controls; private: void PlotReflectance(mitk::PointSet::Pointer m_PointSet, QList<mitk::DataNode::Pointer> dataManagerNodes); mitk::PointSet::Pointer m_PointSet; QmitkPointListWidget* m_PointListWidget; QwtPlot* m_Plot; }; #endif // PointSetInteractionMultispectrum_h diff --git a/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator.h b/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator.h index d15471c14c..49b1159542 100644 --- a/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator.h +++ b/Plugins/org.mitk.gui.qt.pointsetinteractionmultispectrum/src/internal/org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator.h @@ -1,41 +1,41 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator_h #define org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator_h #include <ctkPluginActivator.h> namespace mitk { class org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pointsetinteractionmultispectrum") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; }; // org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator } #endif // org_mitk_gui_qt_pointsetinteractionmultispectrum_Activator_h diff --git a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h index 4551f973ef..7f76bfebef 100644 --- a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h +++ b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h @@ -1,135 +1,135 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QmitkPreprocessingResamplingView_H__INCLUDED) #define QmitkPreprocessingResamplingView_H__INCLUDED #include <QmitkAbstractView.h> #include <org_mitk_gui_qt_preprocessing_resampling_Export.h> #include "ui_QmitkPreprocessingResamplingViewControls.h" #include "QmitkStepperAdapter.h" #include <mitkDataStorageSelection.h> /*! \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 PREPROCESSING_RESAMPLING_EXPORT QmitkPreprocessingResampling : public QmitkAbstractView { Q_OBJECT public: /*! \brief default constructor */ QmitkPreprocessingResampling(); /*! \brief default destructor */ - virtual ~QmitkPreprocessingResampling(); + ~QmitkPreprocessingResampling() override; /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Invoked when the DataManager selection changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>& nodes) override; protected slots: /* * The "Execute" button in the "one image ops" box was triggered */ void StartButtonClicked(); void StartMultipleImagesButtonClicked(); void SelectInterpolator(int interpolator); 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(); /** retrieve the tnc from renderwindow part */ void InternalGetTimeNavigationController(); /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkPreprocessingResamplingViewControls *m_Controls; //mitk::DataNode* m_SelectedImageNode; mitk::DataStorageSelection::Pointer m_SelectedImageNode; QmitkStepperAdapter* m_TimeStepperAdapter; std::vector<mitk::DataNode::Pointer> m_SelectedNodes; enum InterpolationType{ LINEAR, NEAREST, SPLINE } m_SelectedInterpolation; }; #endif // !defined(QmitkBasicImageProcessing_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h b/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h index 41b4bee47a..02b881ee62 100644 --- a/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h +++ b/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h @@ -1,64 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkPythonView_H_ #define QmitkPythonView_H_ /// Qmitk #include <QmitkAbstractView.h> /// /// d pointer forward declaration /// struct QmitkPythonViewData; /// /// \brief New python view (CONSOLE) /// class QmitkPythonView : public QmitkAbstractView { Q_OBJECT public: static const std::string VIEW_ID; // = "org.mitk.extapp.defaultperspective" /// /// \brief Standard ctor. /// QmitkPythonView(); /// /// \brief Standard dtor. /// - virtual ~QmitkPythonView(); + ~QmitkPythonView() override; protected: /// /// \brief Create the view here. /// - virtual void CreateQtPartControl(QWidget* parent); + void CreateQtPartControl(QWidget* parent) override; /// /// focus on load image /// - void SetFocus(); + void SetFocus() override; private: QmitkPythonViewData* d; }; #endif /*QmitkPythonView_H_*/ diff --git a/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h index 1464149858..83c9b713d8 100644 --- a/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h +++ b/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h @@ -1,39 +1,39 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKPLUGINACTIVATOR_H #define MITKPLUGINACTIVATOR_H #include <ctkPluginActivator.h> namespace mitk { class PluginActivator : public QObject, public ctkPluginActivator { Q_OBJECT Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_python") Q_INTERFACES(ctkPluginActivator) public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); + void start(ctkPluginContext* context) override; + void stop(ctkPluginContext* context) override; static QString m_XmlFilePath; }; // PluginActivator } #endif // MITKPLUGINACTIVATOR_H diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h index f54521f569..8dad6a9109 100644 --- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h +++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h @@ -1,107 +1,107 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QmitkRadiomicsArithmetricView_H__INCLUDED) #define QmitkRadiomicsArithmetricView_H__INCLUDED #include <QmitkAbstractView.h> #include <org_mitk_gui_qt_radiomics_Export.h> #include "ui_QmitkRadiomicsArithmetricViewControls.h" #include "QmitkStepperAdapter.h" #include <mitkImage.h> #include <mitkDataStorageSelection.h> #include <usAny.h> class RADIOMICS_EXPORT QmitkRadiomicsArithmetric : public QmitkAbstractView { Q_OBJECT public: /*! \brief default constructor */ QmitkRadiomicsArithmetric(); /*! \brief default destructor */ - virtual ~QmitkRadiomicsArithmetric(); + ~QmitkRadiomicsArithmetric() override; /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Invoked when the DataManager selection changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; protected slots: void TanButton(); void ATanButton(); void CosButton(); void ACosButton(); void SinButton(); void ASinButton(); void SquareButton(); void SqrtButton(); void AbsButton(); void ExpButton(); void ExpNegButton(); void Log10Button(); void AddLeftButton(); void SubLeftButton(); void SubRightButton(); void MulLeftButton(); void DivLeftButton(); void DivRightButton(); void AddButton(); void SubButton(); void MulButton(); void DivButton(); private: /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkRadiomicsArithmetricViewControls *m_Controls; mitk::Image::Pointer GetFirstImage(); mitk::Image::Pointer GetSecondImage(); void AddImageToNode(mitk::Image::Pointer image, std::string nameAddition); }; #endif // !defined(QmitkRadiomicsArithmetric_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h index 18cad18ea5..258f907469 100644 --- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h +++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h @@ -1,97 +1,97 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QmitkRadiomicsMaskProcessingView_H__INCLUDED) #define QmitkRadiomicsMaskProcessingView_H__INCLUDED #include <QmitkAbstractView.h> #include <org_mitk_gui_qt_radiomics_Export.h> #include "ui_QmitkRadiomicsMaskProcessingViewControls.h" #include "QmitkStepperAdapter.h" #include <mitkDataStorageSelection.h> #include <usAny.h> /*! \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. \class QmitkRadiomicsMaskProcessing \author Tobias Schwarz \version 1.0 (3M3) \date 2009-05-10 \ingroup Bundles */ class RADIOMICS_EXPORT QmitkRadiomicsMaskProcessing : public QmitkAbstractView { Q_OBJECT public: /*! \brief default constructor */ QmitkRadiomicsMaskProcessing(); /*! \brief default destructor */ - virtual ~QmitkRadiomicsMaskProcessing(); + ~QmitkRadiomicsMaskProcessing() override; /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Invoked when the DataManager selection changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; protected slots: void executeButtonIntervalBasedMaskClearning(); void executeButtonMaskOutlierRemoval(); private: /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkRadiomicsMaskProcessingViewControls *m_Controls; }; #endif // !defined(QmitkRadiomicsMaskProcessing_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h index 5602ab37d1..1567d9192c 100644 --- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h +++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h @@ -1,100 +1,100 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QmitkRadiomicsStatisticView_H__INCLUDED) #define QmitkRadiomicsStatisticView_H__INCLUDED #include <QmitkAbstractView.h> #include <org_mitk_gui_qt_radiomics_Export.h> #include "ui_QmitkRadiomicsStatisticViewControls.h" #include "QmitkStepperAdapter.h" #include <mitkDataStorageSelection.h> #include <usAny.h> /*! \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. \class QmitkRadiomicsStatistic \author Tobias Schwarz \version 1.0 (3M3) \date 2009-05-10 \ingroup Bundles */ class RADIOMICS_EXPORT QmitkRadiomicsStatistic : public QmitkAbstractView { Q_OBJECT public: /*! \brief default constructor */ QmitkRadiomicsStatistic(); /*! \brief default destructor */ - virtual ~QmitkRadiomicsStatistic(); + ~QmitkRadiomicsStatistic() override; /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Invoked when the DataManager selection changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; protected slots: void executeButtonPressed(); void executeAndAppendButtonPressed(); void copyToClipboardButtonPressed(); private: std::map < std::string, us::Any> GenerateParameters(); /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkRadiomicsStatisticViewControls *m_Controls; }; #endif // !defined(QmitkRadiomicsStatistic_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h index 68ae5b0e14..0285024f7b 100644 --- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h +++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h @@ -1,99 +1,99 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #if !defined(QmitkRadiomicsTransformationView_H__INCLUDED) #define QmitkRadiomicsTransformationView_H__INCLUDED #include <QmitkAbstractView.h> #include <org_mitk_gui_qt_radiomics_Export.h> #include "ui_QmitkRadiomicsTransformationViewControls.h" #include "QmitkStepperAdapter.h" #include <mitkDataStorageSelection.h> #include <usAny.h> /*! \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. \class QmitkRadiomicsTransformation \author Tobias Schwarz \version 1.0 (3M3) \date 2009-05-10 \ingroup Bundles */ class RADIOMICS_EXPORT QmitkRadiomicsTransformation : public QmitkAbstractView { Q_OBJECT public: /*! \brief default constructor */ QmitkRadiomicsTransformation(); /*! \brief default destructor */ - virtual ~QmitkRadiomicsTransformation(); + ~QmitkRadiomicsTransformation() override; /*! \brief method for creating the widget containing the application controls, like sliders, buttons etc. */ - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; - virtual void SetFocus() override; + void SetFocus() override; /*! \brief method for creating the connections of main and control widget */ virtual void CreateConnections(); /*! \brief Invoked when the DataManager selection changed */ - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; protected slots: void executeButtonMultiResolutionPressed(); void executeButtonWaveletPressed(); void executeButtonLoGPressed(); void executeButtonResamplingPressed(); private: /*! * controls containing sliders for scrolling through the slices */ Ui::QmitkRadiomicsTransformationViewControls *m_Controls; }; #endif // !defined(QmitkRadiomicsTransformation_H__INCLUDED) diff --git a/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h b/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h index 762704b976..b1a383464e 100644 --- a/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h +++ b/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKRENDERWINDOWMANAGERVIEW_H #define QMITKRENDERWINDOWMANAGERVIEW_H // render window manager plugin #include "ui_QmitkRenderWindowManagerControls.h" // render window manager UI module #include <QmitkRenderWindowDataStorageInspector.h> // mitk gui qt application #include <QmitkDataNodeContextMenu.h> // mitk gui common plugin #include <mitkIRenderWindowPartListener.h> // mitk gui qt common plugin #include <QmitkAbstractView.h> /** * @brief RenderWindowManager */ class QmitkRenderWindowManagerView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: static const std::string VIEW_ID; - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; - virtual void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override; protected: - virtual void SetFocus() override; + void SetFocus() override; - virtual void CreateQtPartControl(QWidget* parent) override; + void CreateQtPartControl(QWidget* parent) override; private Q_SLOTS: /** * @brief Called when the user changes the render window selection in the combo box. * * @param renderWindowId The text inside the combo box. */ void OnRenderWindowSelectionChanged(const QString& renderWindowId); private: void SetControlledRenderer(); QWidget* m_Parent; Ui::QmitkRenderWindowManagerControls m_Controls; mitk::IRenderWindowPart* m_RenderWindowPart; QmitkRenderWindowDataStorageInspector* m_RenderWindowInspector; QAbstractItemView* m_InspectorView; QmitkDataNodeContextMenu* m_DataNodeContextMenu; - virtual QItemSelectionModel* GetDataNodeSelectionModel() const override; + QItemSelectionModel* GetDataNodeSelectionModel() const override; }; #endif // QMITKRENDERWINDOWMANAGERVIEW_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h index cdb4f94585..2048221172 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h @@ -1,73 +1,73 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEADDTOSEMANTICRELATIONSACTION_H #define QMITKDATANODEADDTOSEMANTICRELATIONSACTION_H #include <org_mitk_gui_qt_semanticrelations_Export.h> // mitk gui qt application plugin #include <QmitkAbstractDataNodeAction.h> // qt #include <QAction> namespace AddToSemanticRelationsAction { /** * @brief The function checks whether the given node is an image or a segmentation and calls the corresponding add function. * The corresponding add functions will add the data node to the semantic relations storage. * If an image is added, the 'AddImage' function will check if another image at the fitting control-point - information type cell * already exists. If so, the user is prompted to overwrite the existing image or abort the process. * If the user wants to overwrite the existing image, the image and it's corresponding segmentation nodes will be removed from the semantic relations storage. * If a segmentation is added, the parent image node will also be to the semantic relations storage. If the segmentation does not contain the required DICOM information, * the DICOM information of the parent data will be transfered to the segmentation data. * * @pre The given dataStorage has to be valid (!nullptr). * @pre The given dataNode has to be valid (!nullptr). * The function simply returns if the preconditions are not met. * * @throw SemanticRelationException re-thrown. * * @param dataStorage The data storage to use for to remove the existing image and to check for the parent image node of a segmentation. * @param dataNode The data node to add. */ MITK_GUI_SEMANTICRELATIONS_EXPORT void Run(mitk::DataStorage* dataStorage, const mitk::DataNode* image); void AddImage(mitk::DataStorage* dataStorage, const mitk::DataNode* image); void AddSegmentation(mitk::DataStorage* dataStorage, const mitk::DataNode* segmentation); } class MITK_GUI_SEMANTICRELATIONS_EXPORT QmitkDataNodeAddToSemanticRelationsAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeAddToSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeAddToSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODEADDTOSEMANTICRELATIONSACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h index 2ac42add53..998beb6747 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h @@ -1,69 +1,69 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEREMOVEFROMSEMANTICRELATIONSACTION_H #define QMITKDATANODEREMOVEFROMSEMANTICRELATIONSACTION_H #include <org_mitk_gui_qt_semanticrelations_Export.h> // mitk gui qt application plugin #include <QmitkAbstractDataNodeAction.h> // qt #include <QAction> namespace RemoveFromSemanticRelationsAction { /** * @brief The function checks whether the given node is an image or a segmentation and calls the corresponding remove function. * The corresponding remove functions will remove the data node from the semantic relations storage. * If an image is removed, the child segmentation nodes will also be removed from the semantic relations storage. * * @pre The given dataStorage has to be valid (!nullptr). * @pre The given dataNode has to be valid (!nullptr). * The function simply returns if the preconditions are not met. * * @throw SemanticRelationException re-thrown. * * @param dataStorage The data storage to use to check for the child segmentation nodes of an image. * @param dataNode The data node to remove. */ MITK_GUI_SEMANTICRELATIONS_EXPORT void Run(mitk::DataStorage* dataStorage, const mitk::DataNode* dataNode); void RemoveImage(mitk::DataStorage* dataStorage, const mitk::DataNode* image); void RemoveSegmentation(const mitk::DataNode* segmentation); } class MITK_GUI_SEMANTICRELATIONS_EXPORT QmitkDataNodeRemoveFromSemanticRelationsAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeRemoveFromSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeRemoveFromSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODEREMOVEFROMSEMANTICRELATIONSACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h index b11eddbb9b..e5bb548568 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODESETCONTROLPOINTACTION_H #define QMITKDATANODESETCONTROLPOINTACTION_H // mitk gui qt application plugin #include <QmitkAbstractDataNodeAction.h> // qt #include <QAction> class QmitkDataNodeSetControlPointAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeSetControlPointAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeSetControlPointAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; QWidget* m_Parent; }; #endif // QMITKDATANODESETCONTROLPOINTACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h index 472def3765..56316dc7d8 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h @@ -1,47 +1,47 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODESETINFORMATIONTYPEACTION_H #define QMITKDATANODESETINFORMATIONTYPEACTION_H // mitk gui qt application plugin #include <QmitkAbstractDataNodeAction.h> // qt #include <QAction> class QmitkDataNodeSetInformationTypeAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeSetInformationTypeAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeSetInformationTypeAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; QWidget* m_Parent; }; #endif // QMITKDATANODESETINFORMATIONTYPEACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h index b9e0bf9d18..960f677997 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATANODEUNLINKFROMLESIONACTION_H #define QMITKDATANODEUNLINKFROMLESIONACTION_H #include <org_mitk_gui_qt_semanticrelations_Export.h> // mitk gui qt application plugin #include <QmitkAbstractDataNodeAction.h> // qt #include <QAction> namespace UnlinkFromLesionAction { MITK_GUI_SEMANTICRELATIONS_EXPORT void Run(const mitk::DataNode* dataNode); } class MITK_GUI_SEMANTICRELATIONS_EXPORT QmitkDataNodeUnlinkFromLesionAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkDataNodeUnlinkFromLesionAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataNodeUnlinkFromLesionAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATANODEUNLINKFROMLESIONACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h index c6bf22736e..3800f3e287 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h @@ -1,48 +1,48 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDATASETOPENINACTION_H #define QMITKDATASETOPENINACTION_H #include "QmitkDataNodeOpenInAction.h" namespace OpenInAction { void Run(mitk::DataStorage::Pointer dataStorage, mitk::DataNode::Pointer imageNode, mitk::BaseRenderer* renderer = nullptr); } class QmitkDataSetOpenInAction : public QmitkDataNodeOpenInAction { Q_OBJECT public: QmitkDataSetOpenInAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkDataSetOpenInAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnMenuAboutToShow(); void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKDATASETOPENINACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h index 7f01b292fb..d52c78397f 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKLESIONSHOWINACTION_H #define QMITKLESIONSHOWINACTION_H // mitk gui qt application plugin #include <QmitkAbstractDataNodeAction.h> // semantic relations module #include <mitkSemanticTypes.h> // qt #include <QAction> class QmitkFocusOnLesionAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: typedef std::vector<mitk::BaseRenderer*> RendererVector; QmitkFocusOnLesionAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkFocusOnLesionAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); void SetSelectedLesion(mitk::SemanticTypes::Lesion selectedLesion); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; void SetControlledRenderer(); RendererVector m_ControlledRenderer; mitk::SemanticTypes::Lesion m_Lesion; }; #endif // QMITKLESIONSHOWINACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h index 0c650ae533..5552d46a20 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKLABELSETJUMPTOACTION_H #define QMITKLABELSETJUMPTOACTION_H #include "QmitkAbstractDataNodeAction.h" // qt #include <QAction> namespace LabelSetJumpToAction { void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, const mitk::DataNode* dataNode, mitk::BaseRenderer* baseRenderer = nullptr); } class QmitkLabelSetJumpToAction : public QAction, public QmitkAbstractDataNodeAction { Q_OBJECT public: QmitkLabelSetJumpToAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite); QmitkLabelSetJumpToAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite); private Q_SLOTS: void OnActionTriggered(bool); protected: - virtual void InitializeAction() override; + void InitializeAction() override; }; #endif // QMITKLABELSETJUMPTOACTION_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h index 64c6ec3c0d..9da6d4bb25 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h @@ -1,78 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKSEMANTICRELATIONSSTATISTICSVIEW_H #define QMITKSEMANTICRELATIONSSTATISTICSVIEW_H // semantic relations plugin #include "ui_QmitkSemanticRelationsStatisticsControls.h" // semantic relations module #include <mitkSemanticTypes.h> // semantic relations ui module #include "QmitkStatisticsTreeModel.h" // mitk qt gui common plugin #include <QmitkAbstractView.h> /* * @brief The QmitkSemanticRelationsStatisticsView is an MITK view to combine and show the statistics tree view of the 'SemanticRelationsUI'-module. * It observes the semantic relations storage and displays the currently available case IDs in a combo box. * A 'QmitkStatisticsTreeModel' is created and set as the model of a QTreeView. */ class QmitkSemanticRelationsStatisticsView : public QmitkAbstractView, public mitk::ISemanticRelationsObserver { Q_OBJECT public: static const std::string VIEW_ID; - virtual ~QmitkSemanticRelationsStatisticsView() override; + ~QmitkSemanticRelationsStatisticsView() override; /* * @brief Update the view with the data from the semantic relations. * * Overridden from 'ISemanticRelationsObserver'. * In order for the Update-function to be called, this view has to be added as an observer of SemanticRelation * (e.g. m_SemanticRelations->AddObserver(this);) * * @par caseID The current case ID to identify the currently active patient / case. */ - virtual void Update(const mitk::SemanticTypes::CaseID& caseID) override; + void Update(const mitk::SemanticTypes::CaseID& caseID) override; protected: - virtual void SetFocus() override; - virtual void CreateQtPartControl(QWidget* parent) override; + void SetFocus() override; + void CreateQtPartControl(QWidget* parent) override; private Q_SLOTS: void OnCaseIDSelectionChanged(const QString&); void OnModelUpdated(); private: void SetUpConnections(); void AddToComboBox(const mitk::SemanticTypes::CaseID& caseID); Ui::QmitkSemanticRelationsStatisticsControls m_Controls; QmitkStatisticsTreeModel* m_StatisticsTreeModel; }; #endif // QMITKSEMANTICRELATIONSSTATISTICSVIEW_H diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h index 3c41a3f2bf..14be82a782 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h @@ -1,110 +1,110 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKSEMANTICRELATIONSVIEW_H #define QMITKSEMANTICRELATIONSVIEW_H // semantic relations plugin #include "ui_QmitkSemanticRelationsControls.h" #include "QmitkLesionInfoWidget.h" #include "QmitkSemanticRelationsContextMenu.h" // semantic relations module #include <mitkSemanticTypes.h> // semantic relations UI module #include <QmitkPatientTableInspector.h> // mitk gui common plugin #include <mitkIRenderWindowPartListener.h> // berry #include <berryISelectionListener.h> // mitk qt gui common plugin #include <QmitkAbstractView.h> class QmitkDnDDataNodeWidget; class QMenu; /* * @brief The QmitkSemanticRelationsView is an MITK view to combine and show the widgets of the 'SemanticRelationsUI'-module and this semantic relations plugin. * * It allows the MITK user to see and modify the content of the SemanticRelations-session. * A combo box is used to select and show the current patient. */ class QmitkSemanticRelationsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: static const std::string VIEW_ID; - virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; - virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; - virtual void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; + void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override; protected: - virtual void SetFocus() override; - virtual void CreateQtPartControl(QWidget* parent) override; + void SetFocus() override; + void CreateQtPartControl(QWidget* parent) override; private Q_SLOTS: void OnLesionSelectionChanged(const mitk::SemanticTypes::Lesion&); void OnDataNodeSelectionChanged(const QList<mitk::DataNode::Pointer>&); void OnDataNodeDoubleClicked(const mitk::DataNode*); void OnCaseIDSelectionChanged(const QString&); void OnNodesAdded(std::vector<mitk::DataNode*>); void OnNodeRemoved(const mitk::DataNode*); private: void SetUpConnections(); /** * @brief Provide a QItemSelectionModel, which supports the data role 'QmitkDataNodeRole' (\see QmitkRenderWindowDataModel). * * The provided QItemSelectionModel is used in the QmitkAbstractView-base class as the selection model of * the selection provider (\see QmitkAbstractView::SetSelectionProvider()). * The default selection provider is a QmitkDataNodeSelectionProvider. Each time a selection in the provided * QItemSeletionModel is changed, a selection changed event is fired. All plugins (views), that subclass the * QmitkAbstractView will be informed about the selection changed via the OnSelectionChanged-function. */ - virtual QItemSelectionModel* GetDataNodeSelectionModel() const override; + QItemSelectionModel* GetDataNodeSelectionModel() const override; - virtual void NodeRemoved(const mitk::DataNode* dataNode) override; + void NodeRemoved(const mitk::DataNode* dataNode) override; void AddToComboBox(const mitk::SemanticTypes::CaseID& caseID); void RemoveFromComboBox(const mitk::SemanticTypes::CaseID& caseID); void OpenInEditor(const mitk::DataNode* dataNode); void SetControlledRenderer(); Ui::QmitkSemanticRelationsControls m_Controls; mitk::IRenderWindowPart* m_RenderWindowPart; QmitkLesionInfoWidget* m_LesionInfoWidget; QmitkPatientTableInspector* m_PatientTableInspector; QmitkDnDDataNodeWidget* m_DnDDataNodeWidget; QmitkSemanticRelationsContextMenu* m_ContextMenu; }; #endif // QMITKSEMANTICRELATIONSVIEW_H diff --git a/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h b/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h index 6c0dec1a27..5a6b99238c 100644 --- a/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h +++ b/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h @@ -1,71 +1,71 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkToFTutorialView_h #define QmitkToFTutorialView_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_QmitkToFTutorialViewControls.h" /*! \brief QmitkToFTutorialView is a tutorial showing the basic implementation techniques of MITK-ToF Step 1 shows how to acquire images from a tof camera Step 2 shows how to apply a processing filter to generate a surface from a range image */ class QmitkToFTutorialView : public QmitkAbstractView { // 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; QmitkToFTutorialView(); - virtual ~QmitkToFTutorialView(); + ~QmitkToFTutorialView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; protected slots: /// \brief Called when the user clicks the Step 1 button void OnStep1(); /// \brief Called when the user clicks the Step 2 button void OnStep2(); protected: void RemoveAllNodesFromDataStorage(); Ui::QmitkToFTutorialViewControls* m_Controls; }; #endif // _QMITKTOFTUTORIALVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h index 72a0320b3b..c8fb4e8abf 100644 --- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h +++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h @@ -1,65 +1,65 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkToFDeviceGeneration_h #define QmitkToFDeviceGeneration_h #include <ui_QmitkToFDeviceGenerationControls.h> #include <QmitkAbstractView.h> #include <QStringList> #include <ui_QmitkToFUtilViewControls.h> /*! \brief QmitkToFDeviceGeneration */ class QmitkToFDeviceGeneration : public QmitkAbstractView { // 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; QmitkToFDeviceGeneration(); - ~QmitkToFDeviceGeneration(); + ~QmitkToFDeviceGeneration() override; void SetFocus() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; protected slots: /*! \brief Slot called when the "Create Device" button of the ConnectionWidget is pressed */ void OnToFCameraConnected(); protected: Ui::QmitkToFDeviceGenerationControls m_Controls; private: }; #endif // _QmitkToFDeviceGeneration_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h index 051c577393..b896325599 100644 --- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h +++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h @@ -1,100 +1,100 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkToFScreenshotMaker_h #define QmitkToFScreenshotMaker_h #include <ui_QmitkToFScreenshotMakerControls.h> #include <QmitkAbstractView.h> #include <QStringList> #include <ui_QmitkToFUtilViewControls.h> /*! \brief QmitkToFScreenshotMaker Select a ToF image source in the GUI to make a screenshot of the provided data. If a camera is active, the Make Screenshot button will become enabled. Select the data including format you want to save at the given path. To activate a camera, you can for example use the ToF Util view. Note you can only select data which is provided by the device. Screenshots will be saved at the respective path with a counter indicating the order. \ingroup ToFUtil */ class QmitkToFScreenshotMaker : public QmitkAbstractView { // 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; QmitkToFScreenshotMaker(); - ~QmitkToFScreenshotMaker(); + ~QmitkToFScreenshotMaker() override; void SetFocus() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; protected slots: /** * @brief OnMakeScreenshotClicked Slot called when the "Make screenshot" button is pressed. */ void OnMakeScreenshotClicked(); /** * @brief OnSelectCamera Slot called to update the GUI according to the selected image source. */ void OnSelectCamera(); protected: Ui::QmitkToFScreenshotMakerControls m_Controls; private: /** * @brief UpdateGUIElements Internal helper method to update the GUI. * @param device The device of the selected image source. * @param ToFImageType Type of the image (e.g. depth, RGB, intensity, etc.) * @param saveCheckBox Checkbox indicating whether the type should be saved. * @param saveTypeComboBox Combobox to chose in which format the data should be saved (e.g. nrrd) * @param fileExentions Other possible file extensions. * @param preferredFormat Default format for this type (e.g. png for RGB). */ void UpdateGUIElements(mitk::ToFCameraDevice* device, const char *ToFImageType, QCheckBox *saveCheckBox, QComboBox *saveTypeComboBox, QStringList fileExentions, const char *preferredFormat); /** * @brief SaveImage Saves a ToF image. * @param image The image to save. * @param saveImage Should it be saved? * @param path Path where to save the image. * @param name Name of the image. * @param extension Type extension (e.g. .nrrd). */ void SaveImage(mitk::Image::Pointer image, bool saveImage, std::string path, std::string name, std::string extension); /** * @brief m_SavingCounter Internal counter for saving images with higher number. */ int m_SavingCounter; }; #endif // QmitkToFScreenshotMaker_h diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h index 379cc7b1a1..17da47d816 100644 --- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h +++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h @@ -1,168 +1,168 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkToFUtilView_h #define QmitkToFUtilView_h #include <QmitkAbstractView.h> #include <berryIWorkbenchPartReference.h> #include <mitkIZombieViewPart.h> #include <ui_QmitkToFUtilViewControls.h> class QTimer; #include <mitkRealTimeClock.h> #include <mitkToFImageGrabber.h> #include <mitkOpenCVVideoSource.h> #include <mitkSurface.h> #include <mitkToFDistanceImageToSurfaceFilter.h> #include <mitkToFImageRecorder.h> #include <mitkToFCompositeFilter.h> #include <mitkCameraIntrinsics.h> /*! \brief QmitkToFUtilView Application that allows simple playing, recording, visualization, processing and measurement of Time-of-Flight (ToF) data. Currently the following features are implemented: <ul> <li>Connecting and showing ToF data from various cameras (PMD CamCube 2/3, PMD CamBoard, PMD O3, MESA SwissRanger)</li> <li>Recording and playing of ToF data</li> <li>Color coded visualization of ToF images</li> <li>Preprocessing of the distance data: Threshold, median, average and bilateral filtering; surface generation</li> <li>Simple measurement and PointSet definition</li> </ul> */ class QmitkToFUtilView : public QmitkAbstractView, public mitk::IZombieViewPart { // 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; QmitkToFUtilView(); - ~QmitkToFUtilView(); + ~QmitkToFUtilView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// \brief Called when the view gets activated. - virtual void Activated() override; + void Activated() override; /// \brief Called when the view gets deactivated. In this case the zombie view of this view becomes active! - virtual void ActivatedZombieView(berry::IWorkbenchPartReference::Pointer zombieView) override; + void ActivatedZombieView(berry::IWorkbenchPartReference::Pointer zombieView) override; - virtual void Deactivated() override; - virtual void Visible() override; - virtual void Hidden() override; + void Deactivated() override; + void Visible() override; + void Hidden() override; void SetFocus() override; protected slots: /*! \brief Slot triggered from the timer to update the images and visualization */ void OnUpdateCamera(); /*! \brief Slot called when the "Connect" button of the ConnectionWidget is pressed */ void OnToFCameraConnected(); /*! \brief Slot called when the "Disconnect" button of the ConnectionWidget is pressed */ void OnToFCameraDisconnected(); /*! \brief Slot called when the "Start" button of the RecorderWidget is pressed */ void OnToFCameraStarted(); /*! \brief Slot called when the "Stop" button of the RecorderWidget is pressed */ void OnToFCameraStopped(); /*! \brief Slot invoked when user alters the coronal window input from RGB to Intensity or vice versa. */ void OnChangeCoronalWindowOutput(int index); /*! \brief Slot invoked when acquisition mode of Kinect is changed */ void OnKinectAcquisitionModeChanged(); protected: /*! \brief initialize the visibility settings of ToF data (images + surface) \param useToF true: distance image: widget1, amplitude image: widget 2, intensity image: widget 3; false: standard */ void UseToFVisibilitySettings(bool useToF); Ui::QmitkToFUtilViewControls* m_Controls; bool m_Framerateoutput; ///< defines if the framerate is computed condinously QTimer* m_Frametimer; ///< Timer used to continuously update the images QString m_SelectedCamera; ///< String holding the selected camera mitk::Image::Pointer m_MitkDistanceImage; ///< member holding a pointer to the distance image of the selected camera mitk::Image::Pointer m_MitkAmplitudeImage; ///< member holding a pointer to the amplitude image of the selected camera mitk::Image::Pointer m_MitkIntensityImage; ///< member holding a pointer to the intensity image of the selected camera mitk::Surface::Pointer m_Surface; ///< member holding a pointer to the surface generated from the distance image of the selected camera mitk::DataNode::Pointer m_DistanceImageNode; ///< DataNode holding the distance image of the selected camera mitk::DataNode::Pointer m_AmplitudeImageNode; ///< DataNode holding the amplitude image of the selected camera mitk::DataNode::Pointer m_IntensityImageNode; ///< DataNode holding the intensity image of the selected camera mitk::DataNode::Pointer m_RGBImageNode; ///< DataNode holding the rgb image of the selected camera mitk::DataNode::Pointer m_SurfaceNode; ///< DataNode holding the surface generated from the distanc image of the selected camera // ToF processing and recording filter mitk::ToFImageRecorder::Pointer m_ToFImageRecorder; ///< ToF image recorder used for lossless recording of ToF image data mitk::ToFImageGrabber::Pointer m_ToFImageGrabber; ///< Source of a ToF image processing pipeline. Provides pointers to distance, amplitude and intensity image mitk::ToFDistanceImageToSurfaceFilter::Pointer m_ToFDistanceImageToSurfaceFilter; ///< Filter for calculating a surface representation from a given distance image mitk::ToFCompositeFilter::Pointer m_ToFCompositeFilter; ///< Filter combining several processing steps (thresholding, Median filtering, Bilateral filtering) int m_2DDisplayCount; ///< member used to determine whether frame rate output should be shown // members for calculating the frame rate mitk::RealTimeClock::Pointer m_RealTimeClock; ///< real time clock used to calculate the display framerate int m_StepsForFramerate; ///< number of steps used for calculating the display framerate double m_2DTimeBefore; ///< holds the time stamp at the beginning of the display framerate measurement double m_2DTimeAfter; ///< holds the time stamp at the end of the display framerate measurement mitk::CameraIntrinsics::Pointer m_CameraIntrinsics; ///< member holding the intrinsic parameters of the camera private: /*! \brief helper method to replace data of the specified node. If node does not exist it will be created \param nodeName Name of the node \param data Data object to be replaced \return returns the node */ mitk::DataNode::Pointer ReplaceNodeData(std::string nodeName, mitk::BaseData* data); void ProcessVideoTransform(); /*! \brief Reset all GUI related things to default. E.g. show sagittal and coronal slices in the renderwindows. */ void ResetGUIToDefault(); }; #endif // _QMITKTOFUTILVIEW_H_INCLUDED diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h index d677658d88..ca5e842ebc 100644 --- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h +++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h @@ -1,52 +1,52 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKTUBEGRAPHDELETELABELGROUPDIALOG_H_INCLUDED #define _QMITKTUBEGRAPHDELETELABELGROUPDIALOG_H_INCLUDED #include <QDialog> class QPushButton; class QListWidget; class QLabel; class QWidget; class QmitkTubeGraphDeleteLabelGroupDialog : public QDialog { Q_OBJECT public: QmitkTubeGraphDeleteLabelGroupDialog(QWidget* parent = nullptr); - virtual ~QmitkTubeGraphDeleteLabelGroupDialog(); + ~QmitkTubeGraphDeleteLabelGroupDialog() override; QStringList GetSelectedLabelGroups(); void SetLabelGroups(const QStringList &labelGroups); protected slots: void OnDeleteLabelGroupClicked(); protected: QLabel* descriptionLabel; QListWidget* labelGroupListWidget; QPushButton* deleteButton; QPushButton* cancleButton; QStringList m_LabelGroupList; }; #endif diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h index 85978663e6..a568c1212e 100644 --- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h +++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h @@ -1,56 +1,56 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKLABELGROUPWIDGET_H_INCLUDED #define _QMITKLABELGROUPWIDGET_H_INCLUDED #include "mitkColorProperty.h" #include <QVector> #include <QVBoxLayout> #include <QWidget> class QmitkTubeGraphLabelGroupWidget : public QWidget { Q_OBJECT public: QmitkTubeGraphLabelGroupWidget(QWidget *parent = nullptr, const char* name = nullptr); - virtual ~QmitkTubeGraphLabelGroupWidget(); + ~QmitkTubeGraphLabelGroupWidget() override; void SetGroupName(QString name); QString GetGroupName(); void AddLabel(QString name, mitk::Color color); signals: void SignalLabelVisibilityInGroupToggled(bool, QString, QString); void SignalLabelButtonInGroupClicked(QString, QString); void SignalLabelColorInGroupChanged(mitk::Color, QString, QString); protected slots: void OnVisibilityToggled(bool isVisible, QString labelName); void OnLabelButtonClicked(QString labelName); void OnColoringButtonClicked(mitk::Color color, QString labelName); private: QString m_GroupName; QVBoxLayout* m_GroupLayout; //QVector<QmitkTubeGraphLabelWidget*> m_Labels; }; #endif diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h index 80158d2241..d3d88b3618 100644 --- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h +++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h @@ -1,61 +1,61 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKTUBEGRAPHLABELWIDGET_H_INCLUDED #define _QMITKTUBEGRAPHLABELWIDGET_H_INCLUDED #include "mitkColorProperty.h" #include <QCheckBox> #include <QPushButton> class QmitkTubeGraphLabelWidget : public QWidget { Q_OBJECT public: QmitkTubeGraphLabelWidget(QWidget* parent = nullptr); //QmitkTubeGraphLabelWidget(QWidget* parent = 0, const char* name = 0, mitk::Color* color = 0 /*TODO*/); - virtual ~QmitkTubeGraphLabelWidget(); + ~QmitkTubeGraphLabelWidget() override; void SetLabelName(QString name); QString GetLabelName(); void SetLabelColor(mitk::Color* color); mitk::Color* GetLabelColor(); signals: void SignalLabelVisibilityToggled(bool, QString); void SignalLabelButtonClicked(QString); void SignalLabelColorChanged(mitk::Color, QString); protected slots: void OnVisibilityToggled(bool isVisible); void OnLabelButtonClicked(); void OnColoringButtonClicked(); private: void InitWidget(); QCheckBox* m_VisibilityCheckBox; QPushButton* m_LabelPushButton; QPushButton* m_ColoringPushButton; }; #endif diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h index bfb34c9a11..eab96810a7 100644 --- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h +++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKTUBEGRAPHNEWANNOTATIONDIALOG_H_INCLUDED #define _QMITKTUBEGRAPHNEWANNOTATIONDIALOG_H_INCLUDED #include <qdialog.h> class QPushButton; class QVBoxLayout; class QHBoxLayout; class QLineEdit; class QLabel; class QmitkTubeGraphNewAnnotationDialog : public QDialog { Q_OBJECT public: QmitkTubeGraphNewAnnotationDialog(QWidget* parent = nullptr); - virtual ~QmitkTubeGraphNewAnnotationDialog(); + ~QmitkTubeGraphNewAnnotationDialog() override; QString GetAnnotationName(); QString GetAnnotationDescription(); protected slots: void OnAddingAnnotation(); protected: QVBoxLayout* layout; QHBoxLayout* buttonLayout; QPushButton* okButton; QPushButton* cancleButton; QLabel* annotationNameLabel; QLineEdit* annotationNameLineEdit; QLabel* annotationDescriptionLabel; QLineEdit* annotationDescriptionLineEdit; QString m_NewAnnotationName; QString m_NewAnnotationDescription; }; #endif diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h index 5302427524..39bca3e834 100644 --- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h +++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h @@ -1,81 +1,81 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKTUBEGRAPHNEWLABELGROUPDIALOG_H_INCLUDED #define _QMITKTUBEGRAPHNEWLABELGROUPDIALOG_H_INCLUDED #include <qdialog.h> #include <vector> #include "mitkTubeGraphProperty.h" class QSpacerItem; class QPushButton; class QVBoxLayout; class QHBoxLayout; class QLineEdit; class QLabel; class QListWidget; class QTreeWidget; class QmitkTubeGraphNewLabelGroupDialog : public QDialog { Q_OBJECT typedef mitk::TubeGraphProperty::LabelGroup LabelGroupType; typedef LabelGroupType::Label LabelType; public: QmitkTubeGraphNewLabelGroupDialog(QWidget* parent = nullptr); - virtual ~QmitkTubeGraphNewLabelGroupDialog(); + ~QmitkTubeGraphNewLabelGroupDialog() override; mitk::TubeGraphProperty::LabelGroup* GetLabelGroup(); protected slots: void OnCreateNewLabelGroup(); void OnAddStandardLabelGroup(); void OnAddingNewLabelGroup(); void OnAddingStandardLabelGroup(); void OnAddingLabel(); protected: QVBoxLayout* layout; QHBoxLayout* buttonLayout; QSpacerItem* spacer; QPushButton* newLabelGroupButton; QPushButton* standardLabelGroupButton; QPushButton* okButton; QPushButton* cancleButton; QLabel* labelGroupDescriptionLabel; QLineEdit* labelGroupLineEdit; QLabel* labelDescriptionLabel; QLineEdit* labelLineEdit; QPushButton* addLabelButton; QListWidget* labelListWidget; QTreeWidget* labelGroupTreeWidget; LabelGroupType* m_NewLabelGroup; std::vector<LabelGroupType*> m_LabelGroupsLiver; std::vector<LabelGroupType*> m_LabelGroupsLung; }; #endif diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h index ab1c190062..276ca35747 100644 --- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h +++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h @@ -1,127 +1,127 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QMITKTUBEGRAPHVIEW_H_INCLUDED #define _QMITKTUBEGRAPHVIEW_H_INCLUDED #include "ui_QmitkTubeGraphViewControls.h" #include <QmitkAbstractView.h> #include "mitkColorProperty.h" #include "mitkTubeGraph.h" #include "mitkTubeGraphProperty.h" #include "mitkTubeGraphDataInteractor.h" #include <QCheckBox> #include <QSignalMapper> /*! * * \brief QmitkTubeGraphConverterView * */ class QmitkTubeGraphView: public QmitkAbstractView { // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT typedef mitk::TubeGraphProperty::LabelGroup LabelGroupType; typedef LabelGroupType::Label LabelType; public: static const std::string VIEW_ID; /** * @brief Constructor. **/ QmitkTubeGraphView(); /** * @brief Destructor. */ - virtual ~QmitkTubeGraphView(); + ~QmitkTubeGraphView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /** \brief Method to create the connections for the component. This Method is obligatory even if no connections is needed*/ virtual void CreateConnections(); protected slots: //active tube graph void OnActiveGraphChanged(int); //activation mode void OnActivationModeChanged(); void OnDeselectAllTubes(); void OnSetRootToggled(bool); void OnTabSwitched(int); //attributation tab void OnAddingLabelGroup(); void OnRemoveLabelGroup(); //annotation tab void OnAddingAnnotation(); void OnRemoveAnnotation(); //edit tab void OnAddTubeBetweenSelection(); void OnSeperateSelection(); void OnDeleteSelection(); //label group void OnLabelVisibilityChanged(bool, QString labelName, QString labelGroupName); void OnLabelChanged(QString labelName, QString labelGroupName); void OnLabelColorChanged(mitk::Color color, QString labelName, QString labelGroupName); protected: mitk::TubeGraphDataInteractor::ActivationMode GetActivationMode(); - virtual void SetFocus() override; - virtual void NodeRemoved(const mitk::DataNode*) override; + void SetFocus() override; + void NodeRemoved(const mitk::DataNode*) override; /// \brief called by QmitkAbstractView when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,const QList<mitk::DataNode::Pointer>& nodes) override; Ui::QmitkTubeGraphViewControls m_Controls; // the Qt parent of our GUI (NOT of this object) QWidget* m_Parent; private: void UpdateActiveTubeGraphInInteractors(); void CreateLabelGroupWidget(LabelGroupType* labelGroup); void InitializeLabelGroups(); void SetTabsEnable(bool enable); void UpdateLabelGroups(); void UpdateAnnotation(); void SelectionInformationChanged(); void UpdateGraphInformation(); mitk::TubeGraph::Pointer m_ActiveTubeGraph; mitk::TubeGraphProperty::Pointer m_ActiveProperty; mitk::TubeGraphDataInteractor::Pointer m_ActiveInteractor; mitk::TubeGraphDataInteractor::ActivationMode m_ActivationMode; /* std::vector<QString> m_LabelGroupName; std::vector<QString> m_LabelName;*/ unsigned int m_InformationChangedObserverTag; }; #endif//QMITK_TubeGraphView_H diff --git a/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h b/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h index 49c10b54a3..a48449f4d4 100644 --- a/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h +++ b/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h @@ -1,113 +1,113 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkUGVisualizationView_h #define QmitkUGVisualizationView_h #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #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. */ class QmitkUGVisualizationView : public QmitkAbstractView { // 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(); + ~QmitkUGVisualizationView() override; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; /// /// Sets the focus to an internal widget. /// - virtual void SetFocus() override; + void SetFocus() override; protected slots: void UpdateRenderWindow(); void ShowTFGeneratorWidget(bool show); void ShowScalarOpacityWidget(bool show); void ShowColorWidget(bool show); void ShowGradientOpacityWidget(bool show); protected: /// \brief called by QmitkAbstractView when DataManager's selection has changed - virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; + void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override; void CreateConnections(); private: friend class UGVisVolumeObserver; void UpdateGUI(); void UpdateEnablement(); Ui::QmitkUGVisualizationViewControls m_Controls; QWidgetAction* m_Outline2DAction; QmitkBoolPropertyWidget* m_Outline2DWidget; QAction* m_LODAction; QWidgetAction* m_ScalarVisibilityAction; QmitkBoolPropertyWidget* m_ScalarVisibilityWidget; int m_FirstVolumeRepId; QHash<int, int> 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/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h b/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h index 65f1141a29..b20b969a36 100644 --- a/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h +++ b/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h @@ -1,185 +1,185 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkUltrasoundSupport_h #define QmitkUltrasoundSupport_h #include <mitkLookupTable.h> #include <mitkLookupTableProperty.h> #include <berryISelectionListener.h> #include <QmitkAbstractView.h> #include "ui_QmitkUltrasoundSupportControls.h" #include "QmitkUSAbstractCustomWidget.h" #include "QmitkUSControlsBModeWidget.h" #include "QmitkUSControlsDopplerWidget.h" #include "QmitkUSControlsProbesWidget.h" #include <mitkBaseRenderer.h> #include "QmitkRenderWindow.h" #include <mitkStandaloneDataStorage.h> #include <QmitkLevelWindowWidget.h> #include <QmitkSliceWidget.h> #include <QTime> #include <ctkServiceEvent.h> /*! \brief UltrasoundSupport This plugin provides functionality to manage Ultrasound devices, create video devices and to view device images. \ingroup ${plugin_target}_internal */ class QmitkUltrasoundSupport : public QmitkAbstractView { // 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: - virtual void SetFocus() override; + void SetFocus() override; static const std::string VIEW_ID; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; QmitkUltrasoundSupport(); - virtual ~QmitkUltrasoundSupport(); + ~QmitkUltrasoundSupport() override; public slots: /* * \brief This is called when the newDeviceWidget is closed */ void OnNewDeviceWidgetDone(); protected slots: void OnClickedAddNewDevice(); void OnChangedFramerateLimit(); void OnClickedEditDevice(); /* *\brief Called, when the selection in the list of the active devices changes. */ void OnChangedActiveDevice(); void OnClickedFreezeButton(); void OnDeviceServiceEvent(const ctkServiceEvent event); /* * \brief This is the main imaging loop that updates the image and is called regularily during the imaging process */ void UpdateImage(); void RenderImage2d(); void RenderImage3d(); void StartTimers(); void StopTimers(); protected: void CreateControlWidgets(); void RemoveControlWidgets(); Ui::UltrasoundSupportControls* m_Controls; QmitkUSAbstractCustomWidget* m_ControlCustomWidget; QmitkUSControlsBModeWidget* m_ControlBModeWidget; QmitkUSControlsDopplerWidget* m_ControlDopplerWidget; QmitkUSControlsProbesWidget* m_ControlProbesWidget; bool m_ImageAlreadySetToNode; unsigned int m_CurrentImageWidth; unsigned int m_CurrentImageHeight; /** Keeps track of the amount of output Nodes*/ unsigned int m_AmountOfOutputs; /** The device that is currently used to aquire images */ mitk::USDevice::Pointer m_Device; void SetTimerIntervals(int intervalPipeline, int interval2D, int interval3D); /** This timer triggers periodic updates to the pipeline */ QTimer* m_UpdateTimer; QTimer* m_RenderingTimer2d; QTimer* m_RenderingTimer3d; /** These clocks are used to compute the framerate in the methods DisplayImage(),RenderImage2d() and RenderImage3d(). */ QTime m_Clock; QTime m_Clock2d; QTime m_Clock3d; /** A counter to comute the framerate. */ int m_FrameCounterPipeline; int m_FrameCounter2d; int m_FrameCounter3d; int m_FPSPipeline, m_FPS2d, m_FPS3d; /** Stores the properties of some QWidgets (and the tool storage file name) to QSettings.*/ void StoreUISettings(); /** Loads the properties of some QWidgets (and the tool storage file name) from QSettings.*/ void LoadUISettings(); /** The nodes that we feed images into.*/ std::vector<mitk::DataNode::Pointer> m_Node; /** Adds a new node to the m_Nodes vector*/ void InitNewNode(); /** Destroys the last node in the m_Nodes vector */ void DestroyLastNode(); /** Checks the amount of slices in the image from the USDevice and creates as many Nodes as there are slices */ void UpdateAmountOfOutputs(); /** This function just checks how many nodes there are currently and sets the laser image to a jet transparent colormap. */ void UpdateLevelWindows(); bool m_ForceRequestUpdateAll; void SetColormap(mitk::DataNode::Pointer node, mitk::LookupTable::LookupTableType type); /** The seperated slices from m_Image */ std::vector<mitk::Image::Pointer> m_curOutput; /** The old geometry of m_Image. It is needed to check if the geometry changed (e.g. because * the zoom factor was modified) and the image needs to be reinitialized. */ mitk::SlicedGeometry3D::Pointer m_OldGeometry; QList<ctkServiceReference> m_CustomWidgetServiceReference; double m_CurrentDynamicRange; /* Spacing calibration variables and methods */ mitk::Point3D m_Xpoint1,m_Xpoint2,m_Ypoint1,m_Ypoint2; double m_XSpacing, m_YSpacing; double ComputeSpacing(mitk::Point3D p1, mitk::Point3D p2, double distance); protected slots: void SetXPoint1(); void SetXPoint2(); void SetYPoint1(); void SetYPoint2(); void WriteSpacingToDevice(); }; #endif // UltrasoundSupport_h diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h index 4b6529d6e1..e9654f7b01 100644 --- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h +++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h @@ -1,50 +1,50 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITK_UPLOADTOXNATACTION_H #define QMITK_UPLOADTOXNATACTION_H #include "mitkIContextMenuAction.h" #include "org_mitk_gui_qt_xnat_Export.h" #include "mitkDataNode.h" class XNAT_EXPORT QmitkUploadToXNATAction : public QObject, public mitk::IContextMenuAction { Q_OBJECT Q_INTERFACES(mitk::IContextMenuAction) public: QmitkUploadToXNATAction(); - virtual ~QmitkUploadToXNATAction(); + ~QmitkUploadToXNATAction() override; //interface methods void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override; // Empty setters (not needed) void SetDataStorage(mitk::DataStorage* dataStorage) override; void SetSmoothed(bool smoothed) override; void SetDecimated(bool decimated) override; void SetFunctionality(berry::QtViewPart* functionality) override; private: std::string ReplaceSpecialChars(const std::string& input) const; typedef QList<mitk::DataNode::Pointer> NodeList; }; #endif // QMITK_UPLOADTOXNATACTION_H diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h index 9a1ebf597c..277f5ca76f 100644 --- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h @@ -1,87 +1,87 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKXNATCONNECTIONPREFERENCEPAGE_H_ #define QMITKXNATCONNECTIONPREFERENCEPAGE_H_ #include "berryIQtPreferencePage.h" #include <berryIPreferences.h> #include "ui_QmitkXnatConnectionPreferencePageControls.h" class QWidget; class QLineEdit; struct QmitkXnatConnectionPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkXnatConnectionPreferencePage(); void Init(berry::IWorkbench::Pointer workbench) override; void CreateQtControl(QWidget* widget) override; QWidget* GetQtControl() const override; /// /// \see IPreferencePage::PerformOk() /// - virtual bool PerformOk() override; + bool PerformOk() override; /// /// \see IPreferencePage::PerformCancel() /// - virtual void PerformCancel() override; + void PerformCancel() override; /// /// \see IPreferencePage::Update() /// - virtual void Update() override; + void Update() override; protected slots: virtual void UrlChanged(); virtual void DownloadPathChanged(); void OnDownloadPathButtonClicked(); /// /// Toggles the Connection in the Service Registry from opened to closed or the other way around. /// virtual void TestConnection(); virtual void onUseNetworkProxy(bool); protected: Ui::QmitkXnatConnectionPreferencePageControls m_Controls; QWidget* m_Control; berry::IPreferences::WeakPtr m_XnatConnectionPreferencesNode; private: /// /// Checks if the entered user information is empty. /// virtual bool UserInformationEmpty(); }; #endif /* QMITKXNATCONNECTIONPREFERENCEPAGE_H_ */ diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h index 0cfdbff16b..7754801ea9 100644 --- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h +++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h @@ -1,149 +1,149 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKXNATTREEBROWSERVIEW_H #define QMITKXNATTREEBROWSERVIEW_H #include <QmitkAbstractView.h> #include "ui_QmitkXnatTreeBrowserViewControls.h" #include "QmitkHttpStatusCodeHandler.h" // ctkXnatCore #include "ctkXnatSession.h" // ctkXnatWidget #include "QmitkXnatTreeModel.h" // MitkXNAT Module #include "mitkXnatSessionTracker.h" #include <mitkIDataStorageService.h> #include <ctkServiceTracker.h> #include <berryIBerryPreferences.h> class QMenu; /*! \brief QmitkXnatTreeBrowserView \warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation. \ingroup ${plugin_target}_internal */ class QmitkXnatTreeBrowserView : public QmitkAbstractView { // 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: QmitkXnatTreeBrowserView(); - ~QmitkXnatTreeBrowserView(); + ~QmitkXnatTreeBrowserView() override; static const QString VIEW_ID; - virtual void CreateQtPartControl(QWidget *parent) override; + void CreateQtPartControl(QWidget *parent) override; enum SearchMethod { ProjectLevel = 0, SubjectLevel = 1 }; protected slots: /// \brief Opens or reuses the xnat editor with the activated node as root item. void OnActivatedNode(const QModelIndex& index); /// \brief Updates the ctkXnatSession and the user interface void UpdateSession(ctkXnatSession* session); /// \brief Cleans the tree model void CleanTreeModel(ctkXnatSession* session); /// \brief Searches the tree model void Search(const QString &toSearch); void OnContextMenuRequested(const QPoint & pos); void OnContextMenuDownloadAndOpenFile(); void OnContextMenuDownloadFile(); void OnContextMenuCreateResourceFolder(); void OnContextMenuUploadFile(); void OnContextMenuCreateNewSubject(); void OnContextMenuCreateNewExperiment(); void OnContextMenuCopyXNATUrlToClipboard(); void OnContextMenuRefreshItem(); void OnUploadResource(const QList<mitk::DataNode*>& , ctkXnatObject *, const QModelIndex &parentIndex); void OnProgress(QUuid, double); void ItemSelected(const QModelIndex& index); void OnUploadFromDataStorage(); void SessionTimedOutMsg(); void SessionTimesOutSoonMsg(); void ToggleConnection(); protected: - virtual void SetFocus() override; + void SetFocus() override; Ui::QmitkXnatTreeBrowserViewControls m_Controls; private slots: void OnXnatNodeSelected(const QModelIndex &index); void OnDownloadSelectedXnatFile(); void OnCreateResourceFolder(); private: void OnPreferencesChanged(const berry::IBerryPreferences*) override; void InternalFileDownload(const QModelIndex& index, bool loadData); void InternalDICOMDownload(ctkXnatObject* obj, QDir &DICOMDirPath); void InternalFileUpload(ctkXnatFile *file); ctkXnatResource* InternalAddResourceFolder(ctkXnatObject* parent); void InternalOpenFiles(const QFileInfoList&, mitk::StringProperty::Pointer xnatURL); void SetStatusInformation(const QString&); void FilePathNotAvailableWarning(QString file); void CleanUp(); ctkServiceTracker<mitk::IDataStorageService*> m_DataStorageServiceTracker; QmitkXnatTreeModel* m_TreeModel; mitk::XnatSessionTracker* m_Tracker; QString m_DownloadPath; QMenu* m_ContextMenu; bool m_SilentMode; QModelIndexList m_hiddenItems; bool m_AlreadyInSearch = false; std::string ReplaceSpecialChars(const std::string& input) const; }; #endif // QMITKXNATTREEBROWSERVIEW_H