Read Image orientation to property

This commit is contained in:
Krad
2022-04-07 14:16:37 +08:00
parent b0b5401c77
commit f96afc95a8

View File

@@ -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);