Skip to content

Commit

Permalink
fix(ImageDataToCornerstoneImage): swap cornerstone image rows&columns
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqi authored and zhangjiaqi committed Dec 31, 2019
1 parent 772d31b commit e5301be
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/Filters/Cornerstone/ImageDataToCornerstoneImage/index.js
Expand Up @@ -37,7 +37,7 @@ function vtkImageDataToCornerstoneImage(publicAPI, model) {
// FIXME probably need to expand to RGBA
let pixelData = null;
if (dims[2] === 1) {
pixelData = scalars.data;
pixelData = (scalars.data === null || scalars.data === undefined) ? rawData : scalars.data;
} else {
const offset =
model.sliceIndex * dims[0] * dims[1] * rawData.BYTES_PER_ELEMENT;
Expand All @@ -52,13 +52,13 @@ function vtkImageDataToCornerstoneImage(publicAPI, model) {
imageId: model.imageId,
color: scalars.getNumberOfComponents() > 1,

columnPixelSpacing: spacing[1],
columns: dims[1],
width: dims[1],
columnPixelSpacing: spacing[0],
columns: dims[0],
width: dims[0],

rowPixelSpacing: spacing[0],
rows: dims[0],
height: dims[0],
rowPixelSpacing: spacing[1],
rows: dims[1],
height: dims[1],

intercept: 0,
invert: false,
Expand Down

0 comments on commit e5301be

Please sign in to comment.