diff --git a/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h b/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h index cdd4022a92..8131a8fad1 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. */ 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 relevant file list.*/ + * 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/DICOMReader/include/mitkBaseDICOMReaderService.h b/Modules/DICOMReader/include/mitkBaseDICOMReaderService.h index aa56718ad8..edfe8e3a90 100644 --- a/Modules/DICOMReader/include/mitkBaseDICOMReaderService.h +++ b/Modules/DICOMReader/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" namespace mitk { /** Base class for service wrappers that make DICOMFileReader from the DICOMReader module usable. */ class MITKDICOMREADER_EXPORT BaseDICOMReaderService : public AbstractFileReader { public: BaseDICOMReaderService(const std::string& description); BaseDICOMReaderService(const mitk::CustomMimeType& customType, const std::string& description); using AbstractFileReader::Read; IFileReader::ConfidenceLevel GetConfidenceLevel() const override; protected: /** 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 descission may be based - * one the passed relevant file list.*/ + /** 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); } #endif // MITKBASEDICOMREADERSERVICE_H diff --git a/Modules/DICOMReaderServices/include/mitkAutoSelectingDICOMReaderService.h b/Modules/DICOMReaderServices/include/mitkAutoSelectingDICOMReaderService.h index b4a3023aba..e0087dd882 100644 --- a/Modules/DICOMReaderServices/include/mitkAutoSelectingDICOMReaderService.h +++ b/Modules/DICOMReaderServices/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. */ class AutoSelectingDICOMReaderService : public BaseDICOMReaderService { public: AutoSelectingDICOMReaderService(); protected: - /** Returns the reader instance that should be used. The descission may be based - * one the passed relevant file list.*/ + /** 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/mitkManualSelectingDICOMReaderService.h b/Modules/DICOMReaderServices/include/mitkManualSelectingDICOMReaderService.h index 18468d373b..50dd72d7f7 100644 --- a/Modules/DICOMReaderServices/include/mitkManualSelectingDICOMReaderService.h +++ b/Modules/DICOMReaderServices/include/mitkManualSelectingDICOMReaderService.h @@ -1,43 +1,43 @@ /*============================================================================ 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 MITKMANUALSELECTINGDICOMREADERSERVICE_H #define MITKMANUALSELECTINGDICOMREADERSERVICE_H #include #include namespace mitk { /** Service wrapper that offers a manual selection of the DICOMFileReader configuration that should be used. */ class ManualSelectingDICOMReaderService : public BaseDICOMReaderService { public: ManualSelectingDICOMReaderService(); protected: - /** Returns the reader instance that should be used. The descission may be based - * one the passed relevant file list.*/ + /** 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: ManualSelectingDICOMReaderService* Clone() const override; DICOMFileReaderSelector::Pointer m_Selector; }; } #endif // MITKMANUALSELECTINGDICOMREADERSERVICE_H diff --git a/Modules/DICOMReaderServices/include/mitkSimpleVolumeDICOMSeriesReaderService.h b/Modules/DICOMReaderServices/include/mitkSimpleVolumeDICOMSeriesReaderService.h index fd71f1844e..10a5ace8a0 100644 --- a/Modules/DICOMReaderServices/include/mitkSimpleVolumeDICOMSeriesReaderService.h +++ b/Modules/DICOMReaderServices/include/mitkSimpleVolumeDICOMSeriesReaderService.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 MITKSIMPLEVOLUMEDICOMSERIESREADERSERVICE_H #define MITKSIMPLEVOLUMEDICOMSERIESREADERSERVICE_H #include namespace mitk { /** Service wrapper that selects a DICOMITKSeriesGDCMReader configured for a simple and non-restrictive 3D volume import. */ class SimpleVolumeDICOMSeriesReaderService : public BaseDICOMReaderService { public: SimpleVolumeDICOMSeriesReaderService(); protected: - /** Returns the reader instance that should be used. The descission may be based - * one the passed relevant file list.*/ + /** 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: SimpleVolumeDICOMSeriesReaderService* Clone() const override; }; } #endif // MITKSIMPLEVOLUMEDICOMSERIESREADERSERVICE_H diff --git a/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.cpp b/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.cpp index e6a54654e9..61cbded071 100644 --- a/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.cpp +++ b/Modules/DICOMReaderServices/src/mitkDICOMReaderServicesActivator.cpp @@ -1,94 +1,94 @@ /*============================================================================ 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 "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 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) { - m_AutoSelectingDICOMReader.reset(new AutoSelectingDICOMReaderService()); - m_SimpleVolumeDICOMSeriesReader.reset(new SimpleVolumeDICOMSeriesReaderService()); - m_ManualSelectingDICOMSeriesReader.reset(new ManualSelectingDICOMReaderService()); + m_AutoSelectingDICOMReader = std::make_unique(); + m_SimpleVolumeDICOMSeriesReader = std::make_unique(); + m_ManualSelectingDICOMSeriesReader = std::make_unique(); - m_DICOMTagsOfInterestService.reset(new DICOMTagsOfInterestService()); + 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()); } void DICOMReaderServicesActivator::Unload(us::ModuleContext*) { } } US_EXPORT_MODULE_ACTIVATOR(mitk::DICOMReaderServicesActivator)