diff --git a/Modules/ModuleList.cmake b/Modules/ModuleList.cmake index 12dc97e8fe..ade6e08d5e 100644 --- a/Modules/ModuleList.cmake +++ b/Modules/ModuleList.cmake @@ -1,81 +1,82 @@ # The entries in the mitk_modules list must be # ordered according to their dependencies. set(mitk_modules Core CommandLine AppUtil DCMTesting RDF LegacyIO DataTypesExt Annotation LegacyGL AlgorithmsExt MapperExt DICOMReader DICOMReaderServices DICOMTesting SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction LegacyAdaptors SceneSerialization Gizmo GraphAlgorithms Multilabel ImageStatistics ContourModel SurfaceInterpolation Segmentation PlanarFigureSegmentation OpenViewCore QtWidgets QtWidgetsExt C3js QmlItems SegmentationUI Classification DiffusionImaging GPGPU OpenIGTLink IGTBase IGT CameraCalibration OpenCL OpenCVVideoSupport QtOverlays ToFHardware ToFProcessing ToFUI US USUI DicomUI Simulation Remeshing Python QtPython Persistence OpenIGTLinkUI IGTUI VtkShaders DicomRT RTUI IOExt XNAT TubeGraph BiophotonicsHardware TumorInvasionAnalysis MatchPointRegistration MatchPointRegistrationUI BoundingShape RenderWindowManager RenderWindowManagerUI CEST DICOMQI + PhotoacousticArtifacts ) if(MITK_ENABLE_PIC_READER) list(APPEND mitk_modules IpPicSupportIO) endif() diff --git a/Modules/PhotoacousticArtifacts/CMakeLists.txt b/Modules/PhotoacousticArtifacts/CMakeLists.txt new file mode 100644 index 0000000000..092b0337b2 --- /dev/null +++ b/Modules/PhotoacousticArtifacts/CMakeLists.txt @@ -0,0 +1,5 @@ +MITK_CREATE_MODULE( + INCLUDE_DIRS PUBLIC src/Algorithms + DEPENDS MitkCore + WARNINGS_AS_ERRORS +) \ No newline at end of file diff --git a/Modules/PhotoacousticArtifacts/doc/doxygen/Modules.dox b/Modules/PhotoacousticArtifacts/doc/doxygen/Modules.dox new file mode 100644 index 0000000000..2e88f3b1f0 --- /dev/null +++ b/Modules/PhotoacousticArtifacts/doc/doxygen/Modules.dox @@ -0,0 +1,6 @@ +/** + \defgroup MitkPhotoacousticArtifactsModule PhotoacousticArtifacts + \ingroup MITKModules + + \brief Analysis of photoacoustic artifacts +*/ diff --git a/Modules/PhotoacousticArtifacts/files.cmake b/Modules/PhotoacousticArtifacts/files.cmake new file mode 100644 index 0000000000..1994796998 --- /dev/null +++ b/Modules/PhotoacousticArtifacts/files.cmake @@ -0,0 +1,10 @@ +file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") + +set(CPP_FILES + Algorithms/mitkPhotoacousticArtifact.cpp +) + +set(RESOURCE_FILES + Interactions/PlanarFigureConfig.xml + Interactions/PlanarFigureInteraction.xml +) diff --git a/Modules/PhotoacousticArtifacts/include/mitkPhotoacousticArtifact.h b/Modules/PhotoacousticArtifacts/include/mitkPhotoacousticArtifact.h new file mode 100644 index 0000000000..c767e24b88 --- /dev/null +++ b/Modules/PhotoacousticArtifacts/include/mitkPhotoacousticArtifact.h @@ -0,0 +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 mitkPhotoacousticArtifact_h +#define mitkPhotoacousticArtifact_h + +#include +#include +#include +#include + +namespace mitk +{ + + class MITKPHOTOACOUSTICARTIFACTS_EXPORT PhotoacousticArtifact + { + public: + PhotoacousticArtifact(); + virtual ~PhotoacousticArtifact(); + + protected: + + private: + + }; +} + +#endif mitkPhotoacousticArtifact_h diff --git a/Modules/PhotoacousticArtifacts/resource/Interactions/PlanarFigureConfig.xml b/Modules/PhotoacousticArtifacts/resource/Interactions/PlanarFigureConfig.xml new file mode 100644 index 0000000000..357c4f54dc --- /dev/null +++ b/Modules/PhotoacousticArtifacts/resource/Interactions/PlanarFigureConfig.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/PhotoacousticArtifacts/resource/Interactions/PlanarFigureInteraction.xml b/Modules/PhotoacousticArtifacts/resource/Interactions/PlanarFigureInteraction.xml new file mode 100644 index 0000000000..0cde69994d --- /dev/null +++ b/Modules/PhotoacousticArtifacts/resource/Interactions/PlanarFigureInteraction.xml @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + " + + + + + + + + + + " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/PhotoacousticArtifacts/src/Algorithms/mitkPhotoacousticArtifact.cpp b/Modules/PhotoacousticArtifacts/src/Algorithms/mitkPhotoacousticArtifact.cpp new file mode 100644 index 0000000000..96748ec3b7 --- /dev/null +++ b/Modules/PhotoacousticArtifacts/src/Algorithms/mitkPhotoacousticArtifact.cpp @@ -0,0 +1,28 @@ +/*=================================================================== + +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 + +mitk::PhotoacousticArtifact::PhotoacousticArtifact() +{ + MITK_INFO << "Hallo!"; + MITK_INFO << "Test12345"; +} + +mitk::PhotoacousticArtifact::~PhotoacousticArtifact() +{ + +} \ No newline at end of file diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index 69a9b62e79..19eac78781 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,98 +1,99 @@ # Plug-ins must be ordered according to their dependencies set(MITK_PLUGINS org.blueberry.core.runtime:ON org.blueberry.core.expressions:OFF org.blueberry.core.commands:OFF org.blueberry.core.jobs:OFF org.blueberry.ui.qt:OFF org.blueberry.ui.qt.help:OFF org.blueberry.ui.qt.log:ON org.blueberry.ui.qt.objectinspector:OFF #org.blueberry.test:ON #org.blueberry.uitest:ON #Testing/org.blueberry.core.runtime.tests:ON #Testing/org.blueberry.osgi.tests:ON org.mitk.core.services:ON org.mitk.gui.common:ON org.mitk.planarfigure:ON org.mitk.core.ext:OFF org.mitk.core.jobs:OFF org.mitk.simulation:OFF org.mitk.gui.qt.application:ON org.mitk.gui.qt.coreapplication:OFF org.mitk.gui.qt.ext:OFF org.mitk.gui.qt.extapplication:OFF org.mitk.gui.qt.common:ON org.mitk.gui.qt.stdmultiwidgeteditor:ON org.mitk.gui.qt.common.legacy:OFF org.mitk.gui.qt.cmdlinemodules:OFF org.mitk.gui.qt.diffusionimagingapp:OFF org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.datamanagerlight:OFF org.mitk.gui.qt.properties:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.dicom:OFF org.mitk.gui.qt.dicominspector:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.diffusionimaging.connectomics:OFF org.mitk.gui.qt.diffusionimaging.denoising:OFF org.mitk.gui.qt.diffusionimaging.fiberfox:OFF org.mitk.gui.qt.diffusionimaging.fiberprocessing:OFF org.mitk.gui.qt.diffusionimaging.ivim:OFF org.mitk.gui.qt.diffusionimaging.odfpeaks:OFF org.mitk.gui.qt.diffusionimaging.partialvolume:OFF org.mitk.gui.qt.diffusionimaging.preprocessing:OFF org.mitk.gui.qt.diffusionimaging.reconstruction:OFF org.mitk.gui.qt.diffusionimaging.registration:OFF org.mitk.gui.qt.diffusionimaging.tbss:OFF org.mitk.gui.qt.diffusionimaging.tractography:OFF org.mitk.gui.qt.dosevisualization:OFF org.mitk.gui.qt.geometrytools:OFF org.mitk.gui.qt.igtexamples:OFF org.mitk.gui.qt.igttracking:OFF org.mitk.gui.qt.openigtlink:OFF org.mitk.gui.qt.imagecropper:OFF org.mitk.gui.qt.imagenavigator:ON org.mitk.gui.qt.viewnavigator:OFF org.mitk.gui.qt.materialeditor:OFF org.mitk.gui.qt.measurementtoolbox:OFF org.mitk.gui.qt.moviemaker:OFF org.mitk.gui.qt.pointsetinteraction:OFF org.mitk.gui.qt.pointsetinteractionmultispectrum:OFF org.mitk.gui.qt.python:OFF org.mitk.gui.qt.remeshing:OFF org.mitk.gui.qt.segmentation:OFF org.mitk.gui.qt.simulation:OFF org.mitk.gui.qt.aicpregistration:OFF org.mitk.gui.qt.renderwindowmanager:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.tubegraph:OFF org.mitk.gui.qt.ugvisualization:OFF org.mitk.gui.qt.ultrasound:OFF org.mitk.gui.qt.volumevisualization:OFF org.mitk.gui.qt.eventrecorder:OFF org.mitk.gui.qt.xnat:OFF org.mitk.gui.qt.igt.app.echotrack:OFF org.mitk.gui.qt.spectrocamrecorder:OFF org.mitk.gui.qt.classificationsegmentation:OFF org.mitk.gui.qt.overlaymanager:OFF org.mitk.gui.qt.igt.app.hummelprotocolmeasurements:OFF org.mitk.gui.qt.multilabelsegmentation:OFF org.mitk.matchpoint.core.helper:OFF org.mitk.gui.qt.matchpoint.algorithm.browser:OFF org.mitk.gui.qt.matchpoint.algorithm.control:OFF org.mitk.gui.qt.matchpoint.algorithm.batch:OFF org.mitk.gui.qt.matchpoint.mapper:OFF org.mitk.gui.qt.matchpoint.framereg:OFF org.mitk.gui.qt.matchpoint.visualizer:OFF org.mitk.gui.qt.matchpoint.evaluator:OFF org.mitk.gui.qt.matchpoint.manipulator:OFF org.mitk.gui.qt.cest:OFF + org.mitk.gui.qt.photoacousticartifacts:OFF ) diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/CMakeLists.txt b/Plugins/org.mitk.gui.qt.photoacousticartifacts/CMakeLists.txt new file mode 100644 index 0000000000..ce28b9a783 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/CMakeLists.txt @@ -0,0 +1,8 @@ +project(org_mitk_gui_qt_photoacousticartifacts) + +mitk_create_plugin( + EXPORT_DIRECTIVE PHOTOACOUSTIC_ARTIFACTS_EXPORTS + EXPORTED_INCLUDE_SUFFIXES src + MODULE_DEPENDS PRIVATE MitkQtWidgetsExt + MODULE_DEPENDS PUBLIC MitkPhotoacousticArtifacts +) diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/UserManual/Manual.dox b/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/UserManual/Manual.dox new file mode 100644 index 0000000000..74e21d8648 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/UserManual/Manual.dox @@ -0,0 +1,20 @@ +/** +\page my_awesomeproject_exampleplugin The Awesome Example Plugin + +\imageMacro{icon.xpm,"Icon of Awesome Example Plugin",2.00} + +\tableofcontents + +\section my_awesomeproject_examplepluginOverview Overview + +Describe the features of your awesome plugin here + +
    +
  • Increases productivity
  • +
  • Creates beautiful images
  • +
  • Generates PhD thesis
  • +
  • Brings world peace
  • +
