From f96afc95a8a9298d190d5205a70ca0522b8db765 Mon Sep 17 00:00:00 2001 From: Krad Date: Thu, 7 Apr 2022 14:16:37 +0800 Subject: [PATCH] Read Image orientation to property --- src/src/base/DICOMDirectoryHelper.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/src/base/DICOMDirectoryHelper.cpp b/src/src/base/DICOMDirectoryHelper.cpp index 86a9060..220f537 100644 --- a/src/src/base/DICOMDirectoryHelper.cpp +++ b/src/src/base/DICOMDirectoryHelper.cpp @@ -121,6 +121,15 @@ void DICOMDirectoryHelper::getFileProperty(const std::string &path, DICOMFileMap dataset->findAndGetFloat64(DcmTagKey(0x0028, 0x0030), Spacing[1], 1); seriesProperty->SetSpacing(Spacing); + double orientation[6] = {.0, .0, .0, .0, .0, .0}; + dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0037), orientation[0], 0); + dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0037), orientation[1], 1); + dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0037), orientation[2], 2); + dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0037), orientation[3], 3); + dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0037), orientation[4], 4); + dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0037), orientation[5], 5); + seriesProperty->SetDirectionCosine(orientation); + unsigned short SamplePerPixel = 0; dataset->findAndGetUint16(DcmTagKey(0x0028, 0x0002), SamplePerPixel); seriesProperty->SetSamplePerPixel(SamplePerPixel);