cornerstoneTools icon indicating copy to clipboard operation
cornerstoneTools copied to clipboard

Spatial calibration tool

Open ruben-cruz opened this issue 4 years ago • 4 comments

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

ruben-cruz avatar Feb 20 '20 12:02 ruben-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.

  1. Add a metadata provider with a very high priority
  2. Measure a length
  3. Prompt for actual length
  4. Do some math
  5. For the calibrated image, add an imagePlaneModule entry that returns all of the previous plane information, but with the new/modified pixelSpacing

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.

dannyrb avatar Feb 20 '20 13:02 dannyrb

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 avatar Jun 05 '20 01:06 cpinchuk

@cpinchuk can you share that with us?

ruben-cruz avatar Sep 21 '21 11:09 ruben-cruz

How do you update the metadata of an image?

rmatesicZavy avatar Aug 04 '22 06:08 rmatesicZavy