Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] User-Defined Calibration Not Affecting Measurements in Cornerstone Viewport #1711

Open
tokyobordel opened this issue Dec 17, 2024 · 1 comment

Comments

@tokyobordel
Copy link

Describe the Bug

Calibration does not change the values ​​of drawn annotations. My code:

const calibration = {
  scale: 2.0,
  type: cornerstoneCore.Enums.CalibrationTypes.USER
};

cornerstoneTools.utilities.calibrateImageSpacing(
  viewport.getCurrentImageId(),
  viewport.getRenderingEngine(),
  calibration
) 

In theory, after executing this code, a value should be written to the "calibration" field of stack viewport instance, but I still have undefined.
Version on Cornerstone3D: 2.12.0

Steps to Reproduce

const calibration = {
  scale: 2.0,
  type: cornerstoneCore.Enums.CalibrationTypes.USER
};

cornerstoneTools.utilities.calibrateImageSpacing(
  viewport.getCurrentImageId(),
  viewport.getRenderingEngine(),
  calibration
) 

The current behavior

Calibration does not change the values ​​of drawn annotations.

The expected behavior

The values ​​of the drawn annotations have changed according to the calibration parameters.

OS

Windows 10

Node version

20.15.1

Browser

Chrome 130.0.6723.70

@sedghi
Copy link
Member

sedghi commented Dec 17, 2024

Does this example work? https://www.cornerstonejs.org/live-examples/calibrationtools

maybe see the code to see how we do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants