Hi Support Team,
I am experiencing an issue with applying user-defined calibration in my Cornerstone viewport. I have tried using both utilities.calibratedPixelSpacingMetadataProvider.add()
and utilities.calibrateImageSpacing()
to set the calibration, but neither approach seems to affect the measurements as expected.
Here is the relevant part of my code:
const calibration = {
scale: 0.5,
type: cornerstone.Enums.CalibrationTypes.USER,
};
const renderingEngine = getRenderingEngine(this.renderingEngineId);
const viewport = <Types.IStackViewport>renderingEngine.getViewport(this.viewportId);
utilities.calibratedPixelSpacingMetadataProvider.add(url[0], calibration);
viewport.calibrateSpacing(url[0]);
// Also tried
utilities.calibrateImageSpacing(url[0], renderingEngine, calibration);
Expected Behavior: Measurements should be scaled according to the user-defined calibration.
Actual Behavior: Measurements remain unchanged after applying the calibration.
Below Cornerstone Version I am using
“@cornerstonejs/core”: “^1.77.0”,
“@cornerstonejs/streaming-image-volume-loader”: “^1.77.0”,
“@cornerstonejs/tools”: “^1.77.0”,