Saving and retrieval of annotation/measurement data in json format

How can i save annotation/measurements to my backend and and retrieve it (in json preferrably) to be rendered back on the dicom in the viewer? Is there any better or easier way to achieve this?

  • I am able to save the annotation data to my backend from the MeasurementService.ts file. But when i load this json back and pass the params to the annotationToMeasurement() method in MeasurementService, it throws errors like - source undefined and no mappings present. Any pointers or references to make this work would be really appreciated.

  • Version : Viewers-3.8.0-beta.81

  • Below is how the code hydrateAnnotations looks like.

 hydrateAnnotations(): void {
      .then(response => {
        const annotations =;'json: ',;

        annotations.measurementList.forEach(annotation => {
          try {
              // this.createSource(, annotation.source.version),
          } catch (error) {
            console.error('Failed to add annotation to viewer:', error);
      .catch(error => {
        console.error('Error fetching data:', error);