@lunit/insight-viewer
Advanced tools
Comparing version 1.0.2 to 1.0.3
import * as dicomParser from 'dicom-parser'; | ||
import { disable, displayImage, enable, getDefaultViewport, getEnabledElement, getStoredPixels, getViewport, internal, loadImage, pageToPixel, resize, setToPixelCoordinateSystem, setViewport } from 'cornerstone-core'; | ||
import { disable, displayImage, enable, getDefaultViewport, getDefaultViewportForImage, getEnabledElement, getStoredPixels, getViewport, internal, loadImage, pageToPixel, resize, setToPixelCoordinateSystem, setViewport } from 'cornerstone-core'; | ||
import * as cornerstone from 'cornerstone-core'; | ||
@@ -215,6 +215,10 @@ import { external } from 'cornerstone-wado-image-loader'; | ||
_this.onResize = function () { | ||
if (!_this.state.enabledElement) { | ||
if (!_this.state.enabledElement || !_this.state.image) { | ||
return; | ||
} | ||
resize(_this.element); | ||
var viewport = getDefaultViewportForImage(_this.element, _this.state.image); | ||
_this.setState(produce(function (draft) { | ||
draft.defaultViewport.scale = viewport.scale; | ||
})); | ||
}; | ||
@@ -221,0 +225,0 @@ return _this; |
@@ -220,6 +220,10 @@ 'use strict'; | ||
_this.onResize = function () { | ||
if (!_this.state.enabledElement) { | ||
if (!_this.state.enabledElement || !_this.state.image) { | ||
return; | ||
} | ||
cornerstone.resize(_this.element); | ||
var viewport = cornerstone.getDefaultViewportForImage(_this.element, _this.state.image); | ||
_this.setState(produce__default(function (draft) { | ||
draft.defaultViewport.scale = viewport.scale; | ||
})); | ||
}; | ||
@@ -226,0 +230,0 @@ return _this; |
{ | ||
"name": "@lunit/insight-viewer", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A React component for DICOM images", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48254
1153