ivmartel / dwv-jqmobile

Medical image viewer using DWV (DICOM Web Viewer) and jQuery Mobile.
https://ivmartel.github.io/dwv-jqmobile/
GNU General Public License v3.0
31 stars 26 forks source link

how to save annotations in database and retrieve it later on from database (jq-mobile) ? #189

Closed ikhizarwork closed 7 months ago

ikhizarwork commented 7 months ago

i want to store the annotations made by me in the database rather than saving it locally , and similarly want to retrieve it later on with the loading of the dicom file .

ikhizarwork commented 7 months ago

i am able to save the annotations to my database , now just need help on how to retrive that json state with the dicom file .

ivmartel commented 7 months ago

Duplicates #104, see answers there.

ikhizarwork commented 7 months ago

got the following error when trying to load the state from the db :-

Error fetching annotations: TypeError: Cannot read properties of undefined (reading 'split') at on.loadURLs (dwv.min.js:1:378291) at Vn.loadURLs (dwv.min.js:1:450130) at applauncher.js:254:15

here is my code , please let me know if i am doing something wrong over here :-

dbRef.once('value')
.then(function (snapshot) {
  const annotations = snapshot.val();
  if (annotations) {

    const drawings = JSON.parse(annotations);

    myapp.loadURLs(drawings);
  }
})
.catch(function (error) {
  console.error('Error fetching annotations:', error);
});
ivmartel commented 7 months ago

Answered in #104.