cornerstoneTools
cornerstoneTools copied to clipboard
Spatial calibration tool
Hello everyone,
Does anyone know if Cornerstone has some calibration tool? If no, any suggestion on how it can be developed?
Thanks.
Best regards, Rúben Cruz
Related: https://github.com/cornerstonejs/cornerstoneTools/issues/264
Your best bet is to create a new tool similar to the ArrowAnnotate tool and Length tool.
- Add a metadata provider with a very high priority
- Measure a length
- Prompt for actual length
- Do some math
- For the calibrated image, add an
imagePlaneModule
entry that returns all of the previous plane information, but with the new/modifiedpixelSpacing
To undo the calibration, remove that metadata. To update it, swap in the updated data. All tools that request the imagePlaneModule
and use pixelSpacing
will magically start using the new value.
I have created such a tool. It takes the pixel size of the object and prompts the user to enter the size in mm, then it calculates the pixelSpacing and applies it via the metadata.
@cpinchuk can you share that with us?
How do you update the metadata of an image?