cornerstoneWebImageLoader icon indicating copy to clipboard operation
cornerstoneWebImageLoader copied to clipboard

metaDataProvider imagePlaneModule get pixelSpacing

Open DStar2013 opened this issue 5 years ago • 0 comments

metaDataProvider `if (type === 'imagePlaneModule') {

const imageOrientationPatient = getNumberValues(dataSet, 'x00200037', 6);
const imagePositionPatient = getNumberValues(dataSet, 'x00200032', 3);
const pixelSpacing = getNumberValues(dataSet, 'x00280030', 2);
let columnPixelSpacing = null;
let rowPixelSpacing = null;

if (pixelSpacing) {
  rowPixelSpacing = pixelSpacing[0];
  columnPixelSpacing = pixelSpacing[1];
}

let rowCosines = null;
let columnCosines = null;

if (imageOrientationPatient) {
  rowCosines = [parseFloat(imageOrientationPatient[0]), parseFloat(imageOrientationPatient[1]), parseFloat(imageOrientationPatient[2])];
  columnCosines = [parseFloat(imageOrientationPatient[3]), parseFloat(imageOrientationPatient[4]), parseFloat(imageOrientationPatient[5])];
}

return {
  frameOfReferenceUID: dataSet.string('x00200052'),
  rows: dataSet.uint16('x00280010'),
  columns: dataSet.uint16('x00280011'),
  imageOrientationPatient,
  rowCosines,
  columnCosines,
  imagePositionPatient,
  sliceThickness: dataSet.floatString('x00180050'),
  sliceLocation: dataSet.floatString('x00201041'),
  pixelSpacing,
  rowPixelSpacing,
  columnPixelSpacing
};

}`

if dicom refined. it has pixelspacing or sometimes only has imagePixelSpacing. naybe can do some compatibility?

DStar2013 avatar Apr 04 '19 03:04 DStar2013