irc_web/.svn/pristine/36/36893689f3bf023454ab1a16575...

24 lines
614 B
Plaintext

import * as cornerstoneTools from 'cornerstone-tools'
const external = cornerstoneTools.external
export default function getPixelSpacing(image) {
const imagePlane = external.cornerstone.metaData.get(
'imagePlaneModule',
image.imageId
)
if (imagePlane) {
return {
rowPixelSpacing:
imagePlane.rowPixelSpacing || imagePlane.rowImagePixelSpacing,
colPixelSpacing:
imagePlane.columnPixelSpacing || imagePlane.colImagePixelSpacing
}
}
return {
rowPixelSpacing: image.rowPixelSpacing,
colPixelSpacing: image.columnPixelSpacing
}
}