Mercurial > hg > orthanc
annotate Resources/Samples/WebApplications/DrawingDicomizer/orthanc.js @ 945:427a1f996b7b templating
integration mainline -> templating
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Jun 2014 11:56:48 +0200 |
parents | 557575fd93e9 |
children | 009dce4ea2f6 |
rev | line source |
---|---|
805
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Belgium |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Permission is hereby granted, free of charge, to any person |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * obtaining a copy of this software and associated documentation |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * files (the "Software"), to deal in the Software without |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * restriction, including without limitation the rights to use, copy, |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * modify, merge, publish, distribute, sublicense, and/or sell copies |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * of the Software, and to permit persons to whom the Software is |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * furnished to do so, subject to the following conditions: |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * The above copyright notice and this permission notice shall be |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * included in all copies or substantial portions of the Software. |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * SOFTWARE. |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 **/ |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 $(document).ready(function() { |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 $('#submit').click(function(event) { |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 var png = context.canvas.toDataURL(); |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 $.ajax({ |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 type: 'POST', |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 url: '/orthanc/tools/create-dicom', |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 data: { |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 PatientName: $('#patientName').val(), |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 PixelData: png, |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 Modality: 'RX' |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 } |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 }) |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 .success(function( msg ) { |
806 | 42 alert('Your drawing has been dicomized!\n\n' + msg); |
805
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 }); |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 return false; |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 }); |
56a813a4714d
drawing dicomizer sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 }); |