diff --git a/CMake/BuildConfigurations/Default.cmake b/CMake/BuildConfigurations/Default.cmake index 5b46d0ac78..4faffa7f12 100644 --- a/CMake/BuildConfigurations/Default.cmake +++ b/CMake/BuildConfigurations/Default.cmake @@ -1,23 +1,23 @@ set(MITK_CONFIG_PACKAGES ACVD Qt5 BLUEBERRY ) set(MITK_CONFIG_PLUGINS org.mitk.gui.qt.mitkworkbench.intro org.mitk.gui.qt.datamanager org.mitk.gui.qt.stdmultiwidgeteditor - org.mitk.gui.qt.dicom + org.mitk.gui.qt.dicombrowser org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.measurementtoolbox org.mitk.gui.qt.properties org.mitk.gui.qt.segmentation org.mitk.gui.qt.volumevisualization org.mitk.planarfigure org.mitk.gui.qt.moviemaker org.mitk.gui.qt.pointsetinteraction org.mitk.gui.qt.remeshing org.mitk.gui.qt.viewnavigator org.mitk.gui.qt.imagecropper ) diff --git a/CMake/BuildConfigurations/mitkNavigationModules.cmake b/CMake/BuildConfigurations/mitkNavigationModules.cmake index c315c718e0..d6881034ab 100644 --- a/CMake/BuildConfigurations/mitkNavigationModules.cmake +++ b/CMake/BuildConfigurations/mitkNavigationModules.cmake @@ -1,35 +1,35 @@ message(STATUS "Configuring MITK Navigation Modules Build") set(MITK_CONFIG_PACKAGES ACVD Qt5 BLUEBERRY ) # Enable open cv and open igt link, which is a necessary configuration set(MITK_USE_OpenCV ON CACHE BOOL "MITK Use OpenCV Library" FORCE) set(MITK_USE_OpenIGTLink ON CACHE BOOL "MITK Use OpenIGTLink Library" FORCE) # Enable default plugins and the navigation modules set(MITK_CONFIG_PLUGINS org.mitk.gui.qt.datamanager org.mitk.gui.qt.stdmultiwidgeteditor - org.mitk.gui.qt.dicom + org.mitk.gui.qt.dicombrowser org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.measurementtoolbox org.mitk.gui.qt.properties org.mitk.gui.qt.segmentation org.mitk.gui.qt.volumevisualization org.mitk.planarfigure org.mitk.gui.qt.moviemaker org.mitk.gui.qt.pointsetinteraction org.mitk.gui.qt.registration org.mitk.gui.qt.remeshing org.mitk.gui.qt.viewnavigator org.mitk.gui.qt.imagecropper org.mitk.gui.qt.igttracking org.mitk.gui.qt.openigtlink org.mitk.gui.qt.ultrasound org.mitk.gui.qt.tofutil ) diff --git a/CMake/Whitelists/CoreCmdApps.cmake b/CMake/Whitelists/CoreCmdApps.cmake index ccc34d77f7..f74c63a9c6 100644 --- a/CMake/Whitelists/CoreCmdApps.cmake +++ b/CMake/Whitelists/CoreCmdApps.cmake @@ -1,25 +1,25 @@ include(${CMAKE_CURRENT_LIST_DIR}/Minimal.cmake) list(APPEND enabled_modules AlgorithmsExt Annotation CommandLine ContourModel CoreCmdApps DataTypesExt DICOMPM DICOMPMIO DICOMQI - DICOMReader - DICOMReaderServices - DicomRT - DicomRTIO + DICOM + DICOMImageIO + RT + DICOMRTIO DICOMSegIO ModelFit Multilabel MultilabelIO LegacyGL SceneSerialization SceneSerializationBase ) diff --git a/CMake/Whitelists/FlowBenchSegmentation.cmake b/CMake/Whitelists/FlowBenchSegmentation.cmake index 41d3c61250..1f2ac2ac73 100644 --- a/CMake/Whitelists/FlowBenchSegmentation.cmake +++ b/CMake/Whitelists/FlowBenchSegmentation.cmake @@ -1,57 +1,57 @@ set(enabled_modules Core CppMicroServices - DICOMReader + DICOM DICOMPM DataTypesExt AlgorithmsExt DICOMQI Multilabel SceneSerializationBase DICOMPMIO - DICOMReaderServices + DICOMImageIO ContourModel DICOMSegIO LegacyGL MapperExt SceneSerialization LegacyIO IOExt MultilabelIO AppUtil QtWidgets QtWidgetsExt Segmentation SegmentationUI PlanarFigure Annotation IpSegmentation IpFunc SurfaceInterpolation GraphAlgorithms ImageExtraction ImageStatistics ) set(enabled_plugins org.blueberry.core.commands org.blueberry.core.expressions org.blueberry.core.runtime org.blueberry.ui.qt org.blueberry.ui.qt.help org.blueberry.ui.qt.log org.mitk.core.ext org.mitk.core.services org.mitk.gui.common org.mitk.gui.qt.application org.mitk.gui.qt.common org.mitk.gui.qt.datamanager org.mitk.gui.qt.flow.segmentation org.mitk.gui.qt.flowapplication org.mitk.gui.qt.imagenavigator org.mitk.gui.qt.multilabelsegmentation org.mitk.gui.qt.properties org.mitk.gui.qt.segmentation org.mitk.gui.qt.stdmultiwidgeteditor org.mitk.planarfigure ) diff --git a/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox b/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox index e86293bb2f..26d569a356 100644 --- a/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox +++ b/Documentation/Doxygen/2-UserManual/MITKPluginManualsList.dox @@ -1,84 +1,84 @@ /** \page PluginListPage MITK Plugin Manuals The plugins and bundles provide much of the extended functionality of MITK. Each encapsulates a solution to a problem and associated features. This way one can easily assemble the necessary capabilites for a workflow without adding a lot of bloat, by combining plugins as needed. \subpage PluginListGeneralPage \subpage PluginListSpecificPage */ diff --git a/Examples/Dump/CMakeLists.txt b/Examples/Dump/CMakeLists.txt index ca7227b8c3..ed6d8ef01b 100644 --- a/Examples/Dump/CMakeLists.txt +++ b/Examples/Dump/CMakeLists.txt @@ -1,3 +1,3 @@ project(Dump) -mitk_create_executable(DEPENDS MitkDICOMReader) +mitk_create_executable(DEPENDS MitkDICOM) diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer.views/CMakeLists.txt b/Examples/Plugins/org.mitk.example.gui.customviewer.views/CMakeLists.txt index 5f6bda6941..08b34eadc6 100644 --- a/Examples/Plugins/org.mitk.example.gui.customviewer.views/CMakeLists.txt +++ b/Examples/Plugins/org.mitk.example.gui.customviewer.views/CMakeLists.txt @@ -1,8 +1,8 @@ project(org_mitk_example_gui_customviewer_views) mitk_create_plugin( EXPORT_DIRECTIVE org_mitk_example_gui_customviewer_views_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkDicomUI + MODULE_DEPENDS MitkQtWidgetsExt MitkDICOMUI NO_INSTALL ) diff --git a/Modules/CEST/CMakeLists.txt b/Modules/CEST/CMakeLists.txt index 8aee176bf4..0b43dac056 100644 --- a/Modules/CEST/CMakeLists.txt +++ b/Modules/CEST/CMakeLists.txt @@ -1,9 +1,9 @@ MITK_CREATE_MODULE( DEPENDS MitkCore - PRIVATE MitkDICOMReader + PRIVATE MitkDICOM PACKAGE_DEPENDS PRIVATE ITK|ITKIOImageBase+ITKIOGDCM Poco ) add_subdirectory(autoload/IO) add_subdirectory(test) diff --git a/Modules/CEST/autoload/IO/CMakeLists.txt b/Modules/CEST/autoload/IO/CMakeLists.txt index 0e9e46ddbb..bd424d386a 100644 --- a/Modules/CEST/autoload/IO/CMakeLists.txt +++ b/Modules/CEST/autoload/IO/CMakeLists.txt @@ -1,6 +1,6 @@ MITK_CREATE_MODULE( CESTIO - DEPENDS MitkCEST MitkDICOMReader + DEPENDS MitkCEST MitkDICOM PACKAGE_DEPENDS PRIVATE ITK|ITKIOGDCM - AUTOLOAD_WITH MitkDICOMReader + AUTOLOAD_WITH MitkDICOM ) diff --git a/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h b/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h index 8131a8fad1..7d31464cf4 100644 --- a/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h +++ b/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h @@ -1,46 +1,46 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKCESTDICOMReaderService_H #define MITKCESTDICOMReaderService_H #include namespace mitk { /** Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from - the DICOMReader module and loads additional meta data for CEST data. + the DICOM module and loads additional meta data for CEST data. */ class CESTDICOMReaderService : public BaseDICOMReaderService { public: CESTDICOMReaderService(); CESTDICOMReaderService(const std::string& description); /** Uses the BaseDICOMReaderService Read function and add extra steps for CEST meta data */ using AbstractFileReader::Read; std::vector > Read() override; protected: /** Returns the reader instance that should be used. The decision may be based * one the passed list of relevant files.*/ mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override; private: CESTDICOMReaderService* Clone() const override; }; } #endif // MITKCESTDICOMREADERSERVICE_H diff --git a/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h b/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h index d173fbc3bc..854c74e359 100644 --- a/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h +++ b/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h @@ -1,54 +1,54 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKCESTGenericDICOMReaderService_H #define MITKCESTGenericDICOMReaderService_H #include namespace mitk { /** Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from - the DICOMReader module and loads the CEST relevant meta data from a provided cest_meta.json file or + the DICOM module and loads the CEST relevant meta data from a provided cest_meta.json file or provided from the user as reader options. */ class CESTDICOMManualReaderService : public BaseDICOMReaderService { public: CESTDICOMManualReaderService(const CustomMimeType& mimeType, const std::string& description); /** Uses the AbstractFileReader Read function and add extra steps for CEST meta data */ using AbstractFileReader::Read; std::vector > Read() override; Options GetOptions() const override; us::Any GetOption(const std::string& name) const override; protected: CESTDICOMManualReaderService(const CESTDICOMManualReaderService&) = default; CESTDICOMManualReaderService& operator=(const CESTDICOMManualReaderService&) = delete; std::string GetCESTMetaFilePath() const; std::string GetTRECFilePath() const; std::string GetLISTFilePath() const; mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override; private: CESTDICOMManualReaderService* Clone() const override; }; DICOMTagPath DICOM_IMAGING_FREQUENCY_PATH(); } #endif // MITKCESTGenericDICOMReaderService_H diff --git a/Modules/Classification/CLUtilities/CMakeLists.txt b/Modules/Classification/CLUtilities/CMakeLists.txt index 0061dac5ba..ad4d3835f8 100644 --- a/Modules/Classification/CLUtilities/CMakeLists.txt +++ b/Modules/Classification/CLUtilities/CMakeLists.txt @@ -1,14 +1,14 @@ mitk_create_module( - DEPENDS MitkCore MitkCLCore MitkCommandLine MitkDICOMReader + DEPENDS MitkCore MitkCLCore MitkCommandLine MitkDICOM PACKAGE_DEPENDS PUBLIC Eigen PRIVATE tinyxml ) if(TARGET ${MODULE_TARGET}) if(MITK_USE_OpenMP) target_link_libraries(${MODULE_TARGET} PUBLIC OpenMP::OpenMP_CXX) endif() if(BUILD_TESTING) add_subdirectory(test) endif() endif() diff --git a/Modules/DICOMReader/CMakeLists.txt b/Modules/DICOM/CMakeLists.txt similarity index 79% rename from Modules/DICOMReader/CMakeLists.txt rename to Modules/DICOM/CMakeLists.txt index 4a1cff1322..98d7de357c 100644 --- a/Modules/DICOMReader/CMakeLists.txt +++ b/Modules/DICOM/CMakeLists.txt @@ -1,8 +1,9 @@ MITK_CREATE_MODULE( DEPENDS MitkCore PACKAGE_DEPENDS PUBLIC tinyxml GDCM PRIVATE ITK|ITKIOImageBase+ITKIOGDCM DCMTK ) add_subdirectory(test) +add_subdirectory(autoload/DICOMImageIO) diff --git a/Modules/DICOMReader/TODOs.txt b/Modules/DICOM/TODOs.txt similarity index 100% rename from Modules/DICOMReader/TODOs.txt rename to Modules/DICOM/TODOs.txt diff --git a/Modules/DICOMReaderServices/CMakeLists.txt b/Modules/DICOM/autoload/DICOMImageIO/CMakeLists.txt similarity index 75% rename from Modules/DICOMReaderServices/CMakeLists.txt rename to Modules/DICOM/autoload/DICOMImageIO/CMakeLists.txt index ca742d6e75..53a0b7f3c2 100644 --- a/Modules/DICOMReaderServices/CMakeLists.txt +++ b/Modules/DICOM/autoload/DICOMImageIO/CMakeLists.txt @@ -1,6 +1,6 @@ MITK_CREATE_MODULE( - DEPENDS MitkCore MitkDICOMReader + DEPENDS MitkCore MitkDICOM PACKAGE_DEPENDS PRIVATE ITK|ITKIOGDCM+ITKIOImageBase AUTOLOAD_WITH MitkCore ) diff --git a/Modules/DICOMReaderServices/files.cmake b/Modules/DICOM/autoload/DICOMImageIO/files.cmake similarity index 89% rename from Modules/DICOMReaderServices/files.cmake rename to Modules/DICOM/autoload/DICOMImageIO/files.cmake index 1a80da327e..7e3c88e6bf 100644 --- a/Modules/DICOMReaderServices/files.cmake +++ b/Modules/DICOM/autoload/DICOMImageIO/files.cmake @@ -1,10 +1,10 @@ file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") set(CPP_FILES mitkAutoSelectingDICOMReaderService.cpp mitkClassicDICOMSeriesReaderService.cpp - mitkDICOMReaderServicesActivator.cpp + mitkDICOMImageIOActivator.cpp mitkDICOMTagsOfInterestService.cpp mitkSimpleVolumeDICOMSeriesReaderService.cpp mitkManualSelectingDICOMReaderService.cpp ) diff --git a/Modules/DICOMReaderServices/include/mitkAutoSelectingDICOMReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkAutoSelectingDICOMReaderService.h similarity index 97% rename from Modules/DICOMReaderServices/include/mitkAutoSelectingDICOMReaderService.h rename to Modules/DICOM/autoload/DICOMImageIO/include/mitkAutoSelectingDICOMReaderService.h index e0087dd882..e8e37b07a1 100644 --- a/Modules/DICOMReaderServices/include/mitkAutoSelectingDICOMReaderService.h +++ b/Modules/DICOM/autoload/DICOMImageIO/include/mitkAutoSelectingDICOMReaderService.h @@ -1,41 +1,41 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKAUTOSELECTINGDICOMREADERSERVICE_H #define MITKAUTOSELECTINGDICOMREADERSERVICE_H #include namespace mitk { /** Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from - the DICOMReader module. + the DICOM module. */ class AutoSelectingDICOMReaderService : public BaseDICOMReaderService { public: AutoSelectingDICOMReaderService(); protected: /** Returns the reader instance that should be used. The decision may be based * one the passed list of relevant files.*/ mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override; private: AutoSelectingDICOMReaderService* Clone() const override; }; } #endif // MITKDICOMSERIESREADERSERVICE_H diff --git a/Modules/DICOMReaderServices/include/mitkClassicDICOMSeriesReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkClassicDICOMSeriesReaderService.h similarity index 97% rename from Modules/DICOMReaderServices/include/mitkClassicDICOMSeriesReaderService.h rename to Modules/DICOM/autoload/DICOMImageIO/include/mitkClassicDICOMSeriesReaderService.h index 8e1237e9e5..8db472ab28 100644 --- a/Modules/DICOMReaderServices/include/mitkClassicDICOMSeriesReaderService.h +++ b/Modules/DICOM/autoload/DICOMImageIO/include/mitkClassicDICOMSeriesReaderService.h @@ -1,40 +1,40 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKCLASSICDICOMSERIESREADERSERVICE_H #define MITKCLASSICDICOMSERIESREADERSERVICE_H #include namespace mitk { /** Service wrapper that directly returns an instance of ClassicDICOMSeriesReader class from - the DICOMReader module. + the DICOM module. */ class ClassicDICOMSeriesReaderService : public BaseDICOMReaderService { public: ClassicDICOMSeriesReaderService(); protected: /** Returns a ClassicDICOMSeriesReader instance.*/ mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override; private: ClassicDICOMSeriesReaderService* Clone() const override; }; } #endif // MITKCLASSICDICOMSERIESREADERSERVICE_H diff --git a/Modules/DICOMReaderServices/include/mitkDICOMTagsOfInterestService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkDICOMTagsOfInterestService.h similarity index 100% rename from Modules/DICOMReaderServices/include/mitkDICOMTagsOfInterestService.h rename to Modules/DICOM/autoload/DICOMImageIO/include/mitkDICOMTagsOfInterestService.h diff --git a/Modules/DICOMReaderServices/include/mitkManualSelectingDICOMReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkManualSelectingDICOMReaderService.h similarity index 100% rename from Modules/DICOMReaderServices/include/mitkManualSelectingDICOMReaderService.h rename to Modules/DICOM/autoload/DICOMImageIO/include/mitkManualSelectingDICOMReaderService.h diff --git a/Modules/DICOMReaderServices/include/mitkSimpleVolumeDICOMSeriesReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkSimpleVolumeDICOMSeriesReaderService.h similarity index 100% rename from Modules/DICOMReaderServices/include/mitkSimpleVolumeDICOMSeriesReaderService.h rename to Modules/DICOM/autoload/DICOMImageIO/include/mitkSimpleVolumeDICOMSeriesReaderService.h diff --git a/Modules/DICOMReaderServices/src/mitkAutoSelectingDICOMReaderService.cpp b/Modules/DICOM/autoload/DICOMImageIO/src/mitkAutoSelectingDICOMReaderService.cpp similarity index 100% rename from Modules/DICOMReaderServices/src/mitkAutoSelectingDICOMReaderService.cpp rename to Modules/DICOM/autoload/DICOMImageIO/src/mitkAutoSelectingDICOMReaderService.cpp diff --git a/Modules/DICOMReaderServices/src/mitkClassicDICOMSeriesReaderService.cpp b/Modules/DICOM/autoload/DICOMImageIO/src/mitkClassicDICOMSeriesReaderService.cpp similarity index 100% rename from Modules/DICOMReaderServices/src/mitkClassicDICOMSeriesReaderService.cpp rename to Modules/DICOM/autoload/DICOMImageIO/src/mitkClassicDICOMSeriesReaderService.cpp diff --git a/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.cpp b/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.cpp similarity index 87% rename from Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.cpp rename to Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.cpp index 907f5ab402..95ea5f389d 100644 --- a/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.cpp +++ b/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.cpp @@ -1,123 +1,123 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ -#include "mitkDICOMReaderServicesActivator.h" +#include "mitkDICOMImageIOActivator.h" #include "mitkAutoSelectingDICOMReaderService.h" #include "mitkManualSelectingDICOMReaderService.h" #include "mitkDICOMTagsOfInterestService.h" #include "mitkSimpleVolumeDICOMSeriesReaderService.h" #include "mitkCoreServices.h" #include "mitkPropertyPersistenceInfo.h" #include "mitkDICOMIOMetaInformationPropertyConstants.h" #include "mitkIPropertyPersistence.h" #include "mitkTemporoSpatialStringProperty.h" #include #include void AddPropertyPersistence(const mitk::PropertyKeyPath& propPath, bool temporoSpatial = false) { mitk::CoreServicePointer persistenceService(mitk::CoreServices::GetPropertyPersistence()); mitk::PropertyPersistenceInfo::Pointer info = mitk::PropertyPersistenceInfo::New(); if (propPath.IsExplicit()) { std::string name = mitk::PropertyKeyPathToPropertyName(propPath); std::string key = name; std::replace(key.begin(), key.end(), '.', '_'); info->SetNameAndKey(name, key); } else { std::string key = mitk::PropertyKeyPathToPersistenceKeyRegEx(propPath); std::string keyTemplate = mitk::PropertyKeyPathToPersistenceKeyTemplate(propPath); std::string propRegEx = mitk::PropertyKeyPathToPropertyRegEx(propPath); std::string propTemplate = mitk::PropertyKeyPathToPersistenceNameTemplate(propPath); info->UseRegEx(propRegEx, propTemplate, key, keyTemplate); } if (temporoSpatial) { info->SetDeserializationFunction(mitk::PropertyPersistenceDeserialization::deserializeJSONToTemporoSpatialStringProperty); info->SetSerializationFunction(mitk::PropertyPersistenceSerialization::serializeTemporoSpatialStringPropertyToJSON); } persistenceService->AddInfo(info); } namespace mitk { - void DICOMReaderServicesActivator::Load(us::ModuleContext* context) + void DICOMImageIOActivator::Load(us::ModuleContext* context) { m_Context = context; m_AutoSelectingDICOMReader = std::make_unique(); m_SimpleVolumeDICOMSeriesReader = std::make_unique(); m_DICOMTagsOfInterestService = std::make_unique(); context->RegisterService(m_DICOMTagsOfInterestService.get()); DICOMTagPathMapType tagmap = GetDefaultDICOMTagsOfInterest(); for (auto tag : tagmap) { m_DICOMTagsOfInterestService->AddTagOfInterest(tag.first); } //add properties that should be persistent (if possible/supported by the writer) AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_3D_plus_t()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_CONFIGURATION()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_DCMTK()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_FILES(), true); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_GANTRY_TILT_CORRECTED()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_GDCM()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_IMPLEMENTATION_LEVEL()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_IMPLEMENTATION_LEVEL_STRING()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_PIXEL_SPACING_INTERPRETATION()); AddPropertyPersistence(mitk::DICOMIOMetaInformationPropertyConstants::READER_PIXEL_SPACING_INTERPRETATION_STRING()); //We have to handle ManualSelectingDICOMSeriesReader different then the other //readers. Reason: The reader uses DICOMFileReaderSelector in its constructor. - //this class needs to access resources of MitkDICOMReader module, which might + //this class needs to access resources of MitkDICOM module, which might //not be initialized yet (that would lead to a crash, see i.a. T27553). Thus check if the module //is alreade loaded. If not, register a listener and create the reader as soon //as the module is available. - auto dicomModule = us::ModuleRegistry::GetModule("MitkDICOMReader"); + auto dicomModule = us::ModuleRegistry::GetModule("MitkDICOM"); if (nullptr == dicomModule) { std::lock_guard lock(m_Mutex); // Listen for events of module life cycle. - m_Context->AddModuleListener(this, &DICOMReaderServicesActivator::EnsureManualSelectingDICOMSeriesReader); + m_Context->AddModuleListener(this, &DICOMImageIOActivator::EnsureManualSelectingDICOMSeriesReader); } else { m_ManualSelectingDICOMSeriesReader = std::make_unique(); } } - void DICOMReaderServicesActivator::Unload(us::ModuleContext*) + void DICOMImageIOActivator::Unload(us::ModuleContext*) { } - void DICOMReaderServicesActivator::EnsureManualSelectingDICOMSeriesReader(const us::ModuleEvent event) + void DICOMImageIOActivator::EnsureManualSelectingDICOMSeriesReader(const us::ModuleEvent event) { //We have to handle ManualSelectingDICOMSeriesReader different then the other //readers. For more details see the explanations in the constructor. std::lock_guard lock(m_Mutex); - if (nullptr == m_ManualSelectingDICOMSeriesReader && event.GetModule()->GetName()=="MitkDICOMReader" && event.GetType() == us::ModuleEvent::LOADED) + if (nullptr == m_ManualSelectingDICOMSeriesReader && event.GetModule()->GetName()=="MitkDICOM" && event.GetType() == us::ModuleEvent::LOADED) { m_ManualSelectingDICOMSeriesReader = std::make_unique(); } } } -US_EXPORT_MODULE_ACTIVATOR(mitk::DICOMReaderServicesActivator) +US_EXPORT_MODULE_ACTIVATOR(mitk::DICOMImageIOActivator) diff --git a/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.h b/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.h similarity index 85% rename from Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.h rename to Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.h index ae6c9d4de1..52a80c0db8 100644 --- a/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.h +++ b/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.h @@ -1,50 +1,50 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ -#ifndef MITKDICOMREADERSERVICESACTIVATOR_H -#define MITKDICOMREADERSERVICESACTIVATOR_H +#ifndef MITKDICOMIMAGEIOACTIVATOR_H +#define MITKDICOMIMAGEIOACTIVATOR_H #include #include #include #include namespace mitk { struct IFileReader; class IDICOMTagsOfInterest; -class DICOMReaderServicesActivator : public us::ModuleActivator +class DICOMImageIOActivator : public us::ModuleActivator { public: void Load(us::ModuleContext* context) override; void Unload(us::ModuleContext* context) override; private: void EnsureManualSelectingDICOMSeriesReader(const us::ModuleEvent event); std::unique_ptr m_AutoSelectingDICOMReader; std::unique_ptr m_ManualSelectingDICOMSeriesReader; std::unique_ptr m_SimpleVolumeDICOMSeriesReader; std::unique_ptr m_DICOMTagsOfInterestService; us::ModuleContext* m_Context; /**mutex to guard the module listening */ std::mutex m_Mutex; }; } -#endif // MITKDICOMREADERSERVICESACTIVATOR_H +#endif // MITKDICOMIMAGEIOACTIVATOR_H diff --git a/Modules/DICOMReaderServices/src/mitkDICOMTagsOfInterestService.cpp b/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMTagsOfInterestService.cpp similarity index 100% rename from Modules/DICOMReaderServices/src/mitkDICOMTagsOfInterestService.cpp rename to Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMTagsOfInterestService.cpp diff --git a/Modules/DICOMReaderServices/src/mitkManualSelectingDICOMReaderService.cpp b/Modules/DICOM/autoload/DICOMImageIO/src/mitkManualSelectingDICOMReaderService.cpp similarity index 100% rename from Modules/DICOMReaderServices/src/mitkManualSelectingDICOMReaderService.cpp rename to Modules/DICOM/autoload/DICOMImageIO/src/mitkManualSelectingDICOMReaderService.cpp diff --git a/Modules/DICOMReaderServices/src/mitkSimpleVolumeDICOMSeriesReaderService.cpp b/Modules/DICOM/autoload/DICOMImageIO/src/mitkSimpleVolumeDICOMSeriesReaderService.cpp similarity index 93% rename from Modules/DICOMReaderServices/src/mitkSimpleVolumeDICOMSeriesReaderService.cpp rename to Modules/DICOM/autoload/DICOMImageIO/src/mitkSimpleVolumeDICOMSeriesReaderService.cpp index 06ca6de7e6..71f9460b5a 100644 --- a/Modules/DICOMReaderServices/src/mitkSimpleVolumeDICOMSeriesReaderService.cpp +++ b/Modules/DICOM/autoload/DICOMImageIO/src/mitkSimpleVolumeDICOMSeriesReaderService.cpp @@ -1,64 +1,64 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "mitkSimpleVolumeDICOMSeriesReaderService.h" #include "mitkDICOMReaderConfigurator.h" #include #include #include #include #include #include #include namespace mitk { SimpleVolumeDICOMSeriesReaderService::SimpleVolumeDICOMSeriesReaderService() : BaseDICOMReaderService("MITK Simple 3D Volume Importer") { this->RegisterService(); } DICOMFileReader::Pointer SimpleVolumeDICOMSeriesReaderService::GetReader(const mitk::StringList& relevantFiles) const { mitk::StringList files = relevantFiles; std::string descr; us::ModuleResource resource = - us::ModuleRegistry::GetModule("MitkDICOMReader")->GetResource("configurations/3D/simpleinstancenumber_soft.xml"); + us::ModuleRegistry::GetModule("MitkDICOM")->GetResource("configurations/3D/simpleinstancenumber_soft.xml"); if ( resource.IsValid() ) { us::ModuleResourceStream stream(resource); stream.seekg(0, std::ios::end); descr.reserve(stream.tellg()); stream.seekg(0, std::ios::beg); descr.assign((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); } DICOMReaderConfigurator::Pointer configurator = DICOMReaderConfigurator::New(); DICOMFileReader::Pointer reader = configurator->CreateFromUTF8ConfigString(descr); return reader.GetPointer(); }; SimpleVolumeDICOMSeriesReaderService* SimpleVolumeDICOMSeriesReaderService::Clone() const { return new SimpleVolumeDICOMSeriesReaderService(*this); } } diff --git a/Modules/DICOMReader/doc/Doxygen/Modules.dox b/Modules/DICOM/doc/Doxygen/Modules.dox similarity index 88% rename from Modules/DICOMReader/doc/Doxygen/Modules.dox rename to Modules/DICOM/doc/Doxygen/Modules.dox index 2867b4a88e..93953558ba 100644 --- a/Modules/DICOMReader/doc/Doxygen/Modules.dox +++ b/Modules/DICOM/doc/Doxygen/Modules.dox @@ -1,38 +1,38 @@ /** -\defgroup DICOMReaderModule The DICOMReader Module +\defgroup DICOMModule The DICOM Module \ingroup MITKModules \brief DICOM This module contains a number of classes for DICOM image loading within MITK. -\section DICOMReaderModule_overview Scope +\section DICOMModule_overview Scope When people around MITK talk about loading DICOM images or series, they are really not interested in the images (2D slices) but in a 3D mitk::Image instance that groups DICOM images in a meaningful way. The task of this module is to provide - an interface for the general "DICOM files to mitk::Images" transformation: mitk::DICOMFileReader - a flexible default reader for the most common DICOM images: mitk::DICOMITKSeriesGDCMReader Most documentation is kept with these classes, so please have a look at their documentations. \remark Prior to this module, a class called DicomSeriesReader grew too much to be maintainable anymore. Its functionality is conserved by class mitk::ClassicDICOMSeriesReader. -\section DICOMReaderModule_interface Module Interface +\section DICOMModule_interface Module Interface The general loading proceduce is structured by mitk::DICOMFileReader, under the assumption that the best reader for a set of files is not known prior to inspection. To facilitate applications that need to select between possible readers based on what would be loaded, file readers are required to implement loading in two separate steps: 1. analysis of a list of files and description of potential mitk::Image%s by means of mitk::DICOMImageBlockDescriptor 2. actual loading of pixel data into mitk::Image%s A very simple implementation is mitk::DICOMFileReaderSelector which selects the reader with the least possible number of mitk::Images (least confusing for the user?). -\section DICOMReaderModule_tasks Tasks for future development +\section DICOMModule_tasks Tasks for future development Unstructured development tasks and ideas for future extensions - a multi-frame image reader based on DCMTK - perspective: slice-by-slice loading */ diff --git a/Modules/DICOMReader/doc/Doxygen/tilt-correction.jpg b/Modules/DICOM/doc/Doxygen/tilt-correction.jpg similarity index 100% rename from Modules/DICOMReader/doc/Doxygen/tilt-correction.jpg rename to Modules/DICOM/doc/Doxygen/tilt-correction.jpg diff --git a/Modules/DICOMReader/doc/images/implementeditkseriesgdcmreader.jpg b/Modules/DICOM/doc/images/implementeditkseriesgdcmreader.jpg similarity index 100% rename from Modules/DICOMReader/doc/images/implementeditkseriesgdcmreader.jpg rename to Modules/DICOM/doc/images/implementeditkseriesgdcmreader.jpg diff --git a/Modules/DICOMReader/doc/images/tilt-correction.jpg b/Modules/DICOM/doc/images/tilt-correction.jpg similarity index 100% rename from Modules/DICOMReader/doc/images/tilt-correction.jpg rename to Modules/DICOM/doc/images/tilt-correction.jpg diff --git a/Modules/DICOMReader/files.cmake b/Modules/DICOM/files.cmake similarity index 100% rename from Modules/DICOMReader/files.cmake rename to Modules/DICOM/files.cmake diff --git a/Modules/DICOMReader/include/mitkBaseDICOMReaderService.h b/Modules/DICOM/include/mitkBaseDICOMReaderService.h similarity index 89% rename from Modules/DICOMReader/include/mitkBaseDICOMReaderService.h rename to Modules/DICOM/include/mitkBaseDICOMReaderService.h index 0850f14699..ce18439626 100644 --- a/Modules/DICOMReader/include/mitkBaseDICOMReaderService.h +++ b/Modules/DICOM/include/mitkBaseDICOMReaderService.h @@ -1,70 +1,70 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKBASEDICOMREADERSERVICE_H #define MITKBASEDICOMREADERSERVICE_H #include #include -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** Base class for service wrappers that make DICOMFileReader from - the DICOMReader module usable. + the DICOM module usable. */ -class MITKDICOMREADER_EXPORT BaseDICOMReaderService : public AbstractFileReader +class MITKDICOM_EXPORT BaseDICOMReaderService : public AbstractFileReader { public: using AbstractFileReader::Read; IFileReader::ConfidenceLevel GetConfidenceLevel() const override; protected: BaseDICOMReaderService(const std::string& description); BaseDICOMReaderService(const mitk::CustomMimeType& customType, const std::string& description); /** Uses this->GetRelevantFile() and this->GetReader to load the image. * data and puts it into base data instances-*/ std::vector> DoRead() override; /** Returns the list of all DCM files that are in the same directory * like this->GetLocalFileName().*/ mitk::StringList GetDICOMFilesInSameDirectory() const; /** Returns the reader instance that should be used. The decision may be based * one the passed list of relevant files.*/ virtual mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const = 0; void SetOnlyRegardOwnSeries(bool); bool GetOnlyRegardOwnSeries() const; private: /** Flags that constrols if the read() operation should only regard DICOM files of the same series if the specified GetLocalFileName() is a file. If it is a director, this flag has no impact (it is assumed false then). */ bool m_OnlyRegardOwnSeries = true; }; class IPropertyProvider; /** Helper function that generates a name string (e.g. for DataNode names) from the DICOM properties of the passed provider instance. If the instance is nullptr, or has no dicom properties DataNode::NO_NAME_VALUE() will be returned.*/ -std::string MITKDICOMREADER_EXPORT GenerateNameFromDICOMProperties(const mitk::IPropertyProvider* provider); +std::string MITKDICOM_EXPORT GenerateNameFromDICOMProperties(const mitk::IPropertyProvider* provider); } #endif // MITKBASEDICOMREADERSERVICE_H diff --git a/Modules/DICOMReader/include/mitkClassicDICOMSeriesReader.h b/Modules/DICOM/include/mitkClassicDICOMSeriesReader.h similarity index 94% rename from Modules/DICOMReader/include/mitkClassicDICOMSeriesReader.h rename to Modules/DICOM/include/mitkClassicDICOMSeriesReader.h index 5e19e2901f..4aa37c6118 100644 --- a/Modules/DICOMReader/include/mitkClassicDICOMSeriesReader.h +++ b/Modules/DICOM/include/mitkClassicDICOMSeriesReader.h @@ -1,79 +1,79 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkClassicDICOMSeriesReader_h #define mitkClassicDICOMSeriesReader_h #include "mitkThreeDnTDICOMSeriesReader.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Sorting and grouping like mitk::DicomSeriesReader until 2013. This class implements the same functionality as the legacy class DicomSeriesReader, except that is is 75 lines instead of 2500 lines. \warning Since the old class is known to have problems with some series, it is advised to use a good configuration of DICOMITKSeriesGDCMReader, which can be obtained by using DICOMFileReaderSelector. The following text documents the actual sorting logic of this reader. The class groups datasets that have different values in any of the following tags: - (0028,0010) Number of Rows - (0028,0011) Number of Columns - (0028,0030) Pixel Spacing - (0018,1164) Imager Pixel Spacing - (0020,0037) %Image Orientation (Patient) - (0018,0050) Slice Thickness - (0028,0008) Number of Frames - (0020,000e) Series Instance UID Within each of the groups, datasets are sorted by the value of the following tags (primary sorting first): - (0020,0032) %Image Position (Patient) (distance from zero along normal of (0020,0037) %Image Orientation (Patient)) - (0020,0012) Aqcuisition Number - (0008,0032) Aqcuisition Time - (0018,1060) Trigger Time - (0008,0018) SOP Instance UID (last resort, not really meaningful but decides clearly) If the series was acquired using a tilted gantry, this will be "fixed" by applying a shear transformation. If multiple images occupy the same position in space, it is assumed that this indicated a 3D+t image. */ -class MITKDICOMREADER_EXPORT ClassicDICOMSeriesReader : public ThreeDnTDICOMSeriesReader +class MITKDICOM_EXPORT ClassicDICOMSeriesReader : public ThreeDnTDICOMSeriesReader { public: mitkClassMacro( ClassicDICOMSeriesReader, DICOMITKSeriesGDCMReader ); mitkCloneMacro( ClassicDICOMSeriesReader ); itkNewMacro( ClassicDICOMSeriesReader ); bool operator==(const DICOMFileReader& other) const override; protected: ClassicDICOMSeriesReader(); ~ClassicDICOMSeriesReader() override; ClassicDICOMSeriesReader(const ClassicDICOMSeriesReader& other); ClassicDICOMSeriesReader& operator=(const ClassicDICOMSeriesReader& other); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMDCMTKTagScanner.h b/Modules/DICOM/include/mitkDICOMDCMTKTagScanner.h similarity index 95% rename from Modules/DICOMReader/include/mitkDICOMDCMTKTagScanner.h rename to Modules/DICOM/include/mitkDICOMDCMTKTagScanner.h index fd7248478e..248843d32c 100644 --- a/Modules/DICOMReader/include/mitkDICOMDCMTKTagScanner.h +++ b/Modules/DICOM/include/mitkDICOMDCMTKTagScanner.h @@ -1,95 +1,95 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMDCMTKTagScanner_h #define mitkDICOMDCMTKTagScanner_h #include #include "mitkDICOMTagScanner.h" #include "mitkDICOMEnums.h" #include "mitkDICOMGenericTagCache.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Encapsulates the tag scanning process for a set of DICOM files. For the scanning process it uses DCMTK functionality. */ - class MITKDICOMREADER_EXPORT DICOMDCMTKTagScanner : public DICOMTagScanner + class MITKDICOM_EXPORT DICOMDCMTKTagScanner : public DICOMTagScanner { public: mitkClassMacro(DICOMDCMTKTagScanner, DICOMTagScanner); itkFactorylessNewMacro( DICOMDCMTKTagScanner ); itkCloneMacro(Self); /** \brief Add this tag to the scanning process. */ void AddTag(const DICOMTag& tag) override; /** \brief Add a list of tags to the scanning process. */ void AddTags(const DICOMTagList& tags) override; /** \brief Add this tag path to the scanning process. */ void AddTagPath(const DICOMTagPath& tag) override; /** \brief Add a list of tag pathes to the scanning process. */ void AddTagPaths(const DICOMTagPathList& tags) override; /** \brief Define the list of files to scan. This does not ADD to an internal list, but it replaces the whole list of files. */ void SetInputFiles(const StringList& filenames) override; /** \brief Start the scanning process. Calling Scan() will invalidate previous scans, forgetting all about files and tags from files that have been scanned previously. */ void Scan() override; /** \brief Retrieve a result list for file-by-file tag access. */ DICOMDatasetAccessingImageFrameList GetFrameInfoList() const override; /** \brief Retrieve Pointer to the complete cache of the scan. */ DICOMTagCache::Pointer GetScanCache() const override; protected: DICOMDCMTKTagScanner(); ~DICOMDCMTKTagScanner() override; std::set m_ScannedTags; StringList m_InputFilenames; DICOMGenericTagCache::Pointer m_Cache; private: DICOMDCMTKTagScanner(const DICOMDCMTKTagScanner&); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMDatasetAccess.h b/Modules/DICOM/include/mitkDICOMDatasetAccess.h similarity index 92% rename from Modules/DICOMReader/include/mitkDICOMDatasetAccess.h rename to Modules/DICOM/include/mitkDICOMDatasetAccess.h index 6b33ec8b6f..53b115ee5f 100644 --- a/Modules/DICOMReader/include/mitkDICOMDatasetAccess.h +++ b/Modules/DICOM/include/mitkDICOMDatasetAccess.h @@ -1,74 +1,74 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMDatasetAccess_h #define mitkDICOMDatasetAccess_h #include "mitkDICOMTag.h" #include "mitkDICOMTagPath.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** Helper class that is used for the result of DICOMDatasetAccess::GetTagValueAsString */ - struct MITKDICOMREADER_EXPORT DICOMDatasetFinding + struct MITKDICOM_EXPORT DICOMDatasetFinding { /**Indicates if value is valid or not.*/ bool isValid; /**The found value.*/ std::string value; /**Tag path of the value*/ DICOMTagPath path; DICOMDatasetFinding(bool valid = false, const std::string& aValue = "", const DICOMTagPath& aPath = DICOMTagPath()) : isValid(valid), value(aValue), path(aPath) {}; }; /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Interface to datasets that is presented to sorting classes such as DICOMDatasetSorter. Minimal interface to hide actual implementation, which might rely on GDCM. */ -class MITKDICOMREADER_EXPORT DICOMDatasetAccess +class MITKDICOM_EXPORT DICOMDatasetAccess { public: typedef std::list FindingsListType; /// \brief Return a filename if possible. /// If DICOM is not read from file but from somewhere else (network, database), we might not have files. virtual std::string GetFilenameIfAvailable() const = 0; /** \brief Return a DICOMDatasetFinding instance of the tag. The return containes (if valid) the raw value of the tag as a string. \param tag Tag which value should be retreived. */ virtual DICOMDatasetFinding GetTagValueAsString(const DICOMTag& tag) const = 0; /** \brief Return a list of DICOMDatasetFindings of the passed tag path. The return containes (if valid) the raw value of the tag as a string. \param path Tag path which value should be retreived. */ virtual FindingsListType GetTagValueAsString(const DICOMTagPath& path) const = 0; virtual ~DICOMDatasetAccess() {}; }; typedef std::vector DICOMDatasetList; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMDatasetAccessingImageFrameInfo.h b/Modules/DICOM/include/mitkDICOMDatasetAccessingImageFrameInfo.h similarity index 83% rename from Modules/DICOMReader/include/mitkDICOMDatasetAccessingImageFrameInfo.h rename to Modules/DICOM/include/mitkDICOMDatasetAccessingImageFrameInfo.h index 938e7d791e..064f683914 100644 --- a/Modules/DICOMReader/include/mitkDICOMDatasetAccessingImageFrameInfo.h +++ b/Modules/DICOM/include/mitkDICOMDatasetAccessingImageFrameInfo.h @@ -1,59 +1,59 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMDatasetAccessingImageFrameInfo_h #define mitkDICOMDatasetAccessingImageFrameInfo_h #include "mitkDICOMImageFrameInfo.h" #include "mitkDICOMDatasetAccess.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Defines an abstract base class for DICOM image frame infos with data access. This abstract base class extends the DICOMImageFrameInfo by the DICOMDatasetAccess interface. This allows to directly query for tag values of a frame/file specified by the info. DICOMGDCMImageFrameInfo is an example for a concrete implementation. */ - class MITKDICOMREADER_EXPORT DICOMDatasetAccessingImageFrameInfo : public DICOMImageFrameInfo, public DICOMDatasetAccess + class MITKDICOM_EXPORT DICOMDatasetAccessingImageFrameInfo : public DICOMImageFrameInfo, public DICOMDatasetAccess { public: mitkClassMacro(DICOMDatasetAccessingImageFrameInfo, DICOMImageFrameInfo); protected: DICOMDatasetAccessingImageFrameInfo(const std::string& filename = "", unsigned int frameNo = 0); ~DICOMDatasetAccessingImageFrameInfo() override; private: DICOMDatasetAccessingImageFrameInfo(const DICOMDatasetAccessingImageFrameInfo::Pointer& frameinfo); Self& operator = (const Self& frameinfo); }; typedef std::vector DICOMDatasetAccessingImageFrameList; - MITKDICOMREADER_EXPORT mitk::DICOMImageFrameList + MITKDICOM_EXPORT mitk::DICOMImageFrameList ConvertToDICOMImageFrameList(const DICOMDatasetAccessingImageFrameList& input); - MITKDICOMREADER_EXPORT mitk::DICOMDatasetList + MITKDICOM_EXPORT mitk::DICOMDatasetList ConvertToDICOMDatasetList(const DICOMDatasetAccessingImageFrameList& input); - MITKDICOMREADER_EXPORT mitk::DICOMDatasetAccessingImageFrameList + MITKDICOM_EXPORT mitk::DICOMDatasetAccessingImageFrameList ConvertToDICOMDatasetAccessingImageFrameList(const DICOMDatasetList& input); } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMDatasetSorter.h b/Modules/DICOM/include/mitkDICOMDatasetSorter.h similarity index 96% rename from Modules/DICOMReader/include/mitkDICOMDatasetSorter.h rename to Modules/DICOM/include/mitkDICOMDatasetSorter.h index 88487ca536..98ae516a7d 100644 --- a/Modules/DICOMReader/include/mitkDICOMDatasetSorter.h +++ b/Modules/DICOM/include/mitkDICOMDatasetSorter.h @@ -1,91 +1,91 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMDatasetSorter_h #define mitkDICOMDatasetSorter_h #include "itkObjectFactory.h" #include "mitkCommon.h" #include "mitkDICOMDatasetAccess.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief The sorting/splitting building-block of DICOMITKSeriesGDCMReader. This class describes the interface of the sorting/splitting process described as part of DICOMITKSeriesGDCMReader::AnalyzeInputFiles() (see \ref DICOMITKSeriesGDCMReader_LoadingStrategy). The prodecure is simple: - take a list of input datasets (DICOMDatasetAccess) - sort them (to be defined by sub-classes, based on specific tags) - return the sorting result as outputs (the single input might be distributed into multiple outputs) The simplest and most generic form of sorting is implemented in sub-class DICOMTagBasedSorter. */ -class MITKDICOMREADER_EXPORT DICOMDatasetSorter : public itk::LightObject +class MITKDICOM_EXPORT DICOMDatasetSorter : public itk::LightObject { public: mitkClassMacroItkParent( DICOMDatasetSorter, itk::LightObject ); /** \brief Return the tags of interest (to facilitate scanning) */ virtual DICOMTagList GetTagsOfInterest() = 0; /// \brief Input for sorting void SetInput(DICOMDatasetList filenames); /// \brief Input for sorting const DICOMDatasetList& GetInput() const; /// \brief Sort input datasets into one or multiple outputs. virtual void Sort() = 0; /// \brief Output of the sorting process. unsigned int GetNumberOfOutputs() const; /// \brief Output of the sorting process. const DICOMDatasetList& GetOutput(unsigned int index) const; /// \brief Output of the sorting process. DICOMDatasetList& GetOutput(unsigned int index); /// \brief Print configuration details into stream. virtual void PrintConfiguration(std::ostream& os, const std::string& indent = "") const = 0; virtual bool operator==(const DICOMDatasetSorter& other) const = 0; protected: DICOMDatasetSorter(); ~DICOMDatasetSorter() override; DICOMDatasetSorter(const DICOMDatasetSorter& other); DICOMDatasetSorter& operator=(const DICOMDatasetSorter& other); void ClearOutputs(); void SetNumberOfOutputs(unsigned int numberOfOutputs); void SetOutput(unsigned int index, const DICOMDatasetList& output); private: DICOMDatasetList m_Input; std::vector< DICOMDatasetList > m_Outputs; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMEnums.h b/Modules/DICOM/include/mitkDICOMEnums.h similarity index 97% rename from Modules/DICOMReader/include/mitkDICOMEnums.h rename to Modules/DICOM/include/mitkDICOMEnums.h index 48152667ce..51993a0f19 100644 --- a/Modules/DICOMReader/include/mitkDICOMEnums.h +++ b/Modules/DICOM/include/mitkDICOMEnums.h @@ -1,64 +1,64 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMEnums_h #define mitkDICOMEnums_h #include #include #include namespace mitk { typedef std::vector StringList; typedef std::vector BoolList; /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief How the mitk::Image spacing should be interpreted (see mitk::DICOMFileReader). Compare DICOM PS 3.3 10.7 (Basic Pixel Spacing Calibration Macro). */ typedef enum { SpacingInPatient, ///< distances are mm within a patient SpacingAtDetector, ///< distances are mm at detector surface SpacingUnknown ///< NO spacing information is present, we use (1,1) as default } PixelSpacingInterpretation; /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Describes how well the reader is tested for a certain file type (see mitk::DICOMFileReader). Applications should not rely on the outcome for images which are reported Implemented or Unsupported. Errors to load images which are reported as Supported are considered bugs. For PartlySupported please check the reader documentation on specifics. */ typedef enum { SOPClassSupported, ///< loader code and tests are established SOPClassPartlySupported, ///< loader code and tests are establised for specific parts of a SOP Class SOPClassImplemented, ///< loader code is implemented but not accompanied by tests SOPClassUnsupported, ///< loader code is not known to work with this SOP Class SOPClassUnknown, ///< loader did not yet inspect any images, unknown fitness } ReaderImplementationLevel; /// Convert mitk::PixelSpacingInterpretation to a human readable string. std::string PixelSpacingInterpretationToString(const PixelSpacingInterpretation& value); /// Convert mitk::ReaderImplementationLevel to a human readable string. std::string ReaderImplementationLevelToString( const ReaderImplementationLevel& enumValue ); } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMFileReader.h b/Modules/DICOM/include/mitkDICOMFileReader.h similarity index 97% rename from Modules/DICOMReader/include/mitkDICOMFileReader.h rename to Modules/DICOM/include/mitkDICOMFileReader.h index 91407ffa88..43f8bd7d91 100644 --- a/Modules/DICOMReader/include/mitkDICOMFileReader.h +++ b/Modules/DICOM/include/mitkDICOMFileReader.h @@ -1,169 +1,169 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMFileReader_h #define mitkDICOMFileReader_h #include "itkObjectFactory.h" #include "mitkCommon.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" #include "mitkDICOMTagCache.h" #include "mitkDICOMImageBlockDescriptor.h" #include namespace mitk { // TODO Philips3D! // TODO http://bugs.mitk.org/show_bug.cgi?id=11572 ? /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Interface for DICOM readers that produce mitk::Images. - As described in \ref DICOMReaderModule, this class structures + As described in \ref DICOMModule, this class structures the reader's part in the process of analyzing a set of DICOM files and selecting the most appropriate reader. The overall loading process is as follows: - Define input files: a list of absolute filenames - Analyze the potential output: see what can be made of the input files, describe with DICOMImageBlockDescriptor%s - Load pixel data: an application will usually analyze files using multiple readers and only load with a single reader Sub-classes are required to implement a number of methods that reflect above structure. See mitk::DICOMITKSeriesGDCMReader for an example. To help applications in describing different readers to the user, each reader brings a number of methods that describe its configuration/specifics by means of a short label and a (longer) description. */ -class MITKDICOMREADER_EXPORT DICOMFileReader : public itk::Object +class MITKDICOM_EXPORT DICOMFileReader : public itk::Object { public: mitkClassMacroItkParent( DICOMFileReader, itk::Object ); /// Test whether a file is DICOM at all static bool IsDICOM( const std::string& filename ); /// Indicate whether this reader can handle given file virtual bool CanHandleFile( const std::string& filename ) = 0; /// This input files void SetInputFiles( const StringList& filenames ); /// This input files const StringList& GetInputFiles() const; /// Analyze input files virtual void AnalyzeInputFiles() = 0; /// Number of outputs, only meaningful after calling AnalyzeInputFiles() unsigned int GetNumberOfOutputs() const; /// Individual outputs, only meaningful after calling AnalyzeInputFiles(). \throws std::invalid_argument const DICOMImageBlockDescriptor& GetOutput( unsigned int index ) const; // void AllocateOutputImages(); TODO for later implementation of slice-by-slice loading /// Load the mitk::Image%s in our outputs, the DICOMImageBlockDescriptor. To be called only after /// AnalyzeInputFiles(). Take care of potential exceptions! virtual bool LoadImages() = 0; virtual DICOMTagPathList GetTagsOfInterest() const = 0; /// A way to provide external knowledge about files and tag values is appreciated. virtual void SetTagCache( const DICOMTagCache::Pointer& ) = 0; /// Short label/name to describe this reader void SetConfigurationLabel( const std::string& ); /// Short label/name to describe this reader std::string GetConfigurationLabel() const; /// One-sentence description of the reader's loading "strategy" void SetConfigurationDescription( const std::string& ); /// One-sentence description of the reader's loading "strategy" std::string GetConfigurationDescription() const; /// Print configuration description to given stream, for human reader void PrintConfiguration( std::ostream& os ) const; /// Print output description to given stream, for human reader void PrintOutputs( std::ostream& os, bool filenameDetails = false ) const; virtual bool operator==( const DICOMFileReader& other ) const = 0; /** Type specifies additional tags of interest. Key is the tag path of interest. * The value is an optional user defined name for the property that should be used to store the tag value(s). * Empty value is default and will imply to use the found DICOMTagPath as property name.*/ typedef DICOMImageBlockDescriptor::AdditionalTagsMapType AdditionalTagsMapType; /** * \brief Set a list of DICOMTagPaths that specifiy all DICOM-Tags that will be copied into the property of the mitk::Image. * * This method can be used to specify a list of DICOM-tags that shall be available after the loading. * The value in the tagMap is an optional user defined name for the property key that should be used * when storing the property). Empty value is default and will imply to use the found DICOMTagPath * as property key. * By default the content of the DICOM tags will be stored in a StringLookupTable on the mitk::Image. * This behaviour can be changed by setting a different TagLookupTableToPropertyFunctor via * SetTagLookupTableToPropertyFunctor(). */ virtual void SetAdditionalTagsOfInterest(const AdditionalTagsMapType& tagList); /** * \brief Set a functor that defines how the slice-specific tag-values are stored in a Property. * * This method sets a functor that is given a StringLookupTable that contains the values of one DICOM tag * mapped to the slice index. * The functor is supposed to store these values in an mitk Property. * * By default, the StringLookupTable is stored in a StringLookupTableProperty except if all values are * identical. In this case, the unique value is stored only once in a StringProperty. */ virtual void SetTagLookupTableToPropertyFunctor( mitk::DICOMImageBlockDescriptor::TagLookupTableToPropertyFunctor functor ); protected: DICOMFileReader(); ~DICOMFileReader() override; DICOMFileReader( const DICOMFileReader& other ); DICOMFileReader& operator=( const DICOMFileReader& other ); void ClearOutputs(); void SetNumberOfOutputs( unsigned int numberOfOutputs ); void SetOutput( unsigned int index, const DICOMImageBlockDescriptor& output ); /// non-const access to the DICOMImageBlockDescriptor DICOMImageBlockDescriptor& InternalGetOutput( unsigned int index ); /// Configuration description for human reader, to be implemented by sub-classes virtual void InternalPrintConfiguration( std::ostream& os ) const = 0; virtual AdditionalTagsMapType GetAdditionalTagsOfInterest() const; mitk::DICOMImageBlockDescriptor::TagLookupTableToPropertyFunctor GetTagLookupTableToPropertyFunctor() const; private: StringList m_InputFilenames; std::vector m_Outputs; std::string m_ConfigLabel; std::string m_ConfigDescription; AdditionalTagsMapType m_AdditionalTagsOfInterest; mitk::DICOMImageBlockDescriptor::TagLookupTableToPropertyFunctor m_TagLookupTableToPropertyFunctor; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMFileReaderSelector.h b/Modules/DICOM/include/mitkDICOMFileReaderSelector.h similarity index 92% rename from Modules/DICOMReader/include/mitkDICOMFileReaderSelector.h rename to Modules/DICOM/include/mitkDICOMFileReaderSelector.h index 1ec18d21e6..fc69b29aa6 100644 --- a/Modules/DICOMReader/include/mitkDICOMFileReaderSelector.h +++ b/Modules/DICOM/include/mitkDICOMFileReaderSelector.h @@ -1,116 +1,116 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMFileReaderSelector_h #define mitkDICOMFileReaderSelector_h #include "mitkDICOMFileReader.h" #include namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Simple best-reader selection. This class implements a process of comparing different DICOMFileReader%s and selecting the reader with the minimal number of mitk::Image%s in its output. The code found in this class can - just be used to select a reader using this simple strategy - be taken as an example of how to use DICOMFileReader%s To create a selection of potential readers, the class makes use of mitk::DICOMReaderConfigurator, i.e. DICOMFileReaderSelector also expects the configuration files/strings to be in the format expected by mitk::DICOMReaderConfigurator. Two convenience methods load "default" configurations from compiled-in resources: LoadBuiltIn3DConfigs() and LoadBuiltIn3DnTConfigs(). @remark If you use LoadBuiltIn3DConfigs() and LoadBuiltIn3DnTConfigs() you must - ensure that the MitkDICOMReader module (and therefore its resources) is properly + ensure that the MitkDICOM module (and therefore its resources) is properly loaded. If the module is not available these methods will do nothing. This can especially lead to problems if these methods are used in the scope of another module's activator. */ -class MITKDICOMREADER_EXPORT DICOMFileReaderSelector : public itk::LightObject +class MITKDICOM_EXPORT DICOMFileReaderSelector : public itk::LightObject { public: typedef std::list ReaderList; mitkClassMacroItkParent( DICOMFileReaderSelector, itk::LightObject ); itkNewMacro( DICOMFileReaderSelector ); /// \brief Add a configuration as expected by DICOMReaderConfigurator. /// Configs can only be reset by instantiating a new DICOMFileReaderSelector. void AddConfig(const std::string& xmlDescription); /// \brief Add a configuration as expected by DICOMReaderConfigurator. /// Configs can only be reset by instantiating a new DICOMFileReaderSelector. void AddConfigFile(const std::string& filename); /// \brief Add a configuration that is stored in the passed us::ModuleResourse. /// Configs can only be reset by instantiating a new DICOMFileReaderSelector. void AddConfigFromResource(us::ModuleResource& resource); /// \brief Add a whole pre-configured reader to the selection process. void AddFileReaderCanditate(DICOMFileReader::Pointer reader); /// \brief Load 3D image creating configurations from the MITK module system (see us::Module::FindResources()). - /// For a default set of configurations, look into the directory Resources of the DICOMReader module. - /// @remark If you use this function you must ensure that the MitkDICOMReader module(and therefore its resources) + /// For a default set of configurations, look into the directory Resources of the DICOM module. + /// @remark If you use this function you must ensure that the MitkDICOM module(and therefore its resources) /// is properly loaded. If the module is not available this function will do nothing. /// This can especially lead to problem if this function is used in the scope /// of another module's activator. void LoadBuiltIn3DConfigs(); /// \brief Load 3D+t image creating configurations from the MITK module system (see us::Module::FindResources()). - /// For a default set of configurations, look into the directory Resources of the DICOMReader module. - /// @remark If you use this function you must ensure that the MitkDICOMReader module(and therefore its resources) + /// For a default set of configurations, look into the directory Resources of the DICOM module. + /// @remark If you use this function you must ensure that the MitkDICOM module(and therefore its resources) /// is properly loaded. If the module is not available this function will do nothing. /// This can especially lead to problem if this function is used in the scope /// of another module's activator. void LoadBuiltIn3DnTConfigs(); /// \brief Return all the DICOMFileReader%s that are currently used for selection by this class. /// The readers returned by this method depend on what config files have been added earlier /// (or which of the built-in readers have been loaded) ReaderList GetAllConfiguredReaders() const; /// Input files void SetInputFiles(StringList filenames); /// Input files const StringList& GetInputFiles() const; /// Execute the analysis and selection process. The first reader with a minimal number of outputs will be returned. DICOMFileReader::Pointer GetFirstReaderWithMinimumNumberOfOutputImages(); protected: DICOMFileReaderSelector(); ~DICOMFileReaderSelector() override; void AddConfigsFromResources(const std::string& path); void AddConfigFromResource(const std::string& resourcename); private: StringList m_PossibleConfigurations; StringList m_InputFilenames; ReaderList m_Readers; }; } // namespace #endif // mitkDICOMFileReaderSelector_h diff --git a/Modules/DICOMReader/include/mitkDICOMFilesHelper.h b/Modules/DICOM/include/mitkDICOMFilesHelper.h similarity index 97% rename from Modules/DICOMReader/include/mitkDICOMFilesHelper.h rename to Modules/DICOM/include/mitkDICOMFilesHelper.h index 104b7f2511..e3165e754c 100644 --- a/Modules/DICOMReader/include/mitkDICOMFilesHelper.h +++ b/Modules/DICOM/include/mitkDICOMFilesHelper.h @@ -1,41 +1,41 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKDICOMFILESHELPER_H #define MITKDICOMFILESHELPER_H #include #include -#include +#include namespace mitk { typedef std::vector DICOMFilePathList; /** Helper functions. Searches for all files in the directory of the passed file path. All files will be checked if they are DICOM files. All DICOM files will be added to the result and returned. @remark The helper does no sorting of any kind.*/ DICOMFilePathList GetDICOMFilesInSameDirectory(const std::string& filePath); /** All passed files will be checked if they are DICOM files. All DICOM files will be added to the result and returned. @remark The helper does no sorting of any kind.*/ DICOMFilePathList FilterForDICOMFiles(const DICOMFilePathList& fileList); /** Returns all DICOM files passed with fileList that have the same series instance UID then the passed refFilePath. @pre refFilePath must point to a valid DICOM file.*/ DICOMFilePathList FilterDICOMFilesForSameSeries(const std::string& refFilePath, const DICOMFilePathList& fileList); } #endif // MITKDICOMFILESHELPER_H diff --git a/Modules/DICOMReader/include/mitkDICOMGDCMImageFrameInfo.h b/Modules/DICOM/include/mitkDICOMGDCMImageFrameInfo.h similarity index 94% rename from Modules/DICOMReader/include/mitkDICOMGDCMImageFrameInfo.h rename to Modules/DICOM/include/mitkDICOMGDCMImageFrameInfo.h index e756fc18b5..bed6f3986e 100644 --- a/Modules/DICOMReader/include/mitkDICOMGDCMImageFrameInfo.h +++ b/Modules/DICOM/include/mitkDICOMGDCMImageFrameInfo.h @@ -1,60 +1,60 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMGDCMImageFrameInfo_h #define mitkDICOMGDCMImageFrameInfo_h #include "mitkDICOMDatasetAccessingImageFrameInfo.h" #include "gdcmScanner.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief The dataset access implementation for DICOMITKSeriesGDCMReader, based on GDCM. This class combines a DICOMImageFrameInfo object with the scanning results from gdcm::Scanner. The scanning results will be used to implement the tag access methods of DICOMDatasetAccess. */ - class MITKDICOMREADER_EXPORT DICOMGDCMImageFrameInfo : public DICOMDatasetAccessingImageFrameInfo + class MITKDICOM_EXPORT DICOMGDCMImageFrameInfo : public DICOMDatasetAccessingImageFrameInfo { public: mitkClassMacro(DICOMGDCMImageFrameInfo, DICOMDatasetAccessingImageFrameInfo); itkFactorylessNewMacro( DICOMGDCMImageFrameInfo ); mitkNewMacro1Param( DICOMGDCMImageFrameInfo, const std::string&); mitkNewMacro2Param( DICOMGDCMImageFrameInfo, const std::string&, unsigned int ); mitkNewMacro1Param( DICOMGDCMImageFrameInfo, const DICOMImageFrameInfo::Pointer& ); mitkNewMacro2Param( DICOMGDCMImageFrameInfo, const DICOMImageFrameInfo::Pointer&, gdcm::Scanner::TagToValue const&); ~DICOMGDCMImageFrameInfo() override; DICOMDatasetFinding GetTagValueAsString(const DICOMTag&) const override; FindingsListType GetTagValueAsString(const DICOMTagPath& path) const override; std::string GetFilenameIfAvailable() const override; protected: explicit DICOMGDCMImageFrameInfo(const DICOMImageFrameInfo::Pointer& frameinfo); DICOMGDCMImageFrameInfo(const DICOMImageFrameInfo::Pointer& frameinfo, gdcm::Scanner::TagToValue const& tagToValueMapping); DICOMGDCMImageFrameInfo(const std::string& filename = "", unsigned int frameNo = 0); const gdcm::Scanner::TagToValue m_TagForValue; }; typedef std::vector DICOMGDCMImageFrameList; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMGDCMTagCache.h b/Modules/DICOM/include/mitkDICOMGDCMTagCache.h similarity index 93% rename from Modules/DICOMReader/include/mitkDICOMGDCMTagCache.h rename to Modules/DICOM/include/mitkDICOMGDCMTagCache.h index ffc8eace60..e5a56348bc 100644 --- a/Modules/DICOMReader/include/mitkDICOMGDCMTagCache.h +++ b/Modules/DICOM/include/mitkDICOMGDCMTagCache.h @@ -1,64 +1,64 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMGDCMTagCache_h #define mitkDICOMGDCMTagCache_h #include "mitkDICOMTagCache.h" #include #include #include namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Tag cache implementation used by the DICOMGDCMTagScanner. */ - class MITKDICOMREADER_EXPORT DICOMGDCMTagCache : public DICOMTagCache + class MITKDICOM_EXPORT DICOMGDCMTagCache : public DICOMTagCache { public: mitkClassMacro(DICOMGDCMTagCache, DICOMTagCache); itkFactorylessNewMacro( DICOMGDCMTagCache ); itkCloneMacro(Self); DICOMDatasetFinding GetTagValue(DICOMImageFrameInfo* frame, const DICOMTag& tag) const override; FindingsListType GetTagValue(DICOMImageFrameInfo* frame, const DICOMTagPath& path) const override; DICOMDatasetAccessingImageFrameList GetFrameInfoList() const override; void InitCache(const std::set& scannedTags, const std::shared_ptr& scanner, const StringList& inputFiles); const gdcm::Scanner& GetScanner() const; protected: DICOMGDCMTagCache(); ~DICOMGDCMTagCache() override; std::set m_ScannedTags; std::shared_ptr m_Scanner; DICOMDatasetAccessingImageFrameList m_ScanResult; private: DICOMGDCMTagCache(const DICOMGDCMTagCache&); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMGDCMTagScanner.h b/Modules/DICOM/include/mitkDICOMGDCMTagScanner.h similarity index 97% rename from Modules/DICOMReader/include/mitkDICOMGDCMTagScanner.h rename to Modules/DICOM/include/mitkDICOMGDCMTagScanner.h index fa07590ddb..4143554521 100644 --- a/Modules/DICOMReader/include/mitkDICOMGDCMTagScanner.h +++ b/Modules/DICOM/include/mitkDICOMGDCMTagScanner.h @@ -1,119 +1,119 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMGDCMTagScanner_h #define mitkDICOMGDCMTagScanner_h #include "mitkDICOMTagScanner.h" #include "mitkDICOMEnums.h" #include "mitkDICOMGDCMTagCache.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Encapsulates the tag scanning process for a set of DICOM files. Formerly integrated as a part of DICOMITKSeriesGDCMReader, the tag scanning part has been factored out into this DICOMGDCMTagScanner class in order to allow a single scan for multiple reader alternatives. This helps much in the selection process of e.g. DICOMFileReaderSelector. The class works similar to gdcm::Scanner, just with the MITK set of classes: - add a number of DICOM tags that should be read - set a list of files that should be scanned for named tags - call Scan() - retrieve the scan results - via GetFrameInfoList() or - via GetTagValue() When used in a process where multiple classes will access the scan results, care should be taken that all the tags and files of interest are communicated to DICOMGDCMTagScanner before requesting the results! @remark This scanner does only support the scanning for simple value tag. If you need to scann for sequence items or non-top-level elements, this scanner will not be sufficient. See i.a. DICOMDCMTKTagScanner for these cases. */ - class MITKDICOMREADER_EXPORT DICOMGDCMTagScanner : public DICOMTagScanner + class MITKDICOM_EXPORT DICOMGDCMTagScanner : public DICOMTagScanner { public: mitkClassMacro(DICOMGDCMTagScanner, DICOMTagScanner); itkFactorylessNewMacro( DICOMGDCMTagScanner ); itkCloneMacro(Self); /** \brief Add this tag to the scanning process. */ void AddTag(const DICOMTag& tag) override; /** \brief Add a list of tags to the scanning process. */ void AddTags(const DICOMTagList& tags) override; /** \brief Add this tag path to the scanning process. */ void AddTagPath(const DICOMTagPath& tag) override; /** \brief Add a list of tag pathes to the scanning process. */ void AddTagPaths(const DICOMTagPathList& tags) override; /** \brief Define the list of files to scan. This does not ADD to an internal list, but it replaces the whole list of files. */ void SetInputFiles(const StringList& filenames) override; /** \brief Start the scanning process. Calling Scan() will invalidate previous scans, forgetting all about files and tags from files that have been scanned previously. */ void Scan() override; /** \brief Retrieve a result list for file-by-file tag access. */ DICOMDatasetAccessingImageFrameList GetFrameInfoList() const override; /** \brief Retrieve Pointer to the complete cache of the scan. */ DICOMTagCache::Pointer GetScanCache() const override; /** \brief Directly retrieve the tag value for a given frame and tag. @pre Scan() must have been called before calling this function. */ virtual DICOMDatasetFinding GetTagValue(DICOMImageFrameInfo* frame, const DICOMTag& tag) const; protected: DICOMGDCMTagScanner(); ~DICOMGDCMTagScanner() override; std::set m_ScannedTags; StringList m_InputFilenames; DICOMGDCMTagCache::Pointer m_Cache; std::shared_ptr m_GDCMScanner; private: DICOMGDCMTagScanner(const DICOMGDCMTagScanner&); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMGenericImageFrameInfo.h b/Modules/DICOM/include/mitkDICOMGenericImageFrameInfo.h similarity index 93% rename from Modules/DICOMReader/include/mitkDICOMGenericImageFrameInfo.h rename to Modules/DICOM/include/mitkDICOMGenericImageFrameInfo.h index 66a8269f0c..03f36aa13b 100644 --- a/Modules/DICOMReader/include/mitkDICOMGenericImageFrameInfo.h +++ b/Modules/DICOM/include/mitkDICOMGenericImageFrameInfo.h @@ -1,65 +1,65 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMGenericImageFrameInfo_h #define mitkDICOMGenericImageFrameInfo_h #include "mitkDICOMDatasetAccessingImageFrameInfo.h" #include namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief A generic storage class for image frame info with data access. */ - class MITKDICOMREADER_EXPORT DICOMGenericImageFrameInfo : public DICOMDatasetAccessingImageFrameInfo + class MITKDICOM_EXPORT DICOMGenericImageFrameInfo : public DICOMDatasetAccessingImageFrameInfo { public: mitkClassMacro(DICOMGenericImageFrameInfo, DICOMDatasetAccessingImageFrameInfo); itkFactorylessNewMacro( DICOMGenericImageFrameInfo ); mitkNewMacro1Param( DICOMGenericImageFrameInfo, const std::string&); mitkNewMacro2Param( DICOMGenericImageFrameInfo, const std::string&, unsigned int ); mitkNewMacro1Param( DICOMGenericImageFrameInfo, const DICOMImageFrameInfo::Pointer& ); ~DICOMGenericImageFrameInfo() override; DICOMDatasetFinding GetTagValueAsString(const DICOMTag&) const override; FindingsListType GetTagValueAsString(const DICOMTagPath& path) const override; std::string GetFilenameIfAvailable() const override; /** Sets the value for a passed tag path. If the tag path is already set, it will be overwritten with the new value. @pre Path must be explicit. No wildcards are allowed. @post The passed value is set for the passed path. */ void SetTagValue(const DICOMTagPath& path, const std::string& value); protected: typedef std::map ValueMapType; ValueMapType m_Values; explicit DICOMGenericImageFrameInfo(const DICOMImageFrameInfo::Pointer& frameinfo); DICOMGenericImageFrameInfo(const std::string& filename = "", unsigned int frameNo = 0); private: Self& operator = (const Self&); DICOMGenericImageFrameInfo(const Self&); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMGenericTagCache.h b/Modules/DICOM/include/mitkDICOMGenericTagCache.h similarity index 92% rename from Modules/DICOMReader/include/mitkDICOMGenericTagCache.h rename to Modules/DICOM/include/mitkDICOMGenericTagCache.h index e9b9406c4c..53cec1eed0 100644 --- a/Modules/DICOMReader/include/mitkDICOMGenericTagCache.h +++ b/Modules/DICOM/include/mitkDICOMGenericTagCache.h @@ -1,55 +1,55 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMGenericTagCache_h #define mitkDICOMGenericTagCache_h #include "mitkDICOMTagCache.h" #include "mitkDICOMGenericImageFrameInfo.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Generic tag cache implementation. */ - class MITKDICOMREADER_EXPORT DICOMGenericTagCache : public DICOMTagCache + class MITKDICOM_EXPORT DICOMGenericTagCache : public DICOMTagCache { public: mitkClassMacro(DICOMGenericTagCache, DICOMTagCache); itkFactorylessNewMacro( DICOMGenericTagCache ); itkCloneMacro(Self); DICOMDatasetFinding GetTagValue(DICOMImageFrameInfo* frame, const DICOMTag& tag) const override; FindingsListType GetTagValue(DICOMImageFrameInfo* frame, const DICOMTagPath& path) const override; DICOMDatasetAccessingImageFrameList GetFrameInfoList() const override; void AddFrameInfo(DICOMDatasetAccessingImageFrameInfo* info); void Reset(); protected: DICOMGenericTagCache(); ~DICOMGenericTagCache() override; DICOMDatasetAccessingImageFrameList m_ScanResult; private: DICOMGenericTagCache(const DICOMGenericTagCache&); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMIOHelper.h b/Modules/DICOM/include/mitkDICOMIOHelper.h similarity index 70% rename from Modules/DICOMReader/include/mitkDICOMIOHelper.h rename to Modules/DICOM/include/mitkDICOMIOHelper.h index b2ffca389b..33506e22e7 100644 --- a/Modules/DICOMReader/include/mitkDICOMIOHelper.h +++ b/Modules/DICOM/include/mitkDICOMIOHelper.h @@ -1,36 +1,36 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKDICOMIOHelper_H #define MITKDICOMIOHelper_H #include "mitkDICOMDatasetAccessingImageFrameInfo.h" #include "mitkIDICOMTagsOfInterest.h" -#include +#include namespace mitk { class BaseData; typedef std::vector FindingsListVectorType; typedef BaseData *BaseDataPointer; - MITKDICOMREADER_EXPORT mitk::IDICOMTagsOfInterest *GetDicomTagsOfInterestService(); + MITKDICOM_EXPORT mitk::IDICOMTagsOfInterest *GetDicomTagsOfInterestService(); - MITKDICOMREADER_EXPORT FindingsListVectorType ExtractPathsOfInterest(const DICOMTagPathList &pathsOfInterest, + MITKDICOM_EXPORT FindingsListVectorType ExtractPathsOfInterest(const DICOMTagPathList &pathsOfInterest, const DICOMDatasetAccessingImageFrameList &frames); - MITKDICOMREADER_EXPORT void SetProperties(BaseDataPointer image, const FindingsListVectorType &findings); + MITKDICOM_EXPORT void SetProperties(BaseDataPointer image, const FindingsListVectorType &findings); } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMIOMetaInformationPropertyConstants.h b/Modules/DICOM/include/mitkDICOMIOMetaInformationPropertyConstants.h similarity index 95% rename from Modules/DICOMReader/include/mitkDICOMIOMetaInformationPropertyConstants.h rename to Modules/DICOM/include/mitkDICOMIOMetaInformationPropertyConstants.h index 5a6bc3eaa7..c960205747 100644 --- a/Modules/DICOMReader/include/mitkDICOMIOMetaInformationPropertyConstants.h +++ b/Modules/DICOM/include/mitkDICOMIOMetaInformationPropertyConstants.h @@ -1,51 +1,51 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKDICOMIOMETAINFORMATIONCONSTANTS_H_ #define MITKDICOMIOMETAINFORMATIONCONSTANTS_H_ -#include +#include #include "mitkPropertyKeyPath.h" namespace mitk { /** * @ingroup IO * @brief The IOMetaInformationPropertyConsants struct */ - struct MITKDICOMREADER_EXPORT DICOMIOMetaInformationPropertyConstants + struct MITKDICOM_EXPORT DICOMIOMetaInformationPropertyConstants { //Path to the property containing the name of the dicom reader configuration used to read the data static PropertyKeyPath READER_CONFIGURATION(); //Path to the property containing the files the dicom reader used in a TemporoSpatialProperty static PropertyKeyPath READER_FILES(); //Path to the property containing PixelSpacingInterpretationString for the read data static PropertyKeyPath READER_PIXEL_SPACING_INTERPRETATION_STRING(); //Path to the property containing PixelSpacingInterpretation for the read data static PropertyKeyPath READER_PIXEL_SPACING_INTERPRETATION(); //Path to the property containing ReaderImplementationLevelString for the read data static PropertyKeyPath READER_IMPLEMENTATION_LEVEL_STRING(); //Path to the property containing ReaderImplementationLevel for the read data static PropertyKeyPath READER_IMPLEMENTATION_LEVEL(); //Path to the property containing the indicator of the gantry tilt was corrected when reading the data static PropertyKeyPath READER_GANTRY_TILT_CORRECTED(); //Path to the property containing the indicator of the data was read as 3D+t static PropertyKeyPath READER_3D_plus_t(); //Path to the property containing the version of GDCM used to read the data static PropertyKeyPath READER_GDCM(); //Path to the property containing the version of DCMTK used to read the data static PropertyKeyPath READER_DCMTK(); }; } #endif // MITKIOCONSTANTS_H_ diff --git a/Modules/DICOMReader/include/mitkDICOMITKSeriesGDCMReader.h b/Modules/DICOM/include/mitkDICOMITKSeriesGDCMReader.h similarity index 99% rename from Modules/DICOMReader/include/mitkDICOMITKSeriesGDCMReader.h rename to Modules/DICOM/include/mitkDICOMITKSeriesGDCMReader.h index 6f768d24a8..3e6c790bc4 100644 --- a/Modules/DICOMReader/include/mitkDICOMITKSeriesGDCMReader.h +++ b/Modules/DICOM/include/mitkDICOMITKSeriesGDCMReader.h @@ -1,377 +1,377 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMITKSeriesGDCMReader_h #define mitkDICOMITKSeriesGDCMReader_h #include #include "itkMutexLock.h" #include "mitkDICOMFileReader.h" #include "mitkDICOMDatasetSorter.h" #include "mitkDICOMGDCMImageFrameInfo.h" #include "mitkEquiDistantBlocksSorter.h" #include "mitkNormalDirectionConsistencySorter.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace itk { class TimeProbesCollectorBase; } namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Flexible reader based on itk::ImageSeriesReader and GDCM, for single-slice modalities like CT, MR, PET, CR, etc. Implements the loading processed as structured by DICOMFileReader offers configuration of its loading strategy. Documentation sections: - \ref DICOMITKSeriesGDCMReader_LoadingStrategy - \ref DICOMITKSeriesGDCMReader_ForcedConfiguration - \ref DICOMITKSeriesGDCMReader_UserConfiguration - \ref DICOMITKSeriesGDCMReader_GantryTilt - \ref DICOMITKSeriesGDCMReader_Testing - \ref DICOMITKSeriesGDCMReader_Internals - \ref DICOMITKSeriesGDCMReader_RelatedClasses - \ref DICOMITKSeriesGDCMReader_TiltInternals - \ref DICOMITKSeriesGDCMReader_Condensing \section DICOMITKSeriesGDCMReader_LoadingStrategy Loading strategy The set of input files is processed by a number of DICOMDatasetSorter objects which may do two sort of things: 1. split a list of input frames into multiple lists, based on DICOM tags such as "Rows", "Columns", which cannot be mixed within a single mitk::Image 2. sort the frames within the input lists, based on the values of DICOM tags such as "Image Position Patient" When the DICOMITKSeriesGDCMReader is configured with DICOMDatasetSorter%s, the list of input files is processed as follows: 1. build an initial set of output groups, simply by grouping all input files. 2. for each configured DICOMDatasetSorter, process: - for each output group: 1. set this group's files as input to the sorter 2. let the sorter sort (and split) 3. integrate the sorter's output groups with our own output groups \section DICOMITKSeriesGDCMReader_ForcedConfiguration Forced Configuration In all cases, the reader will add two DICOMDatasetSorter objects that are required to load mitk::Images properly via itk::ImageSeriesReader: 1. As a \b first step, the input files will be split into groups that are not compatible because they differ in essential aspects: - (0028,0010) Number of Rows - (0028,0011) Number of Columns - (0028,0030) Pixel Spacing - (0018,1164) Imager Pixel Spacing - (0020,0037) %Image Orientation (Patient) - (0018,0050) Slice Thickness - (0028,0008) Number of Frames 2. As are two forced \b last steps: 1. There will always be an instance of EquiDistantBlocksSorter, which ensures that there is an equal distance between all the frames of an Image. This is required to achieve correct geometrical positions in the mitk::Image, i.e. it is essential to be able to make measurements in images. - whether or not the distance is required to be orthogonal to the image planes is configured by SetFixTiltByShearing(). - during this check, we need to tolerate some minor errors in documented vs. calculated image origins. The amount of tolerance can be adjusted by SetToleratedOriginOffset() and SetToleratedOriginOffsetToAdaptive(). Please see EquiDistantBlocksSorter for more details. The default should be good for most cases. 2. There is always an instance of NormalDirectionConsistencySorter, which makes the order of images go along the image normals (see NormalDirectionConsistencySorter) \section DICOMITKSeriesGDCMReader_UserConfiguration User Configuration The user of this class can add more sorting steps (similar to the one described in above section) by calling AddSortingElement(). Usually, an application will add sorting by "Image Position Patient", by "Instance Number", and by other relevant tags here. \section DICOMITKSeriesGDCMReader_GantryTilt Gantry tilt handling When CT gantry tilt is used, the gantry plane (= X-Ray source and detector ring) and the vertical plane do not align anymore. This scanner feature is used for example to reduce metal artifacs (e.g. Lee C , Evaluation of Using CT Gantry Tilt Scan on Head and Neck Cancer Patients with Dental Structure: Scans Show Less Metal Artifacts. Presented at: Radiological Society of North America 2011 Scientific Assembly and Annual Meeting; November 27- December 2, 2011 Chicago IL.). The acquired planes of such CT series do not match the expectations of a orthogonal geometry in mitk::Image: if you stack the slices, they show a small shift along the Y axis: \verbatim without tilt with tilt |||||| ////// |||||| ////// -- |||||| --------- ////// -------- table orientation |||||| ////// |||||| ////// Stacked slices: without tilt with tilt -------------- -------------- -------------- -------------- -------------- -------------- -------------- -------------- -------------- -------------- \endverbatim As such gemetries do not "work" in conjunction with mitk::Image, DICOMITKSeriesGDCMReader is able to perform a correction for such series. Whether or not such correction should be attempted is controlled by SetFixTiltByShearing(), the default being correction. For details, see "Internals" below. \section DICOMITKSeriesGDCMReader_Testing Testing A number of tests is implemented in module DICOMTesting, which is documented at \ref DICOMTesting. \section DICOMITKSeriesGDCMReader_Internals Class internals Internally, the class is based on GDCM and it depends heavily on the gdcm::Scanner class. Since the sorting elements (see DICOMDatasetSorter and DICOMSortCriterion) can access tags only via the DICOMDatasetAccess interface, BUT DICOMITKSeriesGDCMReader holds a list of more specific classes DICOMGDCMImageFrameInfo, we must convert between the two types sometimes. This explains the methods ToDICOMDatasetList(), FromDICOMDatasetList(). The intermediate result of all the sorting efforts is held in m_SortingResultInProgress, which is modified through InternalExecuteSortingStep(). \subsection DICOMITKSeriesGDCMReader_RelatedClasses Overview of related classes The following diagram gives an overview of the related classes: \image html implementeditkseriesgdcmreader.jpg \subsection DICOMITKSeriesGDCMReader_TiltInternals Details about the tilt correction The gantry tilt "correction" algorithm fixes two errors introduced by ITK's ImageSeriesReader: - the plane shift that is ignored by ITK's reader is recreated by applying a shearing transformation using itk::ResampleFilter. - the spacing is corrected (it is calculated by ITK's reader from the distance between two origins, which is NOT the slice distance in this special case) Both errors are introduced in itkImageSeriesReader.txx (ImageSeriesReader::GenerateOutputInformation(void)), lines 176 to 245 (as of ITK 3.20) For the correction, we examine two consecutive slices of a series, both described as a pair (origin/orientation): - we calculate if the first origin is on a line along the normal of the second slice - if this is not the case, the geometry will not fit a normal mitk::Image/mitk::Geometry3D - we then project the second origin into the first slice's coordinate system to quantify the shift - both is done in class GantryTiltInformation with quite some comments. The geometry of image stacks with tilted geometries is illustrated below: - green: the DICOM images as described by their tags: origin as a point with the line indicating the orientation - red: the output of ITK ImageSeriesReader: wrong, larger spacing, no tilt - blue: how much a shear must correct \image html tilt-correction.jpg \subsection DICOMITKSeriesGDCMReader_Condensing Sub-classes can condense multiple blocks into a single larger block The sorting/splitting process described above is helpful for at least two more DICOM readers, which either try to load 3D+t images or which load diffusion data. In both cases, a single pixel of the mitk::Image is made up of multiple values, in one case values over time, in the other case multiple measurements of a single point. The specialized readers for these cases (e.g. ThreeDnTDICOMSeriesReader) can reuse most of the methods in DICOMITKSeriesGDCMReader, except that they need an extra step after the usual sorting, in which they can merge already grouped 3D blocks. What blocks are merged depends on the specialized reader's understanding of these images. To allow for such merging, a method Condense3DBlocks() is called as an absolute last step of AnalyzeInputFiles(). Given this, a sub-class could implement only LoadImages() and Condense3DBlocks() instead repeating most of AnalyzeInputFiles(). */ -class MITKDICOMREADER_EXPORT DICOMITKSeriesGDCMReader : public DICOMFileReader +class MITKDICOM_EXPORT DICOMITKSeriesGDCMReader : public DICOMFileReader { public: mitkClassMacro( DICOMITKSeriesGDCMReader, DICOMFileReader ); mitkCloneMacro( DICOMITKSeriesGDCMReader ); itkFactorylessNewMacro( DICOMITKSeriesGDCMReader ); mitkNewMacro1Param( DICOMITKSeriesGDCMReader, unsigned int ); mitkNewMacro2Param( DICOMITKSeriesGDCMReader, unsigned int, bool ); /** \brief Runs the sorting / splitting process described in \ref DICOMITKSeriesGDCMReader_LoadingStrategy. Method required by DICOMFileReader. */ void AnalyzeInputFiles() override; // void AllocateOutputImages(); /** \brief Loads images using itk::ImageSeriesReader, potentially applies shearing to correct gantry tilt. */ bool LoadImages() override; // re-implemented from super-class bool CanHandleFile(const std::string& filename) override; /** \brief Add an element to the sorting procedure described in \ref DICOMITKSeriesGDCMReader_LoadingStrategy. */ virtual void AddSortingElement(DICOMDatasetSorter* sorter, bool atFront = false); typedef const std::list ConstSorterList; ConstSorterList GetFreelyConfiguredSortingElements() const; /** \brief Controls whether to "fix" tilted acquisitions by shearing the output (see \ref DICOMITKSeriesGDCMReader_GantryTilt). */ void SetFixTiltByShearing(bool on); bool GetFixTiltByShearing() const; /** \brief Controls whether groups of only two images are accepted when ensuring consecutive slices via EquiDistantBlocksSorter. */ void SetAcceptTwoSlicesGroups(bool accept) const; bool GetAcceptTwoSlicesGroups() const; /** \brief See \ref DICOMITKSeriesGDCMReader_ForcedConfiguration. */ void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct = 0.3) const; /** \brief See \ref DICOMITKSeriesGDCMReader_ForcedConfiguration. */ void SetToleratedOriginOffset(double millimeters = 0.005) const; /** \brief Ignore all dicom tags that are non-essential for simple 3D volume import. */ void SetSimpleVolumeReading(bool read) { m_SimpleVolumeReading = read; }; /** \brief Ignore all dicom tags that are non-essential for simple 3D volume import. */ bool GetSimpleVolumeReading() { return m_SimpleVolumeReading; }; double GetToleratedOriginError() const; bool IsToleratedOriginOffsetAbsolute() const; double GetDecimalPlacesForOrientation() const; bool operator==(const DICOMFileReader& other) const override; DICOMTagPathList GetTagsOfInterest() const override; static int GetDefaultDecimalPlacesForOrientation() { return m_DefaultDecimalPlacesForOrientation; } static bool GetDefaultSimpleVolumeImport() { return m_DefaultSimpleVolumeImport; } static bool GetDefaultFixTiltByShearing() { return m_DefaultFixTiltByShearing; } protected: void InternalPrintConfiguration(std::ostream& os) const override; /// \brief Return active C locale static std::string GetActiveLocale(); /** \brief Remember current locale on stack, activate "C" locale. "C" locale is required for correct parsing of numbers by itk::ImageSeriesReader */ void PushLocale() const; /** \brief Activate last remembered locale from locale stack "C" locale is required for correct parsing of numbers by itk::ImageSeriesReader */ void PopLocale() const; const static int m_DefaultDecimalPlacesForOrientation = 5; const static bool m_DefaultSimpleVolumeImport = false; const static bool m_DefaultFixTiltByShearing = true; DICOMITKSeriesGDCMReader(unsigned int decimalPlacesForOrientation = m_DefaultDecimalPlacesForOrientation, bool simpleVolumeImport = m_DefaultSimpleVolumeImport); ~DICOMITKSeriesGDCMReader() override; DICOMITKSeriesGDCMReader(const DICOMITKSeriesGDCMReader& other); DICOMITKSeriesGDCMReader& operator=(const DICOMITKSeriesGDCMReader& other); typedef std::vector SortingBlockList; /** \brief "Hook" for sub-classes, see \ref DICOMITKSeriesGDCMReader_Condensing \return REMAINING blocks */ virtual SortingBlockList Condense3DBlocks(SortingBlockList& resultOf3DGrouping); virtual DICOMTagCache::Pointer GetTagCache() const; void SetTagCache( const DICOMTagCache::Pointer& ) override; /// \brief Sorting step as described in \ref DICOMITKSeriesGDCMReader_LoadingStrategy static SortingBlockList InternalExecuteSortingStep( unsigned int sortingStepIndex, const DICOMDatasetSorter::Pointer& sorter, const SortingBlockList& input); /// \brief Loads the mitk::Image by means of an itk::ImageSeriesReader virtual bool LoadMitkImageForOutput(unsigned int o); virtual bool LoadMitkImageForImageBlockDescriptor(DICOMImageBlockDescriptor& block) const; /// \brief Describe this reader's confidence for given SOP class UID static ReaderImplementationLevel GetReaderImplementationLevel(const std::string sopClassUID); private: /// \brief Creates the required sorting steps described in \ref DICOMITKSeriesGDCMReader_ForcedConfiguration void EnsureMandatorySortersArePresent(unsigned int decimalPlacesForOrientation, bool simpleVolumeImport = false); protected: // NOT nice, made available to ThreeDnTDICOMSeriesReader due to lack of time bool m_FixTiltByShearing; // could be removed by ITKDICOMSeriesReader NOT flagging tilt unless requested to fix it! bool m_SimpleVolumeReading; private: SortingBlockList m_SortingResultInProgress; typedef std::list SorterList; SorterList m_Sorter; protected: // NOT nice, made available to ThreeDnTDICOMSeriesReader and ClassicDICOMSeriesReader due to lack of time mitk::EquiDistantBlocksSorter::Pointer m_EquiDistantBlocksSorter; mitk::NormalDirectionConsistencySorter::Pointer m_NormalDirectionConsistencySorter; private: static itk::MutexLock::Pointer s_LocaleMutex; mutable std::stack m_ReplacedCLocales; mutable std::stack m_ReplacedCinLocales; double m_DecimalPlacesForOrientation; DICOMTagCache::Pointer m_TagCache; bool m_ExternalCache; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMImageBlockDescriptor.h b/Modules/DICOM/include/mitkDICOMImageBlockDescriptor.h similarity index 98% rename from Modules/DICOMReader/include/mitkDICOMImageBlockDescriptor.h rename to Modules/DICOM/include/mitkDICOMImageBlockDescriptor.h index 90ae54f6af..81112d3e91 100644 --- a/Modules/DICOMReader/include/mitkDICOMImageBlockDescriptor.h +++ b/Modules/DICOM/include/mitkDICOMImageBlockDescriptor.h @@ -1,237 +1,237 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMImageBlockDescriptor_h #define mitkDICOMImageBlockDescriptor_h #include "mitkDICOMEnums.h" #include "mitkDICOMImageFrameInfo.h" #include "mitkDICOMTag.h" #include "mitkDICOMTagCache.h" #include "mitkImage.h" #include "mitkProperties.h" #include "mitkWeakPointer.h" #include "mitkIPropertyProvider.h" #include "mitkGantryTiltInformation.h" #include namespace mitk { struct DICOMCachedValueInfo { unsigned int TimePoint; unsigned int SliceInTimePoint; std::string Value; }; class DICOMCachedValueLookupTable : public GenericLookupTable< DICOMCachedValueInfo > { public: typedef DICOMCachedValueLookupTable Self; typedef GenericLookupTable< DICOMCachedValueInfo > Superclass; const char *GetNameOfClass() const override { return "DICOMCachedValueLookupTable"; } DICOMCachedValueLookupTable() {} Superclass& operator=(const Superclass& other) override { return Superclass::operator=(other); } ~DICOMCachedValueLookupTable() override {} }; /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Output descriptor for DICOMFileReader. As a result of analysis by a mitk::DICOMFileReader, this class describes the properties of a single mitk::Images that could be loaded by the file reader. The descriptor contains the following information: - the mitk::Image itself. This will be nullptr after analysis and only be present after actual loading. - a list of frames (mostly: filenames) that went into composition of the mitk::Image. - an assessment of the reader's ability to load this set of files (ReaderImplementationLevel) - this can be used for reader selection when one reader is able to load an image with correct colors and the other is able to produce only gray values, for example - description of aspects of the image. Mostly a key-value list implemented by means of mitk::PropertyList. - for specific keys and possible values, see documentation of specific readers. \note an mitk::Image may both consist of multiple files (the "old" DICOM way) or a mitk::Image may be described by a single DICOM file or even only parts of a DICOM file (the newer multi-frame DICOM classes). To reflect this DICOMImageFrameList describes a list of frames from different or a single file. Described aspects of an image are: - whether pixel spacing is meant to be in-patient or on-detector (mitk::PixelSpacingInterpretation) - details about a possible gantry tilt (intended for use by file readers, may be hidden later) */ - class MITKDICOMREADER_EXPORT DICOMImageBlockDescriptor: public IPropertyProvider + class MITKDICOM_EXPORT DICOMImageBlockDescriptor: public IPropertyProvider { public: DICOMImageBlockDescriptor(); ~DICOMImageBlockDescriptor() override; DICOMImageBlockDescriptor(const DICOMImageBlockDescriptor& other); DICOMImageBlockDescriptor& operator=(const DICOMImageBlockDescriptor& other); static DICOMTagList GetTagsOfInterest(); /// List of frames that constitute the mitk::Image (DICOMImageFrame%s) void SetImageFrameList(const DICOMImageFrameList& framelist); /// List of frames that constitute the mitk::Image (DICOMImageFrame%s) const DICOMImageFrameList& GetImageFrameList() const; /// The 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList void SetMitkImage(Image::Pointer image); /// the 3D mitk::Image that is loaded from the DICOM files of a DICOMImageFrameList Image::Pointer GetMitkImage() const; /// Reader's capability to appropriately load this set of frames ReaderImplementationLevel GetReaderImplementationLevel() const; /// Reader's capability to appropriately load this set of frames void SetReaderImplementationLevel(const ReaderImplementationLevel& level); /// Key-value store describing aspects of the image to be loaded void SetProperty(const std::string& key, BaseProperty* value); /// Key-value store describing aspects of the image to be loaded BaseProperty* GetProperty(const std::string& key) const; /// Convenience function around GetProperty() std::string GetPropertyAsString(const std::string&) const; /// Convenience function around SetProperty() void SetFlag(const std::string& key, bool value); /// Convenience function around GetProperty() bool GetFlag(const std::string& key, bool defaultValue) const; /// Convenience function around SetProperty() void SetIntProperty(const std::string& key, int value); /// Convenience function around GetProperty() int GetIntProperty(const std::string& key, int defaultValue) const; BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override; std::vector GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override; std::vector GetPropertyContextNames() const override; private: // For future implementation: load slice-by-slice, mark this using these methods void SetSliceIsLoaded(unsigned int index, bool isLoaded); // For future implementation: load slice-by-slice, mark this using these methods bool IsSliceLoaded(unsigned int index) const; // For future implementation: load slice-by-slice, mark this using these methods bool AllSlicesAreLoaded() const; public: /// Describe how the mitk::Image's pixel spacing should be interpreted PixelSpacingInterpretation GetPixelSpacingInterpretation() const; /// Describe the correct x/y pixel spacing of the mitk::Image (which some readers might need to adjust after loading) void GetDesiredMITKImagePixelSpacing(ScalarType& spacingXinMM, ScalarType& spacingYinMM) const; /// Describe the gantry tilt of the acquisition void SetTiltInformation(const GantryTiltInformation& info); /// Describe the gantry tilt of the acquisition const GantryTiltInformation GetTiltInformation() const; /// SOP Class UID of this set of frames void SetSOPClassUID(const std::string& uid); /// SOP Class UID of this set of frames std::string GetSOPClassUID() const; /// SOP Class as human readable name (e.g. "CT Image Storage") std::string GetSOPClassUIDAsName() const; /**Convinience method that returns the property timesteps*/ int GetNumberOfTimeSteps() const; /**return the number of frames that constitute one timestep.*/ int GetNumberOfFramesPerTimeStep() const; void SetTagCache(DICOMTagCache* privateCache); /** Type specifies additional tags of interest. Key is the tag path of interest. * The value is an optional user defined name for the property that should be used to store the tag value(s). * Empty value is default and will imply to use the found DICOMTagPath as property name.*/ typedef std::map AdditionalTagsMapType; /** * \brief Set a list of DICOMTagPaths that specifiy all DICOM-Tags that will be copied into the property of the mitk::Image. * * This method can be used to specify a list of DICOM-tags that shall be available after the loading. * The value in the tagMap is an optional user defined name for the property key that should be used * when storing the property). Empty value is default and will imply to use the found DICOMTagPath * as property key. * By default the content of the DICOM tags will be stored in a StringLookupTable on the mitk::Image. * This behaviour can be changed by setting a different TagLookupTableToPropertyFunctor via * SetTagLookupTableToPropertyFunctor(). */ void SetAdditionalTagsOfInterest(const AdditionalTagsMapType& tagMap); typedef std::function TagLookupTableToPropertyFunctor; /** * \brief Set a functor that defines how the slice-specific tag-values are stored in a Property. * * This method sets a functor that is given a StringLookupTable that contains the values of one DICOM tag * mapped to the slice index. * The functor is supposed to store these values in an mitk Property. * * By default, the StringLookupTable is stored in a StringLookupTableProperty except if all values are * identical. In this case, the unique value is stored only once in a StringProperty. */ void SetTagLookupTableToPropertyFunctor(TagLookupTableToPropertyFunctor); /// Print information about this image block to given stream void Print(std::ostream& os, bool filenameDetails) const; private: // read values from tag cache std::string GetPixelSpacing() const; std::string GetImagerPixelSpacing() const; Image::Pointer FixupSpacing(Image* mitkImage); Image::Pointer DescribeImageWithProperties(Image* mitkImage); void UpdateImageDescribingProperties() const; static mitk::BaseProperty::Pointer GetPropertyForDICOMValues(const DICOMCachedValueLookupTable& cacheLookupTable); double stringtodouble(const std::string& str) const; DICOMImageFrameList m_ImageFrameList; Image::Pointer m_MitkImage; BoolList m_SliceIsLoaded; ReaderImplementationLevel m_ReaderImplementationLevel; GantryTiltInformation m_TiltInformation; PropertyList::Pointer m_PropertyList; mitk::WeakPointer m_TagCache; mutable bool m_PropertiesOutOfDate; AdditionalTagsMapType m_AdditionalTagMap; std::set m_FoundAdditionalTags; TagLookupTableToPropertyFunctor m_PropertyFunctor; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMImageFrameInfo.h b/Modules/DICOM/include/mitkDICOMImageFrameInfo.h similarity index 91% rename from Modules/DICOMReader/include/mitkDICOMImageFrameInfo.h rename to Modules/DICOM/include/mitkDICOMImageFrameInfo.h index 2dfd4f16cf..b99f30998c 100644 --- a/Modules/DICOMReader/include/mitkDICOMImageFrameInfo.h +++ b/Modules/DICOM/include/mitkDICOMImageFrameInfo.h @@ -1,56 +1,56 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMImageFrameInfo_h #define mitkDICOMImageFrameInfo_h #include "itkObjectFactory.h" #include "mitkCommon.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Describes a frame within a DICOM file. This is a minimal data structure to describe a single frame (think of DICOM multi-frame classes) within a DICOM file. To be used by DICOMFileReader%s and as part of DICOMImageBlockDescriptor. */ - class MITKDICOMREADER_EXPORT DICOMImageFrameInfo : public itk::LightObject + class MITKDICOM_EXPORT DICOMImageFrameInfo : public itk::LightObject { public: /// absolute filename const std::string Filename; /// frame number, starting with 0 const unsigned int FrameNo; mitkClassMacroItkParent( DICOMImageFrameInfo, itk::LightObject ); itkFactorylessNewMacro( DICOMImageFrameInfo ); mitkNewMacro1Param( DICOMImageFrameInfo, const std::string&); mitkNewMacro2Param( DICOMImageFrameInfo, const std::string&, unsigned int ); bool operator==(const DICOMImageFrameInfo& other) const; protected: DICOMImageFrameInfo(const std::string& filename = "", unsigned int frameNo = 0); }; typedef std::vector DICOMImageFrameList; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMProperty.h b/Modules/DICOM/include/mitkDICOMProperty.h similarity index 84% rename from Modules/DICOMReader/include/mitkDICOMProperty.h rename to Modules/DICOM/include/mitkDICOMProperty.h index 4f24614af2..d396e6502f 100644 --- a/Modules/DICOMReader/include/mitkDICOMProperty.h +++ b/Modules/DICOM/include/mitkDICOMProperty.h @@ -1,82 +1,82 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMProperty_h #define mitkDICOMProperty_h #include "mitkDICOMImageBlockDescriptor.h" #include "mitkTemporoSpatialStringProperty.h" #include "mitkDICOMTagPath.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { typedef TemporoSpatialStringProperty DICOMProperty; /** Generation functor for DICOMFileReader classes to convert the collected tag values into DICOMProperty instances. */ - MITKDICOMREADER_EXPORT mitk::BaseProperty::Pointer GetDICOMPropertyForDICOMValuesFunctor(const DICOMCachedValueLookupTable& cacheLookupTable); + MITKDICOM_EXPORT mitk::BaseProperty::Pointer GetDICOMPropertyForDICOMValuesFunctor(const DICOMCachedValueLookupTable& cacheLookupTable); class PropertyList; class BaseData; /** Helper function that searches for all properties in a given property list that matches the passed path. * The result will be the matching properties in a map*/ - MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer> GetPropertyByDICOMTagPath(const PropertyList* list, const DICOMTagPath& path); + MITKDICOM_EXPORT std::map< std::string, BaseProperty::Pointer> GetPropertyByDICOMTagPath(const PropertyList* list, const DICOMTagPath& path); /** Helper function that searches for all properties in a given base data that matches the passed path. * The result will be the matching properties in a map*/ - MITKDICOMREADER_EXPORT std::map< std::string, BaseProperty::Pointer> GetPropertyByDICOMTagPath(const BaseData* data, const DICOMTagPath& path); + MITKDICOM_EXPORT std::map< std::string, BaseProperty::Pointer> GetPropertyByDICOMTagPath(const BaseData* data, const DICOMTagPath& path); /**Helper function that can be used to convert the content of a DICOM property into the given return type. The function makes the following assumptions: 1. dcmValueString does only encode one number. 2. The value is encoded compliant to locale "C". @pre dcmValueString must be convertibel into the return type. If this is not the case an exception will be thrown. */ template TNumericReturnType ConvertDICOMStrToValue(const std::string& dcmValueString) { std::istringstream iss(dcmValueString); iss.imbue(std::locale("C")); TNumericReturnType d; if (!(iss >> d) || !(iss.eof())) { mitkThrow() << "Cannot convert string to value type. Type: " << typeid(TNumericReturnType).name() << "; String: " << dcmValueString; } return d; }; /**Helper function that can be used to convert a numeric value into content of a DICOM property. @pre value must be convertibel into a string. If this is not the case an exception will be thrown. */ template std::string ConvertValueToDICOMStr(const TNumericType value) { std::ostringstream oss; oss.imbue(std::locale("C")); if (!(oss << value)) { mitkThrow() << "Cannot convert value type to dicom string. Type: " << typeid(TNumericType).name() << "; value: " << value; } return oss.str(); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMReaderConfigurator.h b/Modules/DICOM/include/mitkDICOMReaderConfigurator.h similarity index 98% rename from Modules/DICOMReader/include/mitkDICOMReaderConfigurator.h rename to Modules/DICOM/include/mitkDICOMReaderConfigurator.h index 9fa675aa69..f8e161e3a4 100644 --- a/Modules/DICOMReader/include/mitkDICOMReaderConfigurator.h +++ b/Modules/DICOM/include/mitkDICOMReaderConfigurator.h @@ -1,142 +1,142 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMReaderConfigurator_h #define mitkDICOMReaderConfigurator_h #include "mitkClassicDICOMSeriesReader.h" #include "mitkDICOMTagBasedSorter.h" // to put into private implementation #include "tinyxml.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Too-simple factory to create DICOMFileReader%s. This class is able to instantiate and configure (where possible) DICOMFileReader%s from XML descriptions. \note This is a bad factory example, because the factory is not extensible and needs to know all the specific readers. A flexible implementation should be provided in a future version. In its current version, the XML input is meant to be structured like \verbatim \endverbatim The root-tag \i names the class to be instantiated, currently this can be one of - DICOMITKSeriesGDCMReader - ThreeDnTDICOMSeriesReader Both classes bring simple configuration flags with them and a description of how images are sorted prior to loading. Flag for DICOMITKSeriesGDCMReader:
fixTiltByShearing="true|false"
Determines whether a potential gantry tilt should be "fixed" by shearing the output image. Flag for ThreeDnTDICOMSeriesReader:
group3DnT="true|false"
Determines whether images at the same spatial position should be interpreted as 3D+t images. The tags and describe the basic loading strategy of both reader mentioned above: first images are divided into incompatible groups (), and afterwards the images within each group are sorted by means of DICOMSortCriterion, which most commonly mentions a tag. Tag element and group are interpreted as the exadecimal numbers found all around the DICOM standard. The numbers can be prepended by a "0x" if this is preferred by the programmer (but they are taken as hexadecimal in all cases). \section DICOMReaderConfigurator_AboutTheFuture About the future evolution of this class This first version is hard coded for the current state of the implementation. If things should evolve in a way that needs us to splitt off readers for "old" versions, time should be taken to refactor this class. Basically, a serializer class should accompany each of the configurable classes. Such serializer classes should be registered and discovered via micro-services (to support extensions). A serializer should offer both methods to serialize a class and to desirialize it again. A "version" attribute at the top-level tag should be used to distinguish versions. Usually it should be enough to keep DE-serializers for all versions. Writers for the most recent version should be enough. */ -class MITKDICOMREADER_EXPORT DICOMReaderConfigurator : public itk::LightObject +class MITKDICOM_EXPORT DICOMReaderConfigurator : public itk::LightObject { public: mitkClassMacroItkParent( DICOMReaderConfigurator, itk::LightObject ); itkNewMacro( DICOMReaderConfigurator ); DICOMFileReader::Pointer CreateFromConfigFile(const std::string& filename) const; DICOMFileReader::Pointer CreateFromUTF8ConfigString(const std::string& xmlContents) const; std::string CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const; protected: DICOMReaderConfigurator(); ~DICOMReaderConfigurator() override; private: DICOMFileReader::Pointer CreateFromTiXmlDocument(TiXmlDocument& doc) const; DICOMTag tagFromXMLElement(TiXmlElement*) const; std::string requiredStringAttribute(TiXmlElement* xmlElement, const std::string& key) const; unsigned int hexStringToUInt(const std::string& s) const; ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement*) const; DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement*) const; void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, TiXmlElement* element) const; void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, TiXmlElement* element) const; DICOMSortCriterion::Pointer CreateDICOMSortByTag(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const; DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(TiXmlElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const; mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(TiXmlElement* element) const; TiXmlElement* CreateConfigStringFromReader(const DICOMITKSeriesGDCMReader* reader) const; TiXmlElement* CreateConfigStringFromReader(const ThreeDnTDICOMSeriesReader* reader) const; TiXmlElement* CreateConfigStringFromReader(const ClassicDICOMSeriesReader* reader) const; TiXmlElement* CreateConfigStringFromDICOMDatasetSorter(const DICOMTagBasedSorter* sorter) const; TiXmlElement* CreateConfigStringFromDICOMTag(const DICOMTag& tag) const; TiXmlElement* CreateDICOMFileReaderTag(const DICOMFileReader* reader) const; const char* toString(bool) const; std::string toHexString(unsigned int i) const; /** Helper that queries an boolean xml attribute. If the attribute does not exist, the passed default value is used.*/ bool QueryBooleanAttribute(const TiXmlElement* element, const char* attributeName, bool defaultValue) const; }; } // namespace #endif // mitkDICOMReaderConfigurator_h diff --git a/Modules/DICOMReader/include/mitkDICOMSortByTag.h b/Modules/DICOM/include/mitkDICOMSortByTag.h similarity index 95% rename from Modules/DICOMReader/include/mitkDICOMSortByTag.h rename to Modules/DICOM/include/mitkDICOMSortByTag.h index b97726f3f1..e84efb6435 100644 --- a/Modules/DICOMReader/include/mitkDICOMSortByTag.h +++ b/Modules/DICOM/include/mitkDICOMSortByTag.h @@ -1,68 +1,68 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMSortByTag_h #define mitkDICOMSortByTag_h #include "mitkDICOMSortCriterion.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Compare two datasets by the value of a single tag (for use in DICOMTagBasedSorter). The class will compare the tag values by 1. numerical value if possible (i.e. both datasets have a value that is numerical) 2. alphabetical order otherwise If the comparison results in equalness, it is refered to the secondary criterion, see DICOMSortByTag::NextLevelIsLeftBeforeRight(). */ -class MITKDICOMREADER_EXPORT DICOMSortByTag : public DICOMSortCriterion +class MITKDICOM_EXPORT DICOMSortByTag : public DICOMSortCriterion { public: mitkClassMacro( DICOMSortByTag, DICOMSortCriterion ); mitkNewMacro1Param( DICOMSortByTag, const DICOMTag& ); mitkNewMacro2Param( DICOMSortByTag, const DICOMTag&, DICOMSortCriterion::Pointer ); DICOMTagList GetTagsOfInterest() const override; bool IsLeftBeforeRight(const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right) const override; double NumericDistance(const mitk::DICOMDatasetAccess* from, const mitk::DICOMDatasetAccess* to) const override; void Print(std::ostream& os) const override; bool operator==(const DICOMSortCriterion& other) const override; protected: DICOMSortByTag( const DICOMTag& tag, DICOMSortCriterion::Pointer secondaryCriterion = nullptr ); ~DICOMSortByTag() override; DICOMSortByTag(const DICOMSortByTag& other); DICOMSortByTag& operator=(const DICOMSortByTag& other); bool StringCompare(const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right, const DICOMTag& tag) const; bool NumericCompare(const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right, const DICOMTag& tag) const; private: DICOMTag m_Tag; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMSortCriterion.h b/Modules/DICOM/include/mitkDICOMSortCriterion.h similarity index 96% rename from Modules/DICOMReader/include/mitkDICOMSortCriterion.h rename to Modules/DICOM/include/mitkDICOMSortCriterion.h index 7997de89c1..4fa2aebff1 100644 --- a/Modules/DICOMReader/include/mitkDICOMSortCriterion.h +++ b/Modules/DICOM/include/mitkDICOMSortCriterion.h @@ -1,78 +1,78 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMSortCriterion_h #define mitkDICOMSortCriterion_h #include "itkObjectFactory.h" #include "mitkCommon.h" #include "mitkDICOMDatasetAccess.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief A tag based sorting criterion for use in DICOMTagBasedSorter. This class is used within std::sort (see DICOMTagBasedSorter::Sort()) and has to answer a simple question by implementing IsLeftBeforeRight(). Each time IsLeftBeforeRight() is called, the method should return whether the left dataset should be sorted before the right dataset. Because there are identical tags values quite oftenly, a DICOMSortCriterion will always hold a secondary DICOMSortCriterion. In cases of equal tag values, the decision is refered to the secondary criterion. */ -class MITKDICOMREADER_EXPORT DICOMSortCriterion : public itk::LightObject +class MITKDICOM_EXPORT DICOMSortCriterion : public itk::LightObject { public: mitkClassMacroItkParent( DICOMSortCriterion, itk::LightObject ); /// \brief Tags used for comparison (includes seconary criteria). DICOMTagList GetAllTagsOfInterest() const; /// \brief Tags used for comparison. virtual DICOMTagList GetTagsOfInterest() const = 0; /// \brief Answer the sorting question. virtual bool IsLeftBeforeRight(const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right) const = 0; /// \brief Calculate a distance between two datasets. /// This ansers the question of consecutive datasets. virtual double NumericDistance(const mitk::DICOMDatasetAccess* from, const mitk::DICOMDatasetAccess* to) const = 0; /// \brief The fallback criterion. DICOMSortCriterion::ConstPointer GetSecondaryCriterion() const; /// brief describe this class in given stream. virtual void Print(std::ostream& os) const = 0; virtual bool operator==(const DICOMSortCriterion& other) const = 0; protected: DICOMSortCriterion( DICOMSortCriterion::Pointer secondaryCriterion ); ~DICOMSortCriterion() override; bool NextLevelIsLeftBeforeRight(const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right) const; explicit DICOMSortCriterion(const DICOMSortCriterion& other); DICOMSortCriterion& operator=(const DICOMSortCriterion& other); DICOMSortCriterion::Pointer m_SecondaryCriterion; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMTag.h b/Modules/DICOM/include/mitkDICOMTag.h similarity index 95% rename from Modules/DICOMReader/include/mitkDICOMTag.h rename to Modules/DICOM/include/mitkDICOMTag.h index 19b67c2e1e..b62289a587 100644 --- a/Modules/DICOMReader/include/mitkDICOMTag.h +++ b/Modules/DICOM/include/mitkDICOMTag.h @@ -1,86 +1,86 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkTag_h #define mitkTag_h #include "mitkPoint.h" #include "mitkVector.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Representation of a DICOM tag. This class is just meant to combine group and element numbers for better readability and make handling tags more easy by offering comparison methods. */ -class MITKDICOMREADER_EXPORT DICOMTag +class MITKDICOM_EXPORT DICOMTag { public: DICOMTag(unsigned int group, unsigned int element); DICOMTag(const DICOMTag& other); DICOMTag& operator=(const DICOMTag& other); bool operator==(const DICOMTag& other) const; bool operator<(const DICOMTag& other) const; unsigned int GetGroup() const; unsigned int GetElement() const; /// Return the name of this tag (e.g. "SeriesDescription" instead of "(0008,103e)") std::string GetName() const; /// add "(group-id,element-id) name" to given stream void Print(std::ostream& os) const; private: std::string toHexString(unsigned int i) const; unsigned int m_Group; unsigned int m_Element; }; typedef std::vector DICOMTagList; /** \brief Convert DICOM string describing a point two Vector3D. DICOM tags like ImageOrientationPatient contain two vectors as float numbers separated by backslashes: \verbatim 42.7131\13.77\0.7\137.76\0.3 \endverbatim */ void DICOMStringToOrientationVectors(const std::string& s, Vector3D& right, Vector3D& up, bool& successful); bool DICOMStringToSpacing(const std::string& s, ScalarType& spacingX, ScalarType& spacingY); /** \brief Convert DICOM string describing a point to Point3D. DICOM tags like ImagePositionPatient contain a position as float numbers separated by backslashes: \verbatim 42.7131\13.77\0.7 \endverbatim */ Point3D DICOMStringToPoint3D(const std::string& s, bool& successful); } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMTagBasedSorter.h b/Modules/DICOM/include/mitkDICOMTagBasedSorter.h similarity index 96% rename from Modules/DICOMReader/include/mitkDICOMTagBasedSorter.h rename to Modules/DICOM/include/mitkDICOMTagBasedSorter.h index efc2b46121..b708bf53c1 100644 --- a/Modules/DICOMReader/include/mitkDICOMTagBasedSorter.h +++ b/Modules/DICOM/include/mitkDICOMTagBasedSorter.h @@ -1,202 +1,202 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMTagBasedSorter_h #define mitkDICOMTagBasedSorter_h #include "mitkDICOMDatasetSorter.h" #include "mitkDICOMSortCriterion.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Sort DICOM datasets based on configurable tags. This class implements sorting of input DICOM datasets into multiple outputs as described in \ref DICOMITKSeriesGDCMReader_LoadingStrategy. The logic of sorting and splitting is most simple and most generic: 1. Datasets will be put into different groups, if they differ in their value of specific tags (defined by AddDistinguishingTag()) - there might be multiple distinguishing tags defined - tag values might be processed before comparison by means of TagValueProcessor (e.g. round to a number of decimal places) 2. Each of the groups will be sorted by comparing their tag values using multiple DICOMSortCriterion - DICOMSortCriterion might evaluate a single tag (e.g. Instance Number) or multiple values (as in SortByImagePositionPatient) - only a single DICOMSortCriterion is defined for DICOMTagBasedSorter, because each DICOMSortCriterion holds a "secondary sort criterion", i.e. an application can define multiple tags for sorting by chaining \link DICOMSortCriterion DICOMSortCriteria \endlink - applications should make sure that sorting is always defined (to avoid problems with standard containers), e.g. by adding a comparison of filenames or instance UIDs as a last sorting fallback. */ -class MITKDICOMREADER_EXPORT DICOMTagBasedSorter : public DICOMDatasetSorter +class MITKDICOM_EXPORT DICOMTagBasedSorter : public DICOMDatasetSorter { public: /** \brief Processes tag values before they are compared. These classes could do some kind of normalization such as rounding, lower case formatting, etc. */ - class MITKDICOMREADER_EXPORT TagValueProcessor + class MITKDICOM_EXPORT TagValueProcessor { public: /// \brief Implements the "processing". virtual std::string operator()(const std::string&) const = 0; virtual TagValueProcessor* Clone() const = 0; virtual ~TagValueProcessor() {} }; /** \brief Cuts a number after configured number of decimal places. An instance of this class can be used to avoid errors when comparing minimally different image orientations. */ - class MITKDICOMREADER_EXPORT CutDecimalPlaces : public TagValueProcessor + class MITKDICOM_EXPORT CutDecimalPlaces : public TagValueProcessor { public: CutDecimalPlaces(unsigned int precision); CutDecimalPlaces(const CutDecimalPlaces& other); unsigned int GetPrecision() const; std::string operator()(const std::string&) const override; TagValueProcessor* Clone() const override; private: unsigned int m_Precision; }; mitkClassMacro( DICOMTagBasedSorter, DICOMDatasetSorter ); itkNewMacro( DICOMTagBasedSorter ); /** \brief Datasets that differ in given tag's value will be sorted into separate outputs. */ void AddDistinguishingTag( const DICOMTag&, TagValueProcessor* tagValueProcessor = nullptr ); DICOMTagList GetDistinguishingTags() const; const TagValueProcessor* GetTagValueProcessorForDistinguishingTag(const DICOMTag&) const; /** \brief Define the sorting criterion (which holds seconardy criteria) */ void SetSortCriterion( DICOMSortCriterion::ConstPointer criterion ); DICOMSortCriterion::ConstPointer GetSortCriterion() const; /** \brief A list of all the tags needed for processing (facilitates scanning). */ DICOMTagList GetTagsOfInterest() override; /** \brief Whether or not groups should be checked for consecutive tag values. When this flag is set (default in constructor=off), the sorter will not only sort in a way that the values of a configured tag are ascending BUT in addition the sorter will enforce a constant numerical distance between values. Having this flag is useful for handling of series with missing slices, e.g. Instance Numbers 1 2 3 5 6 7 8. With the flag set to true, the sorter would split this group into two, because the initial distance of 1 is not kept between Instance Numbers 3 and 5. A special case of this behavior can be configured by SetExpectDistanceOne(). When this additional flag is set to true, the sorter will expect distance 1 exactly. This can help if the second slice is missing already. Without this additional flag, we would "learn" about a wrong distance of 2 (or similar) and then sort completely wrong. */ void SetStrictSorting(bool strict); bool GetStrictSorting() const; /** \brief Flag for a special case in "strict sorting". Please see documentation of SetStrictSorting(). \sa SetStrictSorting */ void SetExpectDistanceOne(bool strict); bool GetExpectDistanceOne() const; /** \brief Actually sort as described in the Detailed Description. */ void Sort() override; /** \brief Print configuration details into given stream. */ void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override; bool operator==(const DICOMDatasetSorter& other) const override; static bool GetDefaultStrictSorting() { return m_DefaultStrictSorting; } static bool GetDefaultExpectDistanceOne() { return m_DefaultExpectDistanceOne; } protected: /** \brief Helper struct to feed into std::sort, configured via DICOMSortCriterion. */ struct ParameterizedDatasetSort { ParameterizedDatasetSort(DICOMSortCriterion::ConstPointer); bool operator() (const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right); DICOMSortCriterion::ConstPointer m_SortCriterion; }; DICOMTagBasedSorter(); ~DICOMTagBasedSorter() override; DICOMTagBasedSorter(const DICOMTagBasedSorter& other); DICOMTagBasedSorter& operator=(const DICOMTagBasedSorter& other); /** \brief Helper for SplitInputGroups(). */ std::string BuildGroupID( DICOMDatasetAccess* dataset ); typedef std::map GroupIDToListType; /** \brief Implements the "distiguishing tags". To sort datasets into different groups, a long string will be built for each dataset. The string concatenates all tags and their respective values. Datasets that match in all values will end up with the same string. */ GroupIDToListType SplitInputGroups(); /** \brief Implements the sorting step. Relatively simple implementation thanks to std::sort and a parameterization via DICOMSortCriterion. */ GroupIDToListType& SortGroups(GroupIDToListType& groups); DICOMTagList m_DistinguishingTags; typedef std::map TagValueProcessorMap; TagValueProcessorMap m_TagValueProcessor; DICOMSortCriterion::ConstPointer m_SortCriterion; bool m_StrictSorting; bool m_ExpectDistanceOne; const static bool m_DefaultStrictSorting = false; const static bool m_DefaultExpectDistanceOne = false; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMTagCache.h b/Modules/DICOM/include/mitkDICOMTagCache.h similarity index 92% rename from Modules/DICOMReader/include/mitkDICOMTagCache.h rename to Modules/DICOM/include/mitkDICOMTagCache.h index e16a2b28bb..1e70ae3478 100644 --- a/Modules/DICOMReader/include/mitkDICOMTagCache.h +++ b/Modules/DICOM/include/mitkDICOMTagCache.h @@ -1,63 +1,63 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMTagCache_h #define mitkDICOMTagCache_h #include "itkObjectFactory.h" #include "mitkCommon.h" #include "mitkDICOMTag.h" #include "mitkDICOMDatasetAccess.h" #include "mitkDICOMEnums.h" #include "mitkDICOMDatasetAccessingImageFrameInfo.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief ... */ - class MITKDICOMREADER_EXPORT DICOMTagCache : public itk::Object + class MITKDICOM_EXPORT DICOMTagCache : public itk::Object { public: mitkClassMacroItkParent( DICOMTagCache, itk::Object ); typedef std::list FindingsListType; /** \brief Define the list of files that were scanned to populate the cache. */ virtual void SetInputFiles(const StringList& filenames); virtual DICOMDatasetFinding GetTagValue(DICOMImageFrameInfo* frame, const DICOMTag& tag) const = 0; virtual FindingsListType GetTagValue(DICOMImageFrameInfo* frame, const DICOMTagPath& path) const = 0; /** \brief Retrieve a result list for file-by-file tag access. */ virtual DICOMDatasetAccessingImageFrameList GetFrameInfoList() const = 0; protected: StringList m_InputFilenames; DICOMTagCache(); DICOMTagCache(const DICOMTagCache&); ~DICOMTagCache() override; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMTagPath.h b/Modules/DICOM/include/mitkDICOMTagPath.h similarity index 88% rename from Modules/DICOMReader/include/mitkDICOMTagPath.h rename to Modules/DICOM/include/mitkDICOMTagPath.h index b758384c4a..7c82a56fb7 100644 --- a/Modules/DICOMReader/include/mitkDICOMTagPath.h +++ b/Modules/DICOM/include/mitkDICOMTagPath.h @@ -1,176 +1,176 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMTagPath_h #define mitkDICOMTagPath_h #include #include -#include +#include namespace mitk { /** @brief Class is used to identify (nested) attributes in a DICOM dataset. * In contrast to the class DICOMTag, which only specifies one specific tag, * the tag path can identify nested attributes (like items in a DICOM sequence). * In addition you may also specify wildcards for the selection index or * complete elements of the path. * @remark If you want to keep the DICOMTagPath compatible to the dcmtk search path * format, you may *not* use element wild cards (this IsExplicit() or HasItemSelectionWildcardsOnly() * must return true). */ - class MITKDICOMREADER_EXPORT DICOMTagPath + class MITKDICOM_EXPORT DICOMTagPath { public: typedef int ItemSelectionIndex; - struct MITKDICOMREADER_EXPORT NodeInfo + struct MITKDICOM_EXPORT NodeInfo { enum class NodeType { Invalid = 0, //*< Node is non existant or invalid. Element, //*< Selects an specific element given the node name. SequenceSelection, //*< Selects an specific item in a sequence of items and has a item selector ("[n]"). AnySelection, //*< Selects all items of a specific element ("[*]"). AnyElement, //*< Selects any element/item. Node name is wildcarded ("*"); item selection as well implictily. }; NodeType type; DICOMTag tag; ItemSelectionIndex selection; NodeInfo(); NodeInfo(const DICOMTag& tag, NodeType type = NodeType::Element, ItemSelectionIndex index = 0); bool Matches(const NodeInfo& right) const; bool operator == (const NodeInfo& right) const; }; typedef std::vector NodeInfoVectorType; typedef NodeInfoVectorType::size_type PathIndexType; /** Returns if the DICOMTagPath is empty.*/ bool IsEmpty() const; /** Returns if the path is explicit (has no wildcards).*/ bool IsExplicit() const; /** Returns if the path has any nodes with item selection wild cards ([*]).*/ bool HasItemSelectionWildcardsOnly() const; /** Number of path nodes the DICOMTagPath contains.*/ PathIndexType Size() const; /** Adds a new node to the end of the path. \param [in] newNode Reference to the node that should be added. \return Returns the index of the newly added node.*/ PathIndexType AddNode(const NodeInfo& newNode); /** Function returns the node info of a path node specified by the index * within the DICOMTagPath. * \pre Passed index must not be out of bound. * \param [in] index Index of the node whose info should be retrieved. * \return Info of the specified path node. If the index is out of bound an InvalidPathNode exception will be thrown.*/ const NodeInfo& GetNode(const PathIndexType& index) const; /** Function returns the node info of a path node specified by the index * within the DICOMTagPath. * \pre Passed index must not be out of bound. * \param [in] index Index of the node whose info should be retrieved. * \return Info of the specified path node. If the index is out of bound an InvalidPathNode exception will be thrown.*/ NodeInfo& GetNode(const PathIndexType& index); /** Function returns the node info of the first path node within the DICOMTagPath. * \pre DICOMTagPath must not be empty. * \return Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.*/ NodeInfo& GetFirstNode(); /** Function returns the node info of the first path node within the DICOMTagPath. * \pre DICOMTagPath must not be empty. * \return Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.*/ const NodeInfo& GetFirstNode() const; /** Function returns the node info of the last path node within the DICOMTagPath. * \pre DICOMTagPath must not be empty. * \return Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.*/ NodeInfo& GetLastNode(); /** Function returns the node info of the last path node within the DICOMTagPath. * \pre DICOMTagPath must not be empty. * \return Info of the first path node. If the path is empty, an InvalidPathNode exception will be thrown.*/ const NodeInfo& GetLastNode() const; const NodeInfoVectorType& GetNodes() const; std::string ToStr() const; DICOMTagPath& FromStr(const std::string& pathStr); /**Compares two DICOMTagPaths for real equality. So its a string compare of their string conversion*/ bool operator == (const DICOMTagPath& path) const; /**Operation equals like comparing the ToStr() results with operator <.*/ bool operator < (const DICOMTagPath& right) const; /**Checks if to DICOMTagPathes are specify the same node. Hence all wildcards will be processed.\n * E.G.: "item1/child1/grandChild2" == ".//item1//grandChild2" is true. * \remark If you want to check if to pathes are "truely" equal and not only equal in terms of * pointing to the same node, use the member function Equals()*/ bool Equals(const DICOMTagPath& path) const; DICOMTagPath& operator = (const DICOMTagPath& path); DICOMTagPath& AddAnyElement(); DICOMTagPath& AddElement(unsigned int group, unsigned int element); DICOMTagPath& AddAnySelection(unsigned int group, unsigned int element); DICOMTagPath& AddSelection(unsigned int group, unsigned int element, ItemSelectionIndex index); DICOMTagPath(); DICOMTagPath(const DICOMTagPath& path); DICOMTagPath(const DICOMTag& tag); explicit DICOMTagPath(unsigned int group, unsigned int element); virtual ~DICOMTagPath(); virtual void Reset(); protected: NodeInfoVectorType m_NodeInfos; static bool DICOMTagPathesMatch(const DICOMTagPath& left, const DICOMTagPath& right); }; typedef std::vector DICOMTagPathList; - MITKDICOMREADER_EXPORT std::ostream& operator<<(std::ostream& os, const DICOMTagPath& path); + MITKDICOM_EXPORT std::ostream& operator<<(std::ostream& os, const DICOMTagPath& path); - MITKDICOMREADER_EXPORT std::string DICOMTagPathToPropertyRegEx(const DICOMTagPath& tagPath); - MITKDICOMREADER_EXPORT std::string DICOMTagPathToPersistenceKeyRegEx(const DICOMTagPath& tagPath); - MITKDICOMREADER_EXPORT std::string DICOMTagPathToPersistenceKeyTemplate(const DICOMTagPath& tagPath); - MITKDICOMREADER_EXPORT std::string DICOMTagPathToPersistenceNameTemplate(const DICOMTagPath& tagPath); + MITKDICOM_EXPORT std::string DICOMTagPathToPropertyRegEx(const DICOMTagPath& tagPath); + MITKDICOM_EXPORT std::string DICOMTagPathToPersistenceKeyRegEx(const DICOMTagPath& tagPath); + MITKDICOM_EXPORT std::string DICOMTagPathToPersistenceKeyTemplate(const DICOMTagPath& tagPath); + MITKDICOM_EXPORT std::string DICOMTagPathToPersistenceNameTemplate(const DICOMTagPath& tagPath); /** Converts a passed path into a search string for the DCMTK DcmPathProcessor. @pre tagPath must be an explicit (DICOMTagPath::IsExplicit()) path or must only contain selection wild cards (DICOMTagPath::HasItemSelectionWildcardsOnly()).*/ - MITKDICOMREADER_EXPORT std::string DICOMTagPathToDCMTKSearchPath(const DICOMTagPath& tagPath); + MITKDICOM_EXPORT std::string DICOMTagPathToDCMTKSearchPath(const DICOMTagPath& tagPath); /** Converts the passed property name into a tag path. If the property name cannot be converted into a valid path, the returned path is empty.*/ - MITKDICOMREADER_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string& propertyName); + MITKDICOM_EXPORT DICOMTagPath PropertyNameToDICOMTagPath(const std::string& propertyName); /** returns the correct property name for a given DICOMTagPath instance. */ - MITKDICOMREADER_EXPORT std::string DICOMTagPathToPropertyName(const DICOMTagPath& tagPath); + MITKDICOM_EXPORT std::string DICOMTagPathToPropertyName(const DICOMTagPath& tagPath); } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMTagScanner.h b/Modules/DICOM/include/mitkDICOMTagScanner.h similarity index 97% rename from Modules/DICOMReader/include/mitkDICOMTagScanner.h rename to Modules/DICOM/include/mitkDICOMTagScanner.h index 84a9a9defd..374899f943 100644 --- a/Modules/DICOMReader/include/mitkDICOMTagScanner.h +++ b/Modules/DICOM/include/mitkDICOMTagScanner.h @@ -1,118 +1,118 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMTagScanner_h #define mitkDICOMTagScanner_h #include #include "itkMutexLock.h" #include "mitkDICOMEnums.h" #include "mitkDICOMTagPath.h" #include "mitkDICOMTagCache.h" #include "mitkDICOMDatasetAccessingImageFrameInfo.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Abstracts the tag scanning process for a set of DICOM files. Formerly integrated as a part of DICOMITKSeriesGDCMReader, the tag scanning part has been factored out into DICOMTagScanner classes in order to allow a single scan for multiple reader alternatives. This helps much in the selection process of e.g. DICOMFileReaderSelector. This is an abstract base class for concrete scanner implementations. @remark When used in a process where multiple classes will access the scan results, care should be taken that all the tags and files of interest are communicated to DICOMTagScanner before requesting the results! */ - class MITKDICOMREADER_EXPORT DICOMTagScanner : public itk::Object + class MITKDICOM_EXPORT DICOMTagScanner : public itk::Object { public: mitkClassMacroItkParent(DICOMTagScanner, itk::Object); /** \brief Add this tag to the scanning process. */ virtual void AddTag(const DICOMTag& tag) = 0; /** \brief Add a list of tags to the scanning process. */ virtual void AddTags(const DICOMTagList& tags) = 0; /** \brief Add this tag path to the scanning process. */ virtual void AddTagPath(const DICOMTagPath& path) = 0; /** \brief Add a list of tag pathes to the scanning process. */ virtual void AddTagPaths(const DICOMTagPathList& paths) = 0; /** \brief Define the list of files to scan. This does not ADD to an internal list, but it replaces the whole list of files. */ virtual void SetInputFiles(const StringList& filenames) = 0; /** \brief Start the scanning process. Calling Scan() will invalidate previous scans, forgetting all about files and tags from files that have been scanned previously. */ virtual void Scan() = 0; /** \brief Retrieve a result list for file-by-file tag access. */ virtual DICOMDatasetAccessingImageFrameList GetFrameInfoList() const = 0; /** \brief Retrieve Pointer to the complete cache of the scan. */ virtual DICOMTagCache::Pointer GetScanCache() const = 0; protected: /** \brief Return active C locale */ static std::string GetActiveLocale(); /** \brief Remember current locale on stack, activate "C" locale. "C" locale is required for correct parsing of numbers by itk::ImageSeriesReader */ void PushLocale() const; /** \brief Activate last remembered locale from locale stack "C" locale is required for correct parsing of numbers by itk::ImageSeriesReader */ void PopLocale() const; DICOMTagScanner(); ~DICOMTagScanner() override; private: static itk::MutexLock::Pointer s_LocaleMutex; mutable std::stack m_ReplacedCLocales; mutable std::stack m_ReplacedCinLocales; DICOMTagScanner(const DICOMTagScanner&); }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMTagsOfInterestAddHelper.h b/Modules/DICOM/include/mitkDICOMTagsOfInterestAddHelper.h similarity index 95% rename from Modules/DICOMReader/include/mitkDICOMTagsOfInterestAddHelper.h rename to Modules/DICOM/include/mitkDICOMTagsOfInterestAddHelper.h index d5cb9cceb4..e2160057de 100644 --- a/Modules/DICOMReader/include/mitkDICOMTagsOfInterestAddHelper.h +++ b/Modules/DICOM/include/mitkDICOMTagsOfInterestAddHelper.h @@ -1,72 +1,72 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMTagsOfInterestAddHelper_h #define mitkDICOMTagsOfInterestAddHelper_h #include #include #include #include #include -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace us { class ModuleContext; } namespace mitk { class IDICOMTagsOfInterest; /** Helper class that can be used to ensure that a given list of DICOM tags will be registered at existing DICOMTagsOfInterest services. If the services are available the tags will be directly added. As long as the helper is active, it will add the given tags to all new DICOMTagsOfInterest services as soon as they are registered. This helper class is e.g. used in module activators where the DICOMTagsOfInterest service might not be registered when a module is loaded but the module wants to ensure that the tags are added as soon as possible. The helper must be deactivated before the module context used on activation gets invalid (e.g. in the Unload function of the module activator that uses the helper to ensure that the tags will be added). */ - class MITKDICOMREADER_EXPORT DICOMTagsOfInterestAddHelper + class MITKDICOM_EXPORT DICOMTagsOfInterestAddHelper { public: using TagsOfInterestVector = std::vector; ~DICOMTagsOfInterestAddHelper(); void Activate(us::ModuleContext* context, TagsOfInterestVector tags); void Deactivate(); private: void RegisterTagsOfInterest(IDICOMTagsOfInterest* toiService) const; void DICOMTagsOfInterestServiceChanged(const us::ServiceEvent event); TagsOfInterestVector m_TagsOfInterest; bool m_Active = false; us::ModuleContext* m_Context = nullptr; /**mutex to guard the service listening */ std::mutex m_Mutex; }; } #endif diff --git a/Modules/DICOMReader/include/mitkDICOMTagsOfInterestHelper.h b/Modules/DICOM/include/mitkDICOMTagsOfInterestHelper.h similarity index 87% rename from Modules/DICOMReader/include/mitkDICOMTagsOfInterestHelper.h rename to Modules/DICOM/include/mitkDICOMTagsOfInterestHelper.h index 9068284967..f9dc423f51 100644 --- a/Modules/DICOMReader/include/mitkDICOMTagsOfInterestHelper.h +++ b/Modules/DICOM/include/mitkDICOMTagsOfInterestHelper.h @@ -1,41 +1,41 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMTagsOfInterestHelper_h #define mitkDICOMTagsOfInterestHelper_h #include #include -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** Type specifies tags of interest. Key is the tag path of interest. * The value is an optional user defined name for the property that should be used to store the tag value(s). * Empty value is default and will imply to use the found DICOMTagPath as property name.*/ typedef std::map DICOMTagPathMapType; /** Returns the list of tags that are by default of interest and should * be extracted when loading DICOM data. This can for instance be used * to with DICOMFileReader::SetAdditionalTagsOfInterest().*/ - DICOMTagPathMapType MITKDICOMREADER_EXPORT GetCurrentDICOMTagsOfInterest(); + DICOMTagPathMapType MITKDICOM_EXPORT GetCurrentDICOMTagsOfInterest(); /** Returns the list of tags that are by default of interest and should * be extracted when loading DICOM data. This can for instance be used * to with DICOMFileReader::SetAdditionalTagsOfInterest().*/ - DICOMTagPathMapType MITKDICOMREADER_EXPORT GetDefaultDICOMTagsOfInterest(); + DICOMTagPathMapType MITKDICOM_EXPORT GetDefaultDICOMTagsOfInterest(); } #endif diff --git a/Modules/DICOMReader/include/mitkEquiDistantBlocksSorter.h b/Modules/DICOM/include/mitkEquiDistantBlocksSorter.h similarity index 98% rename from Modules/DICOMReader/include/mitkEquiDistantBlocksSorter.h rename to Modules/DICOM/include/mitkEquiDistantBlocksSorter.h index d80ecc1a78..03bc4f5476 100644 --- a/Modules/DICOMReader/include/mitkEquiDistantBlocksSorter.h +++ b/Modules/DICOM/include/mitkEquiDistantBlocksSorter.h @@ -1,211 +1,211 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkEquiDistantBlocksSorter_h #define mitkEquiDistantBlocksSorter_h #include "mitkDICOMDatasetSorter.h" #include "mitkDICOMSortCriterion.h" #include "mitkGantryTiltInformation.h" #include "mitkVector.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Split inputs into blocks of equidistant slices (for use in DICOMITKSeriesGDCMReader). Since inter-slice distance is not recorded in DICOM tags, we must ensure that blocks are made up of slices that have equal distances between neighboring slices. This is especially necessary because itk::ImageSeriesReader is later used for the actual loading, and this class expects (and does nocht verify) equal inter-slice distance (see \ref DICOMITKSeriesGDCMReader_ForcedConfiguration). To achieve such grouping, the inter-slice distance is calculated from the first two different slice positions of a block. Following slices are added to a block as long as they can be added by adding the calculated inter-slice distance to the last slice of the block. Slices that do not fit into the expected distance pattern, are set aside for further analysis. This grouping is done until each file has been assigned to a group. Slices that share a position in space are also sorted into separate blocks during this step. So the result of this step is a set of blocks that contain only slices with equal z spacing and uniqe slices at each position. During sorting, the origins (documented in tag image position patient) are compared against expected origins (from former origin plus moving direction). As there will be minor differences in numbers (from both calculations and unprecise tag values), we must be a bit tolerant here. The default behavior is to expect that an origin is not further away from the expected position than 30% of the inter-slice distance. To support a legacy behavior of a former loader (DicomSeriesReader), this default can be restricted to a constant number of millimeters by calling SetToleratedOriginOffset(mm). Detailed implementation in AnalyzeFileForITKImageSeriesReaderSpacingAssumption(). */ -class MITKDICOMREADER_EXPORT EquiDistantBlocksSorter : public DICOMDatasetSorter +class MITKDICOM_EXPORT EquiDistantBlocksSorter : public DICOMDatasetSorter { public: mitkClassMacro( EquiDistantBlocksSorter, DICOMDatasetSorter ); itkNewMacro( EquiDistantBlocksSorter ); DICOMTagList GetTagsOfInterest() override; /** \brief Delegates work to AnalyzeFileForITKImageSeriesReaderSpacingAssumption(). AnalyzeFileForITKImageSeriesReaderSpacingAssumption() is called until it does not create multiple blocks anymore. */ void Sort() override; /** \brief Whether or not to accept images from a tilted acquisition in a single output group. */ void SetAcceptTilt(bool accept); bool GetAcceptTilt() const; /** \brief See class description and SetToleratedOriginOffset(). */ void SetToleratedOriginOffsetToAdaptive(double fractionOfInterSliceDistanct = 0.3); /** \brief See class description and SetToleratedOriginOffsetToAdaptive(). Default value of 0.005 is calculated so that we get a maximum of 1/10mm error when having a measurement crosses 20 slices in z direction (too strict? we don't know better..). */ void SetToleratedOriginOffset(double millimeters = 0.005); double GetToleratedOriginOffset() const; bool IsToleratedOriginOffsetAbsolute() const; void SetAcceptTwoSlicesGroups(bool accept); bool GetAcceptTwoSlicesGroups() const; void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override; bool operator==(const DICOMDatasetSorter& other) const override; protected: /** \brief Return type of AnalyzeFileForITKImageSeriesReaderSpacingAssumption(). Class contains the grouping result of method AnalyzeFileForITKImageSeriesReaderSpacingAssumption(), which takes as input a number of images, which are all equally oriented and spatially sorted along their normal direction. The result contains of two blocks: a first one is the grouping result, all of those images can be loaded into one image block because they have an equal origin-to-origin distance without any gaps in-between. */ class SliceGroupingAnalysisResult { public: SliceGroupingAnalysisResult(); /** \brief Grouping result, all same origin-to-origin distance w/o gaps. */ DICOMDatasetList GetBlockDatasets(); void SetFirstFilenameOfBlock(const std::string& filename); std::string GetFirstFilenameOfBlock() const; void SetLastFilenameOfBlock(const std::string& filename); std::string GetLastFilenameOfBlock() const; /** \brief Remaining files, which could not be grouped. */ DICOMDatasetList GetUnsortedDatasets(); /** \brief Wheter or not the grouped result contain a gantry tilt. */ bool ContainsGantryTilt(); /** \brief Detailed description of gantry tilt. */ const GantryTiltInformation& GetTiltInfo() const; /** \brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only. */ void AddFileToSortedBlock(DICOMDatasetAccess* dataset); /** \brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only. */ void AddFileToUnsortedBlock(DICOMDatasetAccess* dataset); void AddFilesToUnsortedBlock(const DICOMDatasetList& datasets); /** \brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only. \todo Could make sense to enhance this with an instance of GantryTiltInformation to store the whole result! */ void FlagGantryTilt(const GantryTiltInformation& tiltInfo); /** \brief Only meaningful for use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption. */ void UndoPrematureGrouping(); protected: DICOMDatasetList m_GroupedFiles; DICOMDatasetList m_UnsortedFiles; GantryTiltInformation m_TiltInfo; std::string m_FirstFilenameOfBlock; std::string m_LastFilenameOfBlock; }; /** \brief Ensure an equal z-spacing for a group of files. Takes as input a number of images, which are all equally oriented and spatially sorted along their normal direction. Internally used by GetSeries. Returns two lists: the first one contins slices of equal inter-slice spacing. The second list contains remaining files, which need to be run through AnalyzeFileForITKImageSeriesReaderSpacingAssumption again. Relevant code that is matched here is in itkImageSeriesReader.txx (ImageSeriesReader::GenerateOutputInformation(void)), lines 176 to 245 (as of ITK 3.20) */ SliceGroupingAnalysisResult AnalyzeFileForITKImageSeriesReaderSpacingAssumption(const DICOMDatasetList& files, bool groupsOfSimilarImages); /** \brief Safely convert const char* to std::string. */ std::string ConstCharStarToString(const char* s); EquiDistantBlocksSorter(); ~EquiDistantBlocksSorter() override; EquiDistantBlocksSorter(const EquiDistantBlocksSorter& other); EquiDistantBlocksSorter& operator=(const EquiDistantBlocksSorter& other); bool m_AcceptTilt; typedef std::vector ResultsList; ResultsList m_SliceGroupingResults; double m_ToleratedOriginOffset; bool m_ToleratedOriginOffsetIsAbsolute; bool m_AcceptTwoSlicesGroups; }; } #endif diff --git a/Modules/DICOMReader/include/mitkGantryTiltInformation.h b/Modules/DICOM/include/mitkGantryTiltInformation.h similarity index 98% rename from Modules/DICOMReader/include/mitkGantryTiltInformation.h rename to Modules/DICOM/include/mitkGantryTiltInformation.h index a213495372..550e9de731 100644 --- a/Modules/DICOMReader/include/mitkGantryTiltInformation.h +++ b/Modules/DICOM/include/mitkGantryTiltInformation.h @@ -1,143 +1,143 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkGantryTiltInformation_h #define mitkGantryTiltInformation_h #include "mitkPoint.h" #include "mitkVector.h" #include "mitkPoint.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Gantry tilt analysis result. Takes geometry information for two slices of a DICOM series and calculates whether these fit into an orthogonal block or not. If NOT, they can either be the result of an acquisition with gantry tilt OR completly broken by some shearing transformation. Most calculations are done in the constructor, results can then be read via the remaining methods. This class is a helper to DICOMITKSeriesGDCMReader and can - not be used outside of \ref DICOMReaderModule + not be used outside of \ref DICOMModule */ class GantryTiltInformation { public: // two types to avoid any rounding errors typedef itk::Point Point3Dd; typedef itk::Vector Vector3Dd; /** \brief Just so we can create empty instances for assigning results later. */ GantryTiltInformation(); void Print(std::ostream& os) const; /** \brief THE constructor, which does all the calculations. Determining the amount of tilt is done by checking the distances of origin1 from planes through origin2. Two planes are considered: - normal vector along normal of slices (right x up): gives the slice distance - normal vector along orientation vector "up": gives the shift parallel to the plane orientation The tilt angle can then be calculated from these distances \param origin1 origin of the first slice \param origin2 origin of the second slice \param right right/up describe the orientatation of borth slices \param up right/up describe the orientatation of borth slices \param numberOfSlicesApart how many slices are the given origins apart (1 for neighboring slices) */ GantryTiltInformation( const Point3D& origin1, const Point3D& origin2, const Vector3D& right, const Vector3D& up, unsigned int numberOfSlicesApart); /** \brief Factory method to create GantryTiltInformation from tag values (strings). Parameters as the regular c'tor. */ static GantryTiltInformation MakeFromTagValues( const std::string& origin1String, const std::string& origin2String, const std::string& orientationString, unsigned int numberOfSlicesApart); /** \brief Whether the slices were sheared. True if any of the shifts along right or up vector are non-zero. */ bool IsSheared() const; /** \brief Whether the shearing is a gantry tilt or more complicated. Gantry tilt will only produce shifts in ONE orientation, not in both. Since the correction code currently only coveres one tilt direction AND we don't know of medical images with two tilt directions, the loading code wants to check if our assumptions are true. */ bool IsRegularGantryTilt() const; /** \brief The offset distance in Y direction for each slice in mm (describes the tilt result). */ double GetMatrixCoefficientForCorrectionInWorldCoordinates() const; /** \brief The z / inter-slice spacing. Needed to correct ImageSeriesReader's result. */ double GetRealZSpacing() const; /** \brief The shift between first and last slice in mm. Needed to resize an orthogonal image volume. */ double GetTiltCorrectedAdditionalSize(unsigned int imageSizeZ) const; /** \brief Calculated tilt angle in degrees. */ double GetTiltAngleInDegrees() const; private: /** \brief Projection of point p onto line through lineOrigin in direction of lineDirection. */ Point3D projectPointOnLine( Point3Dd p, Point3Dd lineOrigin, Vector3Dd lineDirection ); double m_ShiftUp; double m_ShiftRight; double m_ShiftNormal; double m_ITKAssumedSliceSpacing; unsigned int m_NumberOfSlicesApart; }; } // namespace #endif diff --git a/Modules/DICOMReader/include/mitkIDICOMTagsOfInterest.h b/Modules/DICOM/include/mitkIDICOMTagsOfInterest.h similarity index 96% rename from Modules/DICOMReader/include/mitkIDICOMTagsOfInterest.h rename to Modules/DICOM/include/mitkIDICOMTagsOfInterest.h index 410fdb5f40..6b968deaee 100644 --- a/Modules/DICOMReader/include/mitkIDICOMTagsOfInterest.h +++ b/Modules/DICOM/include/mitkIDICOMTagsOfInterest.h @@ -1,64 +1,64 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkIDICOMTagsOfInterest_h #define mitkIDICOMTagsOfInterest_h #include #include #include #include -#include +#include namespace mitk { /** * \ingroup MicroServices_Interfaces * \brief Interface of DICOM tags of interest service. * * This service allows you to manage the tags of interest (toi). * All registred toi will be extracted when loading dicom data and stored as properties in the corresponding * base data object. In addition the service can (if available) use IPropertyPersistance and IPropertyAliases * to ensure that the tags of interests are also persisted and have a human readable alias. */ - class MITKDICOMREADER_EXPORT IDICOMTagsOfInterest + class MITKDICOM_EXPORT IDICOMTagsOfInterest { public: virtual ~IDICOMTagsOfInterest(); /** \brief Add an tag to the TOI. * If the tag was already added it will be overwritten with the passed values. * \param[in] tag Tag that should be added. * \param[in] makePersistant Indicates if the tag should be made persistant if possible via the IPropertyPersistence service. */ virtual void AddTagOfInterest(const DICOMTagPath& tag, bool makePersistant = true) = 0; /** Returns the map of all tags of interest. Key is the property name. Value is the DICOM tag.*/ virtual DICOMTagPathMapType GetTagsOfInterest() const = 0; /** Indicates if the given tag is already a tag of interest.*/ virtual bool HasTag(const DICOMTagPath& tag) const = 0; /** \brief Remove specific tag. If it not exists the function will do nothing. * \param[in] tag Tag that should be removed. */ virtual void RemoveTag(const DICOMTagPath& tag) = 0; /** \brief Remove all tags. */ virtual void RemoveAllTags() = 0; }; } MITK_DECLARE_SERVICE_INTERFACE(mitk::IDICOMTagsOfInterest, "org.mitk.IDICOMTagsOfInterest") #endif diff --git a/Modules/DICOMReader/include/mitkITKDICOMSeriesReaderHelper.h b/Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.h similarity index 100% rename from Modules/DICOMReader/include/mitkITKDICOMSeriesReaderHelper.h rename to Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.h diff --git a/Modules/DICOMReader/include/mitkITKDICOMSeriesReaderHelper.txx b/Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.txx similarity index 100% rename from Modules/DICOMReader/include/mitkITKDICOMSeriesReaderHelper.txx rename to Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.txx diff --git a/Modules/DICOMReader/include/mitkNormalDirectionConsistencySorter.h b/Modules/DICOM/include/mitkNormalDirectionConsistencySorter.h similarity index 94% rename from Modules/DICOMReader/include/mitkNormalDirectionConsistencySorter.h rename to Modules/DICOM/include/mitkNormalDirectionConsistencySorter.h index 6f62620098..a870e7a134 100644 --- a/Modules/DICOMReader/include/mitkNormalDirectionConsistencySorter.h +++ b/Modules/DICOM/include/mitkNormalDirectionConsistencySorter.h @@ -1,71 +1,71 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkNormalDirectionConsistencySorter_h #define mitkNormalDirectionConsistencySorter_h #include "mitkDICOMDatasetSorter.h" #include "mitkGantryTiltInformation.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Makes sure that the order of files is along the image plane normals. When loading with ImageSeriesReader and initializing an mitk::Image with the result we need to make sure that the order of inputs for the ImageSeriesReader is along the normal of the images. I.e. The direction of the normal needs to be the same direction as the vector from the first to the last image origin. Since this class is used as a last sorting step before loading, it will also calculate (and return) an updated GantryTiltInformation object. \note This class might be a workaround for another bug in MITK, but until this issue is completely understood, the workaround fixes the problem of images that appear upside-down. */ -class MITKDICOMREADER_EXPORT NormalDirectionConsistencySorter : public DICOMDatasetSorter +class MITKDICOM_EXPORT NormalDirectionConsistencySorter : public DICOMDatasetSorter { public: mitkClassMacro( NormalDirectionConsistencySorter, DICOMDatasetSorter ); itkNewMacro( NormalDirectionConsistencySorter ); DICOMTagList GetTagsOfInterest() override; /// See class description. void Sort() override; /// See class description and DICOMITKSeriesGDCMReader. GantryTiltInformation GetTiltInformation() const; void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override; bool operator==(const DICOMDatasetSorter& other) const override; protected: NormalDirectionConsistencySorter(); ~NormalDirectionConsistencySorter() override; NormalDirectionConsistencySorter(const NormalDirectionConsistencySorter& other); NormalDirectionConsistencySorter& operator=(const NormalDirectionConsistencySorter& other); GantryTiltInformation m_TiltInfo; }; } #endif diff --git a/Modules/DICOMReader/include/mitkSortByImagePositionPatient.h b/Modules/DICOM/include/mitkSortByImagePositionPatient.h similarity index 94% rename from Modules/DICOMReader/include/mitkSortByImagePositionPatient.h rename to Modules/DICOM/include/mitkSortByImagePositionPatient.h index 4806155ea7..988ee3cfaa 100644 --- a/Modules/DICOMReader/include/mitkSortByImagePositionPatient.h +++ b/Modules/DICOM/include/mitkSortByImagePositionPatient.h @@ -1,64 +1,64 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkSortByImagePositionPatient_h #define mitkSortByImagePositionPatient_h #include "mitkDICOMSortCriterion.h" #include "mitkVector.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief Sort by distance of image origin along image normal (for use in DICOMTagBasedSorter). To compare two datasets, their distance to the world origin is calculated. This distance is calculated along the image normals because we do not know the image orientation in advance, to any of the three coordinates could be identical for all datasets. \note This class assumes that the datasets have identical orientations! */ -class MITKDICOMREADER_EXPORT SortByImagePositionPatient : public DICOMSortCriterion +class MITKDICOM_EXPORT SortByImagePositionPatient : public DICOMSortCriterion { public: mitkClassMacro( SortByImagePositionPatient, DICOMSortCriterion ); mitkNewMacro1Param( SortByImagePositionPatient, DICOMSortCriterion::Pointer ); DICOMTagList GetTagsOfInterest() const override; bool IsLeftBeforeRight(const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right) const override; double NumericDistance(const mitk::DICOMDatasetAccess* from, const mitk::DICOMDatasetAccess* to) const override; void Print(std::ostream& os) const override; bool operator==(const DICOMSortCriterion& other) const override; protected: SortByImagePositionPatient( DICOMSortCriterion::Pointer secondaryCriterion = nullptr ); ~SortByImagePositionPatient() override; SortByImagePositionPatient(const SortByImagePositionPatient& other); SortByImagePositionPatient& operator=(const SortByImagePositionPatient& other); double InternalNumericDistance(const mitk::DICOMDatasetAccess* from, const mitk::DICOMDatasetAccess* to, bool& possible) const; private: }; } #endif diff --git a/Modules/DICOMReader/include/mitkThreeDnTDICOMSeriesReader.h b/Modules/DICOM/include/mitkThreeDnTDICOMSeriesReader.h similarity index 96% rename from Modules/DICOMReader/include/mitkThreeDnTDICOMSeriesReader.h rename to Modules/DICOM/include/mitkThreeDnTDICOMSeriesReader.h index 6bbb263c93..1a903eeef8 100644 --- a/Modules/DICOMReader/include/mitkThreeDnTDICOMSeriesReader.h +++ b/Modules/DICOM/include/mitkThreeDnTDICOMSeriesReader.h @@ -1,99 +1,99 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkThreeDnTDICOMSeriesReader_h #define mitkThreeDnTDICOMSeriesReader_h #include "mitkDICOMITKSeriesGDCMReader.h" -#include "MitkDICOMReaderExports.h" +#include "MitkDICOMExports.h" namespace mitk { /** \ingroup DICOMReader \brief Extends DICOMITKSeriesGDCMReader by sorting/grouping into 3D+t image blocks. This class reuses the DICOMITKSeriesGDCMReader class and adds the option of grouping 3D blocks at the same spatial position into a single block, which is loaded as a 3D+t mitk::Image (compare to \ref DICOMITKSeriesGDCMReader_Condensing). To group two output blocks into a single 3D+t block, this class tests a number of requirements that the two blocks must fulfill: - the origin of the first slice must be identical - the origin of the last slice must be identical - the number of slices must be identical The output blocks described by DICOMImageBlockDescriptor will contains the following properties: - \b "3D+t": true if the image is 3D+t - \b "timesteps": number of timesteps of an image (only defined if "3D+t" is true) */ -class MITKDICOMREADER_EXPORT ThreeDnTDICOMSeriesReader : public DICOMITKSeriesGDCMReader +class MITKDICOM_EXPORT ThreeDnTDICOMSeriesReader : public DICOMITKSeriesGDCMReader { public: mitkClassMacro( ThreeDnTDICOMSeriesReader, DICOMITKSeriesGDCMReader ); mitkCloneMacro( ThreeDnTDICOMSeriesReader ); itkNewMacro( ThreeDnTDICOMSeriesReader ); mitkNewMacro1Param( ThreeDnTDICOMSeriesReader, unsigned int ); /// \brief Control whether 3D+t grouping shall actually be attempted. void SetGroup3DandT(bool on); bool GetGroup3DandT() const; itkBooleanMacro(OnlyCondenseSameSeries); itkSetMacro(OnlyCondenseSameSeries, bool); itkGetConstMacro(OnlyCondenseSameSeries, bool); // void AllocateOutputImages(); /// \brief Load via multiple calls to itk::ImageSeriesReader. bool LoadImages() override; bool operator==(const DICOMFileReader& other) const override; static bool GetDefaultGroup3DandT() { return m_DefaultGroup3DandT; } static bool GetDefaultOnlyCondenseSameSeries() { return m_DefaultOnlyCondenseSameSeries; } protected: ThreeDnTDICOMSeriesReader(unsigned int decimalPlacesForOrientation = Superclass::m_DefaultDecimalPlacesForOrientation); ~ThreeDnTDICOMSeriesReader() override; ThreeDnTDICOMSeriesReader(const ThreeDnTDICOMSeriesReader& other); ThreeDnTDICOMSeriesReader& operator=(const ThreeDnTDICOMSeriesReader& other); /** \brief Analyze the groups produced by DICOMITKSeriesGDCMReader for 3D+t properties. This method tests whether some blocks are at the same spatial position and groups them into single blocks. */ SortingBlockList Condense3DBlocks(SortingBlockList&) override; bool LoadMitkImageForImageBlockDescriptor(DICOMImageBlockDescriptor& block) const override; bool m_Group3DandT; bool m_OnlyCondenseSameSeries; const static bool m_DefaultGroup3DandT = true; const static bool m_DefaultOnlyCondenseSameSeries = true; }; } #endif diff --git a/Modules/DICOMReader/resource/configurations/3D/classicreader.xml b/Modules/DICOM/resource/configurations/3D/classicreader.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/classicreader.xml rename to Modules/DICOM/resource/configurations/3D/classicreader.xml diff --git a/Modules/DICOMReader/resource/configurations/3D/imageposition.xml b/Modules/DICOM/resource/configurations/3D/imageposition.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/imageposition.xml rename to Modules/DICOM/resource/configurations/3D/imageposition.xml diff --git a/Modules/DICOMReader/resource/configurations/3D/imageposition_byacquisition.xml b/Modules/DICOM/resource/configurations/3D/imageposition_byacquisition.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/imageposition_byacquisition.xml rename to Modules/DICOM/resource/configurations/3D/imageposition_byacquisition.xml diff --git a/Modules/DICOMReader/resource/configurations/3D/imagetime.xml b/Modules/DICOM/resource/configurations/3D/imagetime.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/imagetime.xml rename to Modules/DICOM/resource/configurations/3D/imagetime.xml diff --git a/Modules/DICOMReader/resource/configurations/3D/instancenumber.xml b/Modules/DICOM/resource/configurations/3D/instancenumber.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/instancenumber.xml rename to Modules/DICOM/resource/configurations/3D/instancenumber.xml diff --git a/Modules/DICOMReader/resource/configurations/3D/instancenumber_soft.xml b/Modules/DICOM/resource/configurations/3D/instancenumber_soft.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/instancenumber_soft.xml rename to Modules/DICOM/resource/configurations/3D/instancenumber_soft.xml diff --git a/Modules/DICOMReader/resource/configurations/3D/simpleinstancenumber_soft.xml b/Modules/DICOM/resource/configurations/3D/simpleinstancenumber_soft.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/simpleinstancenumber_soft.xml rename to Modules/DICOM/resource/configurations/3D/simpleinstancenumber_soft.xml diff --git a/Modules/DICOMReader/resource/configurations/3D/slicelocation.xml b/Modules/DICOM/resource/configurations/3D/slicelocation.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3D/slicelocation.xml rename to Modules/DICOM/resource/configurations/3D/slicelocation.xml diff --git a/Modules/DICOMReader/resource/configurations/3DnT/classicreader.xml b/Modules/DICOM/resource/configurations/3DnT/classicreader.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3DnT/classicreader.xml rename to Modules/DICOM/resource/configurations/3DnT/classicreader.xml diff --git a/Modules/DICOMReader/resource/configurations/3DnT/imageposition.xml b/Modules/DICOM/resource/configurations/3DnT/imageposition.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3DnT/imageposition.xml rename to Modules/DICOM/resource/configurations/3DnT/imageposition.xml diff --git a/Modules/DICOMReader/resource/configurations/3DnT/imageposition_byacquisition.xml b/Modules/DICOM/resource/configurations/3DnT/imageposition_byacquisition.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3DnT/imageposition_byacquisition.xml rename to Modules/DICOM/resource/configurations/3DnT/imageposition_byacquisition.xml diff --git a/Modules/DICOMReader/resource/configurations/3DnT/imageposition_bytriggertime.xml b/Modules/DICOM/resource/configurations/3DnT/imageposition_bytriggertime.xml similarity index 100% rename from Modules/DICOMReader/resource/configurations/3DnT/imageposition_bytriggertime.xml rename to Modules/DICOM/resource/configurations/3DnT/imageposition_bytriggertime.xml diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSR_GantryTiltInformation.cpp b/Modules/DICOM/src/legacy/mitkDicomSR_GantryTiltInformation.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSR_GantryTiltInformation.cpp rename to Modules/DICOM/src/legacy/mitkDicomSR_GantryTiltInformation.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSR_ImageBlockDescriptor.cpp b/Modules/DICOM/src/legacy/mitkDicomSR_ImageBlockDescriptor.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSR_ImageBlockDescriptor.cpp rename to Modules/DICOM/src/legacy/mitkDicomSR_ImageBlockDescriptor.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMRGBPixel.cpp b/Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMRGBPixel.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMRGBPixel.cpp rename to Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMRGBPixel.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMRGBPixel4D.cpp b/Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMRGBPixel4D.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMRGBPixel4D.cpp rename to Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMRGBPixel4D.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMScalar.cpp b/Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMScalar.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMScalar.cpp rename to Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMScalar.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMScalar4D.cpp b/Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMScalar4D.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSR_LoadDICOMScalar4D.cpp rename to Modules/DICOM/src/legacy/mitkDicomSR_LoadDICOMScalar4D.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSR_SliceGroupingResult.cpp b/Modules/DICOM/src/legacy/mitkDicomSR_SliceGroupingResult.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSR_SliceGroupingResult.cpp rename to Modules/DICOM/src/legacy/mitkDicomSR_SliceGroupingResult.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSeriesReader.cpp b/Modules/DICOM/src/legacy/mitkDicomSeriesReader.cpp similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSeriesReader.cpp rename to Modules/DICOM/src/legacy/mitkDicomSeriesReader.cpp diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSeriesReader.h b/Modules/DICOM/src/legacy/mitkDicomSeriesReader.h similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSeriesReader.h rename to Modules/DICOM/src/legacy/mitkDicomSeriesReader.h diff --git a/Modules/DICOMReader/src/legacy/mitkDicomSeriesReader.txx b/Modules/DICOM/src/legacy/mitkDicomSeriesReader.txx similarity index 100% rename from Modules/DICOMReader/src/legacy/mitkDicomSeriesReader.txx rename to Modules/DICOM/src/legacy/mitkDicomSeriesReader.txx diff --git a/Modules/DICOMReader/src/mitkBaseDICOMReaderService.cpp b/Modules/DICOM/src/mitkBaseDICOMReaderService.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkBaseDICOMReaderService.cpp rename to Modules/DICOM/src/mitkBaseDICOMReaderService.cpp diff --git a/Modules/DICOMReader/src/mitkClassicDICOMSeriesReader.cpp b/Modules/DICOM/src/mitkClassicDICOMSeriesReader.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkClassicDICOMSeriesReader.cpp rename to Modules/DICOM/src/mitkClassicDICOMSeriesReader.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMDCMTKTagScanner.cpp b/Modules/DICOM/src/mitkDICOMDCMTKTagScanner.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMDCMTKTagScanner.cpp rename to Modules/DICOM/src/mitkDICOMDCMTKTagScanner.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMDatasetAccessingImageFrameInfo.cpp b/Modules/DICOM/src/mitkDICOMDatasetAccessingImageFrameInfo.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMDatasetAccessingImageFrameInfo.cpp rename to Modules/DICOM/src/mitkDICOMDatasetAccessingImageFrameInfo.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMDatasetSorter.cpp b/Modules/DICOM/src/mitkDICOMDatasetSorter.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMDatasetSorter.cpp rename to Modules/DICOM/src/mitkDICOMDatasetSorter.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMEnums.cpp b/Modules/DICOM/src/mitkDICOMEnums.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMEnums.cpp rename to Modules/DICOM/src/mitkDICOMEnums.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMFileReader.cpp b/Modules/DICOM/src/mitkDICOMFileReader.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMFileReader.cpp rename to Modules/DICOM/src/mitkDICOMFileReader.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMFileReaderSelector.cpp b/Modules/DICOM/src/mitkDICOMFileReaderSelector.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMFileReaderSelector.cpp rename to Modules/DICOM/src/mitkDICOMFileReaderSelector.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMFilesHelper.cpp b/Modules/DICOM/src/mitkDICOMFilesHelper.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMFilesHelper.cpp rename to Modules/DICOM/src/mitkDICOMFilesHelper.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMGDCMImageFrameInfo.cpp b/Modules/DICOM/src/mitkDICOMGDCMImageFrameInfo.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMGDCMImageFrameInfo.cpp rename to Modules/DICOM/src/mitkDICOMGDCMImageFrameInfo.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMGDCMTagCache.cpp b/Modules/DICOM/src/mitkDICOMGDCMTagCache.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMGDCMTagCache.cpp rename to Modules/DICOM/src/mitkDICOMGDCMTagCache.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMGDCMTagScanner.cpp b/Modules/DICOM/src/mitkDICOMGDCMTagScanner.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMGDCMTagScanner.cpp rename to Modules/DICOM/src/mitkDICOMGDCMTagScanner.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMGenericImageFrameInfo.cpp b/Modules/DICOM/src/mitkDICOMGenericImageFrameInfo.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMGenericImageFrameInfo.cpp rename to Modules/DICOM/src/mitkDICOMGenericImageFrameInfo.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMGenericTagCache.cpp b/Modules/DICOM/src/mitkDICOMGenericTagCache.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMGenericTagCache.cpp rename to Modules/DICOM/src/mitkDICOMGenericTagCache.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMIOHelper.cpp b/Modules/DICOM/src/mitkDICOMIOHelper.cpp similarity index 97% rename from Modules/DICOMReader/src/mitkDICOMIOHelper.cpp rename to Modules/DICOM/src/mitkDICOMIOHelper.cpp index be7a272a0f..648d18a6c6 100644 --- a/Modules/DICOMReader/src/mitkDICOMIOHelper.cpp +++ b/Modules/DICOM/src/mitkDICOMIOHelper.cpp @@ -1,71 +1,71 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "mitkDICOMIOHelper.h" #include #include #include #include namespace mitk { mitk::IDICOMTagsOfInterest *GetDicomTagsOfInterestService() { mitk::IDICOMTagsOfInterest *result = nullptr; us::ModuleContext *context = us::GetModuleContext(); if (context == nullptr) { - MITK_WARN << "No MitkDICOMReader module context found."; + MITK_WARN << "No MitkDICOM module context found."; return result; } std::vector> toiRegisters = context->GetServiceReferences(); if (!toiRegisters.empty()) { if (toiRegisters.size() > 1) { MITK_WARN << "Multiple DICOM tags of interest services found. Using just one."; } result = us::GetModuleContext()->GetService(toiRegisters.front()); } return result; } FindingsListVectorType ExtractPathsOfInterest(const DICOMTagPathList &pathsOfInterest, const DICOMDatasetAccessingImageFrameList &frames) { std::vector findings; for (const auto &entry : pathsOfInterest) { findings.push_back(frames.front()->GetTagValueAsString(entry)); } return findings; } void SetProperties(BaseDataPointer image, const FindingsListVectorType &findings) { for (const auto &finding : findings) { for (const auto &entry : finding) { const std::string propertyName = mitk::DICOMTagPathToPropertyName(entry.path); auto property = mitk::TemporoSpatialStringProperty::New(); property->SetValue(entry.value); image->SetProperty(propertyName.c_str(), property); } } } } diff --git a/Modules/DICOMReader/src/mitkDICOMIOMetaInformationPropertyConstants.cpp b/Modules/DICOM/src/mitkDICOMIOMetaInformationPropertyConstants.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMIOMetaInformationPropertyConstants.cpp rename to Modules/DICOM/src/mitkDICOMIOMetaInformationPropertyConstants.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMITKSeriesGDCMReader.cpp b/Modules/DICOM/src/mitkDICOMITKSeriesGDCMReader.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMITKSeriesGDCMReader.cpp rename to Modules/DICOM/src/mitkDICOMITKSeriesGDCMReader.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMImageBlockDescriptor.cpp b/Modules/DICOM/src/mitkDICOMImageBlockDescriptor.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMImageBlockDescriptor.cpp rename to Modules/DICOM/src/mitkDICOMImageBlockDescriptor.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMImageFrameInfo.cpp b/Modules/DICOM/src/mitkDICOMImageFrameInfo.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMImageFrameInfo.cpp rename to Modules/DICOM/src/mitkDICOMImageFrameInfo.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMProperty.cpp b/Modules/DICOM/src/mitkDICOMProperty.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMProperty.cpp rename to Modules/DICOM/src/mitkDICOMProperty.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMReaderConfigurator.cpp b/Modules/DICOM/src/mitkDICOMReaderConfigurator.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMReaderConfigurator.cpp rename to Modules/DICOM/src/mitkDICOMReaderConfigurator.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMSortByTag.cpp b/Modules/DICOM/src/mitkDICOMSortByTag.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMSortByTag.cpp rename to Modules/DICOM/src/mitkDICOMSortByTag.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMSortCriterion.cpp b/Modules/DICOM/src/mitkDICOMSortCriterion.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMSortCriterion.cpp rename to Modules/DICOM/src/mitkDICOMSortCriterion.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMTag.cpp b/Modules/DICOM/src/mitkDICOMTag.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMTag.cpp rename to Modules/DICOM/src/mitkDICOMTag.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMTagBasedSorter.cpp b/Modules/DICOM/src/mitkDICOMTagBasedSorter.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMTagBasedSorter.cpp rename to Modules/DICOM/src/mitkDICOMTagBasedSorter.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMTagCache.cpp b/Modules/DICOM/src/mitkDICOMTagCache.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMTagCache.cpp rename to Modules/DICOM/src/mitkDICOMTagCache.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMTagPath.cpp b/Modules/DICOM/src/mitkDICOMTagPath.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMTagPath.cpp rename to Modules/DICOM/src/mitkDICOMTagPath.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMTagScanner.cpp b/Modules/DICOM/src/mitkDICOMTagScanner.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMTagScanner.cpp rename to Modules/DICOM/src/mitkDICOMTagScanner.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMTagsOfInterestAddHelper.cpp b/Modules/DICOM/src/mitkDICOMTagsOfInterestAddHelper.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMTagsOfInterestAddHelper.cpp rename to Modules/DICOM/src/mitkDICOMTagsOfInterestAddHelper.cpp diff --git a/Modules/DICOMReader/src/mitkDICOMTagsOfInterestHelper.cpp b/Modules/DICOM/src/mitkDICOMTagsOfInterestHelper.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkDICOMTagsOfInterestHelper.cpp rename to Modules/DICOM/src/mitkDICOMTagsOfInterestHelper.cpp diff --git a/Modules/DICOMReader/src/mitkEquiDistantBlocksSorter.cpp b/Modules/DICOM/src/mitkEquiDistantBlocksSorter.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkEquiDistantBlocksSorter.cpp rename to Modules/DICOM/src/mitkEquiDistantBlocksSorter.cpp diff --git a/Modules/DICOMReader/src/mitkGantryTiltInformation.cpp b/Modules/DICOM/src/mitkGantryTiltInformation.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkGantryTiltInformation.cpp rename to Modules/DICOM/src/mitkGantryTiltInformation.cpp diff --git a/Modules/DICOMReader/src/mitkIDICOMTagsOfInterest.cpp b/Modules/DICOM/src/mitkIDICOMTagsOfInterest.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkIDICOMTagsOfInterest.cpp rename to Modules/DICOM/src/mitkIDICOMTagsOfInterest.cpp diff --git a/Modules/DICOMReader/src/mitkITKDICOMSeriesReaderHelper.cpp b/Modules/DICOM/src/mitkITKDICOMSeriesReaderHelper.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkITKDICOMSeriesReaderHelper.cpp rename to Modules/DICOM/src/mitkITKDICOMSeriesReaderHelper.cpp diff --git a/Modules/DICOMReader/src/mitkNormalDirectionConsistencySorter.cpp b/Modules/DICOM/src/mitkNormalDirectionConsistencySorter.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkNormalDirectionConsistencySorter.cpp rename to Modules/DICOM/src/mitkNormalDirectionConsistencySorter.cpp diff --git a/Modules/DICOMReader/src/mitkSortByImagePositionPatient.cpp b/Modules/DICOM/src/mitkSortByImagePositionPatient.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkSortByImagePositionPatient.cpp rename to Modules/DICOM/src/mitkSortByImagePositionPatient.cpp diff --git a/Modules/DICOMReader/src/mitkThreeDnTDICOMSeriesReader.cpp b/Modules/DICOM/src/mitkThreeDnTDICOMSeriesReader.cpp similarity index 100% rename from Modules/DICOMReader/src/mitkThreeDnTDICOMSeriesReader.cpp rename to Modules/DICOM/src/mitkThreeDnTDICOMSeriesReader.cpp diff --git a/Modules/DICOMReader/test/CMakeLists.txt b/Modules/DICOM/test/CMakeLists.txt similarity index 100% rename from Modules/DICOMReader/test/CMakeLists.txt rename to Modules/DICOM/test/CMakeLists.txt diff --git a/Modules/DICOMReader/test/files.cmake b/Modules/DICOM/test/files.cmake similarity index 100% rename from Modules/DICOMReader/test/files.cmake rename to Modules/DICOM/test/files.cmake diff --git a/Modules/DICOMReader/test/mitkDICOMDCMTKTagScannerTest.cpp b/Modules/DICOM/test/mitkDICOMDCMTKTagScannerTest.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMDCMTKTagScannerTest.cpp rename to Modules/DICOM/test/mitkDICOMDCMTKTagScannerTest.cpp diff --git a/Modules/DICOMReader/test/mitkDICOMFileReaderTest.cpp b/Modules/DICOM/test/mitkDICOMFileReaderTest.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMFileReaderTest.cpp rename to Modules/DICOM/test/mitkDICOMFileReaderTest.cpp diff --git a/Modules/DICOMReader/test/mitkDICOMFileReaderTestHelper.h b/Modules/DICOM/test/mitkDICOMFileReaderTestHelper.h similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMFileReaderTestHelper.h rename to Modules/DICOM/test/mitkDICOMFileReaderTestHelper.h diff --git a/Modules/DICOMReader/test/mitkDICOMFilenameSorter.cpp b/Modules/DICOM/test/mitkDICOMFilenameSorter.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMFilenameSorter.cpp rename to Modules/DICOM/test/mitkDICOMFilenameSorter.cpp diff --git a/Modules/DICOMReader/test/mitkDICOMFilenameSorter.h b/Modules/DICOM/test/mitkDICOMFilenameSorter.h similarity index 97% rename from Modules/DICOMReader/test/mitkDICOMFilenameSorter.h rename to Modules/DICOM/test/mitkDICOMFilenameSorter.h index d788595937..2f44c9fdea 100644 --- a/Modules/DICOMReader/test/mitkDICOMFilenameSorter.h +++ b/Modules/DICOM/test/mitkDICOMFilenameSorter.h @@ -1,57 +1,57 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkDICOMFilenameSorter_h #define mitkDICOMFilenameSorter_h #include "mitkDICOMDatasetSorter.h" namespace mitk { /** - \ingroup DICOMReaderModule + \ingroup DICOMModule \brief sort files based on filename (last resort). */ class DICOMFilenameSorter : public DICOMDatasetSorter { public: mitkClassMacro( DICOMFilenameSorter, DICOMDatasetSorter ); itkNewMacro( DICOMFilenameSorter ); DICOMTagList GetTagsOfInterest() override; void Sort() override; void PrintConfiguration(std::ostream& os, const std::string& indent = "") const override; bool operator==(const DICOMDatasetSorter& other) const override; protected: struct FilenameSort { bool operator() (const mitk::DICOMDatasetAccess* left, const mitk::DICOMDatasetAccess* right); }; DICOMFilenameSorter(); ~DICOMFilenameSorter() override; DICOMFilenameSorter(const DICOMFilenameSorter& other); DICOMFilenameSorter& operator=(const DICOMFilenameSorter& other); }; } #endif diff --git a/Modules/DICOMReader/test/mitkDICOMITKSeriesGDCMReaderBasicsTest.cpp b/Modules/DICOM/test/mitkDICOMITKSeriesGDCMReaderBasicsTest.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMITKSeriesGDCMReaderBasicsTest.cpp rename to Modules/DICOM/test/mitkDICOMITKSeriesGDCMReaderBasicsTest.cpp diff --git a/Modules/DICOMReader/test/mitkDICOMNullFileReader.cpp b/Modules/DICOM/test/mitkDICOMNullFileReader.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMNullFileReader.cpp rename to Modules/DICOM/test/mitkDICOMNullFileReader.cpp diff --git a/Modules/DICOMReader/test/mitkDICOMNullFileReader.h b/Modules/DICOM/test/mitkDICOMNullFileReader.h similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMNullFileReader.h rename to Modules/DICOM/test/mitkDICOMNullFileReader.h diff --git a/Modules/DICOMReader/test/mitkDICOMPropertyTest.cpp b/Modules/DICOM/test/mitkDICOMPropertyTest.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMPropertyTest.cpp rename to Modules/DICOM/test/mitkDICOMPropertyTest.cpp diff --git a/Modules/DICOMReader/test/mitkDICOMReaderConfiguratorTest.cpp b/Modules/DICOM/test/mitkDICOMReaderConfiguratorTest.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMReaderConfiguratorTest.cpp rename to Modules/DICOM/test/mitkDICOMReaderConfiguratorTest.cpp diff --git a/Modules/DICOMReader/test/mitkDICOMSimpleVolumeImportTest.cpp b/Modules/DICOM/test/mitkDICOMSimpleVolumeImportTest.cpp similarity index 96% rename from Modules/DICOMReader/test/mitkDICOMSimpleVolumeImportTest.cpp rename to Modules/DICOM/test/mitkDICOMSimpleVolumeImportTest.cpp index 535bec6d12..712d226183 100644 --- a/Modules/DICOMReader/test/mitkDICOMSimpleVolumeImportTest.cpp +++ b/Modules/DICOM/test/mitkDICOMSimpleVolumeImportTest.cpp @@ -1,106 +1,106 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "mitkDICOMFileReaderSelector.h" #include "mitkDICOMFileReaderTestHelper.h" #include #include #include #include #include #include #include "mitkImageToItk.h" #include "itkImageRegionConstIteratorWithIndex.h" #include "mitkTestingMacros.h" /** \brief Verify single block reading of SimpleDICOMvolumeImport for sloppily tagged data. */ int mitkDICOMSimpleVolumeImportTest(int argc, char* argv[]) { typedef mitk::DICOMFileReaderSelector::ReaderList ReaderList; typedef itk::Image< short, 3 > ImageType; typedef itk::ImageRegionConstIteratorWithIndex< ImageType > IteratorType; MITK_TEST_BEGIN("mitkDICOMSimpleVolumeImportTest"); us::ModuleResource resource = - us::ModuleRegistry::GetModule("MitkDICOMReader")->GetResource("configurations/3D/simpleinstancenumber_soft.xml"); + us::ModuleRegistry::GetModule("MitkDICOM")->GetResource("configurations/3D/simpleinstancenumber_soft.xml"); std::string descr; if ( resource.IsValid() ) { us::ModuleResourceStream stream(resource); stream.seekg(0, std::ios::end); descr.reserve(stream.tellg()); stream.seekg(0, std::ios::beg); descr.assign((std::istreambuf_iterator(stream)), std::istreambuf_iterator()); } mitk::DICOMFileReaderSelector::Pointer readerSelector = mitk::DICOMFileReaderSelector::New(); readerSelector->AddConfig( descr ); ReaderList readers = readerSelector->GetAllConfiguredReaders(); mitk::DICOMFileReader::Pointer simpleReader; for ( ReaderList::const_iterator it = readers.begin(); it != readers.end(); ++it ) { mitk::DICOMFileReader::Pointer reader = *it; std::string configLabel = reader->GetConfigurationLabel(); if ( configLabel == "Instance Number, non-consecutive, simple import" ) { simpleReader = reader; } } MITK_TEST_CONDITION_REQUIRED( simpleReader.IsNotNull(), "DICOMFileReaderSelector is able to create simple reader from XML"); if ( argc > 1 ) { mitk::DICOMFileReaderTestHelper::SetTestInputFilenames( argc,argv ); mitk::DICOMFileReaderTestHelper::TestInputFilenames( simpleReader ); mitk::DICOMFileReaderTestHelper::TestOutputsContainInputs( simpleReader ); mitk::DICOMFileReaderTestHelper::TestSingleBlockIsRead( simpleReader ); const mitk::DICOMImageBlockDescriptor block = simpleReader->GetOutput( 0 ); const mitk::Image::Pointer mitkImage = block.GetMitkImage(); ImageType::Pointer itkImage = mitk::ImageToItkImage( mitkImage ); IteratorType it( itkImage, itkImage->GetLargestPossibleRegion() ); bool success = true; while ( !it.IsAtEnd() ) { ImageType::PixelType val = it.Get(); ImageType::IndexType ind = it.GetIndex(); if ( !(val == ind[2]) ) { success = false; break; } ++it; } MITK_TEST_CONDITION( success, "Single block image composed as expected."); } MITK_TEST_END(); } diff --git a/Modules/DICOMReader/test/mitkDICOMTagPathTest.cpp b/Modules/DICOM/test/mitkDICOMTagPathTest.cpp similarity index 100% rename from Modules/DICOMReader/test/mitkDICOMTagPathTest.cpp rename to Modules/DICOM/test/mitkDICOMTagPathTest.cpp diff --git a/Modules/DICOMPM/CMakeLists.txt b/Modules/DICOMPM/CMakeLists.txt index bb13df19c1..aa17f28473 100644 --- a/Modules/DICOMPM/CMakeLists.txt +++ b/Modules/DICOMPM/CMakeLists.txt @@ -1,6 +1,6 @@ MITK_CREATE_MODULE(DICOMPM - DEPENDS MitkCore MitkDICOMReader MitkModelFit MitkDICOMQI + DEPENDS MitkCore MitkDICOM MitkModelFit MitkDICOMQI PACKAGE_DEPENDS PRIVATE DCMTK ) -add_subdirectory(autoload/DICOMPMIO) \ No newline at end of file +add_subdirectory(autoload/DICOMPMIO) diff --git a/Modules/DICOMQI/CMakeLists.txt b/Modules/DICOMQI/CMakeLists.txt index b02baee9ea..eee1639517 100644 --- a/Modules/DICOMQI/CMakeLists.txt +++ b/Modules/DICOMQI/CMakeLists.txt @@ -1,5 +1,5 @@ MITK_CREATE_MODULE( - DEPENDS MitkCore MitkDICOMReader + DEPENDS MitkCore MitkDICOM PACKAGE_DEPENDS PRIVATE DCMTK ) diff --git a/Modules/DICOMTesting/CMakeLists.txt b/Modules/DICOMTesting/CMakeLists.txt index 256daf6b3b..d0d96f0e67 100644 --- a/Modules/DICOMTesting/CMakeLists.txt +++ b/Modules/DICOMTesting/CMakeLists.txt @@ -1,43 +1,43 @@ if(BUILD_TESTING) if(GDCM_DIR) # clear variables from prior files.cmake # Else CMake would use the content of these variables and would try to create tests (which are not present in DICOMTesting). set(MODULE_TESTS) set(MODULE_IMAGE_TESTS) set(MODULE_SURFACE_TESTS) set(MODULE_TESTIMAGE) set(MODULE_TESTSURFACE) set(MODULE_CUSTOM_TESTS) set(H_FILES) set(CPP_FILES) # now create a new module only for testing purposes MITK_CREATE_MODULE( - DEPENDS MitkDICOMReader + DEPENDS MitkDICOM PACKAGE_DEPENDS PRIVATE GDCM DCMTK ITK|ITKIOGDCM ) mitk_check_module_dependencies(MODULES MitkDICOMTesting MISSING_DEPENDENCIES_VAR _missing_deps) if(_missing_deps) message(STATUS "mitkDICOMTesting module helper applications won't be built. Missing: ${_missing_deps}") else(_missing_deps) # dumps out image information add_executable(DumpDICOMMitkImage src/DumpDICOMMitkImage.cpp) mitk_use_modules(TARGET DumpDICOMMitkImage MODULES MitkDICOMTesting) # compares dumped out image information against reference dump add_executable(VerifyDICOMMitkImageDump src/VerifyDICOMMitkImageDump.cpp) mitk_use_modules(TARGET VerifyDICOMMitkImageDump MODULES MitkDICOMTesting) set_property(TARGET DumpDICOMMitkImage VerifyDICOMMitkImageDump PROPERTY FOLDER "${MITK_ROOT_FOLDER}/Modules/Tests") add_subdirectory(test) endif() endif() endif() diff --git a/Modules/DicomUI/CMakeLists.txt b/Modules/DICOMUI/CMakeLists.txt similarity index 100% rename from Modules/DicomUI/CMakeLists.txt rename to Modules/DICOMUI/CMakeLists.txt diff --git a/Modules/DicomUI/files.cmake b/Modules/DICOMUI/files.cmake similarity index 100% rename from Modules/DicomUI/files.cmake rename to Modules/DICOMUI/files.cmake diff --git a/Modules/DicomUI/include/QmitkDicomExternalDataWidget.h b/Modules/DICOMUI/include/QmitkDicomExternalDataWidget.h similarity index 99% rename from Modules/DicomUI/include/QmitkDicomExternalDataWidget.h rename to Modules/DICOMUI/include/QmitkDicomExternalDataWidget.h index 4c689b3b5b..588628e1a4 100644 --- a/Modules/DicomUI/include/QmitkDicomExternalDataWidget.h +++ b/Modules/DICOMUI/include/QmitkDicomExternalDataWidget.h @@ -1,120 +1,120 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QmitkDicomExternalDataWidget_h #define QmitkDicomExternalDataWidget_h #include "ui_QmitkDicomExternalDataWidgetControls.h" -#include +#include // include ctk #include #include // include QT #include #include #include #include #include #include #include class ctkFileDialog; /** * \brief QmitkDicomExternalDataWidget is a QWidget providing functionality for dicom import. * * \sa QmitkFunctionality * \ingroup Functionalities */ class MITKDICOMUI_EXPORT QmitkDicomExternalDataWidget : public QWidget { // 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 Widget_ID; /** * \brief QmitkDicomExternalDataWidget(QWidget *parent) constructor. * * \param parent is a pointer to the parent widget */ QmitkDicomExternalDataWidget(QWidget *parent); /** * \brief QmitkDicomExternalDataWidget destructor. */ ~QmitkDicomExternalDataWidget() override; /** * \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomExternalDataWidgetControls.h. * * \param parent is a pointer to the parent widget */ virtual void CreateQtPartControl(QWidget *parent); /** * \brief Initializes the widget. This method has to be called before widget can start. */ void Initialize(); signals: /// @brief emitted when import into database is finished. void SignalStartDicomImport(const QStringList &); /// @brief emitted when view button is clicked. void SignalDicomToDataManager(QHash); public slots: /// @brief Called when download button was clicked. void OnDownloadButtonClicked(); /// @brief Called when view button was clicked. void OnViewButtonClicked(); /// @brief Called when adding a dicom directory. Starts a thread adding the directory. void OnStartDicomImport(const QString &); void OnSeriesSelectionChanged(const QStringList &s); protected slots: void OnProgressStep(const QString&); void OnProgressDetail(const QString&); protected: /// \brief Get the list of filepath from current selected index in TreeView. All file paths referring to the index /// will be returned. QStringList GetFileNamesFromIndex(); /// \brief SetupImportDialog Sets up import dialog. void SetupImportDialog(); void SetupProgressDialog(); ctkDICOMDatabase *m_ExternalDatabase; ctkDICOMIndexer *m_ExternalIndexer; ctkFileDialog *m_ImportDialog; QProgressDialog *m_ProgressDialog; QString m_LastImportDirectory; QString m_ProgressStep; Ui::QmitkDicomExternalDataWidgetControls *m_Controls; }; #endif // _QmitkDicomExternalDataWidget_H_INCLUDED diff --git a/Modules/DicomUI/include/QmitkDicomLocalStorageWidget.h b/Modules/DICOMUI/include/QmitkDicomLocalStorageWidget.h similarity index 99% rename from Modules/DicomUI/include/QmitkDicomLocalStorageWidget.h rename to Modules/DICOMUI/include/QmitkDicomLocalStorageWidget.h index 40b275e01a..cd8b541fbc 100644 --- a/Modules/DicomUI/include/QmitkDicomLocalStorageWidget.h +++ b/Modules/DICOMUI/include/QmitkDicomLocalStorageWidget.h @@ -1,117 +1,117 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QmitkDicomLocalStorageWidget_h #define QmitkDicomLocalStorageWidget_h // #include #include "ui_QmitkDicomLocalStorageWidgetControls.h" -#include +#include // include ctk #include #include #include // include QT #include #include #include #include #include class QProgressDialog; class QLabel; /** * \brief QmitkDicomLocalStorageWidget is a QWidget providing functionality for dicom storage and import. * * \sa QmitkFunctionality * \ingroup Functionalities */ class MITKDICOMUI_EXPORT QmitkDicomLocalStorageWidget : public QWidget { // 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 Widget_ID; /** * \brief QmitkDicomLocalStorageWidget(QWidget *parent) constructor. * * \param parent is a pointer to the parent widget */ QmitkDicomLocalStorageWidget(QWidget *parent); /** * \brief QmitkDicomExternalDataWidget destructor. */ ~QmitkDicomLocalStorageWidget() override; /** * \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomExternalDataWidgetControls.h. * * \param parent is a pointer to the parent widget */ virtual void CreateQtPartControl(QWidget *parent); /** * \brief SetDatabaseDirectory sets database directory. * * \param newDatabaseDirectory contains path to new database directoy. */ void SetDatabaseDirectory(QString newDatabaseDirectory); signals: /// @brief emitted when import into database is finished. void SignalFinishedImport(); /** * @brief emitted when view button is clicked. * @param QHash containing dicom UIDs properties. */ void SignalDicomToDataManager(QHash); /// \brief emitted if cancel button is pressed. void SignalCancelImport(); public slots: /// @brief Called when view button was clicked. void OnViewButtonClicked(); /// @brief Called delete button was clicked. void OnDeleteButtonClicked(); /// @brief Called when adding a dicom directory. Starts a thread adding the directory. void OnStartDicomImport(const QString &dicomData); /// @brief Called when adding a list of dicom files. Starts a thread adding the dicom files. void OnStartDicomImport(const QStringList &dicomData); /// @brief Called when the selection in the series table has changed void OnSeriesSelectionChanged(const QStringList &); protected: void SetDatabase(QString databaseFile); bool DeletePatients(); bool DeleteStudies(); bool DeleteSeries(); ctkDICOMDatabase *m_LocalDatabase; ctkDICOMIndexer *m_LocalIndexer; Ui::QmitkDicomLocalStorageWidgetControls *m_Controls; }; #endif // _QmitkDicomLocalStorageWidget_H_INCLUDED diff --git a/Modules/DicomUI/src/QmitkDicomExternalDataWidget.cpp b/Modules/DICOMUI/src/QmitkDicomExternalDataWidget.cpp similarity index 100% rename from Modules/DicomUI/src/QmitkDicomExternalDataWidget.cpp rename to Modules/DICOMUI/src/QmitkDicomExternalDataWidget.cpp diff --git a/Modules/DicomUI/src/QmitkDicomExternalDataWidgetControls.ui b/Modules/DICOMUI/src/QmitkDicomExternalDataWidgetControls.ui similarity index 86% rename from Modules/DicomUI/src/QmitkDicomExternalDataWidgetControls.ui rename to Modules/DICOMUI/src/QmitkDicomExternalDataWidgetControls.ui index 154d4cdd0d..483d6ab6f0 100644 --- a/Modules/DicomUI/src/QmitkDicomExternalDataWidgetControls.ui +++ b/Modules/DICOMUI/src/QmitkDicomExternalDataWidgetControls.ui @@ -1,138 +1,138 @@ QmitkDicomExternalDataWidgetControls 0 0 754 633 Form External Dicom Data true 0 0 QFrame::Box QFrame::Sunken Scan directory - - :/org.mitk.gui.qt.dicom/folder_32.png:/org.mitk.gui.qt.dicom/folder_32.png + + :/org.mitk.gui.qt.dicombrowser/folder_32.png:/org.mitk.gui.qt.dicombrowser/folder_32.png true Add to local storage - - :/org.mitk.gui.qt.dicom/import_32.png:/org.mitk.gui.qt.dicom/import_32.png + + :/org.mitk.gui.qt.dicombrowser/import_32.png:/org.mitk.gui.qt.dicombrowser/import_32.png false View - - :/org.mitk.gui.qt.dicom/viewIcon.png:/org.mitk.gui.qt.dicom/viewIcon.png + + :/org.mitk.gui.qt.dicombrowser/viewIcon.png:/org.mitk.gui.qt.dicombrowser/viewIcon.png 16 20 Qt::Horizontal 40 20 0 QLayout::SetNoConstraint 0 0 ctkDICOMTableManager QWidget
ctkDICOMTableManager.h
1
- +
diff --git a/Modules/DicomUI/src/QmitkDicomLocalStorageWidget.cpp b/Modules/DICOMUI/src/QmitkDicomLocalStorageWidget.cpp similarity index 100% rename from Modules/DicomUI/src/QmitkDicomLocalStorageWidget.cpp rename to Modules/DICOMUI/src/QmitkDicomLocalStorageWidget.cpp diff --git a/Modules/DicomUI/src/QmitkDicomLocalStorageWidgetControls.ui b/Modules/DICOMUI/src/QmitkDicomLocalStorageWidgetControls.ui similarity index 93% rename from Modules/DicomUI/src/QmitkDicomLocalStorageWidgetControls.ui rename to Modules/DICOMUI/src/QmitkDicomLocalStorageWidgetControls.ui index 4087d11a4a..540f1bdad8 100644 --- a/Modules/DicomUI/src/QmitkDicomLocalStorageWidgetControls.ui +++ b/Modules/DICOMUI/src/QmitkDicomLocalStorageWidgetControls.ui @@ -1,128 +1,128 @@ QmitkDicomLocalStorageWidgetControls 0 0 754 633 Form Local Dicom Storage 12 0 0 QFrame::Box QFrame::Sunken false View - - :/org.mitk.gui.qt.dicom/viewIcon.png:/org.mitk.gui.qt.dicom/viewIcon.png + + :/org.mitk.gui.qt.dicombrowser/viewIcon.png:/org.mitk.gui.qt.dicombrowser/viewIcon.png 16 20 true Delete :/org.mitk.gui.qt.datamanager/Remove_48.png:/org.mitk.gui.qt.datamanager/Remove_48.png Qt::Horizontal 40 20 0 QLayout::SetNoConstraint 0 0 ctkDICOMTableManager QWidget
ctkDICOMTableManager.h
1
- +
diff --git a/Modules/DicomRT/CMakeLists.txt b/Modules/DicomRT/CMakeLists.txt deleted file mode 100644 index 7fe08ffd4e..0000000000 --- a/Modules/DicomRT/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -if(NOT DEFINED DCMTK_dcmrt_LIBRARY OR DCMTK_dcmrt_LIBRARY) - mitk_create_module( - DEPENDS MitkSceneSerializationBase MitkDICOMReader - PACKAGE_DEPENDS PUBLIC DCMTK - ) - add_subdirectory(autoload/IO) - add_subdirectory(test) -else() - message("MITK DicomRT Support disabled because the DCMTK dcmrt library not found") -endif() diff --git a/Modules/ModuleList.cmake b/Modules/ModuleList.cmake index d65ee8faa4..e9a5d07801 100644 --- a/Modules/ModuleList.cmake +++ b/Modules/ModuleList.cmake @@ -1,86 +1,85 @@ # The entries in the mitk_modules list must be # ordered according to their dependencies. set(MITK_MODULES Core CommandLine CoreCmdApps AppUtil LegacyIO DataTypesExt Annotation LegacyGL AlgorithmsExt MapperExt - DICOMReader - DICOMReaderServices + DICOM DICOMQI DICOMTesting SceneSerializationBase PlanarFigure ImageDenoising ImageExtraction SceneSerialization Gizmo GraphAlgorithms Multilabel Chart ImageStatistics ContourModel SurfaceInterpolation Segmentation QtWidgets QtWidgetsExt ImageStatisticsUI SegmentationUI MatchPointRegistration MatchPointRegistrationUI Classification OpenIGTLink IGTBase IGT CameraCalibration OpenCL OpenCVVideoSupport QtOverlays ToFHardware ToFProcessing ToFUI PhotoacousticsHardware PhotoacousticsAlgorithms PhotoacousticsLib US USUI - DicomUI + DICOMUI Remeshing Python QtPython Persistence OpenIGTLinkUI IGTUI - DicomRT + RT RTUI IOExt XNAT TubeGraph BiophotonicsHardware BoundingShape RenderWindowManager RenderWindowManagerUI SemanticRelations SemanticRelationsUI CEST BasicImageProcessing ModelFit ModelFitUI Pharmacokinetics PharmacokineticsUI DICOMPM REST RESTService DICOMweb ) if(MITK_ENABLE_PIC_READER) list(APPEND MITK_MODULES IpPicSupportIO) endif() diff --git a/Modules/RT/CMakeLists.txt b/Modules/RT/CMakeLists.txt new file mode 100644 index 0000000000..753686d460 --- /dev/null +++ b/Modules/RT/CMakeLists.txt @@ -0,0 +1,10 @@ +if(NOT DEFINED DCMTK_dcmrt_LIBRARY OR DCMTK_dcmrt_LIBRARY) + mitk_create_module( + DEPENDS MitkSceneSerializationBase MitkDICOM + PACKAGE_DEPENDS PUBLIC DCMTK + ) + add_subdirectory(autoload/DICOMRTIO) + add_subdirectory(test) +else() + message("MITK RT Support disabled because the DCMTK dcmrt library not found") +endif() diff --git a/Modules/DicomRT/autoload/IO/CMakeLists.txt b/Modules/RT/autoload/DICOMRTIO/CMakeLists.txt similarity index 59% rename from Modules/DicomRT/autoload/IO/CMakeLists.txt rename to Modules/RT/autoload/DICOMRTIO/CMakeLists.txt index d449c318cf..54d3ff5335 100644 --- a/Modules/DicomRT/autoload/IO/CMakeLists.txt +++ b/Modules/RT/autoload/DICOMRTIO/CMakeLists.txt @@ -1,8 +1,8 @@ -MITK_CREATE_MODULE(DicomRTIO +MITK_CREATE_MODULE(DICOMRTIO INCLUDE_DIRS PRIVATE src/IO DEPENDS - PUBLIC MitkDicomRT MitkContourModel + PUBLIC MitkRT MitkContourModel PACKAGE_DEPENDS PUBLIC DCMTK AUTOLOAD_WITH MitkCore ) diff --git a/Modules/DicomRT/autoload/IO/files.cmake b/Modules/RT/autoload/DICOMRTIO/files.cmake similarity index 79% rename from Modules/DicomRT/autoload/IO/files.cmake rename to Modules/RT/autoload/DICOMRTIO/files.cmake index e05e20b944..0e04027394 100644 --- a/Modules/DicomRT/autoload/IO/files.cmake +++ b/Modules/RT/autoload/DICOMRTIO/files.cmake @@ -1,6 +1,6 @@ set(CPP_FILES - mitkDicomRTIOActivator.cpp + mitkDICOMRTIOActivator.cpp mitkRTDoseReaderService.cpp mitkRTPlanReaderService.cpp mitkRTStructureSetReaderService.cpp ) diff --git a/Modules/DicomRT/autoload/IO/mitkDicomRTIOActivator.cpp b/Modules/RT/autoload/DICOMRTIO/mitkDICOMRTIOActivator.cpp similarity index 83% rename from Modules/DicomRT/autoload/IO/mitkDicomRTIOActivator.cpp rename to Modules/RT/autoload/DICOMRTIO/mitkDICOMRTIOActivator.cpp index 4ac2ab74f3..af0e65cd38 100644 --- a/Modules/DicomRT/autoload/IO/mitkDicomRTIOActivator.cpp +++ b/Modules/RT/autoload/DICOMRTIO/mitkDICOMRTIOActivator.cpp @@ -1,56 +1,56 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include #include -#include +#include #include #include #include namespace mitk { - class DicomRTIOActivator : public us::ModuleActivator + class DICOMRTIOActivator : public us::ModuleActivator { public: - DicomRTIOActivator() + DICOMRTIOActivator() { } - ~DicomRTIOActivator() = default; + ~DICOMRTIOActivator() = default; void Load(us::ModuleContext* context) override { us::ServiceProperties props; props[us::ServiceConstants::SERVICE_RANKING()] = 100; - for (const auto& mimeType : DicomRTMimeTypes::Get()) + for (const auto& mimeType : DICOMRTMimeTypes::Get()) context->RegisterService(mimeType.get(), props); m_RTDoseReader = std::make_unique(); m_RTPlanReader = std::make_unique(); m_RTStructureSetReader = std::make_unique(); } void Unload(us::ModuleContext*) override { } private: std::unique_ptr m_RTDoseReader; std::unique_ptr m_RTPlanReader; std::unique_ptr m_RTStructureSetReader; }; } -US_EXPORT_MODULE_ACTIVATOR(mitk::DicomRTIOActivator) +US_EXPORT_MODULE_ACTIVATOR(mitk::DICOMRTIOActivator) diff --git a/Modules/DicomRT/autoload/IO/mitkRTDoseReaderService.cpp b/Modules/RT/autoload/DICOMRTIO/mitkRTDoseReaderService.cpp similarity index 97% rename from Modules/DicomRT/autoload/IO/mitkRTDoseReaderService.cpp rename to Modules/RT/autoload/DICOMRTIO/mitkRTDoseReaderService.cpp index 7406172d13..921e4d6556 100644 --- a/Modules/DicomRT/autoload/IO/mitkRTDoseReaderService.cpp +++ b/Modules/RT/autoload/DICOMRTIO/mitkRTDoseReaderService.cpp @@ -1,168 +1,168 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include #include #include #include #include #include #include #include #include #include -#include +#include #include #include #include #include namespace mitk { - RTDoseReaderService::RTDoseReaderService() : AbstractFileReader(CustomMimeType(mitk::DicomRTMimeTypes::DICOMRT_DOSE_MIMETYPE_NAME()), mitk::DicomRTMimeTypes::DICOMRT_DOSE_MIMETYPE_DESCRIPTION()) { + RTDoseReaderService::RTDoseReaderService() : AbstractFileReader(CustomMimeType(mitk::DICOMRTMimeTypes::DICOMRT_DOSE_MIMETYPE_NAME()), mitk::DICOMRTMimeTypes::DICOMRT_DOSE_MIMETYPE_DESCRIPTION()) { m_FileReaderServiceReg = RegisterService(); } RTDoseReaderService::RTDoseReaderService(const RTDoseReaderService& other) : mitk::AbstractFileReader(other) { } RTDoseReaderService::~RTDoseReaderService() {} template void RTDoseReaderService::MultiplyGridScaling(itk::Image* image, float gridscale) { typedef itk::Image OutputImageType; typedef itk::Image InputImageType; typedef itk::CastImageFilter CastFilterType; typedef itk::ShiftScaleImageFilter ScaleFilterType; typename CastFilterType::Pointer castFilter = CastFilterType::New(); typename ScaleFilterType::Pointer scaleFilter = ScaleFilterType::New(); castFilter->SetInput(image); scaleFilter->SetInput(castFilter->GetOutput()); scaleFilter->SetScale(gridscale); scaleFilter->Update(); typename OutputImageType::Pointer scaledOutput = scaleFilter->GetOutput(); this->scaledDoseImage = mitk::Image::New(); mitk::CastToMitkImage(scaledOutput, this->scaledDoseImage); } std::vector > RTDoseReaderService::DoRead() { std::vector > result; mitk::IDICOMTagsOfInterest* toiSrv = GetDicomTagsOfInterestService(); auto tagsOfInterest = toiSrv->GetTagsOfInterest(); DICOMTagPathList tagsOfInterestList; for (const auto& tag : tagsOfInterest) { tagsOfInterestList.push_back(tag.first); } std::string location = GetInputLocation(); mitk::DICOMFileReaderSelector::Pointer selector = mitk::DICOMFileReaderSelector::New(); selector->LoadBuiltIn3DConfigs(); selector->SetInputFiles({ location }); mitk::DICOMFileReader::Pointer reader = selector->GetFirstReaderWithMinimumNumberOfOutputImages(); reader->SetAdditionalTagsOfInterest(toiSrv->GetTagsOfInterest()); reader->SetInputFiles({ location }); reader->AnalyzeInputFiles(); reader->LoadImages(); if (reader->GetNumberOfOutputs() == 0) { MITK_ERROR << "Could not determine a DICOM reader for this file" << std::endl; return result; } mitk::DICOMDCMTKTagScanner::Pointer scanner = mitk::DICOMDCMTKTagScanner::New(); scanner->SetInputFiles({ location }); scanner->AddTagPaths(tagsOfInterestList); scanner->Scan(); mitk::DICOMDatasetAccessingImageFrameList frames = scanner->GetFrameInfoList(); if (frames.empty()) { MITK_ERROR << "Error reading the RTDOSE file" << std::endl; return result; } const mitk::DICOMImageBlockDescriptor& desc = reader->GetOutput(0); mitk::Image::Pointer originalImage = desc.GetMitkImage(); if (originalImage.IsNull()) { MITK_ERROR << "Error reading the RTDOSE file in mitk::DicomFileReader" << std::endl; return result; } DcmFileFormat fileformat; OFCondition outp = fileformat.loadFile(location.c_str(), EXS_Unknown); if (outp.bad()) { MITK_ERROR << "Error reading the RTDOSE file in DCMTK" << std::endl; return result; } DcmDataset *dataset = fileformat.getDataset(); DRTDoseIOD doseObject; OFCondition DCMTKresult = doseObject.read(*dataset); if (DCMTKresult.bad()) { MITK_ERROR << "Error reading the RTDOSE file in DCMTK" << std::endl; return result; } auto findingsGridScaling = frames.front()->GetTagValueAsString(DICOMTagPath(0x3004, 0x000e)); //(0x3004, 0x000e) is grid scaling double gridScaling; if (findingsGridScaling.empty()) { MITK_ERROR << "Could not find DoseGridScaling tag" << std::endl; return result; } else { gridScaling = boost::lexical_cast(findingsGridScaling.front().value); } AccessByItk_1(originalImage, MultiplyGridScaling, gridScaling); auto statistics = this->scaledDoseImage->GetStatistics(); double maxDose = statistics->GetScalarValueMax(); this->scaledDoseImage->SetPropertyList(originalImage->GetPropertyList()); this->scaledDoseImage->SetProperty(mitk::RTConstants::PRESCRIBED_DOSE_PROPERTY_NAME.c_str(), mitk::GenericProperty::New(0.8*maxDose)); auto findings = ExtractPathsOfInterest(tagsOfInterestList, frames); SetProperties(this->scaledDoseImage, findings); result.push_back(this->scaledDoseImage.GetPointer()); return result; } RTDoseReaderService* RTDoseReaderService::Clone() const { return new RTDoseReaderService(*this); } } diff --git a/Modules/DicomRT/autoload/IO/mitkRTDoseReaderService.h b/Modules/RT/autoload/DICOMRTIO/mitkRTDoseReaderService.h similarity index 98% rename from Modules/DicomRT/autoload/IO/mitkRTDoseReaderService.h rename to Modules/RT/autoload/DICOMRTIO/mitkRTDoseReaderService.h index ad24fd6011..720c43cd3f 100644 --- a/Modules/DicomRT/autoload/IO/mitkRTDoseReaderService.h +++ b/Modules/RT/autoload/DICOMRTIO/mitkRTDoseReaderService.h @@ -1,66 +1,66 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkRTDoseReaderService_h #define mitkRTDoseReaderService_h #include #include #include -#include +#include namespace mitk { /** * \brief RTDoseReaderService reads DICOM files of modality RTDOSE. */ class MITKDICOMRTIO_EXPORT RTDoseReaderService : public mitk::AbstractFileReader { public: RTDoseReaderService(const RTDoseReaderService& other); RTDoseReaderService(); ~RTDoseReaderService() override; using AbstractFileReader::Read; protected: /** * @brief Reads a dicom dataset from a RTDOSE file * The method reads the PixelData from the DicomRT dose file and scales * them with a factor for getting Gray-values instead of pixel-values. * The Gray-values are stored in a mitkImage with a vtkColorTransferFunc. * Relative values are used for coloring the image. The relative values are * relative to a PrescriptionDose defined in the RT-Plan. If there is no * RT-Plan file PrescriptionDose is set to 80% of the maximum dose. */ std::vector> DoRead() override; private: RTDoseReaderService* Clone() const override; /** * \brief Scales an image with a factor * * \param gridscale the factor to scale with */ template void MultiplyGridScaling(itk::Image< TPixel, VImageDimension>* image, float gridscale); mitk::Image::Pointer scaledDoseImage; us::ServiceRegistration m_FileReaderServiceReg; }; } #endif diff --git a/Modules/DicomRT/autoload/IO/mitkRTPlanReaderService.cpp b/Modules/RT/autoload/DICOMRTIO/mitkRTPlanReaderService.cpp similarity index 93% rename from Modules/DicomRT/autoload/IO/mitkRTPlanReaderService.cpp rename to Modules/RT/autoload/DICOMRTIO/mitkRTPlanReaderService.cpp index c1d8686b03..9952d979b7 100644 --- a/Modules/DicomRT/autoload/IO/mitkRTPlanReaderService.cpp +++ b/Modules/RT/autoload/DICOMRTIO/mitkRTPlanReaderService.cpp @@ -1,82 +1,82 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include #include #include #include #include #include #include #include -#include +#include namespace mitk { - RTPlanReaderService::RTPlanReaderService() : AbstractFileReader(CustomMimeType(mitk::DicomRTMimeTypes::DICOMRT_PLAN_MIMETYPE_NAME()), mitk::DicomRTMimeTypes::DICOMRT_PLAN_MIMETYPE_DESCRIPTION()) { + RTPlanReaderService::RTPlanReaderService() : AbstractFileReader(CustomMimeType(mitk::DICOMRTMimeTypes::DICOMRT_PLAN_MIMETYPE_NAME()), mitk::DICOMRTMimeTypes::DICOMRT_PLAN_MIMETYPE_DESCRIPTION()) { m_FileReaderServiceReg = RegisterService(); } RTPlanReaderService::RTPlanReaderService(const RTPlanReaderService& other) : mitk::AbstractFileReader(other) { } RTPlanReaderService::~RTPlanReaderService() {} std::vector > RTPlanReaderService::DoRead() { std::vector > result; auto DICOMTagsOfInterestService = GetDicomTagsOfInterestService(); auto tagsOfInterest = DICOMTagsOfInterestService->GetTagsOfInterest(); DICOMTagPathList tagsOfInterestList; for (const auto& tag : tagsOfInterest) { tagsOfInterestList.push_back(tag.first); } std::string location = GetInputLocation(); mitk::StringList files = { location }; mitk::DICOMDCMTKTagScanner::Pointer scanner = mitk::DICOMDCMTKTagScanner::New(); scanner->SetInputFiles(files); scanner->AddTagPaths(tagsOfInterestList); scanner->Scan(); mitk::DICOMDatasetAccessingImageFrameList frames = scanner->GetFrameInfoList(); if (frames.empty()) { MITK_ERROR << "Error reading the RTPLAN file" << std::endl; return result; } auto findings = ExtractPathsOfInterest(tagsOfInterestList, frames); //just create empty image. No image information available in RTPLAN. But properties will be attached. Image::Pointer dummyImage = Image::New(); mitk::PixelType pt = mitk::MakeScalarPixelType(); unsigned int dim[] = { 1,1}; dummyImage->Initialize(pt, 2, dim); SetProperties(dummyImage, findings); result.push_back(dummyImage.GetPointer()); return result; } RTPlanReaderService* RTPlanReaderService::Clone() const { return new RTPlanReaderService(*this); } } diff --git a/Modules/DicomRT/autoload/IO/mitkRTPlanReaderService.h b/Modules/RT/autoload/DICOMRTIO/mitkRTPlanReaderService.h similarity index 98% rename from Modules/DicomRT/autoload/IO/mitkRTPlanReaderService.h rename to Modules/RT/autoload/DICOMRTIO/mitkRTPlanReaderService.h index c2653f2991..f1171b57b0 100644 --- a/Modules/DicomRT/autoload/IO/mitkRTPlanReaderService.h +++ b/Modules/RT/autoload/DICOMRTIO/mitkRTPlanReaderService.h @@ -1,63 +1,63 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef mitkRTPlanReaderService_h #define mitkRTPlanReaderService_h #include "mitkAbstractFileReader.h" #include #include "mitkIDICOMTagsOfInterest.h" #include "mitkDICOMDatasetAccessingImageFrameInfo.h" #include -#include "MitkDicomRTIOExports.h" +#include "MitkDICOMRTIOExports.h" namespace mitk { /** * \brief RTPlanReaderService reads DICOM files of modality RTPLAN. \details The tags are defined in mitk::GetDefaultDICOMTagsOfInterest() in Module MitkDicomReader. They are stored as TemporoSpatialStringProperty. with the key as their respective DICOM tags. \note No image information is in RTPLAN. */ class MITKDICOMRTIO_EXPORT RTPlanReaderService : public mitk::AbstractFileReader { public: RTPlanReaderService(); RTPlanReaderService(const RTPlanReaderService& other); using AbstractFileReader::Read; ~RTPlanReaderService() override; protected: /** * \brief Reads the file (only tags). @details DICOMDCMTKTagScanner is used to read the tags \note No image information is in RTPLAN. \sa mitk::GetDefaultDICOMTagsOfInterest() for tags that are read */ std::vector> DoRead() override; private: RTPlanReaderService* Clone() const override; us::ServiceRegistration m_FileReaderServiceReg; }; } #endif diff --git a/Modules/DicomRT/autoload/IO/mitkRTStructureSetReaderService.cpp b/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.cpp similarity index 98% rename from Modules/DicomRT/autoload/IO/mitkRTStructureSetReaderService.cpp rename to Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.cpp index f4c4bcb794..5455f4112e 100644 --- a/Modules/DicomRT/autoload/IO/mitkRTStructureSetReaderService.cpp +++ b/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.cpp @@ -1,288 +1,288 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "mitkRTStructureSetReaderService.h" -#include +#include #include #include #include #include "dcmtk/dcmrt/drtstrct.h" namespace mitk { - RTStructureSetReaderService::RTStructureSetReaderService() : AbstractFileReader(CustomMimeType(mitk::DicomRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_NAME()), mitk::DicomRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_DESCRIPTION()) { + RTStructureSetReaderService::RTStructureSetReaderService() : AbstractFileReader(CustomMimeType(mitk::DICOMRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_NAME()), mitk::DICOMRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_DESCRIPTION()) { m_FileReaderServiceReg = RegisterService(); } RTStructureSetReaderService::RTStructureSetReaderService(const RTStructureSetReaderService& other) : mitk::AbstractFileReader(other) { } RTStructureSetReaderService::~RTStructureSetReaderService() {} RTStructureSetReaderService::RoiEntry::RoiEntry() { Number = 0; DisplayColor[0] = 1.0; DisplayColor[1] = 0.0; DisplayColor[2] = 0.0; ContourModelSet = mitk::ContourModelSet::New(); } RTStructureSetReaderService::RoiEntry::RoiEntry(const RoiEntry& src) { Number = src.Number; Name = src.Name; Description = src.Description; DisplayColor[0] = src.DisplayColor[0]; DisplayColor[1] = src.DisplayColor[1]; DisplayColor[2] = src.DisplayColor[2]; ContourModelSet = mitk::ContourModelSet::New(); SetPolyData(src.ContourModelSet); } RTStructureSetReaderService::RoiEntry::~RoiEntry() {} RTStructureSetReaderService::RoiEntry& RTStructureSetReaderService:: RoiEntry::operator =(const RoiEntry& src) { Number = src.Number; Name = src.Name; Description = src.Description; DisplayColor[0] = src.DisplayColor[0]; DisplayColor[1] = src.DisplayColor[1]; DisplayColor[2] = src.DisplayColor[2]; SetPolyData(src.ContourModelSet); return (*this); } void RTStructureSetReaderService::RoiEntry:: SetPolyData(mitk::ContourModelSet::Pointer roiPolyData) { if (roiPolyData == this->ContourModelSet) { return; } this->ContourModelSet = roiPolyData; } size_t RTStructureSetReaderService::GetNumberOfROIs() const { return this->ROISequenceVector.size(); } RTStructureSetReaderService::RoiEntry* RTStructureSetReaderService:: FindRoiByNumber(unsigned int roiNum) { for (unsigned int i = 0; i < this->ROISequenceVector.size(); ++i) { if (this->ROISequenceVector[i].Number == roiNum) { return &this->ROISequenceVector[i]; } } return nullptr; } std::vector > RTStructureSetReaderService::DoRead() { std::vector > result; std::string location = GetInputLocation(); auto DICOMTagsOfInterestService = GetDicomTagsOfInterestService(); auto tagsOfInterest = DICOMTagsOfInterestService->GetTagsOfInterest(); DICOMTagPathList tagsOfInterestList; for (const auto& tag : tagsOfInterest) { tagsOfInterestList.push_back(tag.first); } mitk::DICOMDCMTKTagScanner::Pointer scanner = mitk::DICOMDCMTKTagScanner::New(); scanner->SetInputFiles({ location }); scanner->AddTagPaths(tagsOfInterestList); scanner->Scan(); mitk::DICOMDatasetAccessingImageFrameList frames = scanner->GetFrameInfoList(); if (frames.empty()) { MITK_ERROR << "Error reading the RTSTRUCT file" << std::endl; return result; } auto findings = ExtractPathsOfInterest(tagsOfInterestList, frames); DcmFileFormat file; OFCondition output = file.loadFile(location.c_str(), EXS_Unknown); if (output.bad()) { MITK_ERROR << "Can't read the file" << std::endl; return result; } DcmDataset* dataset = file.getDataset(); DRTStructureSetIOD structureSetObject; OFCondition outp = structureSetObject.read(*dataset); if (!outp.good()) { MITK_ERROR << "Error reading the file" << std::endl; return result; } DRTStructureSetROISequence& roiSequence = structureSetObject.getStructureSetROISequence(); if (!roiSequence.gotoFirstItem().good()) { MITK_ERROR << "Error reading the structure sequence" << std::endl; return result; } do { DRTStructureSetROISequence::Item& currentSequence = roiSequence.getCurrentItem(); if (!currentSequence.isValid()) { continue; } OFString roiName; OFString roiDescription; Sint32 roiNumber; RoiEntry roi; currentSequence.getROIName(roiName); currentSequence.getROIDescription(roiDescription); currentSequence.getROINumber(roiNumber); roi.Name = roiName.c_str(); roi.Description = roiDescription.c_str(); roi.Number = roiNumber; this->ROISequenceVector.push_back(roi); } while (roiSequence.gotoNextItem().good()); Sint32 refRoiNumber; DRTROIContourSequence& roiContourSeqObject = structureSetObject.getROIContourSequence(); if (!roiContourSeqObject.gotoFirstItem().good()) { MITK_ERROR << "Error reading the contour sequence" << std::endl; return result; } do { mitk::ContourModelSet::Pointer contourSet = mitk::ContourModelSet::New(); DRTROIContourSequence::Item& currentRoiObject = roiContourSeqObject.getCurrentItem(); if (!currentRoiObject.isValid()) { continue; } currentRoiObject.getReferencedROINumber(refRoiNumber); DRTContourSequence& contourSeqObject = currentRoiObject.getContourSequence(); if (contourSeqObject.getNumberOfItems() > 0 && contourSeqObject.gotoFirstItem().good()) { do { DRTContourSequence::Item& contourItem = contourSeqObject.getCurrentItem(); if (!contourItem.isValid()) { continue; } OFString contourNumber; OFString numberOfPoints; OFVector contourData_LPS; mitk::ContourModel::Pointer contourSequence = mitk::ContourModel::New(); contourItem.getContourNumber(contourNumber); contourItem.getNumberOfContourPoints(numberOfPoints); contourItem.getContourData(contourData_LPS); for (unsigned int i = 0; i < contourData_LPS.size() / 3; i++) { mitk::Point3D point; point[0] = contourData_LPS.at(3 * i); point[1] = contourData_LPS.at(3 * i + 1); point[2] = contourData_LPS.at(3 * i + 2); contourSequence->AddVertex(point); } contourSequence->Close(); contourSet->AddContourModel(contourSequence); } while (contourSeqObject.gotoNextItem().good()); } else { MITK_WARN << "contourSeqObject has no items in sequence. Object is neglected and not read. Struct name: " << this->FindRoiByNumber(refRoiNumber)->Name << std::endl; } RoiEntry* refROI = this->FindRoiByNumber(refRoiNumber); if (refROI == nullptr) { MITK_ERROR << "Can not find references ROI" << std::endl; continue; } Sint32 roiColor; for (unsigned int j = 0; j < 3; j++) { currentRoiObject.getROIDisplayColor(roiColor, j); refROI->DisplayColor[j] = roiColor / 255.0; } refROI->ContourModelSet = contourSet; contourSet->SetProperty("name", mitk::StringProperty::New(refROI->Name)); contourSet->SetProperty("contour.color", mitk::ColorProperty::New( refROI->DisplayColor[0], refROI->DisplayColor[1], refROI->DisplayColor[2])); } while (roiContourSeqObject.gotoNextItem().good()); for (auto const& aROI : ROISequenceVector) { result.push_back(aROI.ContourModelSet.GetPointer()); result.at(result.size() - 1)->SetProperty("name", aROI.ContourModelSet->GetProperty("name")); result.at(result.size() - 1)->SetProperty("color", aROI.ContourModelSet->GetProperty("contour.color")); result.at(result.size() - 1)->SetProperty("contour.color", aROI.ContourModelSet->GetProperty("contour.color")); SetProperties(result.at(result.size() - 1).GetPointer(), findings); } return result; } RTStructureSetReaderService* RTStructureSetReaderService::Clone() const { return new RTStructureSetReaderService(*this); } } diff --git a/Modules/DicomRT/autoload/IO/mitkRTStructureSetReaderService.h b/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.h similarity index 98% rename from Modules/DicomRT/autoload/IO/mitkRTStructureSetReaderService.h rename to Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.h index 8fcf2e8efb..25871642b1 100644 --- a/Modules/DicomRT/autoload/IO/mitkRTStructureSetReaderService.h +++ b/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.h @@ -1,87 +1,87 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKRTSTRUCTURESETREADER_H #define MITKRTSTRUCTURESETREADER_H #include -#include "MitkDicomRTIOExports.h" +#include "MitkDICOMRTIOExports.h" #include #include namespace mitk { class MITKDICOMRTIO_EXPORT RTStructureSetReaderService : public mitk::AbstractFileReader { /** * Represent a region of interest (ROI) */ class RoiEntry { public: RoiEntry(); RoiEntry(const RoiEntry& src); virtual ~RoiEntry(); RoiEntry& operator=(const RoiEntry& src); void SetPolyData(ContourModelSet::Pointer roiPolyData); unsigned int Number; std::string Name; std::string Description; double DisplayColor[3]; mitk::ContourModelSet::Pointer ContourModelSet; }; public: RTStructureSetReaderService(); RTStructureSetReaderService(const RTStructureSetReaderService& other); ~RTStructureSetReaderService() override; /** * @brief Reading a RT StructureSet from the DICOM file and returns the ROIs * (region of interest) as a ContourModelSet. One ContourModelSet represent * one ROI. A ContourModelSet contains ContourModels which represent the * single structures. */ using AbstractFileReader::Read; protected: std::vector> DoRead() override; private: RTStructureSetReaderService* Clone() const override; /** * containing the ROIs meta information like name number and description */ std::vector ROISequenceVector; /** * Returns the number of ROIs from the ROISequenceVector */ size_t GetNumberOfROIs() const; /** * Returns the relevant ROI from the ROISequenceVector by its number */ RoiEntry* FindRoiByNumber(unsigned int roiNum); us::ServiceRegistration m_FileReaderServiceReg; }; } #endif // MITKRTSTRUCTURESETREADER_H diff --git a/Modules/DicomRT/files.cmake b/Modules/RT/files.cmake similarity index 93% rename from Modules/DicomRT/files.cmake rename to Modules/RT/files.cmake index b7fe17c979..e1b6f55ab8 100644 --- a/Modules/DicomRT/files.cmake +++ b/Modules/RT/files.cmake @@ -1,19 +1,19 @@ file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") SET(CPP_FILES mitkRTConstants.cpp mitkIsoDoseLevel.cpp mitkIsoDoseLevelCollections.cpp mitkIsoDoseLevelSetProperty.cpp mitkIsoDoseLevelVectorProperty.cpp mitkDoseImageVtkMapper2D.cpp mitkIsoLevelsGenerator.cpp mitkDoseNodeHelper.cpp - mitkDicomRTMimeTypes.cpp + mitkDICOMRTMimeTypes.cpp ) set(TPP_FILES ) set(MOC_H_FILES ) diff --git a/Modules/DicomRT/include/mitkDicomRTMimeTypes.h b/Modules/RT/include/mitkDICOMRTMimeTypes.h similarity index 79% rename from Modules/DicomRT/include/mitkDicomRTMimeTypes.h rename to Modules/RT/include/mitkDICOMRTMimeTypes.h index d57d821f0d..37522ba7bf 100644 --- a/Modules/DicomRT/include/mitkDicomRTMimeTypes.h +++ b/Modules/RT/include/mitkDICOMRTMimeTypes.h @@ -1,79 +1,79 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ -#ifndef MITKDicomRTMimeTypes_H -#define MITKDicomRTMimeTypes_H +#ifndef MITKDICOMRTMimeTypes_H +#define MITKDICOMRTMimeTypes_H #include #include -#include +#include #include #include #include namespace mitk { -class MITKDICOMRT_EXPORT DicomRTMimeTypes +class MITKRT_EXPORT DICOMRTMimeTypes { public: - class MITKDICOMRT_EXPORT RTDoseMimeType : public CustomMimeType + class MITKRT_EXPORT RTDoseMimeType : public CustomMimeType { public: RTDoseMimeType(); bool AppliesTo(const std::string &path) const override; RTDoseMimeType* Clone() const override; }; - class MITKDICOMRT_EXPORT RTStructMimeType : public CustomMimeType + class MITKRT_EXPORT RTStructMimeType : public CustomMimeType { public: RTStructMimeType(); bool AppliesTo(const std::string &path) const override; RTStructMimeType* Clone() const override; }; - class MITKDICOMRT_EXPORT RTPlanMimeType : public CustomMimeType + class MITKRT_EXPORT RTPlanMimeType : public CustomMimeType { public: RTPlanMimeType(); bool AppliesTo(const std::string &path) const override; RTPlanMimeType* Clone() const override; }; // Get all DicomRT Mime Types static std::array, 3> Get(); static RTDoseMimeType DICOMRT_DOSE_MIMETYPE(); static RTStructMimeType DICOMRT_STRUCT_MIMETYPE(); static RTPlanMimeType DICOMRT_PLAN_MIMETYPE(); static std::string DICOMRT_DOSE_MIMETYPE_NAME(); static std::string DICOMRT_STRUCT_MIMETYPE_NAME(); static std::string DICOMRT_PLAN_MIMETYPE_NAME(); static std::string DICOMRT_DOSE_MIMETYPE_DESCRIPTION(); static std::string DICOMRT_STRUCT_MIMETYPE_DESCRIPTION(); static std::string DICOMRT_PLAN_MIMETYPE_DESCRIPTION(); - DicomRTMimeTypes() = delete; - DicomRTMimeTypes(const DicomRTMimeTypes&) = delete; + DICOMRTMimeTypes() = delete; + DICOMRTMimeTypes(const DICOMRTMimeTypes&) = delete; static mitk::IDICOMTagsOfInterest* GetDicomTagsOfInterestService(); static bool canReadByDicomFileReader(const std::string & path); static std::string GetModality(const std::string & path); }; } -#endif // MITKDicomRTMimeTypes_H +#endif // MITKDICOMRTMimeTypes_H diff --git a/Modules/DicomRT/include/mitkDoseImageVtkMapper2D.h b/Modules/RT/include/mitkDoseImageVtkMapper2D.h similarity index 98% rename from Modules/DicomRT/include/mitkDoseImageVtkMapper2D.h rename to Modules/RT/include/mitkDoseImageVtkMapper2D.h index 636f1a9ffe..cb0f7bbded 100644 --- a/Modules/DicomRT/include/mitkDoseImageVtkMapper2D.h +++ b/Modules/RT/include/mitkDoseImageVtkMapper2D.h @@ -1,309 +1,309 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED #define MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED //MITK #include -#include +#include //MITK Rendering #include "mitkBaseRenderer.h" #include "mitkVtkMapper.h" #include "mitkExtractSliceFilter.h" //VTK #include #include #include class vtkActor; class vtkPolyDataMapper; class vtkPlaneSource; class vtkImageData; class vtkLookupTable; class vtkImageExtractComponents; class vtkImageReslice; class vtkImageChangeInformation; class vtkPoints; class vtkMitkThickSlicesFilter; class vtkPolyData; class vtkMitkApplyLevelWindowToRGBFilter; class vtkMitkLevelWindowFilter; namespace mitk { /** \brief Mapper to resample and display 2D slices of a 3D image. * * The following image gives a brief overview of the mapping and the involved parts. * * \image html DoseImageVtkMapper2Darchitecture.png * * First, the image is resliced by means of vtkImageReslice. The volume image * serves as input to the mapper in addition to spatial placement of the slice and a few other * properties such as thick slices. This code was already present in the old version * (mitkImageMapperGL2D). * * Next, the obtained slice (m_ReslicedImage) is put into a vtkMitkLevelWindowFilter * and the scalar levelwindow, opacity levelwindow and optional clipping to * local image bounds are applied * * Next, the output of the vtkMitkLevelWindowFilter is used to create a texture * (m_Texture) and a plane onto which the texture is rendered (m_Plane). For * mapping purposes, a vtkPolyDataMapper (m_Mapper) is utilized. Orthographic * projection is applied to create the effect of a 2D image. The mapper and the * texture are assigned to the actor (m_Actor) which is passed to the VTK rendering * pipeline via the method GetVtkProp(). * * In order to transform the textured plane to the correct position in space, the * same transformation as used for reslicing is applied to both the camera and the * vtkActor. All important steps are explained in more detail below. The resulting * 2D image (by reslicing the underlying 3D input image appropriately) can either * be directly rendered in a 2D view or just be calculated to be used later by another * rendering entity, e.g. in texture mapping in a 3D view. * * Properties that can be set for images and influence the imageMapper2D are: * * - \b "opacity": (FloatProperty) Opacity of the image * - \b "color": (ColorProperty) Color of the image * - \b "LookupTable": (mitkLookupTableProperty) If this property is set, * the default lookuptable will be ignored and the "LookupTable" value * will be used instead. * - \b "Image Rendering.Mode": This property decides which mode is used to render images. (E.g. if a lookup table or a transferfunction is applied). Detailed documentation about the modes can be found here: \link mitk::RenderingModeProperty \endlink * - \b "Image Rendering.Transfer Function": (mitkTransferFunctionProperty) If this * property is set, a color transferfunction will be used to color the image. * - \b "binary": (BoolProperty) is the image a binary image or not * - \b "outline binary": (BoolProperty) show outline of the image or not * - \b "texture interpolation": (BoolProperty) texture interpolation of the image * - \b "reslice interpolation": (VtkResliceInterpolationProperty) reslice interpolation of the image * - \b "in plane resample extent by geometry": (BoolProperty) Do it or not * - \b "bounding box": (BoolProperty) Is the Bounding Box of the image shown or not * - \b "layer": (IntProperty) Layer of the image * - \b "volume annotation color": (ColorProperty) color of the volume annotation, TODO has to be reimplemented * - \b "volume annotation unit": (StringProperty) annotation unit as string (does not implicit convert the unit!) unit is ml or cm3, TODO has to be reimplemented * The default properties are: * - \b "opacity", mitk::FloatProperty::New(0.3f), renderer, overwrite ) * - \b "color", ColorProperty::New(1.0,0.0,0.0), renderer, overwrite ) * - \b "binary", mitk::BoolProperty::New( true ), renderer, overwrite ) * - \b "outline binary", mitk::BoolProperty::New( false ), renderer, overwrite ) * - \b "texture interpolation", mitk::BoolProperty::New( false ) ) * - \b "reslice interpolation", mitk::VtkResliceInterpolationProperty::New() ) * - \b "in plane resample extent by geometry", mitk::BoolProperty::New( false ) ) * - \b "bounding box", mitk::BoolProperty::New( false ) ) * - \b "layer", mitk::IntProperty::New(10), renderer, overwrite) * - \b "Image Rendering.Transfer Function": Default color transfer function for CTs * - \b "LookupTable": Rainbow color. * If the modality-property is set for an image, the mapper uses modality-specific default properties, * e.g. color maps, if they are defined. * \ingroup Mapper */ - class MITKDICOMRT_EXPORT DoseImageVtkMapper2D : public VtkMapper + class MITKRT_EXPORT DoseImageVtkMapper2D : public VtkMapper { public: /** Standard class typedefs. */ mitkClassMacro( DoseImageVtkMapper2D,VtkMapper ); /** Method for creation through the object factory. */ itkFactorylessNewMacro(Self); itkCloneMacro(Self); /** \brief Get the Image to map */ const mitk::Image *GetInput(void); /** \brief Checks whether this mapper needs to update itself and generate * data. */ void Update(mitk::BaseRenderer * renderer) override; //### methods of MITK-VTK rendering pipeline vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override; //### end of methods of MITK-VTK rendering pipeline /** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */ /** * To render transveral, coronal, and sagittal, the mapper is called three times. * For performance reasons, the corresponding data for each view is saved in the * internal helper class LocalStorage. This allows rendering n views with just * 1 mitkMapper using n vtkMapper. * */ - class MITKDICOMRT_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage + class MITKRT_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage { public: /** \brief Actor of a 2D render window. */ vtkSmartPointer m_Actor; vtkSmartPointer m_Actors; /** \brief Mapper of a 2D render window. */ vtkSmartPointer m_Mapper; vtkSmartPointer m_VectorComponentExtractor; /** \brief Current slice of a 2D render window.*/ vtkSmartPointer m_ReslicedImage; /** \brief Empty vtkPolyData that is set when rendering geometry does not * intersect the image geometry. * \warning This member variable is set to nullptr, * if no image geometry is inside the plane geometry * of the respective render window. Any user of this * slice has to check whether it is set to nullptr! */ vtkSmartPointer m_EmptyPolyData; /** \brief Plane on which the slice is rendered as texture. */ vtkSmartPointer m_Plane; /** \brief The texture which is used to render the current slice. */ vtkSmartPointer m_Texture; /** \brief The lookuptables for colors and level window */ vtkSmartPointer m_DefaultLookupTable; vtkSmartPointer m_BinaryLookupTable; vtkSmartPointer m_ColorLookupTable; /** \brief The actual reslicer (one per renderer) */ mitk::ExtractSliceFilter::Pointer m_Reslicer; /** \brief Filter for thick slices */ vtkSmartPointer m_TSFilter; /** \brief PolyData object containg all lines/points needed for outlining the contour. This container is used to save a computed contour for the next rendering execution. For instance, if you zoom or pann, there is no need to recompute the contour. */ vtkSmartPointer m_OutlinePolyData; /** \brief Timestamp of last update of stored data. */ itk::TimeStamp m_LastUpdateTime; /** \brief mmPerPixel relation between pixel and mm. (World spacing).*/ mitk::ScalarType* m_mmPerPixel; /** \brief This filter is used to apply the level window to Grayvalue and RBG(A) images. */ vtkSmartPointer m_LevelWindowFilter; /** \brief Default constructor of the local storage. */ LocalStorage(); /** \brief Default deconstructor of the local storage. */ ~LocalStorage() override; }; /** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */ mitk::LocalStorageHandler m_LSH; /** \brief Get the LocalStorage corresponding to the current renderer. */ LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer); /** \brief Set the default properties for general image rendering. */ static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = nullptr, bool overwrite = false); /** \brief This method switches between different rendering modes (e.g. use a lookup table or a transfer function). * Detailed documentation about the modes can be found here: \link mitk::RenderingModeProperty \endlink */ void ApplyRenderingMode(mitk::BaseRenderer *renderer); protected: /** \brief Transforms the actor to the actual position in 3D. * \param renderer The current renderer corresponding to the render window. */ void TransformActor(mitk::BaseRenderer* renderer); /** \brief Generates a plane according to the size of the resliced image in milimeters. * * \image html texturedPlane.png * * In VTK a vtkPlaneSource is defined through three points. The origin and two * points defining the axes of the plane (see VTK documentation). The origin is * set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the * resliced image in space. Z is relevant for blending and the layer property. * The center of the plane (C) is also the center of the view plane (cf. the image above). * * \note For the standard MITK view with three 2D render windows showing three * different slices, three such planes are generated. All these planes are generated * in the XY-plane (even if they depict a YZ-slice of the volume). * */ void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]); /** \brief Generates a vtkPolyData object containing the outline of a given binary slice. \param renderer: Pointer to the renderer containing the needed information \note This code is based on code from the iil library. */ vtkSmartPointer CreateOutlinePolyData(mitk::BaseRenderer* renderer); /** Default constructor */ DoseImageVtkMapper2D(); /** Default deconstructor */ ~DoseImageVtkMapper2D() override; /** \brief Does the actual resampling, without rendering the image yet. * All the data is generated inside this method. The vtkProp (or Actor) * is filled with content (i.e. the resliced image). * * After generation, a 4x4 transformation matrix(t) of the current slice is obtained * from the vtkResliceImage object via GetReslicesAxis(). This matrix is * applied to each textured plane (actor->SetUserTransform(t)) to transform everything * to the actual 3D position (cf. the following image). * * \image html cameraPositioning3D.png * */ void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override; /** \brief This method uses the vtkCamera clipping range and the layer property * to calcualte the depth of the object (e.g. image or contour). The depth is used * to keep the correct order for the final VTK rendering.*/ float CalculateLayerDepth(mitk::BaseRenderer* renderer); /** \brief This method applies (or modifies) the lookuptable for all types of images. * \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode' * which uses the lookup table must be set. */ void ApplyLookuptable(mitk::BaseRenderer* renderer); /** \brief This method applies a color transfer function. * Internally, a vtkColorTransferFunction is used. This is usefull for coloring continous * images (e.g. float) * \warning To use the color transfer function, the property 'Image Rendering.Transfer Function' must be set and a 'Image Rendering.Mode' which uses the color transfer function must be set. */ void ApplyColorTransferFunction(mitk::BaseRenderer* renderer); /** * @brief ApplyLevelWindow Apply the level window for the given renderer. * \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses the level window must be set. * @param renderer Level window for which renderer? */ void ApplyLevelWindow(mitk::BaseRenderer* renderer); /** \brief Set the color of the image/polydata */ void ApplyColor( mitk::BaseRenderer* renderer ); /** \brief Set the opacity of the actor. */ void ApplyOpacity( mitk::BaseRenderer* renderer ); /** * \brief Calculates whether the given rendering geometry intersects the * given SlicedGeometry3D. * * This method checks if the given PlaneGeometry intersects the given * SlicedGeometry3D. It calculates the distance of the PlaneGeometry to all * 8 cornerpoints of the SlicedGeometry3D. If all distances have the same * sign (all positive or all negative) there is no intersection. * If the distances have different sign, there is an intersection. **/ bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry ); private: void CreateLevelOutline(mitk::BaseRenderer* renderer, const mitk::IsoDoseLevel* level, float pref, vtkSmartPointer points, vtkSmartPointer lines, vtkSmartPointer colors); }; } // namespace mitk #endif /* MITKDoseImageVtkMapper2D_H_HEADER_INCLUDED_C10E906E */ diff --git a/Modules/DicomRT/include/mitkDoseNodeHelper.h b/Modules/RT/include/mitkDoseNodeHelper.h similarity index 82% rename from Modules/DicomRT/include/mitkDoseNodeHelper.h rename to Modules/RT/include/mitkDoseNodeHelper.h index 7429f1d709..af912d5161 100644 --- a/Modules/DicomRT/include/mitkDoseNodeHelper.h +++ b/Modules/RT/include/mitkDoseNodeHelper.h @@ -1,37 +1,37 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef __DOSE_NODE_HELPER_H #define __DOSE_NODE_HELPER_H #include "mitkIsoDoseLevelCollections.h" #include "mitkDataNode.h" -#include "MitkDicomRTExports.h" +#include "MitkRTExports.h" namespace mitk { /**Helper that ensures that all properties of a dose node are set correctly to visualize the node properly.*/ - void MITKDICOMRT_EXPORT ConfigureNodeAsDoseNode(mitk::DataNode* doseNode, + void MITKRT_EXPORT ConfigureNodeAsDoseNode(mitk::DataNode* doseNode, const mitk::IsoDoseLevelSet* colorPreset, mitk::DoseValueAbs referenceDose, bool showColorWashGlobal = true); - void MITKDICOMRT_EXPORT ConfigureNodeAsIsoLineNode(mitk::DataNode* doseOutlineNode, + void MITKRT_EXPORT ConfigureNodeAsIsoLineNode(mitk::DataNode* doseOutlineNode, const mitk::IsoDoseLevelSet* colorPreset, mitk::DoseValueAbs referenceDose, bool showIsolinesGlobal = true); } #endif diff --git a/Modules/DicomRT/include/mitkDoseValueType.h b/Modules/RT/include/mitkDoseValueType.h similarity index 100% rename from Modules/DicomRT/include/mitkDoseValueType.h rename to Modules/RT/include/mitkDoseValueType.h diff --git a/Modules/DicomRT/include/mitkIsoDoseLevel.h b/Modules/RT/include/mitkIsoDoseLevel.h similarity index 97% rename from Modules/DicomRT/include/mitkIsoDoseLevel.h rename to Modules/RT/include/mitkIsoDoseLevel.h index 7516de7bff..7b2561586e 100644 --- a/Modules/DicomRT/include/mitkIsoDoseLevel.h +++ b/Modules/RT/include/mitkIsoDoseLevel.h @@ -1,100 +1,100 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef _MITK_DOSE_ISO_LEVEL_H_ #define _MITK_DOSE_ISO_LEVEL_H_ #include #include #include #include "mitkCommon.h" #include "mitkDoseValueType.h" -#include "MitkDicomRTExports.h" +#include "MitkRTExports.h" namespace mitk { /** \brief Stores values needed for the representation/visualization of dose iso levels. * * The dose iso level is defined in the topology of a dose distribution by the dose value * that indicates the lower boundary of the iso level. The upper boundary is implicitly defined * by the next IsoDoseLevel greater (higher dose value) than the current iso level. * Color and the visibility options are used to indicate the visualization style. */ - class MITKDICOMRT_EXPORT IsoDoseLevel: public itk::Object + class MITKRT_EXPORT IsoDoseLevel: public itk::Object { public: typedef ::itk::RGBPixel ColorType; typedef DoseValueRel DoseValueType; mitkClassMacroItkParent(IsoDoseLevel, itk::Object); itkNewMacro(Self); mitkNewMacro4Param(Self,DoseValueType, ColorType, bool, bool); /** Checks if current dose iso level instances is greater according to the dose values.*/ bool operator> ( const IsoDoseLevel& right ) const; /** Checks if current dose iso level instances is lesser according to the dose values.*/ bool operator< ( const IsoDoseLevel& right ) const; bool operator == ( const IsoDoseLevel& right) const; itkSetMacro(DoseValue,DoseValueType); itkGetConstMacro(DoseValue,DoseValueType); itkSetMacro(Color,ColorType); itkGetConstMacro(Color,ColorType); itkSetMacro(VisibleIsoLine,bool); itkGetConstMacro(VisibleIsoLine,bool); itkBooleanMacro(VisibleIsoLine); itkSetMacro(VisibleColorWash,bool); itkGetConstMacro(VisibleColorWash,bool); itkBooleanMacro(VisibleColorWash); protected: IsoDoseLevel(); IsoDoseLevel(const IsoDoseLevel & other); IsoDoseLevel(const DoseValueType & value, const ColorType& color, bool visibleIsoLine = true, bool visibleColorWash = true ); ~IsoDoseLevel() override; mitkCloneMacro(IsoDoseLevel); void PrintSelf(std::ostream &os, itk::Indent indent) const override; private: /** Relative dose value and lower boundary of the iso level instance */ DoseValueType m_DoseValue; /** RGB color code that should be used for the iso level.*/ ColorType m_Color; /** indicates if an iso line should be shown for the iso level (the lower boundary indicated by m_DoseValue)*/ bool m_VisibleIsoLine; /** indicates if a color wash should be shown for the iso level.*/ bool m_VisibleColorWash; /** Not implemented on purpose*/ IsoDoseLevel& operator = (const IsoDoseLevel& source); }; } // namespace mitk #endif //_MITK_DOSE_ISO_LEVEL_H_ diff --git a/Modules/DicomRT/include/mitkIsoDoseLevelCollections.h b/Modules/RT/include/mitkIsoDoseLevelCollections.h similarity index 99% rename from Modules/DicomRT/include/mitkIsoDoseLevelCollections.h rename to Modules/RT/include/mitkIsoDoseLevelCollections.h index 4bee6f08f8..ac0b860013 100644 --- a/Modules/DicomRT/include/mitkIsoDoseLevelCollections.h +++ b/Modules/RT/include/mitkIsoDoseLevelCollections.h @@ -1,154 +1,154 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_ #define _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_ #include #include #include "mitkIsoDoseLevel.h" namespace mitk { /** \class IsoDoseLevelVector \brief Simple vector that stores dose iso levels. * * This class is for example used to store the user defined free iso values. */ typedef ::itk::VectorContainer IsoDoseLevelVector; /** \class IsoDoseLevelSet \brief Stores values needed for the representation/visualization of dose iso levels. * * Set of dose iso levels sorted by the dose values of the iso levels (low to high values). * This data structure is used to represent the dose iso level setup used for the * visualization of a dose distribution. */ -class MITKDICOMRT_EXPORT IsoDoseLevelSet: +class MITKRT_EXPORT IsoDoseLevelSet: public itk::Object { public: mitkClassMacroItkParent(IsoDoseLevelSet, itk::Object); itkNewMacro(Self); private: /** Quick access to the STL vector type that was inherited. */ typedef std::vector< IsoDoseLevel::Pointer > InternalVectorType; typedef InternalVectorType::size_type size_type; typedef InternalVectorType::iterator VectorIterator; typedef InternalVectorType::const_iterator VectorConstIterator; InternalVectorType m_IsoLevels; protected: IsoDoseLevelSet() {}; explicit IsoDoseLevelSet(const IsoDoseLevelSet & other); ~IsoDoseLevelSet() override {}; mitkCloneMacro(IsoDoseLevelSet); public: typedef size_type IsoLevelIndexType; typedef IsoDoseLevel::DoseValueType DoseValueType; /** Convenient typedefs for the iterator and const iterator. */ class ConstIterator; /** Friends to this class. */ friend class ConstIterator; /** \class ConstIterator * Simulate STL-vector style const iteration where dereferencing the iterator * gives read access to the value. */ class ConstIterator { public: ConstIterator() {} ConstIterator(const VectorConstIterator & i): m_Iter(i) {} ConstIterator(const ConstIterator & r) { m_Iter = r.m_Iter; } const IsoDoseLevel & operator*() { return *(m_Iter->GetPointer()); } const IsoDoseLevel * operator->() { return m_Iter->GetPointer(); } ConstIterator & operator++() {++m_Iter; return *this; } ConstIterator operator++(int) { ConstIterator temp(*this); ++m_Iter; return temp; } ConstIterator & operator--() {--m_Iter; return *this; } ConstIterator operator--(int) { ConstIterator temp(*this); --m_Iter; return temp; } ConstIterator & operator=(const ConstIterator & r) {m_Iter = r.m_Iter; return *this; } bool operator==(const ConstIterator & r) const { return m_Iter == r.m_Iter; } bool operator!=(const ConstIterator & r) const { return m_Iter != r.m_Iter; } const IsoDoseLevel & Value(void) const { return *(m_Iter->GetPointer()); } private: VectorConstIterator m_Iter; }; /* Declare the public interface routines. */ /** * Read the element from the given index. * It is assumed that the index exists. */ const IsoDoseLevel& GetIsoDoseLevel(IsoLevelIndexType) const; const IsoDoseLevel& GetIsoDoseLevel(DoseValueType) const; /** * Set the element value at the given index. * It is assumed that the index exists. */ void SetIsoDoseLevel(const IsoDoseLevel*); /** * Check if the index range of the vector is large enough to allow the * given index without expansion. */ bool DoseLevelExists(IsoLevelIndexType) const; bool DoseLevelExists(DoseValueType) const; /** * Delete the element defined by the index identifier. In practice, it * doesn't make sense to delete a vector index. Instead, this method just * overwrites the index with the default element. */ void DeleteIsoDoseLevel(DoseValueType); void DeleteIsoDoseLevel(IsoLevelIndexType); /** * Get a begin const iterator for the vector. */ ConstIterator Begin(void) const; /** * Get an end const iterator for the vector. */ ConstIterator End(void) const; /** * Get the number of elements currently stored in the vector. */ IsoLevelIndexType Size(void) const; /** * Clear the elements. The final size will be zero. */ void Reset(void); }; } #endif //_MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_ diff --git a/Modules/DicomRT/include/mitkIsoDoseLevelSetProperty.h b/Modules/RT/include/mitkIsoDoseLevelSetProperty.h similarity index 94% rename from Modules/DicomRT/include/mitkIsoDoseLevelSetProperty.h rename to Modules/RT/include/mitkIsoDoseLevelSetProperty.h index 059a4767d6..eacfeba922 100644 --- a/Modules/DicomRT/include/mitkIsoDoseLevelSetProperty.h +++ b/Modules/RT/include/mitkIsoDoseLevelSetProperty.h @@ -1,73 +1,73 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ #define _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ #include "mitkBaseProperty.h" #include "mitkIsoDoseLevelCollections.h" -#include "MitkDicomRTExports.h" +#include "MitkRTExports.h" namespace mitk { /** \brief Property class for dose iso level sets. */ -class MITKDICOMRT_EXPORT IsoDoseLevelSetProperty : public BaseProperty +class MITKRT_EXPORT IsoDoseLevelSetProperty : public BaseProperty { protected: IsoDoseLevelSet::Pointer m_IsoLevelSet; IsoDoseLevelSetProperty(); explicit IsoDoseLevelSetProperty(const IsoDoseLevelSetProperty& other); explicit IsoDoseLevelSetProperty(IsoDoseLevelSet* levelSet); public: mitkClassMacro(IsoDoseLevelSetProperty, BaseProperty); itkNewMacro(IsoDoseLevelSetProperty); mitkNewMacro1Param(IsoDoseLevelSetProperty, IsoDoseLevelSet*); typedef IsoDoseLevelSet ValueType; ~IsoDoseLevelSetProperty() override; const IsoDoseLevelSet * GetIsoDoseLevelSet() const; const IsoDoseLevelSet * GetValue() const; IsoDoseLevelSet * GetIsoDoseLevelSet(); IsoDoseLevelSet * GetValue(); void SetIsoDoseLevelSet(IsoDoseLevelSet* levelSet); void SetValue(IsoDoseLevelSet* levelSet); std::string GetValueAsString() const override; using BaseProperty::operator=; private: itk::LightObject::Pointer InternalClone() const override; bool IsEqual(const BaseProperty& property) const override; bool Assign(const BaseProperty& property) override; }; } // namespace mitk #endif /* _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ */ diff --git a/Modules/DicomRT/include/mitkIsoDoseLevelVectorProperty.h b/Modules/RT/include/mitkIsoDoseLevelVectorProperty.h similarity index 94% rename from Modules/DicomRT/include/mitkIsoDoseLevelVectorProperty.h rename to Modules/RT/include/mitkIsoDoseLevelVectorProperty.h index 575bbcc7f8..0a1362242b 100644 --- a/Modules/DicomRT/include/mitkIsoDoseLevelVectorProperty.h +++ b/Modules/RT/include/mitkIsoDoseLevelVectorProperty.h @@ -1,74 +1,74 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef _MITK_DOSE_ISO_LEVEL_VECTOR_PROPERTY_H_ #define _MITK_DOSE_ISO_LEVEL_VECTOR_PROPERTY_H_ #include "mitkBaseProperty.h" #include "mitkIsoDoseLevelCollections.h" -#include "MitkDicomRTExports.h" +#include "MitkRTExports.h" namespace mitk { /** \brief Property class for dose iso level vector. */ -class MITKDICOMRT_EXPORT IsoDoseLevelVectorProperty : public BaseProperty +class MITKRT_EXPORT IsoDoseLevelVectorProperty : public BaseProperty { protected: IsoDoseLevelVector::Pointer m_IsoLevelVector; IsoDoseLevelVectorProperty(); explicit IsoDoseLevelVectorProperty(const IsoDoseLevelVectorProperty& other); explicit IsoDoseLevelVectorProperty(IsoDoseLevelVector* levelVector); public: mitkClassMacro(IsoDoseLevelVectorProperty, BaseProperty); itkNewMacro(IsoDoseLevelVectorProperty); mitkNewMacro1Param(IsoDoseLevelVectorProperty, IsoDoseLevelVector*); typedef IsoDoseLevelVector ValueType; ~IsoDoseLevelVectorProperty() override; const IsoDoseLevelVector * GetIsoDoseLevelVector() const; const IsoDoseLevelVector * GetValue() const; IsoDoseLevelVector * GetIsoDoseLevelVector(); IsoDoseLevelVector * GetValue(); void SetIsoDoseLevelVector(IsoDoseLevelVector* levelVector); void SetValue(IsoDoseLevelVector* levelVector); std::string GetValueAsString() const override; using BaseProperty::operator=; private: itk::LightObject::Pointer InternalClone() const override; bool IsEqual(const BaseProperty& property) const override; bool Assign(const BaseProperty& property) override; }; } // namespace mitk #endif /* _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ */ diff --git a/Modules/DicomRT/include/mitkIsoLevelsGenerator.h b/Modules/RT/include/mitkIsoLevelsGenerator.h similarity index 82% rename from Modules/DicomRT/include/mitkIsoLevelsGenerator.h rename to Modules/RT/include/mitkIsoLevelsGenerator.h index 9fcd529c11..e3b43c21b8 100644 --- a/Modules/DicomRT/include/mitkIsoLevelsGenerator.h +++ b/Modules/RT/include/mitkIsoLevelsGenerator.h @@ -1,26 +1,26 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef __ISO_LEVELS_GENERATOR_H #define __ISO_LEVELS_GENERATOR_H #include "mitkIsoDoseLevelCollections.h" -#include "MitkDicomRTExports.h" +#include "MitkRTExports.h" namespace mitk { - IsoDoseLevelSet::Pointer MITKDICOMRT_EXPORT GenerateIsoLevels_Virtuos(); + IsoDoseLevelSet::Pointer MITKRT_EXPORT GenerateIsoLevels_Virtuos(); } #endif diff --git a/Modules/DicomRT/include/mitkRTConstants.h b/Modules/RT/include/mitkRTConstants.h similarity index 98% rename from Modules/DicomRT/include/mitkRTConstants.h rename to Modules/RT/include/mitkRTConstants.h index 598d7bd3df..c586e32809 100644 --- a/Modules/DicomRT/include/mitkRTConstants.h +++ b/Modules/RT/include/mitkRTConstants.h @@ -1,107 +1,107 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef _MITK_RT_CONSTANTS_H_ #define _MITK_RT_CONSTANTS_H_ #include -#include "MitkDicomRTExports.h" +#include "MitkRTExports.h" namespace mitk { -struct MITKDICOMRT_EXPORT RTConstants +struct MITKRT_EXPORT RTConstants { /** * Name of the property that indicates if a data/node is a dose. */ static const std::string DOSE_PROPERTY_NAME; /** * Name of the property that encodes the prescribed dose associated with the data node * If a RTPLAN file exists the value can be extracted from the tag (300A,0026) - Target Prescription Dose in the plan file. */ static const std::string PRESCRIBED_DOSE_PROPERTY_NAME; /** * Name of the property that encodes the reference dose that should be used for relative dose vizualization/evaluation purpose. * It is often the prescribed dose but may differ e.g. when to dose distributions sould be compared using the same reference. */ static const std::string REFERENCE_DOSE_PROPERTY_NAME; /** * Name of the property that encodes the reference structure set. */ static const std::string REFERENCE_STRUCTURE_SET_PROPERTY_NAME; /** * Name of the property that encodes the optional string property holding the information from the tag (3004,0004) - Dose Type. * This contains useful information for medical doctors */ static const std::string DOSE_TYPE_PROPERTY_NAME; /** * Name of the property that encodes the optional string property holding the description information from the tag (300A,0016) - Dose Reference Description. */ static const std::string REFERENCE_DESCRIPTION_DOSE_PROPERTY_NAME; /** * Name of the property that encodes the optional string property holding the information from the tag (3004,000A) - Dose Summation Type. * This contains useful information for medical doctors */ static const std::string DOSE_SUMMATION_TYPE_PROPERTY_NAME; /** * Name of the property that encodes the number of fractions. * It is for example in DICOM stored in tag (300A,0078) - Number of Fractions Prescribed (from the RTPLAN file if this file exists). * This value could be used to further scale the dose according to dose summation type. * For example a given plan consists of 8 fractions. Scaling the fraction dose by 8 gives the complete planned dose. */ static const std::string DOSE_FRACTION_COUNT_PROPERTY_NAME; /** * Name of the property that encodes the number of beams. * It is for example in DICOM stored in tag (300A,0080) - Number of Beams (from the RTPLAN file if this file exists). */ static const std::string DOSE_FRACTION_NUMBER_OF_BEAMS_PROPERTY_NAME; /** * Name of the property that encodes the radiation type of beams. * It is for example in DICOM stored in tag (300A,00C6) - Radiation Type (from the RTPLAN file if this file exists). */ static const std::string DOSE_RADIATION_TYPE_PROPERTY_NAME; /** * Name of the property that encodes if the iso line rendering should be activated for the node. */ static const std::string DOSE_SHOW_ISOLINES_PROPERTY_NAME; /** * Name of the property that encodes if the color wash rendering should be activated for the node. */ static const std::string DOSE_SHOW_COLORWASH_PROPERTY_NAME; /** * Name of the property that encodes if the set of iso levels should be used to visualize the dose distribution. */ static const std::string DOSE_ISO_LEVELS_PROPERTY_NAME; /** * Name of the property that encodes user defined iso values that mark special dose values in the distribution. */ static const std::string DOSE_FREE_ISO_VALUES_PROPERTY_NAME; }; } #endif diff --git a/Modules/DicomRT/src/mitkDicomRTMimeTypes.cpp b/Modules/RT/src/mitkDICOMRTMimeTypes.cpp similarity index 76% rename from Modules/DicomRT/src/mitkDicomRTMimeTypes.cpp rename to Modules/RT/src/mitkDICOMRTMimeTypes.cpp index b8a26714b8..bbb3cc0260 100644 --- a/Modules/DicomRT/src/mitkDicomRTMimeTypes.cpp +++ b/Modules/RT/src/mitkDICOMRTMimeTypes.cpp @@ -1,252 +1,252 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ -#include +#include #include #include #include #include #include #include #include #include #include #include namespace mitk { -std::array, 3> DicomRTMimeTypes::Get() +std::array, 3> DICOMRTMimeTypes::Get() { return { std::make_unique(), std::make_unique(), std::make_unique() }; } // Mime Types -DicomRTMimeTypes::RTDoseMimeType::RTDoseMimeType() +DICOMRTMimeTypes::RTDoseMimeType::RTDoseMimeType() : CustomMimeType(DICOMRT_DOSE_MIMETYPE_NAME()) { std::string category = "DICOMRT"; this->SetCategory(category); this->SetComment("RTDose"); this->AddExtension("dcm"); } -bool DicomRTMimeTypes::RTDoseMimeType::AppliesTo(const std::string &path) const +bool DICOMRTMimeTypes::RTDoseMimeType::AppliesTo(const std::string &path) const { bool canRead( CustomMimeType::AppliesTo(path) ); if (!canRead) { return false; } if (!canReadByDicomFileReader(path)) { return false; } auto modality = GetModality(path); if (modality == "RTDOSE") { return true; } else { return false; } } -std::string DicomRTMimeTypes::GetModality(const std::string & path) +std::string DICOMRTMimeTypes::GetModality(const std::string & path) { mitk::IDICOMTagsOfInterest* toiSrv = GetDicomTagsOfInterestService(); auto tagsOfInterest = toiSrv->GetTagsOfInterest(); DICOMTagPathList tagsOfInterestList; for (const auto& tag : tagsOfInterest) { tagsOfInterestList.push_back(tag.first); } mitk::DICOMDCMTKTagScanner::Pointer scanner = mitk::DICOMDCMTKTagScanner::New(); scanner->SetInputFiles({ path }); scanner->AddTagPaths(tagsOfInterestList); scanner->Scan(); mitk::DICOMDatasetAccessingImageFrameList frames = scanner->GetFrameInfoList(); std::string modality = ""; if (frames.empty()) return modality; auto findings = frames.front()->GetTagValueAsString(DICOMTagPath(0x0008, 0x0060)); modality = findings.front().value; return modality; } -bool DicomRTMimeTypes::canReadByDicomFileReader(const std::string & filename) +bool DICOMRTMimeTypes::canReadByDicomFileReader(const std::string & filename) { mitk::DICOMFileReaderSelector::Pointer selector = mitk::DICOMFileReaderSelector::New(); selector->LoadBuiltIn3DConfigs(); selector->SetInputFiles({ filename }); mitk::DICOMFileReader::Pointer reader = selector->GetFirstReaderWithMinimumNumberOfOutputImages(); if (reader.IsNull()) { return false; } else { return true; } } -DicomRTMimeTypes::RTDoseMimeType* DicomRTMimeTypes::RTDoseMimeType::Clone() const +DICOMRTMimeTypes::RTDoseMimeType* DICOMRTMimeTypes::RTDoseMimeType::Clone() const { return new RTDoseMimeType(*this); } -DicomRTMimeTypes::RTStructMimeType::RTStructMimeType() +DICOMRTMimeTypes::RTStructMimeType::RTStructMimeType() : CustomMimeType(DICOMRT_STRUCT_MIMETYPE_NAME()) { std::string category = "DICOMRT"; this->SetCategory(category); this->SetComment("RTStruct"); this->AddExtension("dcm"); } -bool DicomRTMimeTypes::RTStructMimeType::AppliesTo(const std::string &path) const +bool DICOMRTMimeTypes::RTStructMimeType::AppliesTo(const std::string &path) const { bool canRead(CustomMimeType::AppliesTo(path)); if (!canRead) { return false; } auto modality = GetModality(path); if (modality == "RTSTRUCT") { return true; } else { return false; } } -DicomRTMimeTypes::RTStructMimeType* DicomRTMimeTypes::RTStructMimeType::Clone() const +DICOMRTMimeTypes::RTStructMimeType* DICOMRTMimeTypes::RTStructMimeType::Clone() const { return new RTStructMimeType(*this); } -DicomRTMimeTypes::RTPlanMimeType::RTPlanMimeType() +DICOMRTMimeTypes::RTPlanMimeType::RTPlanMimeType() : CustomMimeType(DICOMRT_PLAN_MIMETYPE_NAME()) { std::string category = "DICOMRT"; this->SetCategory(category); this->SetComment("RTPLAN"); this->AddExtension("dcm"); } -bool DicomRTMimeTypes::RTPlanMimeType::AppliesTo(const std::string &path) const +bool DICOMRTMimeTypes::RTPlanMimeType::AppliesTo(const std::string &path) const { bool canRead(CustomMimeType::AppliesTo(path)); if (!canRead) { return false; } auto modality = GetModality(path); if (modality == "RTPLAN") { return true; } else { return false; } } -DicomRTMimeTypes::RTPlanMimeType* DicomRTMimeTypes::RTPlanMimeType::Clone() const +DICOMRTMimeTypes::RTPlanMimeType* DICOMRTMimeTypes::RTPlanMimeType::Clone() const { return new RTPlanMimeType(*this); } -DicomRTMimeTypes::RTDoseMimeType DicomRTMimeTypes::DICOMRT_DOSE_MIMETYPE() +DICOMRTMimeTypes::RTDoseMimeType DICOMRTMimeTypes::DICOMRT_DOSE_MIMETYPE() { return RTDoseMimeType(); } -DicomRTMimeTypes::RTStructMimeType DicomRTMimeTypes::DICOMRT_STRUCT_MIMETYPE() +DICOMRTMimeTypes::RTStructMimeType DICOMRTMimeTypes::DICOMRT_STRUCT_MIMETYPE() { return RTStructMimeType(); } -DicomRTMimeTypes::RTPlanMimeType DicomRTMimeTypes::DICOMRT_PLAN_MIMETYPE() +DICOMRTMimeTypes::RTPlanMimeType DICOMRTMimeTypes::DICOMRT_PLAN_MIMETYPE() { return RTPlanMimeType(); } // Names -std::string DicomRTMimeTypes::DICOMRT_DOSE_MIMETYPE_NAME() +std::string DICOMRTMimeTypes::DICOMRT_DOSE_MIMETYPE_NAME() { return IOMimeTypes::DEFAULT_BASE_NAME() + ".dicomrt.dose"; } -std::string DicomRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_NAME() +std::string DICOMRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_NAME() { return IOMimeTypes::DEFAULT_BASE_NAME() + ".dicomrt.struct"; } -std::string DicomRTMimeTypes::DICOMRT_PLAN_MIMETYPE_NAME() +std::string DICOMRTMimeTypes::DICOMRT_PLAN_MIMETYPE_NAME() { return IOMimeTypes::DEFAULT_BASE_NAME() + ".dicomrt.plan"; } // Descriptions -std::string DicomRTMimeTypes::DICOMRT_DOSE_MIMETYPE_DESCRIPTION() +std::string DICOMRTMimeTypes::DICOMRT_DOSE_MIMETYPE_DESCRIPTION() { return "RTDOSE reader"; } -std::string DicomRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_DESCRIPTION() +std::string DICOMRTMimeTypes::DICOMRT_STRUCT_MIMETYPE_DESCRIPTION() { return "RTSTRUCT reader"; } -std::string DicomRTMimeTypes::DICOMRT_PLAN_MIMETYPE_DESCRIPTION() +std::string DICOMRTMimeTypes::DICOMRT_PLAN_MIMETYPE_DESCRIPTION() { return "RTPLAN reader"; } -mitk::IDICOMTagsOfInterest* DicomRTMimeTypes::GetDicomTagsOfInterestService() +mitk::IDICOMTagsOfInterest* DICOMRTMimeTypes::GetDicomTagsOfInterestService() { mitk::IDICOMTagsOfInterest* result = nullptr; std::vector > toiRegisters = us::GetModuleContext()->GetServiceReferences(); if (!toiRegisters.empty()) { if (toiRegisters.size() > 1) { MITK_WARN << "Multiple DICOM tags of interest services found. Using just one."; } result = us::GetModuleContext()->GetService(toiRegisters.front()); } return result; } } diff --git a/Modules/DicomRT/src/mitkDoseImageVtkMapper2D.cpp b/Modules/RT/src/mitkDoseImageVtkMapper2D.cpp similarity index 100% rename from Modules/DicomRT/src/mitkDoseImageVtkMapper2D.cpp rename to Modules/RT/src/mitkDoseImageVtkMapper2D.cpp diff --git a/Modules/DicomRT/src/mitkDoseNodeHelper.cpp b/Modules/RT/src/mitkDoseNodeHelper.cpp similarity index 100% rename from Modules/DicomRT/src/mitkDoseNodeHelper.cpp rename to Modules/RT/src/mitkDoseNodeHelper.cpp diff --git a/Modules/DicomRT/src/mitkIsoDoseLevel.cpp b/Modules/RT/src/mitkIsoDoseLevel.cpp similarity index 100% rename from Modules/DicomRT/src/mitkIsoDoseLevel.cpp rename to Modules/RT/src/mitkIsoDoseLevel.cpp diff --git a/Modules/DicomRT/src/mitkIsoDoseLevelCollections.cpp b/Modules/RT/src/mitkIsoDoseLevelCollections.cpp similarity index 100% rename from Modules/DicomRT/src/mitkIsoDoseLevelCollections.cpp rename to Modules/RT/src/mitkIsoDoseLevelCollections.cpp diff --git a/Modules/DicomRT/src/mitkIsoDoseLevelSetProperty.cpp b/Modules/RT/src/mitkIsoDoseLevelSetProperty.cpp similarity index 100% rename from Modules/DicomRT/src/mitkIsoDoseLevelSetProperty.cpp rename to Modules/RT/src/mitkIsoDoseLevelSetProperty.cpp diff --git a/Modules/DicomRT/src/mitkIsoDoseLevelVectorProperty.cpp b/Modules/RT/src/mitkIsoDoseLevelVectorProperty.cpp similarity index 100% rename from Modules/DicomRT/src/mitkIsoDoseLevelVectorProperty.cpp rename to Modules/RT/src/mitkIsoDoseLevelVectorProperty.cpp diff --git a/Modules/DicomRT/src/mitkIsoLevelsGenerator.cpp b/Modules/RT/src/mitkIsoLevelsGenerator.cpp similarity index 100% rename from Modules/DicomRT/src/mitkIsoLevelsGenerator.cpp rename to Modules/RT/src/mitkIsoLevelsGenerator.cpp diff --git a/Modules/DicomRT/src/mitkRTConstants.cpp b/Modules/RT/src/mitkRTConstants.cpp similarity index 100% rename from Modules/DicomRT/src/mitkRTConstants.cpp rename to Modules/RT/src/mitkRTConstants.cpp diff --git a/Modules/DicomRT/src/mitkRTPlanReader.cpp b/Modules/RT/src/mitkRTPlanReader.cpp similarity index 100% rename from Modules/DicomRT/src/mitkRTPlanReader.cpp rename to Modules/RT/src/mitkRTPlanReader.cpp diff --git a/Modules/DicomRT/test/CMakeLists.txt b/Modules/RT/test/CMakeLists.txt similarity index 100% rename from Modules/DicomRT/test/CMakeLists.txt rename to Modules/RT/test/CMakeLists.txt diff --git a/Modules/DicomRT/test/files.cmake b/Modules/RT/test/files.cmake similarity index 100% rename from Modules/DicomRT/test/files.cmake rename to Modules/RT/test/files.cmake diff --git a/Modules/DicomRT/test/mitkRTDoseReaderServiceTest.cpp b/Modules/RT/test/mitkRTDoseReaderServiceTest.cpp similarity index 100% rename from Modules/DicomRT/test/mitkRTDoseReaderServiceTest.cpp rename to Modules/RT/test/mitkRTDoseReaderServiceTest.cpp diff --git a/Modules/DicomRT/test/mitkRTPlanReaderServiceTest.cpp b/Modules/RT/test/mitkRTPlanReaderServiceTest.cpp similarity index 100% rename from Modules/DicomRT/test/mitkRTPlanReaderServiceTest.cpp rename to Modules/RT/test/mitkRTPlanReaderServiceTest.cpp diff --git a/Modules/DicomRT/test/mitkRTPlanReaderTest.cpp b/Modules/RT/test/mitkRTPlanReaderTest.cpp similarity index 100% rename from Modules/DicomRT/test/mitkRTPlanReaderTest.cpp rename to Modules/RT/test/mitkRTPlanReaderTest.cpp diff --git a/Modules/DicomRT/test/mitkRTStructureSetReaderServiceTest.cpp b/Modules/RT/test/mitkRTStructureSetReaderServiceTest.cpp similarity index 100% rename from Modules/DicomRT/test/mitkRTStructureSetReaderServiceTest.cpp rename to Modules/RT/test/mitkRTStructureSetReaderServiceTest.cpp diff --git a/Modules/RTUI/CMakeLists.txt b/Modules/RTUI/CMakeLists.txt index 242fef139f..eb039647d2 100644 --- a/Modules/RTUI/CMakeLists.txt +++ b/Modules/RTUI/CMakeLists.txt @@ -1,5 +1,5 @@ MITK_CREATE_MODULE( INCLUDE_DIRS Qmitk Helper - DEPENDS MitkDicomRT + DEPENDS MitkRT PACKAGE_DEPENDS PUBLIC CTK Qt5|Core ) diff --git a/Modules/SemanticRelations/CMakeLists.txt b/Modules/SemanticRelations/CMakeLists.txt index aa6819b240..f4c3c2d50f 100644 --- a/Modules/SemanticRelations/CMakeLists.txt +++ b/Modules/SemanticRelations/CMakeLists.txt @@ -1,7 +1,7 @@ MITK_CREATE_MODULE( - DEPENDS MitkSceneSerializationBase MitkDICOMReader MitkMultilabel MitkPersistence MitkImageStatisticsUI + DEPENDS MitkSceneSerializationBase MitkDICOM MitkMultilabel MitkPersistence MitkImageStatisticsUI ) if(BUILD_TESTING) ADD_SUBDIRECTORY(Test) endif(BUILD_TESTING) diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index 493c30fb31..a0899b3787 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,96 +1,96 @@ # 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:ON org.blueberry.ui.qt.log:ON org.blueberry.ui.qt.objectinspector:OFF 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.gui.qt.application:ON org.mitk.gui.qt.ext:OFF org.mitk.gui.qt.extapplication:OFF org.mitk.gui.qt.mitkworkbench.intro:OFF org.mitk.gui.qt.common:ON org.mitk.gui.qt.stdmultiwidgeteditor:ON org.mitk.gui.qt.mxnmultiwidgeteditor:OFF org.mitk.gui.qt.common.legacy:OFF org.mitk.gui.qt.cmdlinemodules:OFF org.mitk.gui.qt.chartExample:OFF org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.datamanagerlight:OFF org.mitk.gui.qt.datastorageviewertest:OFF org.mitk.gui.qt.properties:ON org.mitk.gui.qt.basicimageprocessing:OFF - org.mitk.gui.qt.dicom:OFF + org.mitk.gui.qt.dicombrowser:OFF org.mitk.gui.qt.dicominspector: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.lasercontrol: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.aicpregistration:OFF org.mitk.gui.qt.renderwindowmanager:OFF org.mitk.gui.qt.semanticrelations: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.photoacoustics.pausviewer:OFF org.mitk.gui.qt.photoacoustics.pausmotioncompensation:OFF org.mitk.gui.qt.photoacoustics.imageprocessing:OFF org.mitk.gui.qt.photoacoustics.simulation:OFF org.mitk.gui.qt.photoacoustics.spectralunmixing: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.ultrasoundtrackingnavigation: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.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.preprocessing.resampling:OFF org.mitk.gui.qt.radiomics:OFF org.mitk.gui.qt.cest:OFF org.mitk.gui.qt.fit.demo:OFF org.mitk.gui.qt.fit.inspector:OFF org.mitk.gui.qt.fit.genericfitting:OFF org.mitk.gui.qt.pharmacokinetics.mri:OFF org.mitk.gui.qt.pharmacokinetics.pet:OFF org.mitk.gui.qt.pharmacokinetics.simulation:OFF org.mitk.gui.qt.pharmacokinetics.curvedescriptor:OFF org.mitk.gui.qt.pharmacokinetics.concentration.mri:OFF org.mitk.gui.qt.flowapplication:OFF org.mitk.gui.qt.flow.segmentation:OFF ) diff --git a/Plugins/org.mitk.gui.qt.dicom/CMakeLists.txt b/Plugins/org.mitk.gui.qt.dicombrowser/CMakeLists.txt similarity index 79% rename from Plugins/org.mitk.gui.qt.dicom/CMakeLists.txt rename to Plugins/org.mitk.gui.qt.dicombrowser/CMakeLists.txt index 9e021c2a81..2939dc3c5c 100644 --- a/Plugins/org.mitk.gui.qt.dicom/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.dicombrowser/CMakeLists.txt @@ -1,28 +1,28 @@ -project(org_mitk_gui_qt_dicom) +project(org_mitk_gui_qt_dicombrowser) # Note: # If we use an installed version of DCMTK then DCMTK_DIR points to the subdirectory # of the installation directory (share/dcmtk) that contains DCMTKConfig.cmake. # Therefore we look for the the storescp command in the '../../bin' directory, too. find_program(DCMTK_STORESCP NAMES storescp storescp${DCMTK_CMAKE_DEBUG_POSTFIX} storescp${CMAKE_DEBUG_POSTFIX} PATHS "${MITK_EXTERNAL_PROJECT_PREFIX}/bin" PATH_SUFFIXES Release Debug DOC "Dcmtk storage provider which is used to store dicom files which are transfered over network." NO_DEFAULT_PATH ) mark_as_advanced(DCMTK_STORESCP) if(NOT EXISTS ${DCMTK_STORESCP}) message(WARNING "Couldn't find program storescp: Query/retrieve of the DICOM plugin won't work!") else() - configure_file( org_mitk_gui_qt_dicom_config.h.in org_mitk_gui_qt_dicom_config.h @ONLY) + configure_file( org_mitk_gui_qt_dicombrowser_config.h.in org_mitk_gui_qt_dicombrowser_config.h @ONLY) MITK_INSTALL_HELPER_APP(EXECUTABLES ${DCMTK_STORESCP}) mitk_create_plugin( EXPORT_DIRECTIVE DICOM_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkContourModel MitkQtWidgetsExt MitkDicomUI MitkDicomRT MitkRTUI MitkDICOMReader + MODULE_DEPENDS MitkContourModel MitkQtWidgetsExt MitkDICOMUI MitkRT MitkRTUI MitkDICOM ) endif() diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom.dox b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom.dox similarity index 99% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom.dox rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom.dox index 136c56e93d..233ac4a5fb 100644 --- a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom.dox +++ b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom.dox @@ -1,118 +1,118 @@ /** -\page org_mitk_gui_qt_dicom The Dicom Plugin +\page org_mitk_editors_dicombrowser The Dicom Browser Plugin \imageMacro{dicom.svg,"Icon of the DICOM Plugin",2.00} \note This article requires a basic knowledge of the DICOM Standard. \tableofcontents \section org_mitk_gui_qt_dicomOverview Overview The DICOM editor is an experimental editor which allows for loading of DICOM images as well as server communication. It features a highly experimental query/retrieve (you need to configure your PACS correspondingly) as well as a DICOM browser. The DICOM browser allows you to navigate the DICOM folder/cd depending on its metadata (patient/study/series) and import selected series for viewing in your MITK based application. It also allows you to store your dicom data in an internal database so you can easily access often used dicom images. It is based on the commonTK (CTK) DICOM funcionality. \section org_mitk_gui_qt_dicomDataHandling Data handling \imageMacro{QmitkDicom_PluginControls.png,"The dicom Plugin controls",7.37} In the image above you see the start page of the dicom plugin. On top of the start page you see four buttons. The Local Storage, the Import CD, the Import Folder and the Query Retrieve button. If you press one of these buttons, the dicom plugin will switch to your local dicom image storage or will start importing dicom images from CD or a folder on your hard drive or it will open the query retrieve screen.
  • Click the 'Local Storage' button to open the local storage screen.
  • Click the 'Import CD' button to import DICOM data from a CD.
  • Click the 'Import Folder' button to import DICOM date from a directory.
  • Click the 'Query Retrieve' button to open the query retrieve screen.
\subsection org_mitk_gui_qt_dicomStorage Data storage \imageMacro{QmitkDicom_PluginExtended.png,"The DICOM data storage",16.00} If you open the dicom plugin the dicom data storage will be displayed. You are able to see all your stored dicom image data. You can browse your data by clicking on the left arrow beside the name of your data. There are three levels available. The first level is the patient level where you can see the patient data. On the second level you can see the dicom studies for the patient. on the third level you can see all available series refering to it's study. You can delete the data by selecting it and pressing the delete button. Be careful if you have selected a patient or a study all refering data be deleted. So if you delete a patient the patient and all studies and series refered to the patient will be deleted. If you delete a study all series of the study will be deleted. If you want to view the dicom data you have to select a series and click on the View button. The data will appear in the DataManager and will be dispayed. \imageMacro{QmitkDicom_DisplayDataManager.png,"Viewed image",16.00}
  • Click on the arrow on the left of your data to expand or hide dicom data levels.
  • Click the 'Delete' button to delete selected DICOM data.
  • Click the 'View' button to view DICOM data.
\subsection org_mitk_gui_qt_dicomImport Data import \imageMacro{QmitkDicom_ImportDialog.png,"The import dialog checked",9.53} There are two diffrent ways to import DICOM data. The First one is to directly imort it into your DICOM data storage. To achieve this you should toggle the checkbox 'Copy on import'. The second approach is, to have a look at the data first before importing it. To do that you simply don't check 'Copy on import'. This will leed you to the leed you to the 'External Dicom Data' screen which provides you a preview of the data containing in youre choosen folder. You can import the data here by selecting it and pressing the 'Download' button. It is also possible to view DICOM series directly in Mitk by selecting it here and pressing the 'View' button.
  • Click 'Import Folder' or 'Import CD' button to open the import dialog.
    • Enable the 'Copy on import' checkbox and choose a folder to import into data storage directly.
    • Disable the 'Copy on import' checkbox to get to the 'External Dicom Data' screen.
      • Click on the arrow on the left of your data to expand or hide dicom data levels.
      • Click the 'Download' button to download selected DICOM data to your DICOM data storage.
      • Click the 'View' button to view DICOM data.
\section org_mitk_gui_qt_dicomQueryRetrieve Query/Retrieve \warning This plugin is experimental and not all of the described features behave as expected. \note The query retrieve plugin only works if the PACS you are calling knows your machine settings. There are also issues when you are running a firewall. The query retrieve workflow allows you to get DICOM data from a server. \imageMacro{QmitkDicom_QueryRetrieve.png,"The query retrieve screen",16.00} \subsection org_mitk_gui_qt_dicomQuery Query \imageMacro{QmitkDicom_Nodes.png,"The DICOM network configuration",11.26} By performing a DICOM query you will ask a server for it's DICOM data. This requires to setup the DICOM network configuration of your system and the server. By clicking on 'Add Server' a new plain server field will appear. Now you can give it a name of your choice. Fill the servers "DICOM name" the AETitle. Type in it's url, it's port and the specific DICOM protocoll you want to use for image transfer. \note I recommend not to use CGET because most of the PACS systems (Image Servers) don't support that protocoll. You can configure the DICOM network configuration of your machine by editing the 'Calling AETiltle', the 'Storage AETitle' and The 'Storage Port' text fields. But normaly you don't have to change your configuration. \imageMacro{QmitkDicom_FilterWidget.png,"The DICOM search options",3.66} After you have finished your network configuration and before you start the query you should use the 'Search Options' to specify your query. Otherwise all data on the server will be queried and you will have to wait for a long time. You can specify your query by searching for a specific patient name or a study or a serie or a specific DICOM object by it's id. You are allowed to include or exclude DICOM modalities from your query and you can specify a specific time in which the DICOM images you are searching fo might been captured. When you finished that you can click the query button and the queried DICOM data will appear.
  • Click on the 'Add Server' button.
    • Edit 'Name' field.
    • Edit 'AETitle' field.
    • Edit 'Adress' field.
    • Edit 'Port' field.
  • Set search options.
  • Click on 'Query' button.
\subsection org_mitk_gui_qt_dicomRetrieve Retrieve \imageMacro{QmitkDicom_Retrieve.png,"The queried DICOM data.",15.22} After the query you are able to select the queried data and click the 'Retrieve' button. This will store the queried DICOM data into your DICOM storage. Click on the 'Local Storage' button and work with your new data.
  • Click on the 'Retrieve' button to retrieve the data to your DICOM storage.
  • Click on the 'Local Storage' button.
*/ diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_DisplayDataManager.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_DisplayDataManager.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_DisplayDataManager.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_DisplayDataManager.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_ExternalView.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_ExternalView.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_ExternalView.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_ExternalView.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_FilterWidget.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_FilterWidget.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_FilterWidget.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_FilterWidget.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Icon.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Icon.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Icon.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Icon.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_ImportDialog.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_ImportDialog.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_ImportDialog.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_ImportDialog.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Nodes.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Nodes.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Nodes.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Nodes.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Plugin.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Plugin.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Plugin.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Plugin.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_PluginControls.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_PluginControls.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_PluginControls.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_PluginControls.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_PluginExtended.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_PluginExtended.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_PluginExtended.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_PluginExtended.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_QueryRetrieve.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_QueryRetrieve.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_QueryRetrieve.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_QueryRetrieve.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Retrieve.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Retrieve.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/QmitkDicom_Retrieve.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/QmitkDicom_Retrieve.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/Queried.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/Queried.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/Queried.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/Queried.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/StartDicomPlugin.png b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/StartDicomPlugin.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/StartDicomPlugin.png rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/StartDicomPlugin.png diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/dicom.svg b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/dicom.svg similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/documentation/UserManual/dicom.svg rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/UserManual/dicom.svg diff --git a/Plugins/org.mitk.gui.qt.dicom/documentation/doxygen/modules.dox b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/doxygen/modules.dox similarity index 55% rename from Plugins/org.mitk.gui.qt.dicom/documentation/doxygen/modules.dox rename to Plugins/org.mitk.gui.qt.dicombrowser/documentation/doxygen/modules.dox index 729ff70cb9..a2b304e8b5 100644 --- a/Plugins/org.mitk.gui.qt.dicom/documentation/doxygen/modules.dox +++ b/Plugins/org.mitk.gui.qt.dicombrowser/documentation/doxygen/modules.dox @@ -1,16 +1,16 @@ /** - \defgroup org_mitk_gui_qt_dicom org.mitk.gui.qt.dicom Plugin + \defgroup org_mitk_gui_qt_dicombrowser org.mitk.gui.qt.dicombrowser Plugin \ingroup MITKPlugins \brief Describe your plugin here. */ /** - \defgroup org_mitk_gui_qt_dicom_internal Internal - \ingroup org_mitk_gui_qt_dicom + \defgroup org_mitk_gui_qt_dicombrowser_internal Internal + \ingroup org_mitk_gui_qt_dicombrowser - \brief This subcategory includes the internal classes of the org.mitk.gui.qt.dicom plugin. Other + \brief This subcategory includes the internal classes of the org.mitk.gui.qt.dicombrowser 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.dicom/files.cmake b/Plugins/org.mitk.gui.qt.dicombrowser/files.cmake similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/files.cmake rename to Plugins/org.mitk.gui.qt.dicombrowser/files.cmake diff --git a/Plugins/org.mitk.gui.qt.dicom/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.dicombrowser/manifest_headers.cmake similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/manifest_headers.cmake rename to Plugins/org.mitk.gui.qt.dicombrowser/manifest_headers.cmake diff --git a/Plugins/org.mitk.gui.qt.dicom/org_mitk_gui_qt_dicom_config.h.in b/Plugins/org.mitk.gui.qt.dicombrowser/org_mitk_gui_qt_dicombrowser_config.h.in similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/org_mitk_gui_qt_dicom_config.h.in rename to Plugins/org.mitk.gui.qt.dicombrowser/org_mitk_gui_qt_dicombrowser_config.h.in diff --git a/Plugins/org.mitk.gui.qt.dicom/plugin.xml b/Plugins/org.mitk.gui.qt.dicombrowser/plugin.xml similarity index 94% rename from Plugins/org.mitk.gui.qt.dicom/plugin.xml rename to Plugins/org.mitk.gui.qt.dicombrowser/plugin.xml index 45decdc1a2..4af1935280 100644 --- a/Plugins/org.mitk.gui.qt.dicom/plugin.xml +++ b/Plugins/org.mitk.gui.qt.dicombrowser/plugin.xml @@ -1,20 +1,20 @@ diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/dicom.qrc b/Plugins/org.mitk.gui.qt.dicombrowser/resources/dicom.qrc similarity index 86% rename from Plugins/org.mitk.gui.qt.dicom/resources/dicom.qrc rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/dicom.qrc index bc4edfb70a..88a2ec4c62 100644 --- a/Plugins/org.mitk.gui.qt.dicom/resources/dicom.qrc +++ b/Plugins/org.mitk.gui.qt.dicombrowser/resources/dicom.qrc @@ -1,12 +1,12 @@ - + drive-harddisk_32.png import_32.png network-workgroup_32.png network-idle_16.png network-offline_16.png network-error_16.png viewIcon.png folder_32.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/dicom.svg b/Plugins/org.mitk.gui.qt.dicombrowser/resources/dicom.svg similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/dicom.svg rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/dicom.svg diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/drive-harddisk_32.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/drive-harddisk_32.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/drive-harddisk_32.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/drive-harddisk_32.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/folder_32.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/folder_32.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/folder_32.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/folder_32.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/import_32.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/import_32.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/import_32.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/import_32.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/network-error_16.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/network-error_16.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/network-error_16.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/network-error_16.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/network-idle_16.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/network-idle_16.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/network-idle_16.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/network-idle_16.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/network-offline_16.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/network-offline_16.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/network-offline_16.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/network-offline_16.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/network-receive_16.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/network-receive_16.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/network-receive_16.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/network-receive_16.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/network-transmit-receive_16.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/network-transmit-receive_16.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/network-transmit-receive_16.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/network-transmit-receive_16.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/network-transmit_16.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/network-transmit_16.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/network-transmit_16.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/network-transmit_16.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/network-workgroup_32.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/network-workgroup_32.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/network-workgroup_32.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/network-workgroup_32.png diff --git a/Plugins/org.mitk.gui.qt.dicom/resources/viewIcon.png b/Plugins/org.mitk.gui.qt.dicombrowser/resources/viewIcon.png similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/resources/viewIcon.png rename to Plugins/org.mitk.gui.qt.dicombrowser/resources/viewIcon.png diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/DicomEventHandler.cpp similarity index 97% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/DicomEventHandler.cpp index e253097e87..ac03ea8e63 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.cpp +++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/DicomEventHandler.cpp @@ -1,266 +1,266 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "mitkPluginActivator.h" #include "DicomEventHandler.h" #include #include #include #include #include #include #include #include #include #include "mitkImage.h" #include #include -#include +#include #include #include #include #include #include #include #include "mitkBaseDICOMReaderService.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace { mitk::IFileReader* GetReader(mitk::FileReaderRegistry& readerRegistry, const mitk::CustomMimeType& mimeType) { try { return readerRegistry.GetReaders(mitk::MimeType(mimeType, -1, -1)).at(0); } catch (const std::out_of_range&) { mitkThrow() << "Cannot find " << mimeType.GetCategory() << " " << mimeType.GetComment() << " file reader."; } } } DicomEventHandler::DicomEventHandler() { } DicomEventHandler::~DicomEventHandler() { } void DicomEventHandler::OnSignalAddSeriesToDataManager(const ctkEvent& ctkEvent) { QStringList listOfFilesForSeries; listOfFilesForSeries = ctkEvent.getProperty("FilesForSeries").toStringList(); if (!listOfFilesForSeries.isEmpty()) { //for rt data, if the modality tag isn't defined or is "CT" the image is handled like before if(ctkEvent.containsProperty("Modality") && (ctkEvent.getProperty("Modality").toString().compare("RTDOSE",Qt::CaseInsensitive) == 0 || ctkEvent.getProperty("Modality").toString().compare("RTSTRUCT",Qt::CaseInsensitive) == 0 || ctkEvent.getProperty("Modality").toString().compare("RTPLAN", Qt::CaseInsensitive) == 0)) { QString modality = ctkEvent.getProperty("Modality").toString(); mitk::FileReaderRegistry readerRegistry; if(modality.compare("RTDOSE",Qt::CaseInsensitive) == 0) { - auto doseReader = GetReader(readerRegistry, mitk::DicomRTMimeTypes::DICOMRT_DOSE_MIMETYPE()); + auto doseReader = GetReader(readerRegistry, mitk::DICOMRTMimeTypes::DICOMRT_DOSE_MIMETYPE()); doseReader->SetInput(ImporterUtil::getUTF8String(listOfFilesForSeries.front())); std::vector > readerOutput = doseReader->Read(); if (!readerOutput.empty()){ mitk::Image::Pointer doseImage = dynamic_cast(readerOutput.at(0).GetPointer()); mitk::DataNode::Pointer doseImageNode = mitk::DataNode::New(); doseImageNode->SetData(doseImage); doseImageNode->SetName("RTDose"); if (doseImage != nullptr) { std::string sopUID; if (mitk::GetBackwardsCompatibleDICOMProperty(0x0008, 0x0016, "dicomseriesreader.SOPClassUID", doseImage->GetPropertyList(), sopUID)) { doseImageNode->SetName(sopUID); }; berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService(); berry::IPreferences::Pointer prefNode = prefService->GetSystemPreferences()->Node(mitk::RTUIConstants::ROOT_DOSE_VIS_PREFERENCE_NODE_ID.c_str()); if (prefNode.IsNull()) { mitkThrow() << "Error in preference interface. Cannot find preset node under given name. Name: " << prefNode->ToString().toStdString(); } //set some specific colorwash and isoline properties bool showColorWashGlobal = prefNode->GetBool(mitk::RTUIConstants::GLOBAL_VISIBILITY_COLORWASH_ID.c_str(), true); //Set reference dose property double referenceDose = prefNode->GetDouble(mitk::RTUIConstants::REFERENCE_DOSE_ID.c_str(), mitk::RTUIConstants::DEFAULT_REFERENCE_DOSE_VALUE); mitk::ConfigureNodeAsDoseNode(doseImageNode, mitk::GenerateIsoLevels_Virtuos(), referenceDose, showColorWashGlobal); ctkServiceReference serviceReference = mitk::PluginActivator::getContext()->getServiceReference(); mitk::IDataStorageService* storageService = mitk::PluginActivator::getContext()->getService(serviceReference); mitk::DataStorage* dataStorage = storageService->GetDefaultDataStorage().GetPointer()->GetDataStorage(); dataStorage->Add(doseImageNode); mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(dataStorage); } }//END DOSE } else if(modality.compare("RTSTRUCT",Qt::CaseInsensitive) == 0) { - auto structReader = GetReader(readerRegistry, mitk::DicomRTMimeTypes::DICOMRT_STRUCT_MIMETYPE()); + auto structReader = GetReader(readerRegistry, mitk::DICOMRTMimeTypes::DICOMRT_STRUCT_MIMETYPE()); structReader->SetInput(ImporterUtil::getUTF8String(listOfFilesForSeries.front())); std::vector > readerOutput = structReader->Read(); if (readerOutput.empty()){ MITK_ERROR << "No structure sets were created" << endl; } else { std::vector modelVector; ctkServiceReference serviceReference = mitk::PluginActivator::getContext()->getServiceReference(); mitk::IDataStorageService* storageService = mitk::PluginActivator::getContext()->getService(serviceReference); mitk::DataStorage* dataStorage = storageService->GetDefaultDataStorage().GetPointer()->GetDataStorage(); for (const auto& aStruct : readerOutput){ mitk::ContourModelSet::Pointer countourModelSet = dynamic_cast(aStruct.GetPointer()); mitk::DataNode::Pointer structNode = mitk::DataNode::New(); structNode->SetData(countourModelSet); structNode->SetProperty("name", aStruct->GetProperty("name")); structNode->SetProperty("color", aStruct->GetProperty("contour.color")); structNode->SetProperty("contour.color", aStruct->GetProperty("contour.color")); structNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false)); structNode->SetVisibility(true, mitk::BaseRenderer::GetInstance( mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget0"))); structNode->SetVisibility(false, mitk::BaseRenderer::GetInstance( mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget1"))); structNode->SetVisibility(false, mitk::BaseRenderer::GetInstance( mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget2"))); structNode->SetVisibility(true, mitk::BaseRenderer::GetInstance( mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget3"))); dataStorage->Add(structNode); } mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(dataStorage); } } else if (modality.compare("RTPLAN", Qt::CaseInsensitive) == 0) { - auto planReader = GetReader(readerRegistry, mitk::DicomRTMimeTypes::DICOMRT_PLAN_MIMETYPE()); + auto planReader = GetReader(readerRegistry, mitk::DICOMRTMimeTypes::DICOMRT_PLAN_MIMETYPE()); planReader->SetInput(ImporterUtil::getUTF8String(listOfFilesForSeries.front())); std::vector > readerOutput = planReader->Read(); if (!readerOutput.empty()){ //there is no image, only the properties are interesting mitk::Image::Pointer planDummyImage = dynamic_cast(readerOutput.at(0).GetPointer()); mitk::DataNode::Pointer planImageNode = mitk::DataNode::New(); planImageNode->SetData(planDummyImage); planImageNode->SetName("RTPlan"); ctkServiceReference serviceReference = mitk::PluginActivator::getContext()->getServiceReference(); mitk::IDataStorageService* storageService = mitk::PluginActivator::getContext()->getService(serviceReference); mitk::DataStorage* dataStorage = storageService->GetDefaultDataStorage().GetPointer()->GetDataStorage(); dataStorage->Add(planImageNode); } } } else { mitk::StringList seriesToLoad; QStringListIterator it(listOfFilesForSeries); while (it.hasNext()) { seriesToLoad.push_back(ImporterUtil::getUTF8String(it.next())); } //Get Reference for default data storage. ctkServiceReference serviceReference = mitk::PluginActivator::getContext()->getServiceReference(); mitk::IDataStorageService* storageService = mitk::PluginActivator::getContext()->getService(serviceReference); mitk::DataStorage* dataStorage = storageService->GetDefaultDataStorage().GetPointer()->GetDataStorage(); std::vector baseDatas = mitk::IOUtil::Load(seriesToLoad.front()); for (const auto &data : baseDatas) { mitk::DataNode::Pointer node = mitk::DataNode::New(); node->SetData(data); std::string nodeName = mitk::DataNode::NO_NAME_VALUE(); auto nameDataProp = data->GetProperty("name"); if (nameDataProp.IsNotNull()) { //if data has a name property set by reader, use this name nodeName = nameDataProp->GetValueAsString(); } else { //reader didn't specify a name, generate one. nodeName = mitk::GenerateNameFromDICOMProperties(node); } node->SetName(nodeName); dataStorage->Add(node); } } } else { MITK_INFO << "There are no files for the current series"; } } void DicomEventHandler::OnSignalRemoveSeriesFromStorage(const ctkEvent& /*ctkEvent*/) { } void DicomEventHandler::SubscribeSlots() { ctkServiceReference ref = mitk::PluginActivator::getContext()->getServiceReference(); if (ref) { ctkEventAdmin* eventAdmin = mitk::PluginActivator::getContext()->getService(ref); ctkDictionary properties; properties[ctkEventConstants::EVENT_TOPIC] = "org/mitk/gui/qt/dicom/ADD"; eventAdmin->subscribeSlot(this, SLOT(OnSignalAddSeriesToDataManager(ctkEvent)), properties); properties[ctkEventConstants::EVENT_TOPIC] = "org/mitk/gui/qt/dicom/DELETED"; eventAdmin->subscribeSlot(this, SLOT(OnSignalRemoveSeriesFromStorage(ctkEvent)), properties); } } diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/DicomEventHandler.h similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/DicomEventHandler.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/DicomEventHandler.h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.cpp similarity index 97% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.cpp index c3fdd56d9d..b139f22536 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.cpp +++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.cpp @@ -1,193 +1,193 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ // Qmitk #include "QmitkDicomBrowser.h" #include "mitkPluginActivator.h" #include "berryIQtPreferencePage.h" #include #include #include #include const std::string QmitkDicomBrowser::EDITOR_ID = "org.mitk.editors.dicombrowser"; const QString QmitkDicomBrowser::TEMP_DICOM_FOLDER_SUFFIX="TmpDicomFolder"; QmitkDicomBrowser::QmitkDicomBrowser() : m_DicomDirectoryListener(new QmitkDicomDirectoryListener()) , m_StoreSCPLauncher(new QmitkStoreSCPLauncher(&m_Builder)) , m_Publisher(new QmitkDicomDataEventPublisher()) { } QmitkDicomBrowser::~QmitkDicomBrowser() { delete m_DicomDirectoryListener; delete m_StoreSCPLauncher; delete m_Handler; delete m_Publisher; } void QmitkDicomBrowser::CreateQtPartControl(QWidget *parent ) { m_Controls.setupUi( parent ); m_Controls.StoreSCPStatusLabel->setTextFormat(Qt::RichText); - m_Controls.StoreSCPStatusLabel->setText(""); + m_Controls.StoreSCPStatusLabel->setText(""); TestHandler(); OnPreferencesChanged(nullptr); CreateTemporaryDirectory(); StartDicomDirectoryListener(); m_Controls.m_ctkDICOMQueryRetrieveWidget->useProgressDialog(true); connect(m_Controls.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(OnTabChanged(int))); connect(m_Controls.externalDataWidget,SIGNAL(SignalStartDicomImport(const QStringList&)), m_Controls.internalDataWidget,SLOT(OnStartDicomImport(const QStringList&))); connect(m_Controls.externalDataWidget,SIGNAL(SignalDicomToDataManager(const QHash&)), this,SLOT(OnViewButtonAddToDataManager(const QHash&))); connect(m_Controls.internalDataWidget,SIGNAL(SignalFinishedImport()),this, SLOT(OnDicomImportFinished())); connect(m_Controls.internalDataWidget,SIGNAL(SignalDicomToDataManager(const QHash&)), this,SLOT(OnViewButtonAddToDataManager(const QHash&))); } void QmitkDicomBrowser::Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) { this->SetSite(site); this->SetInput(input); } void QmitkDicomBrowser::SetFocus() { } berry::IPartListener::Events::Types QmitkDicomBrowser::GetPartEventTypes() const { return Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void QmitkDicomBrowser::OnTabChanged(int page) { if (page == 2)//Query/Retrieve is selected { QString storagePort = m_Controls.m_ctkDICOMQueryRetrieveWidget->getServerParameters()["StoragePort"].toString(); QString storageAET = m_Controls.m_ctkDICOMQueryRetrieveWidget->getServerParameters()["StorageAETitle"].toString(); if(!((m_Builder.GetAETitle()->compare(storageAET,Qt::CaseSensitive)==0)&& (m_Builder.GetPort()->compare(storagePort,Qt::CaseSensitive)==0))) { StopStoreSCP(); StartStoreSCP(); } } } void QmitkDicomBrowser::OnDicomImportFinished() { m_Controls.tabWidget->setCurrentIndex(0); } void QmitkDicomBrowser::StartDicomDirectoryListener() { m_DicomDirectoryListener->SetDicomListenerDirectory(m_TempDirectory); m_DicomDirectoryListener->SetDicomFolderSuffix(TEMP_DICOM_FOLDER_SUFFIX); connect(m_DicomDirectoryListener, SIGNAL(SignalStartDicomImport(const QStringList&)), m_Controls.internalDataWidget, SLOT(OnStartDicomImport(const QStringList&)), Qt::DirectConnection); } void QmitkDicomBrowser::TestHandler() { m_Handler = new DicomEventHandler(); m_Handler->SubscribeSlots(); } void QmitkDicomBrowser::OnViewButtonAddToDataManager(QHash eventProperties) { ctkDictionary properties; // properties["PatientName"] = eventProperties["PatientName"]; // properties["StudyUID"] = eventProperties["StudyUID"]; // properties["StudyName"] = eventProperties["StudyName"]; // properties["SeriesUID"] = eventProperties["SeriesUID"]; // properties["SeriesName"] = eventProperties["SeriesName"]; properties["FilesForSeries"] = eventProperties["FilesForSeries"]; if(eventProperties.contains("Modality")) { properties["Modality"] = eventProperties["Modality"]; } m_Publisher->PublishSignals(mitk::PluginActivator::getContext()); m_Publisher->AddSeriesToDataManagerEvent(properties); } void QmitkDicomBrowser::StartStoreSCP() { QString storagePort = m_Controls.m_ctkDICOMQueryRetrieveWidget->getServerParameters()["StoragePort"].toString(); QString storageAET = m_Controls.m_ctkDICOMQueryRetrieveWidget->getServerParameters()["StorageAETitle"].toString(); m_Builder.AddPort(storagePort)->AddAETitle(storageAET)->AddTransferSyntax()->AddOtherNetworkOptions()->AddMode()->AddOutputDirectory(m_TempDirectory); m_StoreSCPLauncher = new QmitkStoreSCPLauncher(&m_Builder); connect(m_StoreSCPLauncher, SIGNAL(SignalStatusOfStoreSCP(const QString&)), this, SLOT(OnStoreSCPStatusChanged(const QString&))); connect(m_StoreSCPLauncher ,SIGNAL(SignalStartImport(const QStringList&)),m_Controls.internalDataWidget,SLOT(OnStartDicomImport(const QStringList&))); connect(m_StoreSCPLauncher ,SIGNAL(SignalStoreSCPError(const QString&)),m_DicomDirectoryListener,SLOT(OnDicomNetworkError(const QString&)),Qt::DirectConnection); connect(m_StoreSCPLauncher ,SIGNAL(SignalStoreSCPError(const QString&)),this,SLOT(OnDicomNetworkError(const QString&)),Qt::DirectConnection); m_StoreSCPLauncher->StartStoreSCP(); } void QmitkDicomBrowser::OnStoreSCPStatusChanged(const QString& status) { - m_Controls.StoreSCPStatusLabel->setText(" "+status); + m_Controls.StoreSCPStatusLabel->setText(" "+status); } void QmitkDicomBrowser::OnDicomNetworkError(const QString& status) { - m_Controls.StoreSCPStatusLabel->setText(" "+status); + m_Controls.StoreSCPStatusLabel->setText(" "+status); } void QmitkDicomBrowser::StopStoreSCP() { delete m_StoreSCPLauncher; } void QmitkDicomBrowser::SetPluginDirectory() { m_PluginDirectory = mitk::PluginActivator::getContext()->getDataFile("").absolutePath(); m_PluginDirectory.append("/database"); } void QmitkDicomBrowser::CreateTemporaryDirectory() { QDir tmp; QString tmpPath = QDir::tempPath(); m_TempDirectory.clear(); m_TempDirectory.append(tmpPath); m_TempDirectory.append(QString("/")); m_TempDirectory.append(TEMP_DICOM_FOLDER_SUFFIX); m_TempDirectory.append(QString(".")); m_TempDirectory.append(QTime::currentTime().toString("hhmmsszzz")); m_TempDirectory.append(QString::number(QCoreApplication::applicationPid())); tmp.mkdir(QDir::toNativeSeparators( m_TempDirectory )); } void QmitkDicomBrowser::OnPreferencesChanged(const berry::IBerryPreferences*) { SetPluginDirectory(); berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService(); m_DatabaseDirectory = prefService->GetSystemPreferences()->Node("/org.mitk.views.dicomreader")->Get("default dicom path", m_PluginDirectory); m_Controls.internalDataWidget->SetDatabaseDirectory(m_DatabaseDirectory); } diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h similarity index 98% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h index 212073f403..9dbcc2d139 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowser.h +++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h @@ -1,145 +1,145 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QmitkDicomBrowser_h #define QmitkDicomBrowser_h // Blueberry #include #include #include #include // MITK #include "DicomEventHandler.h" #include "QmitkDicomDataEventPublisher.h" #include "QmitkDicomDirectoryListener.h" #include "QmitkStoreSCPLauncher.h" #include "QmitkStoreSCPLauncherBuilder.h" #include "ui_QmitkDicomBrowserControls.h" -#include +#include // Qt #include #include #include #include #include /** * \brief QmitkDicomBrowser is an editor providing functionality for dicom storage and import and query retrieve functionality. * * \sa berry::IPartListener * \ingroup ${plugin_target}_internal */ class DICOM_EXPORT QmitkDicomBrowser : public berry::QtEditorPart, virtual public berry::IPartListener { // 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: berryObjectMacro(QmitkDicomBrowser); static const std::string EDITOR_ID; static const QString TEMP_DICOM_FOLDER_SUFFIX; /** * \brief QmitkDicomBrowser constructor. */ QmitkDicomBrowser(); /** * \brief QmitkDicomBrowser destructor. */ ~QmitkDicomBrowser() override; /** * \brief Init initialize the editor. */ void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override; void SetFocus() override; void DoSave() override {} void DoSaveAs() override {} bool IsDirty() const override { return false; } bool IsSaveAsAllowed() const override { return false; } virtual void OnPreferencesChanged(const berry::IBerryPreferences* prefs); signals: /** * \brief SignalStartDicomImport is enitted when dicom directory for import was selected. */ void SignalStartDicomImport(const QString&); protected slots: /// \brief Called when import is finished. void OnDicomImportFinished(); /// \brief Called when Query Retrieve or Import Folder was clicked. void OnTabChanged(int); /// \brief Called when view button is clicked. Sends out an event for adding the current selected file to the mitkDataStorage. void OnViewButtonAddToDataManager(QHash eventProperties); /// \brief Called when status of dicom storage provider changes. void OnStoreSCPStatusChanged(const QString& status); /// \brief Called when dicom storage provider emits a network error. void OnDicomNetworkError(const QString& status); protected: /// \brief StartStoreSCP starts dicom storage provider. void StartStoreSCP(); /// \brief StopStoreSCP stops dicom storage provider. void StopStoreSCP(); /// \brief TestHandler initializes event handler. void TestHandler(); /// \brief CreateTemporaryDirectory creates temporary directory in which temorary dicom objects are stored. void CreateTemporaryDirectory(); /// \brief StartDicomDirectoryListener starts dicom directory listener. void StartDicomDirectoryListener(); /** * \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomBrowserControls.h. * * \param parent is a pointer to the parent widget */ void CreateQtPartControl(QWidget *parent) override; /// \brief SetPluginDirectory Sets plugin directory. void SetPluginDirectory(); Events::Types GetPartEventTypes() const override; ctkFileDialog* m_ImportDialog; Ui::QmitkDicomBrowserControls m_Controls; QmitkDicomDirectoryListener* m_DicomDirectoryListener; QmitkStoreSCPLauncherBuilder m_Builder; QmitkStoreSCPLauncher* m_StoreSCPLauncher; DicomEventHandler* m_Handler; QmitkDicomDataEventPublisher* m_Publisher; QString m_PluginDirectory; QString m_TempDirectory; QString m_DatabaseDirectory; }; #endif // QmitkDicomBrowser_h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowserControls.ui b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowserControls.ui similarity index 95% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowserControls.ui rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowserControls.ui index ff5b4f3dc5..d8a12ed7a6 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomBrowserControls.ui +++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowserControls.ui @@ -1,307 +1,307 @@ QmitkDicomBrowserControls 0 0 752 696 0 0 0 0 false QmitkTemplate true 0 0 738 682 0 0 true 0 0 QTabWidget::North QTabWidget::Rounded 1 32 32 0 0 - :/org.mitk.gui.qt.dicom/drive-harddisk_32.png:/org.mitk.gui.qt.dicom/drive-harddisk_32.png + :/org.mitk.gui.qt.dicombrowser/drive-harddisk_32.png:/org.mitk.gui.qt.dicombrowser/drive-harddisk_32.png Local Storage Manage your local dicom imports 0 0 0 0 - :/org.mitk.gui.qt.dicom/import_32.png - :/org.mitk.gui.qt.dicom/import_32.png:/org.mitk.gui.qt.dicom/import_32.png + :/org.mitk.gui.qt.dicombrowser/import_32.png + :/org.mitk.gui.qt.dicombrowser/import_32.png:/org.mitk.gui.qt.dicombrowser/import_32.png Import Import dicom data from any hard drive 0 0 0 0 - :/org.mitk.gui.qt.dicom/network-workgroup_32.png:/org.mitk.gui.qt.dicom/network-workgroup_32.png + :/org.mitk.gui.qt.dicombrowser/network-workgroup_32.png:/org.mitk.gui.qt.dicombrowser/network-workgroup_32.png Query Retrieve Query and retrieve dicom data from server 0 0 color: rgb(255, 0, 0); Warning: This is currently an experimental feature! 0 0 0 0 QFrame::StyledPanel QFrame::Raised 0 0 Qt::Horizontal QSizePolicy::Minimum 4 20 0 0 Qt::RichText Qt::Horizontal 40 20 Qt::Vertical 20 40 ctkDICOMQueryRetrieveWidget QWidget
ctkDICOMQueryRetrieveWidget.h
1
QmitkDicomLocalStorageWidget QWidget
QmitkDicomLocalStorageWidget.h
1
QmitkDicomExternalDataWidget QWidget
QmitkDicomExternalDataWidget.h
1
OnChangePage(int)
diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.cpp diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.h similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDataEventPublisher.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.cpp diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomDirectoryListener.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.cpp diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.h similarity index 97% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.h index 9e16364ea8..e8d151975f 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkDicomPreferencePage.h +++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.h @@ -1,71 +1,71 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QmitkDicomPreferencePage_h #define QmitkDicomPreferencePage_h #include #include #include "berryIQtPreferencePage.h" -#include +#include #include class QWidget; class QCheckBox; class QLineEdit; class QPushButton; class DICOM_EXPORT QmitkDicomPreferencePage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkDicomPreferencePage(); ~QmitkDicomPreferencePage() override; void Init(berry::IWorkbench::Pointer workbench) override; void CreateQtControl(QWidget* widget) override; QWidget* GetQtControl() const override; /// /// \see IPreferencePage::PerformOk() /// bool PerformOk() override; /// /// \see IPreferencePage::PerformCancel() /// void PerformCancel() override; /// /// \see IPreferencePage::Update() /// void Update() override; protected: QWidget* m_MainControl; berry::IPreferences::Pointer m_DicomPreferencesNode; QLineEdit* m_PathEdit; QPushButton* m_PathSelect; QPushButton* m_PathDefault; protected slots: void DefaultButtonPushed(); void PathSelectButtonPushed(); }; #endif // QmitkQmitkDicomPreferencePage_h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.cpp similarity index 99% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.cpp index d632bb6237..d295cdf7df 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.cpp +++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.cpp @@ -1,199 +1,199 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "QmitkStoreSCPLauncher.h" #include #include #include #include #include #include #include #include #include #include #include -#include "org_mitk_gui_qt_dicom_config.h" +#include "org_mitk_gui_qt_dicombrowser_config.h" QmitkStoreSCPLauncher::QmitkStoreSCPLauncher(QmitkStoreSCPLauncherBuilder* builder) : m_StoreSCP(new QProcess()) { m_StoreSCP->setProcessChannelMode(QProcess::MergedChannels); connect( m_StoreSCP, SIGNAL(error(QProcess::ProcessError)),this, SLOT(OnProcessError(QProcess::ProcessError))); connect( m_StoreSCP, SIGNAL(stateChanged(QProcess::ProcessState)),this, SLOT(OnStateChanged(QProcess::ProcessState))); connect( m_StoreSCP, SIGNAL(readyReadStandardOutput()),this, SLOT(OnReadyProcessOutput())); SetArgumentList(builder); } QmitkStoreSCPLauncher::~QmitkStoreSCPLauncher() { disconnect( m_StoreSCP, SIGNAL(error(QProcess::ProcessError)),this, SLOT(OnProcessError(QProcess::ProcessError))); disconnect( m_StoreSCP, SIGNAL(stateChanged(QProcess::ProcessState)),this, SLOT(OnStateChanged(QProcess::ProcessState))); disconnect( m_StoreSCP, SIGNAL(readyReadStandardOutput()),this, SLOT(OnReadyProcessOutput())); m_StoreSCP->close(); m_StoreSCP->waitForFinished(1000); delete m_StoreSCP; } void QmitkStoreSCPLauncher::StartStoreSCP() { FindPathToStoreSCP(); m_StoreSCP->start(m_PathToStoreSCP,m_ArgumentList); } void QmitkStoreSCPLauncher::FindPathToStoreSCP() { QString appPath= QCoreApplication::applicationDirPath(); if(m_PathToStoreSCP.isEmpty()) { QString fileName; #ifdef _WIN32 fileName = "/storescp.exe"; #else fileName = "/storescp"; #endif m_PathToStoreSCP = appPath + fileName; //In developement the storescp isn't copied into bin directory if(!QFile::exists(m_PathToStoreSCP)) { m_PathToStoreSCP = static_cast(DCMTK_STORESCP); } } } void QmitkStoreSCPLauncher::OnReadyProcessOutput() { QString out(m_StoreSCP->readAllStandardOutput()); QStringList allDataList,importList; allDataList = out.split("\n",QString::SkipEmptyParts); QStringListIterator it(allDataList); while(it.hasNext()) { QString output = it.next(); if (output.contains("E: ")) { output.replace("E: ",""); m_ErrorText = output; OnProcessError(QProcess::UnknownError); return; } if(output.contains("I: storing DICOM file: ")) { output.replace("I: storing DICOM file: ",""); output.replace("\\", "/"); // cannot handle backslashes output.replace("\r", ""); // cannot handle carriage return importList += output; } } if(!importList.isEmpty()) { emit SignalStartImport(importList); } } void QmitkStoreSCPLauncher::OnProcessError(QProcess::ProcessError err) { switch(err) { case QProcess::FailedToStart: m_ErrorText.prepend("Failed to start storage provider: "); m_ErrorText.append(m_StoreSCP->errorString()); emit SignalStoreSCPError(m_ErrorText); m_ErrorText.clear(); break; case QProcess::Crashed: m_ErrorText.prepend("Storage provider closed: "); m_ErrorText.append(m_StoreSCP->errorString()); emit SignalStoreSCPError(m_ErrorText); m_ErrorText.clear(); break; case QProcess::Timedout: m_ErrorText.prepend("Storage provider timeout: "); m_ErrorText.append(m_StoreSCP->errorString()); emit SignalStoreSCPError(m_ErrorText); m_ErrorText.clear(); break; case QProcess::WriteError: m_ErrorText.prepend("Storage provider write error: "); m_ErrorText.append(m_StoreSCP->errorString()); emit SignalStoreSCPError(m_ErrorText); m_ErrorText.clear(); break; case QProcess::ReadError: m_ErrorText.prepend("Storage provider read error: "); m_ErrorText.append(m_StoreSCP->errorString()); emit SignalStoreSCPError(m_ErrorText); m_ErrorText.clear(); break; case QProcess::UnknownError: m_ErrorText.prepend("Storage provider unknown error: "); m_ErrorText.append(m_StoreSCP->errorString()); emit SignalStoreSCPError(m_ErrorText); m_ErrorText.clear(); break; default: m_ErrorText.prepend("Storage provider unknown error: "); m_ErrorText.append(m_StoreSCP->errorString()); emit SignalStoreSCPError(m_ErrorText); m_ErrorText.clear(); break; } } void QmitkStoreSCPLauncher::OnStateChanged(QProcess::ProcessState status) { switch(status) { case QProcess::NotRunning: m_StatusText.prepend("Storage provider not running!"); emit SignalStatusOfStoreSCP(m_StatusText); m_StatusText.clear(); break; case QProcess::Starting: m_StatusText.prepend("Starting storage provider!"); emit SignalStatusOfStoreSCP(m_StatusText); m_StatusText.clear(); break; case QProcess::Running: m_StatusText.prepend(m_ArgumentList[0]).prepend(" Port: ").prepend(m_ArgumentList[2]).prepend(" AET: ").prepend("Storage provider running! "); emit SignalStatusOfStoreSCP(m_StatusText); m_StatusText.clear(); break; default: m_StatusText.prepend("Storage provider unknown error!"); emit SignalStatusOfStoreSCP(m_StatusText); m_StatusText.clear(); break; } } void QmitkStoreSCPLauncher::SetArgumentList(QmitkStoreSCPLauncherBuilder* builder) { m_ArgumentList << *builder->GetPort() << QString("-aet") <<*builder->GetAETitle() << *builder->GetTransferSyntax() << *builder->GetOtherNetworkOptions() << *builder->GetMode() << QString("-od") << *builder->GetOutputDirectory(); } QString QmitkStoreSCPLauncher::ArgumentListToQString() { QString argumentString; QStringListIterator argumentIterator(m_ArgumentList); while(argumentIterator.hasNext()) { argumentString.append(" "); argumentString.append(argumentIterator.next()); } return argumentString; } diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncher.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncherBuilder.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncherBuilder.cpp diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncherBuilder.h similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/QmitkStoreSCPLauncherBuilder.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncherBuilder.h diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/mitkPluginActivator.cpp b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.cpp similarity index 100% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/mitkPluginActivator.cpp rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.cpp diff --git a/Plugins/org.mitk.gui.qt.dicom/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.h similarity index 93% rename from Plugins/org.mitk.gui.qt.dicom/src/internal/mitkPluginActivator.h rename to Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.h index e68ad3c52e..265b13f26a 100644 --- a/Plugins/org.mitk.gui.qt.dicom/src/internal/mitkPluginActivator.h +++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.h @@ -1,38 +1,38 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKPLUGINACTIVATOR_H #define MITKPLUGINACTIVATOR_H #include namespace mitk { class PluginActivator : public QObject, public ctkPluginActivator { Q_OBJECT - Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_dicom") + Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_dicombrowser") Q_INTERFACES(ctkPluginActivator) public: void start(ctkPluginContext* context) override; void stop(ctkPluginContext* context) override; static ctkPluginContext* getContext(); private: static ctkPluginContext* pluginContext; }; // PluginActivator } #endif // MITKPLUGINACTIVATOR_H diff --git a/Plugins/org.mitk.gui.qt.dicominspector/CMakeLists.txt b/Plugins/org.mitk.gui.qt.dicominspector/CMakeLists.txt index ea55c8d236..48af1ce7c3 100644 --- a/Plugins/org.mitk.gui.qt.dicominspector/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.dicominspector/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_gui_qt_dicominspector) mitk_create_plugin( EXPORT_DIRECTIVE DICOM_INSPECTOR_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkDICOMReader + MODULE_DEPENDS MitkQtWidgetsExt MitkDICOM ) 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 e030b29a58..ef33115567 100644 --- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h +++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h @@ -1,155 +1,155 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef QmitkDicomInspectorView_h #define QmitkDicomInspectorView_h #include "ui_QmitkDicomInspectorViewControls.h" // Blueberry #include -// mitk DICOMReader module +// mitk DICOM module #include #include // mitk gui common plugin #include // mitk gui qt common plugin #include #include /** * @brief View class to inspect all DICOM tags available for the data of a node. */ class QmitkDicomInspectorView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: QmitkDicomInspectorView(); ~QmitkDicomInspectorView() override; static const std::string VIEW_ID; void SetFocus() override { }; void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; protected: void CreateQtPartControl(QWidget* parent) override; /** @brief Initializes and sets the observers that are used to monitor changes in the selected position or time point in order to actualize the view*/ bool InitObservers(); /** @brief Removes all observers of the specific deleted slice navigation controller.*/ void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer); /** @brief Removes all observers of the deletedPart. If null pointer is passed all observers will be removed.*/ void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr); /** @brief Called by the selection widget when the selection has changed.*/ void OnCurrentSelectionChanged(QList nodes); /** @brief Calls OnSliceChangedDelayed so the event isn't triggered multiple times.*/ void OnSliceChanged(); void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/); /** @brief 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(); private Q_SLOTS: /** @brief Updates the current slice and time is correctly displayed.*/ void OnSliceChangedDelayed(); private: void RenderTable(); /** (Re-)initializes the headers of the data table.*/ void UpdateData(); void UpdateLabels(); void SetAsSelectionListener(bool checked); Ui::QmitkDicomInspectorViewControls m_Controls; mitk::IRenderWindowPart* m_RenderWindowPart; std::unique_ptr m_SelectionServiceConnector; /** 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 ObserverMapType; ObserverMapType m_ObserverMap; /** @brief Currently selected node for the DICOM information.*/ mitk::DataNode::ConstPointer m_SelectedNode; /** @brief Base data of the currently selected node.*/ mitk::BaseData::ConstPointer m_SelectedData; /** @brief Valid selected position in the inspector.*/ mitk::Point3D m_SelectedPosition; /** @brief Indicates if the currently selected position is valid for the currently selected data.*/ bool m_ValidSelectedPosition; mitk::TimePointType m_SelectedTimePoint; itk::IndexValueType m_CurrentSelectedZSlice; /*************************************/ /* Members for visualizing the model */ itk::TimeStamp m_SelectedNodeTime; itk::TimeStamp m_CurrentPositionTime; /**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 TagMapType; TagMapType m_Tags; }; #endif // QmitkDicomInspectorView_h diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/CMakeLists.txt b/Plugins/org.mitk.gui.qt.dosevisualization/CMakeLists.txt index a60f557f37..6da1cbf466 100644 --- a/Plugins/org.mitk.gui.qt.dosevisualization/CMakeLists.txt +++ b/Plugins/org.mitk.gui.qt.dosevisualization/CMakeLists.txt @@ -1,7 +1,7 @@ project(org_mitk_gui_qt_dosevisualization) mitk_create_plugin( EXPORT_DIRECTIVE RTDOSEVISUALIZATION_EXPORT EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS MitkQtWidgetsExt MitkDicomRT MitkRTUI + MODULE_DEPENDS MitkQtWidgetsExt MitkRT MitkRTUI ) diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp index 380cf44b23..c6fb743873 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp +++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.cpp @@ -1,1432 +1,1432 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "QmitkExtWorkbenchWindowAdvisor.h" #include "QmitkExtActionBarAdvisor.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 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // UGLYYY #include "internal/QmitkExtWorkbenchWindowAdvisorHack.h" #include "internal/QmitkCommonExtPlugin.h" #include "mitkUndoController.h" #include "mitkVerboseLimitedLinearUndo.h" #include #include #include #include #include #include QmitkExtWorkbenchWindowAdvisorHack* QmitkExtWorkbenchWindowAdvisorHack::undohack = new QmitkExtWorkbenchWindowAdvisorHack(); QString QmitkExtWorkbenchWindowAdvisor::QT_SETTINGS_FILENAME = "QtSettings.ini"; static bool USE_EXPERIMENTAL_COMMAND_CONTRIBUTIONS = false; class PartListenerForTitle: public berry::IPartListener { public: PartListenerForTitle(QmitkExtWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) { } Events::Types GetPartEventTypes() const override { return Events::ACTIVATED | Events::BROUGHT_TO_TOP | Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void PartActivated(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref.Cast ()) { windowAdvisor->UpdateTitle(false); } } void PartBroughtToTop(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref.Cast ()) { windowAdvisor->UpdateTitle(false); } } void PartClosed(const berry::IWorkbenchPartReference::Pointer& /*ref*/) override { windowAdvisor->UpdateTitle(false); } void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override { if (!windowAdvisor->lastActiveEditor.Expired() && ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock()) { windowAdvisor->UpdateTitle(true); } } void PartVisible(const berry::IWorkbenchPartReference::Pointer& ref) override { if (!windowAdvisor->lastActiveEditor.Expired() && ref->GetPart(false) == windowAdvisor->lastActiveEditor.Lock()) { windowAdvisor->UpdateTitle(false); } } private: QmitkExtWorkbenchWindowAdvisor* windowAdvisor; }; class PartListenerForViewNavigator: public berry::IPartListener { public: PartListenerForViewNavigator(QAction* act) : viewNavigatorAction(act) { } Events::Types GetPartEventTypes() const override { return Events::OPENED | Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void PartOpened(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.viewnavigatorview") { viewNavigatorAction->setChecked(true); } } void PartClosed(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.viewnavigatorview") { viewNavigatorAction->setChecked(false); } } void PartVisible(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.viewnavigatorview") { viewNavigatorAction->setChecked(true); } } void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.viewnavigatorview") { viewNavigatorAction->setChecked(false); } } private: QAction* viewNavigatorAction; }; class PartListenerForImageNavigator: public berry::IPartListener { public: PartListenerForImageNavigator(QAction* act) : imageNavigatorAction(act) { } Events::Types GetPartEventTypes() const override { return Events::OPENED | Events::CLOSED | Events::HIDDEN | Events::VISIBLE; } void PartOpened(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(true); } } void PartClosed(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(false); } } void PartVisible(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(true); } } void PartHidden(const berry::IWorkbenchPartReference::Pointer& ref) override { if (ref->GetId()=="org.mitk.views.imagenavigator") { imageNavigatorAction->setChecked(false); } } private: QAction* imageNavigatorAction; }; class PerspectiveListenerForTitle: public berry::IPerspectiveListener { public: PerspectiveListenerForTitle(QmitkExtWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) , perspectivesClosed(false) { } Events::Types GetPerspectiveEventTypes() const override { if (USE_EXPERIMENTAL_COMMAND_CONTRIBUTIONS) { return Events::ACTIVATED | Events::SAVED_AS | Events::DEACTIVATED; } else { return Events::ACTIVATED | Events::SAVED_AS | Events::DEACTIVATED | Events::CLOSED | Events::OPENED; } } void PerspectiveActivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { windowAdvisor->UpdateTitle(false); } void PerspectiveSavedAs(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*oldPerspective*/, const berry::IPerspectiveDescriptor::Pointer& /*newPerspective*/) override { windowAdvisor->UpdateTitle(false); } void PerspectiveDeactivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { windowAdvisor->UpdateTitle(false); } void PerspectiveOpened(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { if (perspectivesClosed) { QListIterator i(windowAdvisor->viewActions); while (i.hasNext()) { i.next()->setEnabled(true); } //GetViewRegistry()->Find("org.mitk.views.imagenavigator"); - if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) + if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicombrowser")) { windowAdvisor->openDicomEditorAction->setEnabled(true); } if (windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.stdmultiwidget")) { windowAdvisor->openStdMultiWidgetEditorAction->setEnabled(true); } if (windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.mxnmultiwidget")) { windowAdvisor->openMxNMultiWidgetEditorAction->setEnabled(true); } windowAdvisor->fileSaveProjectAction->setEnabled(true); windowAdvisor->closeProjectAction->setEnabled(true); windowAdvisor->undoAction->setEnabled(true); windowAdvisor->redoAction->setEnabled(true); windowAdvisor->imageNavigatorAction->setEnabled(true); windowAdvisor->viewNavigatorAction->setEnabled(true); windowAdvisor->resetPerspAction->setEnabled(true); if( windowAdvisor->GetShowClosePerspectiveMenuItem() ) { windowAdvisor->closePerspAction->setEnabled(true); } } perspectivesClosed = false; } void PerspectiveClosed(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& /*perspective*/) override { berry::IWorkbenchWindow::Pointer wnd = windowAdvisor->GetWindowConfigurer()->GetWindow(); bool allClosed = true; if (wnd->GetActivePage()) { QList perspectives(wnd->GetActivePage()->GetOpenPerspectives()); allClosed = perspectives.empty(); } if (allClosed) { perspectivesClosed = true; QListIterator i(windowAdvisor->viewActions); while (i.hasNext()) { i.next()->setEnabled(false); } - if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) + if(windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicombrowser")) { windowAdvisor->openDicomEditorAction->setEnabled(false); } if (windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.stdmultiwidget")) { windowAdvisor->openStdMultiWidgetEditorAction->setEnabled(false); } if (windowAdvisor->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.mxnmultiwidget")) { windowAdvisor->openMxNMultiWidgetEditorAction->setEnabled(false); } windowAdvisor->fileSaveProjectAction->setEnabled(false); windowAdvisor->closeProjectAction->setEnabled(false); windowAdvisor->undoAction->setEnabled(false); windowAdvisor->redoAction->setEnabled(false); windowAdvisor->imageNavigatorAction->setEnabled(false); windowAdvisor->viewNavigatorAction->setEnabled(false); windowAdvisor->resetPerspAction->setEnabled(false); if( windowAdvisor->GetShowClosePerspectiveMenuItem() ) { windowAdvisor->closePerspAction->setEnabled(false); } } } private: QmitkExtWorkbenchWindowAdvisor* windowAdvisor; bool perspectivesClosed; }; class PerspectiveListenerForMenu: public berry::IPerspectiveListener { public: PerspectiveListenerForMenu(QmitkExtWorkbenchWindowAdvisor* wa) : windowAdvisor(wa) { } Events::Types GetPerspectiveEventTypes() const override { return Events::ACTIVATED | Events::DEACTIVATED; } void PerspectiveActivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& perspective) override { QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()]; if (action) { action->setChecked(true); } } void PerspectiveDeactivated(const berry::IWorkbenchPage::Pointer& /*page*/, const berry::IPerspectiveDescriptor::Pointer& perspective) override { QAction* action = windowAdvisor->mapPerspIdToAction[perspective->GetId()]; if (action) { action->setChecked(false); } } private: QmitkExtWorkbenchWindowAdvisor* windowAdvisor; }; QmitkExtWorkbenchWindowAdvisor::QmitkExtWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor, berry::IWorkbenchWindowConfigurer::Pointer configurer) : berry::WorkbenchWindowAdvisor(configurer) , lastInput(nullptr) , wbAdvisor(wbAdvisor) , showViewToolbar(true) , showPerspectiveToolbar(false) , showVersionInfo(true) , showMitkVersionInfo(true) , showViewMenuItem(true) , showNewWindowMenuItem(false) , showClosePerspectiveMenuItem(true) , viewNavigatorFound(false) , showMemoryIndicator(true) , dropTargetListener(new QmitkDefaultDropTargetListener) { productName = QCoreApplication::applicationName(); viewExcludeList.push_back("org.mitk.views.viewnavigatorview"); } QmitkExtWorkbenchWindowAdvisor::~QmitkExtWorkbenchWindowAdvisor() { } berry::ActionBarAdvisor::Pointer QmitkExtWorkbenchWindowAdvisor::CreateActionBarAdvisor(berry::IActionBarConfigurer::Pointer configurer) { if (USE_EXPERIMENTAL_COMMAND_CONTRIBUTIONS) { berry::ActionBarAdvisor::Pointer actionBarAdvisor(new QmitkExtActionBarAdvisor(configurer)); return actionBarAdvisor; } else { return berry::WorkbenchWindowAdvisor::CreateActionBarAdvisor(configurer); } } QWidget* QmitkExtWorkbenchWindowAdvisor::CreateEmptyWindowContents(QWidget* parent) { QWidget* parentWidget = static_cast(parent); auto label = new QLabel(parentWidget); label->setText("No perspectives are open. Open a perspective in the Window->Open Perspective menu."); label->setContentsMargins(10,10,10,10); label->setAlignment(Qt::AlignTop); label->setEnabled(false); parentWidget->layout()->addWidget(label); return label; } void QmitkExtWorkbenchWindowAdvisor::ShowClosePerspectiveMenuItem(bool show) { showClosePerspectiveMenuItem = show; } bool QmitkExtWorkbenchWindowAdvisor::GetShowClosePerspectiveMenuItem() { return showClosePerspectiveMenuItem; } void QmitkExtWorkbenchWindowAdvisor::ShowMemoryIndicator(bool show) { showMemoryIndicator = show; } bool QmitkExtWorkbenchWindowAdvisor::GetShowMemoryIndicator() { return showMemoryIndicator; } void QmitkExtWorkbenchWindowAdvisor::ShowNewWindowMenuItem(bool show) { showNewWindowMenuItem = show; } void QmitkExtWorkbenchWindowAdvisor::ShowViewToolbar(bool show) { showViewToolbar = show; } void QmitkExtWorkbenchWindowAdvisor::ShowViewMenuItem(bool show) { showViewMenuItem = show; } void QmitkExtWorkbenchWindowAdvisor::ShowPerspectiveToolbar(bool show) { showPerspectiveToolbar = show; } void QmitkExtWorkbenchWindowAdvisor::ShowVersionInfo(bool show) { showVersionInfo = show; } void QmitkExtWorkbenchWindowAdvisor::ShowMitkVersionInfo(bool show) { showMitkVersionInfo = show; } void QmitkExtWorkbenchWindowAdvisor::SetProductName(const QString& product) { productName = product; } void QmitkExtWorkbenchWindowAdvisor::SetWindowIcon(const QString& wndIcon) { windowIcon = wndIcon; } void QmitkExtWorkbenchWindowAdvisor::PostWindowCreate() { // very bad hack... berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow(); QMainWindow* mainWindow = qobject_cast (window->GetShell()->GetControl()); if (!windowIcon.isEmpty()) { mainWindow->setWindowIcon(QIcon(windowIcon)); } mainWindow->setContextMenuPolicy(Qt::PreventContextMenu); // Load icon theme QIcon::setThemeSearchPaths(QStringList() << QStringLiteral(":/org_mitk_icons/icons/")); QIcon::setThemeName(QStringLiteral("awesome")); // ==== Application menu ============================ QMenuBar* menuBar = mainWindow->menuBar(); menuBar->setContextMenuPolicy(Qt::PreventContextMenu); #ifdef __APPLE__ menuBar->setNativeMenuBar(true); #else menuBar->setNativeMenuBar(false); #endif auto basePath = QStringLiteral(":/org_mitk_icons/icons/awesome/scalable/actions/"); auto fileOpenAction = new QmitkFileOpenAction(berry::QtStyleManager::ThemeIcon(basePath + "document-open.svg"), window); fileOpenAction->setShortcut(QKeySequence::Open); auto fileSaveAction = new QmitkFileSaveAction(berry::QtStyleManager::ThemeIcon(basePath + "document-save.svg"), window); fileSaveAction->setShortcut(QKeySequence::Save); fileSaveProjectAction = new QmitkExtFileSaveProjectAction(window); fileSaveProjectAction->setIcon(berry::QtStyleManager::ThemeIcon(basePath + "document-save.svg")); closeProjectAction = new QmitkCloseProjectAction(window); closeProjectAction->setIcon(berry::QtStyleManager::ThemeIcon(basePath + "edit-delete.svg")); auto perspGroup = new QActionGroup(menuBar); std::map VDMap; // sort elements (converting vector to map...) QList::const_iterator iter; berry::IViewRegistry* viewRegistry = berry::PlatformUI::GetWorkbench()->GetViewRegistry(); const QList viewDescriptors = viewRegistry->GetViews(); bool skip = false; for (iter = viewDescriptors.begin(); iter != viewDescriptors.end(); ++iter) { // if viewExcludeList is set, it contains the id-strings of view, which // should not appear as an menu-entry in the menu if (viewExcludeList.size() > 0) { for (int i=0; iGetId()) { skip = true; break; } } if (skip) { skip = false; continue; } } if ((*iter)->GetId() == "org.blueberry.ui.internal.introview") continue; if ((*iter)->GetId() == "org.mitk.views.imagenavigator") continue; if ((*iter)->GetId() == "org.mitk.views.viewnavigatorview") continue; std::pair p((*iter)->GetLabel(), (*iter)); VDMap.insert(p); } std::map::const_iterator MapIter; for (MapIter = VDMap.begin(); MapIter != VDMap.end(); ++MapIter) { berry::QtShowViewAction* viewAction = new berry::QtShowViewAction(window, (*MapIter).second); viewActions.push_back(viewAction); } if (!USE_EXPERIMENTAL_COMMAND_CONTRIBUTIONS) { QMenu* fileMenu = menuBar->addMenu("&File"); fileMenu->setObjectName("FileMenu"); fileMenu->addAction(fileOpenAction); fileMenu->addAction(fileSaveAction); fileMenu->addAction(fileSaveProjectAction); fileMenu->addAction(closeProjectAction); fileMenu->addSeparator(); QAction* fileExitAction = new QmitkFileExitAction(window); fileExitAction->setIcon(berry::QtStyleManager::ThemeIcon(basePath + "system-log-out.svg")); fileExitAction->setShortcut(QKeySequence::Quit); fileExitAction->setObjectName("QmitkFileExitAction"); fileMenu->addAction(fileExitAction); // another bad hack to get an edit/undo menu... QMenu* editMenu = menuBar->addMenu("&Edit"); undoAction = editMenu->addAction(berry::QtStyleManager::ThemeIcon(basePath + "edit-undo.svg"), "&Undo", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onUndo()), QKeySequence("CTRL+Z")); undoAction->setToolTip("Undo the last action (not supported by all modules)"); redoAction = editMenu->addAction(berry::QtStyleManager::ThemeIcon(basePath + "edit-redo.svg"), "&Redo", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onRedo()), QKeySequence("CTRL+Y")); redoAction->setToolTip("execute the last action that was undone again (not supported by all modules)"); // ==== Window Menu ========================== QMenu* windowMenu = menuBar->addMenu("Window"); if (showNewWindowMenuItem) { windowMenu->addAction("&New Window", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onNewWindow())); windowMenu->addSeparator(); } QMenu* perspMenu = windowMenu->addMenu("&Open Perspective"); QMenu* viewMenu = nullptr; if (showViewMenuItem) { viewMenu = windowMenu->addMenu("Show &View"); viewMenu->setObjectName("Show View"); } windowMenu->addSeparator(); resetPerspAction = windowMenu->addAction("&Reset Perspective", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onResetPerspective())); if(showClosePerspectiveMenuItem) closePerspAction = windowMenu->addAction("&Close Perspective", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onClosePerspective())); windowMenu->addSeparator(); windowMenu->addAction("&Preferences...", QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onEditPreferences()), QKeySequence("CTRL+P")); // fill perspective menu berry::IPerspectiveRegistry* perspRegistry = window->GetWorkbench()->GetPerspectiveRegistry(); QList perspectives( perspRegistry->GetPerspectives()); skip = false; for (QList::iterator perspIt = perspectives.begin(); perspIt != perspectives.end(); ++perspIt) { // if perspectiveExcludeList is set, it contains the id-strings of perspectives, which // should not appear as an menu-entry in the perspective menu if (perspectiveExcludeList.size() > 0) { for (int i=0; iGetId()) { skip = true; break; } } if (skip) { skip = false; continue; } } QAction* perspAction = new berry::QtOpenPerspectiveAction(window, *perspIt, perspGroup); mapPerspIdToAction.insert((*perspIt)->GetId(), perspAction); } perspMenu->addActions(perspGroup->actions()); if (showViewMenuItem) { for (auto viewAction : viewActions) { viewMenu->addAction(viewAction); } } // ===== Help menu ==================================== QMenu* helpMenu = menuBar->addMenu("&Help"); helpMenu->addAction("&Welcome",this, SLOT(onIntro())); helpMenu->addAction("&Open Help Perspective", this, SLOT(onHelpOpenHelpPerspective())); helpMenu->addAction("&Context Help",this, SLOT(onHelp()), QKeySequence("F1")); helpMenu->addAction("&About",this, SLOT(onAbout())); // ===================================================== } else { undoAction = new QmitkUndoAction(berry::QtStyleManager::ThemeIcon(basePath + "edit-undo.svg"), nullptr); undoAction->setShortcut(QKeySequence::Undo); redoAction = new QmitkRedoAction(berry::QtStyleManager::ThemeIcon(basePath + "edit-redo.svg"), nullptr); redoAction->setShortcut(QKeySequence::Redo); } // toolbar for showing file open, undo, redo and other main actions auto mainActionsToolBar = new QToolBar; mainActionsToolBar->setObjectName("mainActionsToolBar"); mainActionsToolBar->setContextMenuPolicy(Qt::PreventContextMenu); #ifdef __APPLE__ mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextUnderIcon ); #else mainActionsToolBar->setToolButtonStyle ( Qt::ToolButtonTextBesideIcon ); #endif basePath = QStringLiteral(":/org.mitk.gui.qt.ext/"); imageNavigatorAction = new QAction(berry::QtStyleManager::ThemeIcon(basePath + "image_navigator.svg"), "&Image Navigator", nullptr); bool imageNavigatorViewFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.imagenavigator"); - if (this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) + if (this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicombrowser")) { openDicomEditorAction = new QmitkOpenDicomEditorAction(berry::QtStyleManager::ThemeIcon(basePath + "dicom.svg"), window); } if (this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.stdmultiwidget")) { openStdMultiWidgetEditorAction = new QmitkOpenStdMultiWidgetEditorAction(QIcon(":/org.mitk.gui.qt.ext/Editor.png"), window); } if (this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.mxnmultiwidget")) { openMxNMultiWidgetEditorAction = new QmitkOpenMxNMultiWidgetEditorAction(QIcon(":/org.mitk.gui.qt.ext/Editor.png"), window); } if (imageNavigatorViewFound) { QObject::connect(imageNavigatorAction, SIGNAL(triggered(bool)), QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onImageNavigator())); imageNavigatorAction->setCheckable(true); // add part listener for image navigator imageNavigatorPartListener.reset(new PartListenerForImageNavigator(imageNavigatorAction)); window->GetPartService()->AddPartListener(imageNavigatorPartListener.data()); berry::IViewPart::Pointer imageNavigatorView = window->GetActivePage()->FindView("org.mitk.views.imagenavigator"); imageNavigatorAction->setChecked(false); if (imageNavigatorView) { bool isImageNavigatorVisible = window->GetActivePage()->IsPartVisible(imageNavigatorView); if (isImageNavigatorVisible) imageNavigatorAction->setChecked(true); } imageNavigatorAction->setToolTip("Toggle image navigator for navigating through image"); } viewNavigatorAction = new QAction(berry::QtStyleManager::ThemeIcon(QStringLiteral(":/org.mitk.gui.qt.ext/view-manager.svg")),"&View Navigator", nullptr); viewNavigatorFound = window->GetWorkbench()->GetViewRegistry()->Find("org.mitk.views.viewnavigatorview"); if (viewNavigatorFound) { QObject::connect(viewNavigatorAction, SIGNAL(triggered(bool)), QmitkExtWorkbenchWindowAdvisorHack::undohack, SLOT(onViewNavigator())); viewNavigatorAction->setCheckable(true); // add part listener for view navigator viewNavigatorPartListener.reset(new PartListenerForViewNavigator(viewNavigatorAction)); window->GetPartService()->AddPartListener(viewNavigatorPartListener.data()); berry::IViewPart::Pointer viewnavigatorview = window->GetActivePage()->FindView("org.mitk.views.viewnavigatorview"); viewNavigatorAction->setChecked(false); if (viewnavigatorview) { bool isViewNavigatorVisible = window->GetActivePage()->IsPartVisible(viewnavigatorview); if (isViewNavigatorVisible) viewNavigatorAction->setChecked(true); } viewNavigatorAction->setToolTip("Toggle View Navigator"); } mainActionsToolBar->addAction(fileOpenAction); mainActionsToolBar->addAction(fileSaveProjectAction); mainActionsToolBar->addAction(closeProjectAction); mainActionsToolBar->addAction(undoAction); mainActionsToolBar->addAction(redoAction); - if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicomeditor")) + if(this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.dicombrowser")) { mainActionsToolBar->addAction(openDicomEditorAction); } if (this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.stdmultiwidget")) { mainActionsToolBar->addAction(openStdMultiWidgetEditorAction); } if (this->GetWindowConfigurer()->GetWindow()->GetWorkbench()->GetEditorRegistry()->FindEditor("org.mitk.editors.mxnmultiwidget")) { mainActionsToolBar->addAction(openMxNMultiWidgetEditorAction); } if (imageNavigatorViewFound) { mainActionsToolBar->addAction(imageNavigatorAction); } if (viewNavigatorFound) { mainActionsToolBar->addAction(viewNavigatorAction); } mainWindow->addToolBar(mainActionsToolBar); // ==== Perspective Toolbar ================================== auto qPerspectiveToolbar = new QToolBar; qPerspectiveToolbar->setObjectName("perspectiveToolBar"); if (showPerspectiveToolbar) { qPerspectiveToolbar->addActions(perspGroup->actions()); mainWindow->addToolBar(qPerspectiveToolbar); } else delete qPerspectiveToolbar; if (showViewToolbar) { auto prefService = berry::WorkbenchPlugin::GetDefault()->GetPreferencesService(); berry::IPreferences::Pointer stylePrefs = prefService->GetSystemPreferences()->Node(berry::QtPreferences::QT_STYLES_NODE); bool showCategoryNames = stylePrefs->GetBool(berry::QtPreferences::QT_SHOW_TOOLBAR_CATEGORY_NAMES, true); // Order view descriptors by category QMultiMap categoryViewDescriptorMap; for (auto labelViewDescriptorPair : VDMap) { auto viewDescriptor = labelViewDescriptorPair.second; auto category = !viewDescriptor->GetCategoryPath().isEmpty() ? viewDescriptor->GetCategoryPath().back() : QString(); categoryViewDescriptorMap.insert(category, viewDescriptor); } // Create a separate toolbar for each category for (auto category : categoryViewDescriptorMap.uniqueKeys()) { auto viewDescriptorsInCurrentCategory = categoryViewDescriptorMap.values(category); if (!viewDescriptorsInCurrentCategory.isEmpty()) { auto toolbar = new QToolBar; toolbar->setObjectName(category + " View Toolbar"); mainWindow->addToolBar(toolbar); if (showCategoryNames && !category.isEmpty()) { auto categoryButton = new QToolButton; categoryButton->setToolButtonStyle(Qt::ToolButtonTextOnly); categoryButton->setText(category); categoryButton->setStyleSheet("background: transparent; margin: 0; padding: 0;"); toolbar->addWidget(categoryButton); connect(categoryButton, &QToolButton::clicked, [toolbar]() { for (QWidget* widget : toolbar->findChildren()) { if (QStringLiteral("qt_toolbar_ext_button") == widget->objectName() && widget->isVisible()) { QMouseEvent pressEvent(QEvent::MouseButtonPress, QPointF(0.0f, 0.0f), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPointF(0.0f, 0.0f), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QApplication::sendEvent(widget, &pressEvent); QApplication::sendEvent(widget, &releaseEvent); } } }); } for (auto viewDescriptor : viewDescriptorsInCurrentCategory) { auto viewAction = new berry::QtShowViewAction(window, viewDescriptor); toolbar->addAction(viewAction); } } } } QSettings settings(GetQSettingsFile(), QSettings::IniFormat); mainWindow->restoreState(settings.value("ToolbarPosition").toByteArray()); auto qStatusBar = new QStatusBar(); //creating a QmitkStatusBar for Output on the QStatusBar and connecting it with the MainStatusBar auto statusBar = new QmitkStatusBar(qStatusBar); //disabling the SizeGrip in the lower right corner statusBar->SetSizeGripEnabled(false); auto progBar = new QmitkProgressBar(); qStatusBar->addPermanentWidget(progBar, 0); progBar->hide(); // progBar->AddStepsToDo(2); // progBar->Progress(1); mainWindow->setStatusBar(qStatusBar); if (showMemoryIndicator) { auto memoryIndicator = new QmitkMemoryUsageIndicatorView(); qStatusBar->addPermanentWidget(memoryIndicator, 0); } } void QmitkExtWorkbenchWindowAdvisor::PreWindowOpen() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); // show the shortcut bar and progress indicator, which are hidden by // default //configurer->SetShowPerspectiveBar(true); //configurer->SetShowFastViewBars(true); //configurer->SetShowProgressIndicator(true); // // add the drag and drop support for the editor area // configurer.addEditorAreaTransfer(EditorInputTransfer.getInstance()); // configurer.addEditorAreaTransfer(ResourceTransfer.getInstance()); // configurer.addEditorAreaTransfer(FileTransfer.getInstance()); // configurer.addEditorAreaTransfer(MarkerTransfer.getInstance()); // configurer.configureEditorAreaDropListener(new EditorAreaDropAdapter( // configurer.getWindow())); this->HookTitleUpdateListeners(configurer); menuPerspectiveListener.reset(new PerspectiveListenerForMenu(this)); configurer->GetWindow()->AddPerspectiveListener(menuPerspectiveListener.data()); configurer->AddEditorAreaTransfer(QStringList("text/uri-list")); configurer->ConfigureEditorAreaDropListener(dropTargetListener.data()); } void QmitkExtWorkbenchWindowAdvisor::PostWindowOpen() { berry::WorkbenchWindowAdvisor::PostWindowOpen(); // Force Rendering Window Creation on startup. berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); ctkPluginContext* context = QmitkCommonExtPlugin::getContext(); ctkServiceReference serviceRef = context->getServiceReference(); if (serviceRef) { mitk::IDataStorageService *dsService = context->getService(serviceRef); if (dsService) { mitk::IDataStorageReference::Pointer dsRef = dsService->GetDataStorage(); mitk::DataStorageEditorInput::Pointer dsInput(new mitk::DataStorageEditorInput(dsRef)); mitk::WorkbenchUtil::OpenEditor(configurer->GetWindow()->GetActivePage(),dsInput); } } auto introPart = configurer->GetWindow()->GetWorkbench()->GetIntroManager()->GetIntro(); if (introPart.IsNotNull()) { configurer->GetWindow()->GetWorkbench()->GetIntroManager()->ShowIntro(GetWindowConfigurer()->GetWindow(), false); } } void QmitkExtWorkbenchWindowAdvisor::onIntro() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onIntro(); } void QmitkExtWorkbenchWindowAdvisor::onHelp() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onHelp(); } void QmitkExtWorkbenchWindowAdvisor::onHelpOpenHelpPerspective() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onHelpOpenHelpPerspective(); } void QmitkExtWorkbenchWindowAdvisor::onAbout() { QmitkExtWorkbenchWindowAdvisorHack::undohack->onAbout(); } //-------------------------------------------------------------------------------- // Ugly hack from here on. Feel free to delete when command framework // and undo buttons are done. //-------------------------------------------------------------------------------- QmitkExtWorkbenchWindowAdvisorHack::QmitkExtWorkbenchWindowAdvisorHack() : QObject() { } QmitkExtWorkbenchWindowAdvisorHack::~QmitkExtWorkbenchWindowAdvisorHack() { } void QmitkExtWorkbenchWindowAdvisorHack::onUndo() { mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel(); if (model) { if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast( model )) { mitk::VerboseLimitedLinearUndo::StackDescription descriptions = verboseundo->GetUndoDescriptions(); if (descriptions.size() >= 1) { MITK_INFO << "Undo " << descriptions.front().second; } } model->Undo(); } else { MITK_ERROR << "No undo model instantiated"; } } void QmitkExtWorkbenchWindowAdvisorHack::onRedo() { mitk::UndoModel* model = mitk::UndoController::GetCurrentUndoModel(); if (model) { if (mitk::VerboseLimitedLinearUndo* verboseundo = dynamic_cast( model )) { mitk::VerboseLimitedLinearUndo::StackDescription descriptions = verboseundo->GetRedoDescriptions(); if (descriptions.size() >= 1) { MITK_INFO << "Redo " << descriptions.front().second; } } model->Redo(); } else { MITK_ERROR << "No undo model instantiated"; } } // safe calls to the complete chain // berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->FindView("org.mitk.views.imagenavigator"); // to cover for all possible cases of closed pages etc. static void SafeHandleNavigatorView(QString view_query_name) { berry::IWorkbench* wbench = berry::PlatformUI::GetWorkbench(); if( wbench == nullptr ) return; berry::IWorkbenchWindow::Pointer wbench_window = wbench->GetActiveWorkbenchWindow(); if( wbench_window.IsNull() ) return; berry::IWorkbenchPage::Pointer wbench_page = wbench_window->GetActivePage(); if( wbench_page.IsNull() ) return; auto wbench_view = wbench_page->FindView( view_query_name ); if( wbench_view.IsNotNull() ) { bool isViewVisible = wbench_page->IsPartVisible( wbench_view ); if( isViewVisible ) { wbench_page->HideView( wbench_view ); return; } } wbench_page->ShowView( view_query_name ); } void QmitkExtWorkbenchWindowAdvisorHack::onImageNavigator() { // show/hide ImageNavigatorView SafeHandleNavigatorView("org.mitk.views.imagenavigator"); } void QmitkExtWorkbenchWindowAdvisorHack::onViewNavigator() { // show/hide viewnavigatorView SafeHandleNavigatorView("org.mitk.views.viewnavigatorview"); } void QmitkExtWorkbenchWindowAdvisorHack::onEditPreferences() { QmitkPreferencesDialog _PreferencesDialog(QApplication::activeWindow()); _PreferencesDialog.exec(); } void QmitkExtWorkbenchWindowAdvisorHack::onQuit() { berry::PlatformUI::GetWorkbench()->Close(); } void QmitkExtWorkbenchWindowAdvisorHack::onResetPerspective() { berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage()->ResetPerspective(); } void QmitkExtWorkbenchWindowAdvisorHack::onClosePerspective() { berry::IWorkbenchPage::Pointer page = berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()->GetActivePage(); page->ClosePerspective(page->GetPerspective(), true, true); } void QmitkExtWorkbenchWindowAdvisorHack::onNewWindow() { berry::PlatformUI::GetWorkbench()->OpenWorkbenchWindow(nullptr); } void QmitkExtWorkbenchWindowAdvisorHack::onIntro() { bool hasIntro = berry::PlatformUI::GetWorkbench()->GetIntroManager()->HasIntro(); if (!hasIntro) { QRegExp reg("(.*)(\\n)*"); QRegExp reg2("(\\n)*(.*)"); QFile file(":/org.mitk.gui.qt.ext/index.html"); file.open(QIODevice::ReadOnly | QIODevice::Text); //text file only for reading QString text = QString(file.readAll()); file.close(); QString title = text; title.replace(reg, ""); title.replace(reg2, ""); std::cout << title.toStdString() << std::endl; QMessageBox::information(nullptr, title, text, "Close"); } else { berry::PlatformUI::GetWorkbench()->GetIntroManager()->ShowIntro( berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow(), false); } } void QmitkExtWorkbenchWindowAdvisorHack::onHelp() { ctkPluginContext* context = QmitkCommonExtPlugin::getContext(); if (context == nullptr) { MITK_WARN << "Plugin context not set, unable to open context help"; return; } // Check if the org.blueberry.ui.qt.help plug-in is installed and started QList > plugins = context->getPlugins(); foreach(QSharedPointer p, plugins) { if (p->getSymbolicName() == "org.blueberry.ui.qt.help") { if (p->getState() != ctkPlugin::ACTIVE) { // try to activate the plug-in explicitly try { p->start(ctkPlugin::START_TRANSIENT); } catch (const ctkPluginException& pe) { MITK_ERROR << "Activating org.blueberry.ui.qt.help failed: " << pe.what(); return; } } } } ctkServiceReference eventAdminRef = context->getServiceReference(); ctkEventAdmin* eventAdmin = nullptr; if (eventAdminRef) { eventAdmin = context->getService(eventAdminRef); } if (eventAdmin == nullptr) { MITK_WARN << "ctkEventAdmin service not found. Unable to open context help"; } else { ctkEvent ev("org/blueberry/ui/help/CONTEXTHELP_REQUESTED"); eventAdmin->postEvent(ev); } } void QmitkExtWorkbenchWindowAdvisorHack::onHelpOpenHelpPerspective() { berry::PlatformUI::GetWorkbench()->ShowPerspective("org.blueberry.perspectives.help", berry::PlatformUI::GetWorkbench()->GetActiveWorkbenchWindow()); } void QmitkExtWorkbenchWindowAdvisorHack::onAbout() { auto aboutDialog = new QmitkAboutDialog(QApplication::activeWindow(),nullptr); aboutDialog->open(); } void QmitkExtWorkbenchWindowAdvisor::HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer) { // hook up the listeners to update the window title titlePartListener.reset(new PartListenerForTitle(this)); titlePerspectiveListener.reset(new PerspectiveListenerForTitle(this)); editorPropertyListener.reset(new berry::PropertyChangeIntAdapter< QmitkExtWorkbenchWindowAdvisor>(this, &QmitkExtWorkbenchWindowAdvisor::PropertyChange)); // configurer.getWindow().addPageListener(new IPageListener() { // public void pageActivated(IWorkbenchPage page) { // updateTitle(false); // } // // public void pageClosed(IWorkbenchPage page) { // updateTitle(false); // } // // public void pageOpened(IWorkbenchPage page) { // // do nothing // } // }); configurer->GetWindow()->AddPerspectiveListener(titlePerspectiveListener.data()); configurer->GetWindow()->GetPartService()->AddPartListener(titlePartListener.data()); } QString QmitkExtWorkbenchWindowAdvisor::ComputeTitle() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); berry::IWorkbenchPage::Pointer currentPage = configurer->GetWindow()->GetActivePage(); berry::IEditorPart::Pointer activeEditor; if (currentPage) { activeEditor = lastActiveEditor.Lock(); } QString title; berry::IProduct::Pointer product = berry::Platform::GetProduct(); if (product.IsNotNull()) { title = product->GetName(); } if (title.isEmpty()) { // instead of the product name, we use a custom variable for now title = productName; } if(showMitkVersionInfo) { QString mitkVersionInfo = MITK_REVISION_DESC; if(mitkVersionInfo.isEmpty()) mitkVersionInfo = MITK_VERSION_STRING; title += " " + mitkVersionInfo; } if (showVersionInfo) { // add version informatioin QString versions = QString(" (ITK %1.%2.%3 | VTK %4.%5.%6 | Qt %7)") .arg(ITK_VERSION_MAJOR).arg(ITK_VERSION_MINOR).arg(ITK_VERSION_PATCH) .arg(VTK_MAJOR_VERSION).arg(VTK_MINOR_VERSION).arg(VTK_BUILD_VERSION) .arg(QT_VERSION_STR); title += versions; } if (currentPage) { if (activeEditor) { lastEditorTitle = activeEditor->GetTitleToolTip(); if (!lastEditorTitle.isEmpty()) title = lastEditorTitle + " - " + title; } berry::IPerspectiveDescriptor::Pointer persp = currentPage->GetPerspective(); QString label = ""; if (persp) { label = persp->GetLabel(); } berry::IAdaptable* input = currentPage->GetInput(); if (input && input != wbAdvisor->GetDefaultPageInput()) { label = currentPage->GetLabel(); } if (!label.isEmpty()) { title = label + " - " + title; } } title += " (Not for use in diagnosis or treatment of patients)"; return title; } void QmitkExtWorkbenchWindowAdvisor::RecomputeTitle() { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); QString oldTitle = configurer->GetTitle(); QString newTitle = ComputeTitle(); if (newTitle != oldTitle) { configurer->SetTitle(newTitle); } } void QmitkExtWorkbenchWindowAdvisor::UpdateTitle(bool editorHidden) { berry::IWorkbenchWindowConfigurer::Pointer configurer = GetWindowConfigurer(); berry::IWorkbenchWindow::Pointer window = configurer->GetWindow(); berry::IEditorPart::Pointer activeEditor; berry::IWorkbenchPage::Pointer currentPage = window->GetActivePage(); berry::IPerspectiveDescriptor::Pointer persp; berry::IAdaptable* input = nullptr; if (currentPage) { activeEditor = currentPage->GetActiveEditor(); persp = currentPage->GetPerspective(); input = currentPage->GetInput(); } if (editorHidden) { activeEditor = nullptr; } // Nothing to do if the editor hasn't changed if (activeEditor == lastActiveEditor.Lock() && currentPage == lastActivePage.Lock() && persp == lastPerspective.Lock() && input == lastInput) { return; } if (!lastActiveEditor.Expired()) { lastActiveEditor.Lock()->RemovePropertyListener(editorPropertyListener.data()); } lastActiveEditor = activeEditor; lastActivePage = currentPage; lastPerspective = persp; lastInput = input; if (activeEditor) { activeEditor->AddPropertyListener(editorPropertyListener.data()); } RecomputeTitle(); } void QmitkExtWorkbenchWindowAdvisor::PropertyChange(const berry::Object::Pointer& /*source*/, int propId) { if (propId == berry::IWorkbenchPartConstants::PROP_TITLE) { if (!lastActiveEditor.Expired()) { QString newTitle = lastActiveEditor.Lock()->GetPartName(); if (lastEditorTitle != newTitle) { RecomputeTitle(); } } } } void QmitkExtWorkbenchWindowAdvisor::SetPerspectiveExcludeList(const QList& v) { this->perspectiveExcludeList = v; } QList QmitkExtWorkbenchWindowAdvisor::GetPerspectiveExcludeList() { return this->perspectiveExcludeList; } void QmitkExtWorkbenchWindowAdvisor::SetViewExcludeList(const QList& v) { this->viewExcludeList = v; } QList QmitkExtWorkbenchWindowAdvisor::GetViewExcludeList() { return this->viewExcludeList; } void QmitkExtWorkbenchWindowAdvisor::PostWindowClose() { berry::IWorkbenchWindow::Pointer window = this->GetWindowConfigurer()->GetWindow(); QMainWindow* mainWindow = static_cast (window->GetShell()->GetControl()); QSettings settings(GetQSettingsFile(), QSettings::IniFormat); settings.setValue("ToolbarPosition", mainWindow->saveState()); } QString QmitkExtWorkbenchWindowAdvisor::GetQSettingsFile() const { QFileInfo settingsInfo = QmitkCommonExtPlugin::getContext()->getDataFile(QT_SETTINGS_FILENAME); return settingsInfo.canonicalFilePath(); } diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.cpp b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.cpp index 05b5ed870a..cf328e3ec8 100644 --- a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.cpp +++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.cpp @@ -1,77 +1,77 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "QmitkOpenDicomEditorAction.h" #include #include #include "mitkCoreObjectFactory.h" #include "mitkSceneIO.h" #include "mitkProgressBar.h" #include #include #include #include #include #include #include #include "mitkProperties.h" #include "mitkNodePredicateData.h" #include "mitkNodePredicateNot.h" #include "mitkNodePredicateProperty.h" QmitkOpenDicomEditorAction::QmitkOpenDicomEditorAction(berry::IWorkbenchWindow::Pointer window) : QAction(nullptr) { this->init(window); } QmitkOpenDicomEditorAction::QmitkOpenDicomEditorAction(const QIcon & icon, berry::IWorkbenchWindow::Pointer window) : QAction(nullptr) { this->setIcon(icon); this->init(window); } void QmitkOpenDicomEditorAction::init(berry::IWorkbenchWindow::Pointer window) { m_Window = window; this->setParent(static_cast(m_Window->GetShell()->GetControl())); this->setText("&DICOM"); - this->setToolTip("Open dicom tool"); + this->setToolTip("Open dicom browser"); berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService(); m_GeneralPreferencesNode = prefService->GetSystemPreferences()->Node("/General"); this->connect(this, SIGNAL(triggered(bool)), this, SLOT(Run())); } void QmitkOpenDicomEditorAction::Run() { // check if there is an open perspective, if not open the default perspective if (m_Window->GetActivePage().IsNull()) { QString defaultPerspId = m_Window->GetWorkbench()->GetPerspectiveRegistry()->GetDefaultPerspective(); m_Window->GetWorkbench()->ShowPerspective(defaultPerspId, m_Window); } berry::IEditorInput::Pointer editorInput2(new berry::FileEditorInput(QString())); - m_Window->GetActivePage()->OpenEditor(editorInput2, "org.mitk.editors.dicomeditor"); + m_Window->GetActivePage()->OpenEditor(editorInput2, "org.mitk.editors.dicombrowser"); } diff --git a/Plugins/org.mitk.gui.qt.radiomics/documentation/doxygen/tutorial_gui/RadiomicsTutorial_GUI_01_Basic.dox b/Plugins/org.mitk.gui.qt.radiomics/documentation/doxygen/tutorial_gui/RadiomicsTutorial_GUI_01_Basic.dox index f7f73f09b7..c07b77e924 100644 --- a/Plugins/org.mitk.gui.qt.radiomics/documentation/doxygen/tutorial_gui/RadiomicsTutorial_GUI_01_Basic.dox +++ b/Plugins/org.mitk.gui.qt.radiomics/documentation/doxygen/tutorial_gui/RadiomicsTutorial_GUI_01_Basic.dox @@ -1,30 +1,30 @@ /** \page org_mitk_views_radiomicstutorial_gui_01_basic GUI based Radiomics Tutorial - Basic handling of MITK \subsection Basic handling of MITK Open a MITK Workbench which also includes MITK Phenotyping. You should see something similar to figure 1. At the top you'll see a bar (1), (2) with different important operations like open and saving data, different important views (like DICOM Window, Image Navigator and View Navigator), and a list of all Views included in your version (2). Items are grouped, and depending on the width of your screen might be hidden behind small arrows. The Data Manager (3) is usually placed at the left, although it could be also open at other positions. It is used to organize open images and other data items. Below it you see the Image Navigator (4) which helps to navigate through the 3D data. It allows to change the position within the data either in real-world coordinates (in mm) or by specifiying a slice number. In the center of your application you should see the Displays (5), which will display the images. It usually consists of four views, showing axial, sagittal, coronal and a 3D view of the data. It is possible to rearange the single displays and configure them to your wishes with the three small buttons which will become visible if the mouse is in the upper right corner of display. Beside these elements, there are various open views (6). You can close them with the cross and reopen them using the bar at the top (2). It is also possible to rearrange all Views to various positions left, right, above, or below the displays. An important view is the "View Navigator". In figure 1 it is hidden behind the Data Manager (3) and could be made visible with a click on the corresponding bar left of the "Data Manager" bar. The View Navigator is an easy and straight forward tool to show all available views and open them. It allows to search through all views. Offering a search function it allows to find views using their name of just searching for a functionality you are looking for. \imageMacro{RadiomicsTutorial_GUI_Step1_01_Overview.png,"Overview of MITK Workbench with active MITK Phenotyping",1} \subsection Loading image data In order to calculate the radiomics features using the graphical interface you first need to load the data into the graphical environment. This can be done in different ways. If you want to load an DICOM series, it is sufficient to load a single image if the other images of the series are within the same folder. MITK will then combine all Series DICOM Images to a single 3D Image. \li Open an Image using the "Open File" menu item: If you click on the "Open File" item in the "File" menu or the "Open File" button in the top bar you will be presented a standard file dialog of your system. Select the image you want to load and click "Open". \li Drag n' Drop: Select the image you want to load with your standard data managing tool, for example with the explorer on windows or finder on Mac. Drag and drop the file into the open MITK Workbench window, the image will then be loaded if possible. If you -\li DICOM Browser: MITK offers the basic possibiliy to manage and handle DICOM images using the DICOM Browser. You can enable this view by clicking on "DICOM", right of the "Redo"-Button. Within the DICOM Browser, it is possible to read complete folders, and load specific series into the workbench. For more information see \ref org_mitk_gui_qt_dicom . +\li DICOM Browser: MITK offers the basic possibiliy to manage and handle DICOM images using the DICOM Browser. You can enable this view by clicking on "DICOM", right of the "Redo"-Button. Within the DICOM Browser, it is possible to read complete folders, and load specific series into the workbench. For more information see \ref org_mitk_gui_qt_dicombrowser . -*/ \ No newline at end of file +*/ diff --git a/Wrapping/Python/CMakeLists.txt b/Wrapping/Python/CMakeLists.txt index cb9327dc76..260623b192 100644 --- a/Wrapping/Python/CMakeLists.txt +++ b/Wrapping/Python/CMakeLists.txt @@ -1,77 +1,77 @@ # Version 2.8.1 is the minium requirement for this script. # this is lower than the general minimum requirement. #cmake_minimum_required ( VERSION 2.8.1 FATAL_ERROR ) include(mitkTargetLinkLibrariesWithDynamicLookup) project( MITK_Python ) set(CMAKE_SHARED_LINKER_FLAGS "" CACHE INTERNAL "" FORCE) set(CMAKE_MODULE_LINKER_FLAGS "" CACHE INTERNAL "" FORCE) mitk_check_dynamic_lookup(MODULE SHARED MITK_UNDEFINED_SYMBOLS_ALLOWED ) # # Find the necessary libraries etc.. # if ( MITK_UNDEFINED_SYMBOLS_ALLOWED ) set( _QUIET_LIBRARY "QUIET" ) else() set( _QUIET_LIBRARY "REQUIRED" ) endif() find_package ( PythonInterp REQUIRED ) find_package ( PythonLibs ${_QUIET_LIBRARY} ) include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) # # Options # option ( MITK_PYTHON_THREADS "Enable threaded python usage by unlocking the GIL." ON ) mark_as_advanced( MITK_PYTHON_THREADS ) option ( MITK_PYTHON_EGG "Add building of python eggs to the dist target." OFF ) mark_as_advanced( MITK_PYTHON_EGG ) option ( MITK_PYTHON_WHEEL "Add building of python wheels to the dist target." ON ) mark_as_advanced( MITK_PYTHON_WHEEL ) # Prepare the SWIG-File, i.e. especially add necessary include folders -mitkSwigPrepareFiles(pyMITK MITK.i "MitkCore;MitkCLCore;MitkCLUtilities;ITKCommon;MitkMatchPointRegistration;MitkSegmentation;MitkMultilabel;MitkDICOMReader;MitkDICOMReaderServices;MitkDicomRT") +mitkSwigPrepareFiles(pyMITK MITK.i "MitkCore;MitkCLCore;MitkCLUtilities;ITKCommon;MitkMatchPointRegistration;MitkSegmentation;MitkMultilabel;MitkDICOM;MitkDICOMImageIO;MitkRT") # Add additional SWIG Parameters # These parameters depend on the target language set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_GLOBAL_FLAGS} -features autodoc=1 -keyword ) if( MITK_PYTHON_THREADS ) set(CMAKE_SWIG_FLAGS ${CMAKE_SWIG_FLAGS} -threads) endif() set(CMAKE_SWIG_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}) # Create the actual SWIG project swig_add_module(pyMITK python MITK.i ) -mitkSwigAddLibraryDependencies(pyMITK "MitkCore;MitkCLCore;MitkCLUtilities;ITKCommon;MitkMatchPointRegistration;MitkSegmentation;MitkMultilabel;MitkDICOMReader;MitkDICOMReaderServices;MitkDicomRT") +mitkSwigAddLibraryDependencies(pyMITK "MitkCore;MitkCLCore;MitkCLUtilities;ITKCommon;MitkMatchPointRegistration;MitkSegmentation;MitkMultilabel;MitkDICOM;MitkDICOMImageIO;MitkRT") mitk_target_link_libraries_with_dynamic_lookup(${SWIG_MODULE_pyMITK_REAL_NAME} ${PYTHON_LIBRARIES}) if(DEFINED SKBUILD) message(WARNING "SKBuild exists") # Currently this installation install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pyMITK.py ${CMAKE_CURRENT_SOURCE_DIR}/Packaging/__init__.py # ${MITK_DOC_FILES} DESTINATION pyMITK COMPONENT Runtime ) install(TARGETS ${SWIG_MODULE_pyMITK_REAL_NAME} RUNTIME DESTINATION pyMITK LIBRARY DESTINATION pyMITK COMPONENT Runtime ) else() message(WARNING "SKBuild missing") include(LegacyPackaging.cmake) endif()