MCPcopy Create free account
hub / github.com/MITK/MITK / DescribeImageWithProperties

Method DescribeImageWithProperties

Modules/DICOM/src/mitkDICOMImageBlockDescriptor.cpp:466–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

464}
465
466mitk::Image::Pointer mitk::DICOMImageBlockDescriptor::DescribeImageWithProperties( Image* mitkImage )
467{
468 // TODO: this is a collection of properties that have been provided by the
469 // legacy DicomSeriesReader.
470 // We should at some point clean up this collection and name them in a more
471 // consistent way!
472
473 if ( !mitkImage )
474 return mitkImage;
475
476 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_FILES()), this->GetProperty("filenamesForSlices"));
477 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_PIXEL_SPACING_INTERPRETATION_STRING()),
478 StringProperty::New(PixelSpacingInterpretationToString(this->GetPixelSpacingInterpretation())));
479 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_PIXEL_SPACING_INTERPRETATION()),
480 GenericProperty<PixelSpacingInterpretation>::New(this->GetPixelSpacingInterpretation()));
481 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_IMPLEMENTATION_LEVEL_STRING()),
482 StringProperty::New(ReaderImplementationLevelToString(m_ReaderImplementationLevel)));
483 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_IMPLEMENTATION_LEVEL()),
484 GenericProperty<ReaderImplementationLevel>::New(m_ReaderImplementationLevel));
485 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_GANTRY_TILT_CORRECTED()),
486 BoolProperty::New(this->GetTiltInformation().IsRegularGantryTilt()));
487 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_3D_plus_t()), BoolProperty::New(this->GetFlag("3D+t", false)));
488 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_GDCM()), StringProperty::New(gdcm::Version::GetVersion()));
489 mitkImage->SetProperty(PropertyKeyPathToPropertyName(DICOMIOMetaInformationPropertyConstants::READER_DCMTK()), StringProperty::New(PACKAGE_VERSION));
490
491 if (nullptr != m_SplitReason && m_SplitReason->HasReasons())
492 {
493 mitkImage->SetProperty(PropertyKeyPathToPropertyName(IOMetaInformationPropertyConstants::VOLUME_SPLIT_REASON()), StringProperty::New(IOVolumeSplitReason::ToJSON(m_SplitReason).dump()));
494 }
495
496 // get all found additional tags of interest
497
498 for (const auto &tag : m_FoundAdditionalTags)
499 {
500 BaseProperty* prop = this->GetProperty(tag);
501 if (prop)
502 {
503 mitkImage->SetProperty(tag.c_str(), prop);
504 }
505 }
506
507 /////////////////////////////////////////////////////////////////////////////
508 /////////////////////////////////////////////////////////////////////////////
509 //// Deprecated properties should be removed sooner then later (see above)
510 /////////////////////////////////////////////////////////////////////////////
511 /////////////////////////////////////////////////////////////////////////////
512
513 // first part: add some tags that describe individual slices
514 // these properties are defined at analysis time (see UpdateImageDescribingProperties())
515
516 const char* propertyKeySliceLocation = "dicom.image.0020.1041";
517 const char* propertyKeyInstanceNumber = "dicom.image.0020.0013";
518 const char* propertyKeySOPInstanceUID = "dicom.image.0008.0018";
519
520 mitkImage->SetProperty( propertyKeySliceLocation, this->GetProperty( "sliceLocationForSlices" ) );
521 mitkImage->SetProperty( propertyKeyInstanceNumber, this->GetProperty( "instanceNumberForSlices" ) );
522 mitkImage->SetProperty( propertyKeySOPInstanceUID, this->GetProperty( "SOPInstanceUIDForSlices" ) );
523 mitkImage->SetProperty( "files", this->GetProperty( "filenamesForSlices_deprecated" ) );

Callers 1

SetMitkImageMethod · 0.95

Calls 13

GetPropertyMethod · 0.95
GetTiltInformationMethod · 0.95
GetFlagMethod · 0.95
GetSOPClassUIDMethod · 0.95
GetSOPClassUIDAsNameMethod · 0.95
GetPropertyAsStringMethod · 0.95
ToJSONFunction · 0.85
HasReasonsMethod · 0.80
NewFunction · 0.50
SetPropertyMethod · 0.45

Tested by

no test coverage detected