comparison Framework/Toolbox/GeometryToolbox.cpp @ 118:a4d0b6c82b29 wasm

using Orthanc::DicomMap instead of OrthancPlugins::DicomDatasetReader
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Oct 2017 14:31:26 +0200
parents 2eca030792aa
children e2fe9352f240
comparison
equal deleted inserted replaced
117:42c05a3baee3 118:a4d0b6c82b29
66 return true; 66 return true;
67 } 67 }
68 68
69 69
70 bool ParseVector(Vector& target, 70 bool ParseVector(Vector& target,
71 const OrthancPlugins::IDicomDataset& dataset, 71 const Orthanc::DicomMap& dataset,
72 const OrthancPlugins::DicomPath& tag) 72 const Orthanc::DicomTag& tag)
73 { 73 {
74 std::string value; 74 std::string value;
75 return (dataset.GetStringValue(value, tag) && 75 return (dataset.CopyToString(value, tag, false) &&
76 ParseVector(target, value)); 76 ParseVector(target, value));
77 } 77 }
78 78
79 79
80 void AssignVector(Vector& v, 80 void AssignVector(Vector& v,
349 } 349 }
350 350
351 351
352 void GetPixelSpacing(double& spacingX, 352 void GetPixelSpacing(double& spacingX,
353 double& spacingY, 353 double& spacingY,
354 const OrthancPlugins::IDicomDataset& dicom) 354 const Orthanc::DicomMap& dicom)
355 { 355 {
356 Vector v; 356 Vector v;
357 357
358 if (ParseVector(v, dicom, OrthancPlugins::DICOM_TAG_PIXEL_SPACING)) 358 if (ParseVector(v, dicom, Orthanc::DICOM_TAG_PIXEL_SPACING))
359 { 359 {
360 if (v.size() != 2 || 360 if (v.size() != 2 ||
361 v[0] <= 0 || 361 v[0] <= 0 ||
362 v[1] <= 0) 362 v[1] <= 0)
363 { 363 {