ivmartel / dwv

DICOM Web Viewer: open source zero footprint medical image library.
https://ivmartel.github.io/dwv/
GNU General Public License v3.0
1.64k stars 591 forks source link

Dynamically opening JSON state #489

Closed jagjotwadali closed 6 years ago

jagjotwadali commented 6 years ago

I had already integrated DWV application into telemedicine application .I want to save the JSON state on the server . I want to show a button on the DICOM viewer where the user can click and save the annotations and can view the annotated image.

I was also reading the document about ?state=[path to state file]) but it was not working .

var ff="http://localhost:62919/images/417.dcm?state=[http://localhost:62919/images/417.dcm]";
var fimage = "viewers/mobile/index.html?input=" +ff;
window.open(fimage, "_blank", "status=0,top=0,left=0,toolbar=0,menubar=0,resizable=1,width=" + (screen.width) + ",height=" + (screen.height));

Any help in this regard.

ivmartel commented 6 years ago

The separator between input and state must be an & and not a ?. And better encode the query string to avoid confusion of characters. Something like:

var dicom = "http://localhost:62919/images/417.dcm";
var state = "http://localhost:62919/images/417.json";
var url = "viewers/mobile/index.html" + 
   "?input=" + encodeURIComponent(dicom) +
   "&state=" + encodeURIComponent(state);
jagjotwadali commented 6 years ago

Thanks @ivmartel .Its Working.

anoob09 commented 6 years ago

I am getting this error Cannot read property 'getParent' of undefined when I am trying to load state.json file with this URL http://localhost/MIC/index_dicom.php?input=http://localhost/MIC/mammos/case333/0003.DCM&state=http://localhost/state.json

ivmartel commented 6 years ago

Could you share the console log to better understand what is going on?

anoob09 commented 6 years ago

its ok now. I had to use state just after input and it went good

Coebin commented 2 years ago

I have a problem loading the state by the URL. this is the path I use

http://localhost/DicomVista/index.php?input=http%3A%2F%2Flocalhost%2FDicomVista%2FArchivosDicom%2F86%2FPrueba%2F%3Ffile%3D1.dcm%26file%3D2.dcm%26file%3D3.dcm%26file%3D4.dcm%26file%3D5.dcm%26file%3D6.dcm%26file%3D7.dcm%26file%3D8.dcm%26file%3D9.dcm%26file%3D10.dcm%26file%3D11.dcm%26file%3D12.dcm%26file%3D13.dcm%26file%3D14.dcm%26file%3D15.dcm%26file%3D16.dcm%26file%3D17.dcm%26file%3D18.dcm%26file%3D19.dcm%26file%3D20.dcm&dwvReplaceMode=void&state=http://localhost/ArchivosDicom/86/Prueba/state.json

and it gives me the image error, if I load only the DCM files there is no problem. it looks like you are spelling out the state url

dcmfail

ivmartel commented 2 years ago

Moved to issue #1101 (thanks for creating it @Coebin!)