# HG changeset patch # User Sebastien Jodogne # Date 1399558097 -7200 # Node ID 2f63c225c4c05824468153c56e4e29a0ef1d3586 # Parent 5dcfdd3bfca9313ae706dd9e8d0e62da947eb806 readme Web applications diff -r 5dcfdd3bfca9 -r 2f63c225c4c0 Resources/Samples/WebApplications/README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/Samples/WebApplications/README.txt Thu May 08 16:08:17 2014 +0200 @@ -0,0 +1,34 @@ +=================== +GENERAL INFORMATION +=================== + +This folder contains sample Web applications. + +These Web applications make use of NodeJs (http://nodejs.org/). To run +the applications, you therefore need to install NodeJs on your +computer. NodeJs acts here as a lightweight, cross-platform Web server +that statically serves the HTML/JavaScript files and that dynamically +serves the Orthanc REST API as a reverse proxy (to avoid cross-domain +problems with AJAX). + +Once NodeJs is installed, start Orthanc with default parameters +(i.e. HTTP port set to 8042), start NodeJs with the sample application +you are interested in (e.g. "node DrawingDicomizer.js"). Then, open +http://localhost:8000/ with a standard Web browser to try the sample +application. + + + +======================================= +DRAWING DICOMIZER (DrawingDicomizer.js) +======================================= + +This sample shows how to convert the content of a HTML5 canvas as a +DICOM file, using a single AJAX request to Orthanc. + +Internally, the content of the HTML5 canvas is serialized through the +standard "toDataURL()" method of the canvas object. This returns a +string containing the PNG image encoded using the Data URI Scheme +(http://en.wikipedia.org/wiki/Data_URI_scheme). Such a string is then +sent to Orthanc using the '/tools/create-dicom' REST call, that +transparently decompresses the PNG image into a DICOM image.