Skip to content

Commit

Permalink
Test branch for #143
Browse files Browse the repository at this point in the history
  • Loading branch information
swederik committed Dec 8, 2017
1 parent 688312c commit fc80696
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions dist/cornerstoneWADOImageLoader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cornerstoneWADOImageLoader.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cornerstoneWADOImageLoader.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cornerstoneWADOImageLoader.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cornerstoneWADOImageLoaderWebWorker.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cornerstoneWADOImageLoaderWebWorker.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/cornerstone.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/cornerstone.min.js.map

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/imageLoader/createImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@ function createImage (imageId, pixelData, transferSyntax, options) {
image.voiLUT = voiLutModule.voiLUTSequence[0];
}

if (image.color) {
image.windowWidth = 255;
image.windowCenter = 127;
}

// set the ww/wc to cover the dynamic range of the image if no values are supplied
if (image.windowCenter === undefined || image.windowWidth === undefined) {
if (image.color) {
image.windowWidth = 255;
image.windowCenter = 128;
} else {
const maxVoi = image.maxPixelValue * image.slope + image.intercept;
const minVoi = image.minPixelValue * image.slope + image.intercept;

image.windowWidth = maxVoi - minVoi;
image.windowCenter = (maxVoi + minVoi) / 2;
}
const maxVoi = image.maxPixelValue * image.slope + image.intercept;
const minVoi = image.minPixelValue * image.slope + image.intercept;

image.windowWidth = maxVoi - minVoi;
image.windowCenter = (maxVoi + minVoi) / 2;
}
resolve(image);
}, reject);
Expand Down

0 comments on commit fc80696

Please sign in to comment.