diff --git a/Modules/DICOMQI/mitkDICOMQIPropertyHelper.cpp b/Modules/DICOMQI/mitkDICOMQIPropertyHelper.cpp index b9c1bb6f49..54c58a7a95 100644 --- a/Modules/DICOMQI/mitkDICOMQIPropertyHelper.cpp +++ b/Modules/DICOMQI/mitkDICOMQIPropertyHelper.cpp @@ -1,94 +1,96 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include "mitkDICOMQIPropertyHelper.h" namespace mitk { - void DICOMQIPropertyHandler::DeriveDICOMSourceProperties(const BaseData *sourceDICOMImage, BaseData *derivedDICOMImage) + void DICOMQIPropertyHelper::DeriveDICOMSourceProperties(const BaseData *sourceDICOMImage, BaseData *derivedDICOMImage) { // Check if original image is a DICOM image; if so, store relevant DICOM Tags into the PropertyList of new - // segmentation image + // segmentation/PM image PropertyList::Pointer sourcePropertyList = sourceDICOMImage->GetPropertyList(); bool parentIsDICOM = false; for (const auto &element : *(sourcePropertyList->GetMap())) { if (element.first.find("DICOM") == 0) { parentIsDICOM = true; break; } } if (!parentIsDICOM) return; + PropertyList::Pointer propertyList = derivedDICOMImage->GetPropertyList(); //====== Patient information ====== // Add DICOM Tag (0010,0010) patient's name; default "No Name" AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0010, 0x0010), "NO NAME"); // Add DICOM Tag (0010,0020) patient id; default "No Name" AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0010, 0x0020), "NO NAME"); // Add DICOM Tag (0010,0030) patient's birth date; no default AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0010, 0x0030)); // Add DICOM Tag (0010,0040) patient's sex; default "U" (Unknown) AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0010, 0x0040), "U"); //====== General study ====== // Add DICOM Tag (0020,000D) Study Instance UID; no default --> MANDATORY! AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0020, 0x000D)); // Add DICOM Tag (0080,0020) Study Date; no default (think about "today") AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0080, 0x0020)); // Add DICOM Tag (0008,0050) Accession Number; no default AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0008, 0x0050)); // Add DICOM Tag (0008,1030) Study Description; no default AdoptReferenceDICOMProperty(sourcePropertyList, propertyList, DICOMTag(0x0008, 0x1030)); + //====== Reference DICOM data ====== // Add reference file paths to referenced DICOM data BaseProperty::Pointer dcmFilesProp = sourcePropertyList->GetProperty("files"); if (dcmFilesProp.IsNotNull()) propertyList->SetProperty("referenceFiles", dcmFilesProp); } - void DICOMQIPropertyHandler::AdoptReferenceDICOMProperty(PropertyList *referencedPropertyList, + void DICOMQIPropertyHelper::AdoptReferenceDICOMProperty(PropertyList *referencedPropertyList, PropertyList *propertyList, const DICOMTag &tag, const std::string &defaultString) { std::string tagString = GeneratePropertyNameForDICOMTag(tag.GetGroup(), tag.GetElement()); // Get DICOM property from referenced image BaseProperty::Pointer originalProperty = referencedPropertyList->GetProperty(tagString.c_str()); - + // if property exists, copy the informtaion to the derived image if (originalProperty.IsNotNull()) propertyList->SetProperty(tagString.c_str(), originalProperty); else // use the default value, if there is one { if (!defaultString.empty()) propertyList->SetProperty(tagString.c_str(), TemporoSpatialStringProperty::New(defaultString).GetPointer()); } } } diff --git a/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h b/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h index 114ae2aff9..9956696388 100644 --- a/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h +++ b/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h @@ -1,40 +1,40 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef DICOMQIPROPERTYHANDLER_H_ -#define DICOMQIPROPERTYHANDLER_H_ +#ifndef DICOMQIPROPERTYHELPER_H_ +#define DICOMQIPROPERTYHELPER_H_ #include #include #include namespace mitk { - class MITKDICOMQI_EXPORT DICOMQIPropertyHandler + class MITKDICOMQI_EXPORT DICOMQIPropertyHelper { public: static void DeriveDICOMSourceProperties(const BaseData *sourceDICOMImage, BaseData *derivedDICOMImage); private: static void AdoptReferenceDICOMProperty(PropertyList *referencedPropertyList, PropertyList *propertyList, const DICOMTag &tag, const std::string &defaultString = ""); //------------- }; } #endif diff --git a/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.cpp b/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.cpp index c87dabecd2..84f0788c50 100644 --- a/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.cpp +++ b/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.cpp @@ -1,177 +1,177 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include #include #include #include #include #include #include "mitkDICOMSegmentationPropertyHelper.h" #include #include namespace mitk { - void DICOMSegmentationPropertyHandler::DeriveDICOMSegmentationProperties(LabelSetImage* dicomSegImage) + void DICOMSegmentationPropertyHelper::DeriveDICOMSegmentationProperties(LabelSetImage* dicomSegImage) { PropertyList::Pointer propertyList = dicomSegImage->GetPropertyList(); // Add DICOM Tag (0008, 0060) Modality "SEG" propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0008, 0x0060).c_str(), TemporoSpatialStringProperty::New("SEG")); // Add DICOM Tag (0008,103E) Series Description propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0008, 0x103E).c_str(), TemporoSpatialStringProperty::New("MITK Segmentation")); // Add DICOM Tag (0070,0084) Content Creator Name propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0070, 0x0084).c_str(), TemporoSpatialStringProperty::New("MITK")); // Add DICOM Tag (0012, 0071) Clinical Trial Series ID propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0071).c_str(), TemporoSpatialStringProperty::New("Session 1")); // Add DICOM Tag (0012,0050) Clinical Trial Time Point ID propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0050).c_str(), TemporoSpatialStringProperty::New("0")); // Add DICOM Tag (0012, 0060) Clinical Trial Coordinating Center Name propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0060).c_str(), TemporoSpatialStringProperty::New("Unknown")); // Set DICOM properties for each label // Iterate over all layers for (unsigned int layer = 0; layer < dicomSegImage->GetNumberOfLayers(); ++layer) { // Iterate over all labels const LabelSet *labelSet = dicomSegImage->GetLabelSet(layer); auto labelIter = labelSet->IteratorConstBegin(); // Ignore background label ++labelIter; for (; labelIter != labelSet->IteratorConstEnd(); ++labelIter) { Label::Pointer label = labelIter->second; SetDICOMSegmentProperties(label); } } } - void DICOMSegmentationPropertyHandler::SetDICOMSegmentProperties(Label *label) + void DICOMSegmentationPropertyHelper::SetDICOMSegmentProperties(Label *label) { PropertyList::Pointer propertyList = PropertyList::New(); AnatomicalStructureColorPresets::Category category; AnatomicalStructureColorPresets::Type type; auto presets = vtkSmartPointer::New(); presets->LoadPreset(); for (const auto &preset : presets->GetCategoryPresets()) { auto presetOrganName = preset.first; if (label->GetName().compare(presetOrganName) == 0) { category = preset.second; break; } } for (const auto &preset : presets->GetTypePresets()) { auto presetOrganName = preset.first; if (label->GetName().compare(presetOrganName) == 0) { type = preset.second; break; } } //------------------------------------------------------------ // Add Segment Sequence tags (0062, 0002) // Segment Number:Identification number of the segment.The value of Segment Number(0062, 0004) shall be unique // within the Segmentation instance in which it is created label->SetProperty(DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_NUMBER_PATH()).c_str(), TemporoSpatialStringProperty::New(std::to_string(label->GetValue()))); // Segment Label: User-defined label identifying this segment. label->SetProperty(DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_LABEL_PATH()).c_str(), TemporoSpatialStringProperty::New(label->GetName())); // Segment Algorithm Type: Type of algorithm used to generate the segment. AUTOMATIC SEMIAUTOMATIC MANUAL label->SetProperty(DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_ALGORITHM_TYPE_PATH()).c_str(), TemporoSpatialStringProperty::New("SEMIAUTOMATIC")); //------------------------------------------------------------ // Add Segmented Property Category Code Sequence tags (0062, 0003): Sequence defining the general category of this // segment. // (0008,0100) Code Value if (!category.codeValue.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_CATEGORY_CODE_VALUE_PATH()).c_str(), TemporoSpatialStringProperty::New(category.codeValue)); // (0008,0102) Coding Scheme Designator if (!category.codeScheme.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_CATEGORY_CODE_SCHEME_PATH()).c_str(), TemporoSpatialStringProperty::New(category.codeScheme)); // (0008,0104) Code Meaning if (!category.codeName.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_CATEGORY_CODE_MEANING_PATH()).c_str(), TemporoSpatialStringProperty::New(category.codeName)); //------------------------------------------------------------ // Add Segmented Property Type Code Sequence (0062, 000F): Sequence defining the specific property type of this // segment. // (0008,0100) Code Value if (!type.codeValue.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_TYPE_CODE_VALUE_PATH()).c_str(), TemporoSpatialStringProperty::New(type.codeValue)); // (0008,0102) Coding Scheme Designator if (!type.codeScheme.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_TYPE_CODE_SCHEME_PATH()).c_str(), TemporoSpatialStringProperty::New(type.codeScheme)); // (0008,0104) Code Meaning if (!type.codeName.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_TYPE_CODE_MEANING_PATH()).c_str(), TemporoSpatialStringProperty::New(type.codeName)); //------------------------------------------------------------ // Add Segmented Property Type Modifier Code Sequence (0062,0011): Sequence defining the modifier of the property // type of this segment. // (0008,0100) Code Value if (!type.modifier.codeValue.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_MODIFIER_CODE_VALUE_PATH()).c_str(), TemporoSpatialStringProperty::New(type.modifier.codeValue)); // (0008,0102) Coding Scheme Designator if (!type.modifier.codeScheme.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_MODIFIER_CODE_SCHEME_PATH()).c_str(), TemporoSpatialStringProperty::New(type.modifier.codeScheme)); // (0008,0104) Code Meaning if (!type.modifier.codeName.empty()) label->SetProperty( DICOMTagPathToPropertyName(DICOMSegmentationConstants::SEGMENT_MODIFIER_CODE_MEANING_PATH()).c_str(), TemporoSpatialStringProperty::New(type.modifier.codeName)); } } diff --git a/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h b/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h index 438f5875f2..00ec85a1b1 100644 --- a/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h +++ b/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h @@ -1,35 +1,35 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef DICOMPMPROPERTYHANDLER_H_ -#define DICOMPMPROPERTYHANDLER_H_ +#ifndef DICOMPMPROPERTYHELPER_H_ +#define DICOMPMPROPERTYHELPER_H_ #include #include #include #include namespace mitk { - class MITKMULTILABEL_EXPORT DICOMSegmentationPropertyHandler + class MITKMULTILABEL_EXPORT DICOMSegmentationPropertyHelper { public: static void DeriveDICOMSegmentationProperties(LabelSetImage* dicomSegImage); static void SetDICOMSegmentProperties(Label *label); }; } #endif diff --git a/Modules/Pharmacokinetics/files.cmake b/Modules/Pharmacokinetics/files.cmake index 1b18f9974f..0289a227c1 100644 --- a/Modules/Pharmacokinetics/files.cmake +++ b/Modules/Pharmacokinetics/files.cmake @@ -1,70 +1,70 @@ file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") set(CPP_FILES Common/mitkAterialInputFunctionGenerator.cpp Common/mitkAIFParametrizerHelper.cpp Common/mitkConcentrationCurveGenerator.cpp Common/mitkDescriptionParameterImageGeneratorBase.cpp Common/mitkPixelBasedDescriptionParameterImageGenerator.cpp Common/mitkDICOMPMConstants.cpp - Common/mitkDICOMPMPropertyHandler.cpp + Common/mitkDICOMPMPropertyHelper.cpp Common/mitkParamapPresets.cpp DescriptionParameters/mitkCurveDescriptionParameterBase.cpp DescriptionParameters/mitkAreaUnderTheCurveDescriptionParameter.cpp DescriptionParameters/mitkAreaUnderFirstMomentDescriptionParameter.cpp DescriptionParameters/mitkMeanResidenceTimeDescriptionParameter.cpp DescriptionParameters/mitkTimeToPeakCurveDescriptionParameter.cpp DescriptionParameters/mitkMaximumCurveDescriptionParameter.cpp Functors/mitkCurveParameterFunctor.cpp Models/mitkAIFBasedModelBase.cpp Models/mitkDescriptivePharmacokineticBrixModel.cpp Models/mitkDescriptivePharmacokineticBrixModelFactory.cpp Models/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.cpp Models/mitkDescriptivePharmacokineticBrixModelParameterizer.cpp Models/mitkThreeStepLinearModel.cpp Models/mitkThreeStepLinearModelFactory.cpp Models/mitkThreeStepLinearModelParameterizer.cpp Models/mitkTwoCompartmentExchangeModel.cpp Models/mitkTwoCompartmentExchangeModelFactory.cpp Models/mitkTwoCompartmentExchangeModelParameterizer.cpp Models/mitkNumericTwoCompartmentExchangeModel.cpp Models/mitkNumericTwoCompartmentExchangeModelFactory.cpp Models/mitkNumericTwoCompartmentExchangeModelParameterizer.cpp Models/mitkExtendedToftsModel.cpp Models/mitkExtendedToftsModelFactory.cpp Models/mitkExtendedToftsModelParameterizer.cpp Models/mitkStandardToftsModel.cpp Models/mitkStandardToftsModelFactory.cpp Models/mitkStandardToftsModelParameterizer.cpp Models/mitkOneTissueCompartmentModel.cpp Models/mitkOneTissueCompartmentModelFactory.cpp Models/mitkOneTissueCompartmentModelParameterizer.cpp Models/mitkExtendedOneTissueCompartmentModel.cpp Models/mitkExtendedOneTissueCompartmentModelFactory.cpp Models/mitkExtendedOneTissueCompartmentModelParameterizer.cpp Models/mitkTwoTissueCompartmentModel.cpp Models/mitkTwoTissueCompartmentModelFactory.cpp Models/mitkTwoTissueCompartmentModelParameterizer.cpp Models/mitkTwoTissueCompartmentFDGModel.cpp Models/mitkTwoTissueCompartmentFDGModelFactory.cpp Models/mitkTwoTissueCompartmentFDGModelParameterizer.cpp Models/mitkNumericTwoTissueCompartmentModel.cpp Models/mitkNumericTwoTissueCompartmentModelFactory.cpp Models/mitkNumericTwoTissueCompartmentModelParameterizer.cpp SimulationFramework/mitkPerfusionDataGenerator.cpp SimulationFramework/mitkImageGenerationHelper.cpp ) set(HXX_FILES mitkDICOMSegmentationConstants.h ) set(MOC_H_FILES ) set(RESOURCE_FILES mitkParamapPresets.xml ) diff --git a/Modules/Pharmacokinetics/include/mitkDICOMPMPropertyHandler.h b/Modules/Pharmacokinetics/include/mitkDICOMPMPropertyHelper.h similarity index 51% rename from Modules/Pharmacokinetics/include/mitkDICOMPMPropertyHandler.h rename to Modules/Pharmacokinetics/include/mitkDICOMPMPropertyHelper.h index bb4030dce3..4a80a07263 100644 --- a/Modules/Pharmacokinetics/include/mitkDICOMPMPropertyHandler.h +++ b/Modules/Pharmacokinetics/include/mitkDICOMPMPropertyHelper.h @@ -1,38 +1,34 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ -#ifndef DICOMSEGMENTATIONPROPERTYHANDLER_H_ -#define DICOMSEGMENTATIONPROPERTYHANDLER_H_ +#ifndef DICOMSEGMENTATIONPROPERTYHELPER_H_ +#define DICOMSEGMENTATIONPROPERTYHELPER_H_ #include -//#include -//#include + #include namespace mitk { - class MITKPHARMACOKINETICS_EXPORT DICOMPMPropertyHandler + class MITKPHARMACOKINETICS_EXPORT DICOMPMPropertyHelper { public: - static PropertyList::Pointer GetDICOMPMProperties(PropertyList *referencedPropertyList); - static void SetReferenceDICOMProperty(PropertyList *referencedPropertyList, - PropertyList *propertyList, - const DICOMTag &tag, - const std::string &defaultString = ""); + static PropertyList::Pointer DeriveDICOMPMProperties(); + }; } // namespace mitk #endif diff --git a/Modules/Pharmacokinetics/src/Common/mitkDICOMPMPropertyHandler.cpp b/Modules/Pharmacokinetics/src/Common/mitkDICOMPMPropertyHandler.cpp deleted file mode 100644 index 7389f902b0..0000000000 --- a/Modules/Pharmacokinetics/src/Common/mitkDICOMPMPropertyHandler.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/*=================================================================== - -The Medical Imaging Interaction Toolkit (MITK) - -Copyright (c) German Cancer Research Center, -Division of Medical and Biological Informatics. -All rights reserved. - -This software is distributed WITHOUT ANY WARRANTY; without -even the implied warranty of MERCHANTABILITY or FITNESS FOR -A PARTICULAR PURPOSE. - -See LICENSE.txt or http://www.mitk.org for details. - -===================================================================*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include - -// us -#include -#include - -namespace mitk -{ - PropertyList::Pointer DICOMPMPropertyHandler::GetDICOMPMProperties(PropertyList *referencedPropertyList) - { - - PropertyList::Pointer propertyList = PropertyList::New(); - - // Add DICOM Tag (0008, 0060) Modality "SEG" - propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0008, 0x0060).c_str(), - TemporoSpatialStringProperty::New("PM")); - // Add DICOM Tag (0008,103E) Series Description - propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0008, 0x103E).c_str(), - TemporoSpatialStringProperty::New("MITK Parameter Map")); - // Add DICOM Tag (0070,0084) Content Creator Name - propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0070, 0x0084).c_str(), - TemporoSpatialStringProperty::New("MITK")); - // Add DICOM Tag (0012, 0071) Clinical Trial Series ID - propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0071).c_str(), - TemporoSpatialStringProperty::New("Session 1")); - // Add DICOM Tag (0012,0050) Clinical Trial Time Point ID - propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0050).c_str(), - TemporoSpatialStringProperty::New("0")); - // Add DICOM Tag (0012, 0060) Clinical Trial Coordinating Center Name - propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0060).c_str(), - TemporoSpatialStringProperty::New("Unknown")); - - // Check if original image is a DICOM image; if so, store relevant DICOM Tags into the PropertyList of new - // PM image - bool parentIsDICOM = false; - - for (const auto &element : *(referencedPropertyList->GetMap())) - { - if (element.first.find("DICOM") == 0) - { - parentIsDICOM = true; - break; - } - } - - if (!parentIsDICOM) - return propertyList; - - //====== Patient information ====== - - // Add DICOM Tag (0010,0010) patient's name; default "No Name" - DICOMPMPropertyHandler::SetReferenceDICOMProperty( - referencedPropertyList, propertyList, DICOMTag(0x0010, 0x0010), "NO NAME"); - // Add DICOM Tag (0010,0020) patient id; default "No Name" - DICOMPMPropertyHandler::SetReferenceDICOMProperty( - referencedPropertyList, propertyList, DICOMTag(0x0010, 0x0020), "NO NAME"); - // Add DICOM Tag (0010,0030) patient's birth date; no default - DICOMPMPropertyHandler::SetReferenceDICOMProperty(referencedPropertyList, propertyList, DICOMTag(0x0010, 0x0030)); - // Add DICOM Tag (0010,0040) patient's sex; default "U" (Unknown) - DICOMPMPropertyHandler::SetReferenceDICOMProperty( - referencedPropertyList, propertyList, DICOMTag(0x0010, 0x0040), "U"); - - //====== General study ====== - - // Add DICOM Tag (0020,000D) Study Instance UID; no default --> MANDATORY! - DICOMPMPropertyHandler::SetReferenceDICOMProperty(referencedPropertyList, propertyList, DICOMTag(0x0020, 0x000D)); - // Add DICOM Tag (0080,0020) Study Date; no default (think about "today") - DICOMPMPropertyHandler::SetReferenceDICOMProperty(referencedPropertyList, propertyList, DICOMTag(0x0080, 0x0020)); - // Add DICOM Tag (0008,0050) Accession Number; no default - DICOMPMPropertyHandler:: SetReferenceDICOMProperty(referencedPropertyList, propertyList, DICOMTag(0x0008, 0x0050)); - // Add DICOM Tag (0008,1030) Study Description; no default - DICOMPMPropertyHandler::SetReferenceDICOMProperty(referencedPropertyList, propertyList, DICOMTag(0x0008, 0x1030)); - - //====== Reference DICOM data ====== - - // Add reference file paths to referenced DICOM data - BaseProperty::Pointer dcmFilesProp = referencedPropertyList->GetProperty("files"); - if (dcmFilesProp.IsNotNull()) - propertyList->SetProperty("referenceFiles", dcmFilesProp); - - return propertyList; - } - - void DICOMPMPropertyHandler::SetReferenceDICOMProperty(PropertyList *referencedPropertyList, - PropertyList *propertyList, - const DICOMTag &tag, - const std::string &defaultString) - { - - std::string tagString = GeneratePropertyNameForDICOMTag(tag.GetGroup(), tag.GetElement()); - - // Get DICOM property from referenced image - BaseProperty::Pointer originalProperty = referencedPropertyList->GetProperty(tagString.c_str()); - - // if property exists, copy the informtaion to the segmentation - if (originalProperty.IsNotNull()) - propertyList->SetProperty(tagString.c_str(), originalProperty); - else // use the default value, if there is one - { - if (!defaultString.empty()) - propertyList->SetProperty(tagString.c_str(), TemporoSpatialStringProperty::New(defaultString).GetPointer()); - } - - } -} // namespace mitk diff --git a/Modules/Pharmacokinetics/src/Common/mitkDICOMPMPropertyHelper.cpp b/Modules/Pharmacokinetics/src/Common/mitkDICOMPMPropertyHelper.cpp new file mode 100644 index 0000000000..2b4e1ab23c --- /dev/null +++ b/Modules/Pharmacokinetics/src/Common/mitkDICOMPMPropertyHelper.cpp @@ -0,0 +1,71 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include + +// us +#include +#include + +namespace mitk +{ + PropertyList::Pointer DICOMPMPropertyHelper::DeriveDICOMPMProperties() + { + PropertyList::Pointer propertyList = PropertyList::New(); + + // Add DICOM Tag (0008, 0060) Modality "PM" + propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0008, 0x0060).c_str(), + TemporoSpatialStringProperty::New("PM")); + + // Add DICOM Tag (0008,103E) Series Description + propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0008, 0x103E).c_str(), + TemporoSpatialStringProperty::New("MITK Parameter Map")); + // Add DICOM Tag (0070,0084) Content Creator Name + propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0070, 0x0084).c_str(), + TemporoSpatialStringProperty::New("MITK")); + // Add DICOM Tag (0012, 0071) Clinical Trial Series ID + propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0071).c_str(), + TemporoSpatialStringProperty::New("Session 1")); + // Add DICOM Tag (0012,0050) Clinical Trial Time Point ID + propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0050).c_str(), + TemporoSpatialStringProperty::New("0")); + // Add DICOM Tag (0012, 0060) Clinical Trial Coordinating Center Name + propertyList->SetProperty(GeneratePropertyNameForDICOMTag(0x0012, 0x0060).c_str(), + TemporoSpatialStringProperty::New("Unknown")); + + + return propertyList; + } + + + +} // namespace mitk + + +