+ +*/ + diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/UserManual/icon.xpm b/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/UserManual/icon.xpm new file mode 100644 index 0000000000..83e48be4d8 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/UserManual/icon.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static const char * icon_xpm[] = { +"16 16 2 1", +" c #FF0000", +". c #000000", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/doxygen/modules.dox new file mode 100644 index 0000000000..0a267aec8e --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/documentation/doxygen/modules.dox @@ -0,0 +1,16 @@ +/** + \defgroup my_awesomeproject_exampleplugin my.awesomeproject.exampleplugin Plugin + \ingroup MITKPlugins + + \brief Describe your plugin here. + +*/ + +/** + \defgroup my_awesomeproject_exampleplugin_internal Internal + \ingroup my_awesomeproject_exampleplugin + + \brief This subcategory includes the internal classes of the my.awesomeproject.exampleplugin plugin. Other + plugins must not rely on these classes. They contain implementation details and their interface + may change at any time. We mean it. +*/ diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/files.cmake b/Plugins/org.mitk.gui.qt.photoacousticartifacts/files.cmake new file mode 100644 index 0000000000..0a0587bd1c --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/files.cmake @@ -0,0 +1,24 @@ +set(CPP_FILES + src/internal/PhotoacousticArtifactActivator.cpp + src/internal/PhotoacousticArtifact.cpp +) + +set(UI_FILES + src/internal/PhotoacousticArtifactViewControls.ui +) + +set(MOC_H_FILES + src/internal/PhotoacousticArtifactActivator.h + src/internal/PhotoacousticArtifact.h +) + +# List of resource files that can be used by the plugin system without loading +# the actual plugin. For example, the icon that is typically displayed in the +# plugin view menu at the top of the application window. +set(CACHED_RESOURCE_FILES + resources/AwesomeIcon.png + plugin.xml +) + +set(QRC_FILES +) diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.photoacousticartifacts/manifest_headers.cmake new file mode 100644 index 0000000000..6ccb20277e --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/manifest_headers.cmake @@ -0,0 +1,5 @@ +set(Plugin-Name "Photoacoustic Artifact Plugin") +set(Plugin-Version "0.1") +set(Plugin-Vendor "Photoacoustic Artifact Company") +set(Plugin-ContactAddress "http://www.awesomeproject.my") +set(Require-Plugin org.mitk.gui.qt.common) diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/plugin.xml b/Plugins/org.mitk.gui.qt.photoacousticartifacts/plugin.xml new file mode 100644 index 0000000000..78bf63089a --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/plugin.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/resources/AwesomeIcon.png b/Plugins/org.mitk.gui.qt.photoacousticartifacts/resources/AwesomeIcon.png new file mode 100644 index 0000000000..a858653b2a Binary files /dev/null and b/Plugins/org.mitk.gui.qt.photoacousticartifacts/resources/AwesomeIcon.png differ diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifact.cpp b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifact.cpp new file mode 100644 index 0000000000..f1fa9eefb0 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifact.cpp @@ -0,0 +1,178 @@ +/*=================================================================== + +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 "PhotoacousticArtifact.h" + +#include +#include + +#include + +#include +#include + +#include + +//#include +//#include + +// Helper function to create a fully set up instance of our +// AwesomeImageInteractor, based on the state machine specified in Paint.xml +// as well as its configuration in PaintConfig.xml. Both files are compiled +// into our MyAwesomeLib module as resources. +//static AwesomeImageInteractor::Pointer CreateAwesomeImageInteractor() +//{ +// auto myAwesomeLib = us::ModuleRegistry::GetModule("MyAwesomeLib"); +// +// auto interactor = AwesomeImageInteractor::New(); +// interactor->LoadStateMachine("Paint.xml", myAwesomeLib); +// interactor->SetEventConfig("PaintConfig.xml", myAwesomeLib); +// +// return interactor; +//} + +// Don't forget to initialize the VIEW_ID. +const std::string PhotoacousticArtifact::VIEW_ID = "photoacousticproject.views.photoacoustic.artifacts"; + +void PhotoacousticArtifact::CreateQtPartControl(QWidget* parent) +{ + // Setting up the UI is a true pleasure when using .ui files, isn't it? + m_Controls.setupUi(parent); + + // Wire up the UI widgets with our functionality. + connect(m_Controls.processImageButton, SIGNAL(clicked()), this, SLOT(ProcessSelectedImage())); +} + +void PhotoacousticArtifact::SetFocus() +{ + m_Controls.processImageButton->setFocus(); +} + +void PhotoacousticArtifact::OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList& dataNodes) +{ + for (const auto& dataNode : dataNodes) + { + // Write robust code. Always check pointers before using them. If the + // data node pointer is null, the second half of our condition isn't + // even evaluated and we're safe (C++ short-circuit evaluation). + if (dataNode.IsNotNull() && dynamic_cast(dataNode->GetData()) != nullptr) + { + m_Controls.selectImageLabel->setVisible(false); + return; + } + } + + // Nothing is selected or the selection doesn't contain an image. + m_Controls.selectImageLabel->setVisible(true); +} + +void PhotoacousticArtifact::ProcessSelectedImage() +{ + // Before we even think about processing something, we need to make sure + // that we have valid input. Don't be sloppy, this is a main reason + // for application crashes if neglected. + + mitk::PhotoacousticArtifact* filter = new mitk::PhotoacousticArtifact(); + + auto selectedDataNodes = this->GetDataManagerSelection(); + + if (selectedDataNodes.empty()) + return; + + auto firstSelectedDataNode = selectedDataNodes.front(); + + if (firstSelectedDataNode.IsNull()) + { + QMessageBox::information(nullptr, "Photoacoustic Artifact", "Please load and select an image before starting image processing."); + return; + } + + auto data = firstSelectedDataNode->GetData(); + + // Something is selected, but does it contain data? + if (data != nullptr) + { + // We don't use the auto keyword here, which would evaluate to a native + // image pointer. Instead, we want a smart pointer in order to ensure that + // the image isn't deleted somewhere else while we're using it. + mitk::Image::Pointer image = dynamic_cast(data); + + // Something is selected and it contains data, but is it an image? + if (image.IsNotNull()) + { + auto imageName = firstSelectedDataNode->GetName(); + auto offset = m_Controls.offsetSpinBox->value(); + + MITK_INFO << "Process image \"" << imageName << "\" ..."; + + // We're finally using the AwesomeImageFilter from our AwesomeLib module. + //auto filter = AwesomeImageFilter::New(); + //filter->SetInput(image); + //filter->SetOffset(offset); + + //filter->Update(); + + //mitk::Image::Pointer processedImage = filter->GetOutput(); + + //if (processedImage.IsNull() || !processedImage->IsInitialized()) + //return; + + MITK_INFO << " done"; + + // Stuff the resulting image into a data node, set some properties, + // and add it to the data storage, which will eventually display the + // image in the application. + auto processedImageDataNode = mitk::DataNode::New(); + //processedImageDataNode->SetData(processedImage); + + QString name = QString("%1 (Offset: %2)").arg(imageName.c_str()).arg(offset); + processedImageDataNode->SetName(name.toStdString()); + + // We don't really need to copy the level window, but if we wouldn't + // do it, the new level window would be initialized to display the image + // with optimal contrast in order to capture the whole range of pixel + // values. This is also true for the input image as long as one didn't + // modify its level window manually. Thus, the images would appear + // identical unless you compare the level window widget for both images. + mitk::LevelWindow levelWindow; + + if (firstSelectedDataNode->GetLevelWindow(levelWindow)) + processedImageDataNode->SetLevelWindow(levelWindow); + + // We also attach our AwesomeImageInteractor, which allows us to paint + // on the resulting images by using the mouse as long as the CTRL key + // is pressed. + //auto interactor = CreateAwesomeImageInteractor(); + + //if (interactor.IsNotNull()) + // interactor->SetDataNode(processedImageDataNode); + + this->GetDataStorage()->Add(processedImageDataNode); + } + } + + // Now it's your turn. This class/method has lots of room for improvements, + // for example: + // + // - What happens when multiple items are selected but the first one isn't + // an image? - There isn't any feedback for the user at all. + // - What's the front item of a selection? Does it depend on the order + // of selection or the position in the Data Manager? - Isn't it + // better to process all selected images? Don't forget to adjust the + // titles of the UI widgets. + // - In addition to the the displayed label, it's probably a good idea to + // enable or disable the button depending on the selection. +} diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifact.h b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifact.h new file mode 100644 index 0000000000..916da8e3f5 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifact.h @@ -0,0 +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 PhotoacousticArtifact_h +#define PhotoacousticArtifact_h + +#include +#include + +// There's an item "PhotoacousticArtifactViewControls.ui" in the UI_FILES list in +// files.cmake. The Qt UI Compiler will parse this file and generate a +// header file prefixed with "ui_", which is located in the build directory. +// Use Qt Creator to view and edit .ui files. The generated header file +// provides a class that contains all of the UI widgets. +#include + +// All views in MITK derive from QmitkAbstractView. You have to override +// at least the two methods CreateQtPartControl() and SetFocus(). +class PhotoacousticArtifact : public QmitkAbstractView +{ + // As QmitkAbstractView derives from QObject and we want to use the Qt + // signal and slot mechanism, we must not forget the Q_OBJECT macro. + // This header file also has to be listed in MOC_H_FILES in files.cmake, + // in order that the Qt Meta-Object Compiler can find and process this + // class declaration. + Q_OBJECT + +public: + // This is a tricky one and will give you some headache later on in + // your debug sessions if it has been forgotten. Also, don't forget + // to initialize it in the implementation file. + static const std::string VIEW_ID; + + // In this method we initialize the GUI components and connect the + // associated signals and slots. + void CreateQtPartControl(QWidget* parent) override; + +private slots: + void ProcessSelectedImage(); + +private: + // Typically a one-liner. Set the focus to the default widget. + void SetFocus() override; + + // This method is conveniently called whenever the selection of Data Manager + // items changes. + void OnSelectionChanged( + berry::IWorkbenchPart::Pointer source, + const QList& dataNodes) override; + + // Generated from the associated UI file, it encapsulates all the widgets + // of our view. + Ui::PhotoacousticArtifactViewControls m_Controls; +}; + +#endif diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactActivator.cpp b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactActivator.cpp new file mode 100644 index 0000000000..b60f9ac123 --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactActivator.cpp @@ -0,0 +1,27 @@ +/*=================================================================== + +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 "PhotoacousticArtifactActivator.h" +#include "PhotoacousticArtifact.h" + +void PhotoacousticArtifactActivator::start(ctkPluginContext* context) +{ + BERRY_REGISTER_EXTENSION_CLASS(PhotoacousticArtifact, context) +} + +void PhotoacousticArtifactActivator::stop(ctkPluginContext*) +{ +} diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactActivator.h b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactActivator.h new file mode 100644 index 0000000000..039479b60c --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactActivator.h @@ -0,0 +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 PhotoacousticArtifactActivator_h +#define PhotoacousticArtifactActivator_h + +#include + +class PhotoacousticArtifactActivator + : public QObject, + public ctkPluginActivator +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "photoacoustic_artifact_activator") + Q_INTERFACES(ctkPluginActivator) + +public: + void start(ctkPluginContext* context); + void stop(ctkPluginContext* context); +}; + +#endif diff --git a/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactViewControls.ui b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactViewControls.ui new file mode 100644 index 0000000000..bab44d293a --- /dev/null +++ b/Plugins/org.mitk.gui.qt.photoacousticartifacts/src/internal/PhotoacousticArtifactViewControls.ui @@ -0,0 +1,87 @@ + + + PhotoacousticArtifactViewControls + + + + 0 + 0 + 220 + 160 + + + + Photoacoustic Artifacts + + + + + + QLabel { color: rgb(255, 0, 0) } + + + Please select an image. + + + + + + + + 0 + + + + + Offset + + + + + + + + 0 + 0 + + + + 9999 + + + + + + + + + + Process selected image + + + Add Offset + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 220 + + + + + + + + + +