Read spacing and position to property

This commit is contained in:
Krad
2022-04-15 09:10:20 +08:00
parent 50f7a50946
commit a7311bb898

View File

@@ -116,7 +116,7 @@ void DICOMDirectoryHelper::getFileProperty(const std::string &path, DICOMFileMap
dataset->findAndGetFloat64(DcmTagKey(0x0028, 0x1051), WindowWidth);
seriesProperty->AddWindowLevelPreset(WindowWidth, WindowCenter);
double Spacing[2] = {0.0,0.0};
double Spacing[3] = {0.0, 0.0, 0.0};
dataset->findAndGetFloat64(DcmTagKey(0x0028, 0x0030), Spacing[0], 0);
dataset->findAndGetFloat64(DcmTagKey(0x0028, 0x0030), Spacing[1], 1);
seriesProperty->SetSpacing(Spacing);
@@ -130,6 +130,12 @@ void DICOMDirectoryHelper::getFileProperty(const std::string &path, DICOMFileMap
dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0037), orientation[5], 5);
seriesProperty->SetDirectionCosine(orientation);
double position[3] = {.0, .0, .0};
dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0032), position[0], 0);
dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0032), position[1], 1);
dataset->findAndGetFloat64(DcmTagKey(0x0020, 0x0032), position[2], 2);
seriesProperty->SetPosition(position);
unsigned short SamplePerPixel = 0;
dataset->findAndGetUint16(DcmTagKey(0x0028, 0x0002), SamplePerPixel);
seriesProperty->SetSamplePerPixel(SamplePerPixel);