Hi everyone,
I’m working with Cornerstone3D (within an Cornestone v1.0 environment) and I’m trying to implement saving and retrieving annotations for entire DICOM series.
I’ve been using the annotationManager and specifically the annotationManager.saveAnnotations(frameOfReferenceUid) method to get the annotation data for a given series. While this works to export the annotations, the resulting JSON object is often extremely large, especially for series with a moderate to high number of annotations or complex annotations (e.g.,FreehandROI). This large JSON size is becoming problematic for storage (e.g., in our database or even for sending over the network efficiently). I’m wondering if:
-
saveAnnotations(frameOfReferenceUid) is indeed the intended way to serialize all annotations for a series, or if there’s a more granular/efficient approach I might be missing.
-
Are there any recommended strategies or built-in mechanisms within Cornerstone3D:
-
Compressing the annotation data before storage?
-
Serializing annotations in a more compact format?
-
Saving annotations on a per-slice/per-image basis and then re-associating them with the series on load (and if so, what’s the best practice for this)?
- Are there any examples or best practices from the community on how to handle potentially large annotation datasets for series effectively?
My goal is to find a more storage-efficient way to persist and retrieve these annotations. Any advice, pointers to examples, or suggestions on alternative approaches would be greatly appreciated!
Thanks in advance!
What steps can we follow to reproduce the bug?
This isn’t a “bug” in Cornerstone3D per se, but rather a question about best practices for handling a potentially problematic outcome (large data). The steps to observe the large JSON are:
-
Add a substantial number of annotations (e.g., 50+ Length tools) across various slices within the loaded series.
-
In your application code, access the annotationManager and call saveAnnotations() for the FrameOfReferenceUID of the current series.