OpenREM 1.0.0b2__py3-none-any.whl → 1.0.0b3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openrem/locale/de/LC_MESSAGES/django.po +1060 -1059
- openrem/locale/django.pot +973 -972
- openrem/locale/es_MX/LC_MESSAGES/django.po +1049 -1048
- openrem/locale/it/LC_MESSAGES/django.po +1044 -1043
- openrem/locale/lt/LC_MESSAGES/django.po +989 -988
- openrem/locale/nb_NO/LC_MESSAGES/django.po +985 -984
- openrem/locale/pt_BR/LC_MESSAGES/django.po +1003 -1002
- openrem/manage.py +10 -10
- openrem/openremproject/__init__.py +1 -1
- openrem/openremproject/local_settings.py.linux +128 -128
- openrem/openremproject/local_settings.py.windows +144 -144
- openrem/openremproject/local_settings.py.windows-sqlite3 +129 -129
- openrem/openremproject/settings.py +278 -278
- openrem/openremproject/urls.py +32 -32
- openrem/openremproject/wsgi.py.example +28 -28
- openrem/remapp/__init__.py +2 -2
- openrem/remapp/admin.py +31 -31
- openrem/remapp/exports/ct_export.py +780 -753
- openrem/remapp/exports/dx_export.py +817 -805
- openrem/remapp/exports/export_common.py +931 -951
- openrem/remapp/exports/export_common_pandas.py +2422 -0
- openrem/remapp/exports/exportviews.py +815 -860
- openrem/remapp/exports/mg_csv_nhsbsp.py +292 -292
- openrem/remapp/exports/mg_export.py +673 -510
- openrem/remapp/exports/nm_export.py +796 -575
- openrem/remapp/exports/rf_export.py +1418 -1431
- openrem/remapp/extractors/ct_philips.py +424 -414
- openrem/remapp/extractors/ct_toshiba.py +2116 -2108
- openrem/remapp/extractors/dx.py +1033 -952
- openrem/remapp/extractors/extract_common.py +817 -817
- openrem/remapp/extractors/import_views.py +426 -426
- openrem/remapp/extractors/mam.py +685 -672
- openrem/remapp/extractors/nm_image.py +439 -431
- openrem/remapp/extractors/ptsizecsv2db.py +368 -368
- openrem/remapp/extractors/rdsr.py +667 -654
- openrem/remapp/extractors/rdsr_methods.py +1771 -1768
- openrem/remapp/extractors/rrdsr_methods.py +630 -622
- openrem/remapp/fixtures/openskin_safelist.json +11 -11
- openrem/remapp/forms.py +2286 -2277
- openrem/remapp/interface/chart_functions.py +2412 -2393
- openrem/remapp/interface/mod_filters.py +1241 -1243
- openrem/remapp/migrations/0001_initial.py.1-0-upgrade +1043 -1043
- openrem/remapp/models.py +3418 -3407
- openrem/remapp/netdicom/dicomviews.py +681 -683
- openrem/remapp/netdicom/qrscu.py +2646 -2646
- openrem/remapp/netdicom/tools.py +134 -134
- openrem/remapp/static/css/bootstrap-theme.css +587 -587
- openrem/remapp/static/css/bootstrap-theme.min.css +4 -4
- openrem/remapp/static/css/bootstrap.css +6800 -6800
- openrem/remapp/static/css/bootstrap.min.css +4 -4
- openrem/remapp/static/css/datepicker3.css +790 -790
- openrem/remapp/static/css/jquery.qtip.min.css +2 -2
- openrem/remapp/static/css/openrem-extra.css +442 -442
- openrem/remapp/static/css/openrem.css +96 -96
- openrem/remapp/static/css/registration.css +34 -34
- openrem/remapp/static/fonts/glyphicons-halflings-regular.svg +287 -287
- openrem/remapp/static/js/bootstrap-datepicker.js +1671 -1671
- openrem/remapp/static/js/bootstrap.js +2363 -2363
- openrem/remapp/static/js/bootstrap.min.js +6 -6
- openrem/remapp/static/js/charts/chartCommonFunctions.js +75 -75
- openrem/remapp/static/js/charts/chartFullScreen.js +41 -41
- openrem/remapp/static/js/charts/ctChartAjax.js +331 -331
- openrem/remapp/static/js/charts/dxChartAjax.js +290 -290
- openrem/remapp/static/js/charts/mgChartAjax.js +144 -144
- openrem/remapp/static/js/charts/nmChartAjax.js +64 -64
- openrem/remapp/static/js/charts/plotly-2.35.2.min.js +8 -0
- openrem/remapp/static/js/charts/rfChartAjax.js +128 -128
- openrem/remapp/static/js/chroma.min.js +32 -32
- openrem/remapp/static/js/datepicker.js +5 -5
- openrem/remapp/static/js/dicom.js +115 -115
- openrem/remapp/static/js/django_reverse/reverse.js +13 -13
- openrem/remapp/static/js/formatDate.js +7 -7
- openrem/remapp/static/js/html5shiv.min.js +8 -8
- openrem/remapp/static/js/jquery-1.11.0.min.js +4 -4
- openrem/remapp/static/js/npm.js +12 -12
- openrem/remapp/static/js/respond.min.js +4 -4
- openrem/remapp/static/js/skin-dose-maps/jquery.qtip.min.js +4 -4
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMap3dHUDObject.js +112 -112
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMap3dObject.js +367 -367
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMap3dPersonObject.js +158 -158
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapColourScaleObject.js +153 -153
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapObject.js +367 -367
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapping.js +584 -584
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMapping3d.js +255 -255
- openrem/remapp/static/js/skin-dose-maps/rfSkinDoseMappingAjax.js +267 -212
- openrem/remapp/static/js/skin-dose-maps/three.min.js +835 -835
- openrem/remapp/static/js/sorttable.js +495 -495
- openrem/remapp/templates/base.html +253 -253
- openrem/remapp/templates/registration/changepassword.html +25 -25
- openrem/remapp/templates/registration/changepassworddone.html +12 -12
- openrem/remapp/templates/registration/login.html +42 -42
- openrem/remapp/templates/remapp/backgroundtaskmaximumrows_form.html +29 -29
- openrem/remapp/templates/remapp/base.html +1 -1
- openrem/remapp/templates/remapp/ctdetail.html +235 -235
- openrem/remapp/templates/remapp/ctfiltered.html +310 -310
- openrem/remapp/templates/remapp/dicomdeletesettings_form.html +31 -31
- openrem/remapp/templates/remapp/dicomqr.html +147 -147
- openrem/remapp/templates/remapp/dicomquerydetails.html +83 -83
- openrem/remapp/templates/remapp/dicomqueryimages.html +49 -49
- openrem/remapp/templates/remapp/dicomqueryseries.html +109 -109
- openrem/remapp/templates/remapp/dicomquerysummary.html +48 -48
- openrem/remapp/templates/remapp/dicomremoteqr_confirm_delete.html +60 -60
- openrem/remapp/templates/remapp/dicomremoteqr_form.html +32 -32
- openrem/remapp/templates/remapp/dicomstorescp_confirm_delete.html +53 -53
- openrem/remapp/templates/remapp/dicomstorescp_form.html +48 -48
- openrem/remapp/templates/remapp/dicomsummary.html +257 -257
- openrem/remapp/templates/remapp/displaychartoptions.html +184 -184
- openrem/remapp/templates/remapp/displayhomepageoptions.html +57 -57
- openrem/remapp/templates/remapp/displayname-count.html +6 -6
- openrem/remapp/templates/remapp/displayname-last-date.html +3 -3
- openrem/remapp/templates/remapp/displayname-modality.html +86 -105
- openrem/remapp/templates/remapp/displayname-skinmap.html +18 -18
- openrem/remapp/templates/remapp/displaynameupdate.html +100 -100
- openrem/remapp/templates/remapp/displaynameview.html +222 -219
- openrem/remapp/templates/remapp/dxdetail.html +176 -176
- openrem/remapp/templates/remapp/dxfiltered.html +324 -324
- openrem/remapp/templates/remapp/exports-active.html +25 -25
- openrem/remapp/templates/remapp/exports-complete.html +35 -35
- openrem/remapp/templates/remapp/exports-error.html +26 -26
- openrem/remapp/templates/remapp/exports-queue.html +18 -18
- openrem/remapp/templates/remapp/exports.html +191 -191
- openrem/remapp/templates/remapp/failed_summary_list.html +27 -27
- openrem/remapp/templates/remapp/filteredbase.html +162 -162
- openrem/remapp/templates/remapp/highdosemetricalertsettings_form.html +76 -76
- openrem/remapp/templates/remapp/home-list-modalities.html +94 -94
- openrem/remapp/templates/remapp/home.html +202 -202
- openrem/remapp/templates/remapp/list_filters.html +24 -24
- openrem/remapp/templates/remapp/mgdetail.html +160 -138
- openrem/remapp/templates/remapp/mgfiltered.html +311 -311
- openrem/remapp/templates/remapp/nmdetail.html +300 -300
- openrem/remapp/templates/remapp/nmfiltered.html +255 -255
- openrem/remapp/templates/remapp/notpatient.html +190 -190
- openrem/remapp/templates/remapp/notpatientindicators_form_base.html +81 -81
- openrem/remapp/templates/remapp/notpatientindicatorsid_confirm_delete.html +54 -54
- openrem/remapp/templates/remapp/notpatientindicatorsid_form.html +23 -23
- openrem/remapp/templates/remapp/notpatientindicatorsname_confirm_delete.html +54 -54
- openrem/remapp/templates/remapp/notpatientindicatorsname_form.html +23 -23
- openrem/remapp/templates/remapp/notpatientindicatorsname_form_base.html +85 -85
- openrem/remapp/templates/remapp/openskinsafelist_add.html +130 -130
- openrem/remapp/templates/remapp/openskinsafelist_confirm_delete.html +100 -100
- openrem/remapp/templates/remapp/openskinsafelist_form.html +207 -207
- openrem/remapp/templates/remapp/patientidsettings_form.html +83 -83
- openrem/remapp/templates/remapp/populate_summary_progress.html +83 -83
- openrem/remapp/templates/remapp/populate_summary_progress_error.html +36 -36
- openrem/remapp/templates/remapp/review_failed_imports.html +157 -157
- openrem/remapp/templates/remapp/review_failed_study.html +41 -41
- openrem/remapp/templates/remapp/review_studies_delete_button.html +20 -20
- openrem/remapp/templates/remapp/review_study.html +19 -19
- openrem/remapp/templates/remapp/review_summary_list.html +245 -245
- openrem/remapp/templates/remapp/rf_dose_alert_email_template.html +14 -1
- openrem/remapp/templates/remapp/rfalertnotificationsview.html +59 -59
- openrem/remapp/templates/remapp/rfdetail.html +547 -543
- openrem/remapp/templates/remapp/rfdetailbase.html +18 -18
- openrem/remapp/templates/remapp/rffiltered.html +404 -404
- openrem/remapp/templates/remapp/sizeimports.html +119 -119
- openrem/remapp/templates/remapp/sizeprocess.html +96 -96
- openrem/remapp/templates/remapp/sizeupload.html +110 -110
- openrem/remapp/templates/remapp/skindosemapcalcsettings_form.html +28 -28
- openrem/remapp/templates/remapp/standardname-modality.html +69 -69
- openrem/remapp/templates/remapp/standardnames_confirm_delete.html +71 -71
- openrem/remapp/templates/remapp/standardnames_form.html +87 -87
- openrem/remapp/templates/remapp/standardnamesettings_form.html +41 -41
- openrem/remapp/templates/remapp/standardnamesrefreshall.html +92 -92
- openrem/remapp/templates/remapp/standardnameview.html +103 -103
- openrem/remapp/templates/remapp/study_confirm_delete.html +147 -147
- openrem/remapp/templates/remapp/task_admin.html +265 -265
- openrem/remapp/templates/remapp/tasks.html +76 -76
- openrem/remapp/templatetags/formfilters.py +13 -13
- openrem/remapp/templatetags/proper_paginate.py +38 -38
- openrem/remapp/templatetags/remappduration.py +36 -36
- openrem/remapp/templatetags/sigdig.py +38 -38
- openrem/remapp/templatetags/sort_class_property_value.py +15 -15
- openrem/remapp/templatetags/update_variable.py +20 -20
- openrem/remapp/templatetags/url_replace.py +25 -25
- openrem/remapp/tests/test_charts_common.py +202 -202
- openrem/remapp/tests/test_charts_ct.py +7111 -7111
- openrem/remapp/tests/test_charts_dx.py +3513 -3513
- openrem/remapp/tests/test_charts_mg.py +1116 -1115
- openrem/remapp/tests/test_dcmdatetime.py +189 -189
- openrem/remapp/tests/test_dicom_qr.py +2580 -2580
- openrem/remapp/tests/test_display_name.py +274 -274
- openrem/remapp/tests/test_export_ct_xlsx.py +272 -248
- openrem/remapp/tests/test_export_dx_xlsx.py +137 -134
- openrem/remapp/tests/test_export_mammo_csv.py +242 -242
- openrem/remapp/tests/test_export_rf_xlsx.py +246 -246
- openrem/remapp/tests/test_files/DX-Im-DRGEM.dcm +0 -0
- openrem/remapp/tests/test_files/MG-RDSR-GEPristina-2D.dcm +0 -0
- openrem/remapp/tests/test_files/MG-RDSR-GEPristina-DBT.dcm +0 -0
- openrem/remapp/tests/test_files/MG-RDSR-Giotto-DBT.dcm +0 -0
- openrem/remapp/tests/test_files/skin_map_alphenix.py +590 -590
- openrem/remapp/tests/test_files/skin_map_zee.py +354 -354
- openrem/remapp/tests/test_filters_ct.py +321 -321
- openrem/remapp/tests/test_filters_dx.py +92 -92
- openrem/remapp/tests/test_filters_mammo.py +183 -183
- openrem/remapp/tests/test_filters_rf.py +118 -118
- openrem/remapp/tests/test_get_values.py +72 -72
- openrem/remapp/tests/test_hash_id.py +65 -65
- openrem/remapp/tests/test_import_ct_esr_ge.py +3034 -3034
- openrem/remapp/tests/test_import_ct_philips_rdsr.py +42 -42
- openrem/remapp/tests/test_import_ct_rdsr_multiple.py +256 -256
- openrem/remapp/tests/test_import_ct_rdsr_siemens.py +827 -827
- openrem/remapp/tests/test_import_ct_rdsr_spectrumdynamics.py +91 -91
- openrem/remapp/tests/test_import_ct_rdsr_toshiba_dosecheck.py +67 -67
- openrem/remapp/tests/test_import_ct_rdsr_toshiba_multivaluesd.py +33 -33
- openrem/remapp/tests/test_import_ct_rdsr_toshiba_pixelmed.py +118 -118
- openrem/remapp/tests/test_import_ct_sc_philips.py +44 -44
- openrem/remapp/tests/test_import_dual_rdsr.py +110 -110
- openrem/remapp/tests/test_import_dx.py +1267 -1191
- openrem/remapp/tests/test_import_dx_rdsr.py +1250 -1253
- openrem/remapp/tests/test_import_mam.py +438 -438
- openrem/remapp/tests/test_import_mg_im_hol_proj.py +46 -46
- openrem/remapp/tests/test_import_mg_rdsr.py +586 -586
- openrem/remapp/tests/test_import_nm_image.py +420 -420
- openrem/remapp/tests/test_import_nm_siemens_rdsr.py +396 -396
- openrem/remapp/tests/test_import_px.py +161 -161
- openrem/remapp/tests/test_import_rf_rdsr.py +420 -418
- openrem/remapp/tests/test_missing_date.py +42 -42
- openrem/remapp/tests/test_not_patient.py +60 -60
- openrem/remapp/tests/test_openskin.py +272 -272
- openrem/remapp/tests/test_patient_id_settings.py +72 -72
- openrem/remapp/tests/test_pt_size_import.py +232 -232
- openrem/remapp/tests/test_rf_detail.py +113 -113
- openrem/remapp/tests/test_rf_high_dose_alert.py +361 -361
- openrem/remapp/tools/background.py +361 -361
- openrem/remapp/tools/check_standard_name_status.py +47 -0
- openrem/remapp/tools/check_uid.py +70 -70
- openrem/remapp/tools/dcmdatetime.py +248 -248
- openrem/remapp/tools/default_import.py +44 -47
- openrem/remapp/tools/get_values.py +230 -230
- openrem/remapp/tools/hash_id.py +58 -58
- openrem/remapp/tools/make_skin_map.py +448 -406
- openrem/remapp/tools/not_patient_indicators.py +72 -72
- openrem/remapp/tools/openskin/calc_exp_map.py +173 -173
- openrem/remapp/tools/openskin/geomclass.py +475 -475
- openrem/remapp/tools/openskin/geomfunc.py +433 -432
- openrem/remapp/tools/openskin/skinmap.py +417 -417
- openrem/remapp/tools/populate_summary.py +185 -193
- openrem/remapp/tools/save_skin_map_structure.py +73 -73
- openrem/remapp/tools/send_high_dose_alert_emails.py +238 -207
- openrem/remapp/urls.py +456 -448
- openrem/remapp/version.py +11 -11
- openrem/remapp/views.py +1147 -1052
- openrem/remapp/views_admin.py +3876 -3936
- openrem/remapp/views_charts_ct.py +2110 -2058
- openrem/remapp/views_charts_dx.py +1906 -1836
- openrem/remapp/views_charts_mg.py +1349 -1196
- openrem/remapp/views_charts_nm.py +535 -535
- openrem/remapp/views_charts_rf.py +1219 -1241
- openrem/remapp/views_openskin.py +379 -384
- openrem/sample-config/openrem-consumer.service +12 -12
- openrem/sample-config/openrem-gunicorn.service +13 -13
- openrem/sample-config/openrem-server +14 -13
- openrem/sample-config/openrem_orthanc_config_linux.lua +454 -454
- openrem/sample-config/openrem_orthanc_config_windows.lua +455 -455
- openrem/sample-config/queue-init.bat +73 -73
- openrem/scripts/openrem_ctphilips.py +25 -25
- openrem/scripts/openrem_cttoshiba.py +28 -28
- openrem/scripts/openrem_dx.py +22 -22
- openrem/scripts/openrem_mg.py +22 -22
- openrem/scripts/openrem_nm.py +22 -22
- openrem/scripts/openrem_ptsizecsv.py +17 -17
- openrem/scripts/openrem_qr.py +12 -12
- openrem/scripts/openrem_rdsr.py +25 -25
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info}/METADATA +39 -29
- openrem-1.0.0b3.dist-info/RECORD +379 -0
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info}/WHEEL +1 -1
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info/licenses}/COPYING-GPLv3 +674 -674
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info/licenses}/LICENSE +22 -22
- OpenREM-1.0.0b2.dist-info/RECORD +0 -373
- openrem/remapp/static/js/charts/plotly-2.17.1.min.js +0 -8
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_ctphilips.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_cttoshiba.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_dx.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_mg.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_nm.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_ptsizecsv.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_qr.py +0 -0
- {OpenREM-1.0.0b2.data → openrem-1.0.0b3.data}/scripts/openrem_rdsr.py +0 -0
- {OpenREM-1.0.0b2.dist-info → openrem-1.0.0b3.dist-info}/top_level.txt +0 -0
|
@@ -1,368 +1,368 @@
|
|
|
1
|
-
/*global chroma*/
|
|
2
|
-
/*eslint no-undef: "error"*/
|
|
3
|
-
/*eslint security/detect-object-injection: "off" */
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Function to create a 2D skin dose map object
|
|
7
|
-
* @param skinDoseMapCanvasName
|
|
8
|
-
* @param colourScaleName
|
|
9
|
-
*/
|
|
10
|
-
function skinDoseMapObject(skinDoseMapCanvasName, colourScaleName) {
|
|
11
|
-
|
|
12
|
-
this.skinDoseMapCanvasName = skinDoseMapCanvasName;
|
|
13
|
-
this.skinDoseMapCanvas = document.getElementById(this.skinDoseMapCanvasName);
|
|
14
|
-
this.skinDoseMapContext = this.skinDoseMapCanvas.getContext("2d");
|
|
15
|
-
|
|
16
|
-
this.colourScaleName = colourScaleName;
|
|
17
|
-
this.colourScale = chroma.scale(colourScaleName);
|
|
18
|
-
|
|
19
|
-
this.mag = 6;
|
|
20
|
-
|
|
21
|
-
this.skinDoseMap = [];
|
|
22
|
-
this.skinDoseMapWidth = 10;
|
|
23
|
-
this.skinDoseMapHeight = 10;
|
|
24
|
-
|
|
25
|
-
this.minDose = 0.0;
|
|
26
|
-
this.maxDose = 10.0;
|
|
27
|
-
|
|
28
|
-
this.maxDoseLabel = this.maxDose.toFixed(3);
|
|
29
|
-
this.phantomDimensionsLabel = "94x34x20";
|
|
30
|
-
this.patientHeight = "1.79";
|
|
31
|
-
this.patientMass = "73.2";
|
|
32
|
-
this.patientOrientation = "HFS";
|
|
33
|
-
this.patientHeightSource = "Assumed";
|
|
34
|
-
this.patientMassSource = "Assumed";
|
|
35
|
-
this.patientOrientationSource = "Assumed";
|
|
36
|
-
this.fractionDAP = "0";
|
|
37
|
-
|
|
38
|
-
this.phantomFlatWidth = 14;
|
|
39
|
-
this.phantomCurvedEdgeWidth = 31;
|
|
40
|
-
|
|
41
|
-
this.showOverlay = false;
|
|
42
|
-
|
|
43
|
-
this.frontLeftBoundary = this.phantomFlatWidth * this.mag;
|
|
44
|
-
this.leftBackBoundary = this.frontLeftBoundary + (this.phantomCurvedEdgeWidth * this.mag);
|
|
45
|
-
this.backRightBoundary = this.leftBackBoundary + (this.phantomFlatWidth * this.mag);
|
|
46
|
-
this.rightFrontBoundary = this.backRightBoundary + (this.phantomCurvedEdgeWidth * this.mag);
|
|
47
|
-
|
|
48
|
-
this.windowWidth = this.maxDose - this.minDose;
|
|
49
|
-
this.windowLevel = this.minDose + (this.windowWidth / 2.0);
|
|
50
|
-
this.minDisplayedDose = this.minDose;
|
|
51
|
-
this.maxDisplayedDose = this.maxDose;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Internal function to create a new colour scale
|
|
56
|
-
* @param newScale
|
|
57
|
-
*/
|
|
58
|
-
this.useNewColourScale = function (newScale) {
|
|
59
|
-
var _this = this;
|
|
60
|
-
_this.colourScale = chroma.scale(newScale);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Internal function to set the rgba value of a pixel
|
|
66
|
-
* @param imageData
|
|
67
|
-
* @param x
|
|
68
|
-
* @param y
|
|
69
|
-
* @param r
|
|
70
|
-
* @param g
|
|
71
|
-
* @param b
|
|
72
|
-
* @param a
|
|
73
|
-
*/
|
|
74
|
-
this.setPixel = function (imageData, x, y, r, g, b, a) {
|
|
75
|
-
var index = (x + y * imageData.width) * 4;
|
|
76
|
-
imageData.data[index ] = r;
|
|
77
|
-
imageData.data[index + 1] = g;
|
|
78
|
-
imageData.data[index + 2] = b;
|
|
79
|
-
imageData.data[index + 3] = a;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Internal function to draw the skin dose map
|
|
85
|
-
*/
|
|
86
|
-
this.draw = function () {
|
|
87
|
-
var _this = this;
|
|
88
|
-
var x, y, dose, scaledDose;
|
|
89
|
-
for (x = 0; x < _this.skinDoseMapWidth; x++) {
|
|
90
|
-
for (y = 0; y < _this.skinDoseMapHeight; y++) {
|
|
91
|
-
dose = _this.skinDoseMap[(y) * _this.skinDoseMapWidth + x];
|
|
92
|
-
scaledDose = dose - (_this.windowLevel - (_this.windowWidth / 2.0));
|
|
93
|
-
if (scaledDose < 0) {scaledDose = 0;}
|
|
94
|
-
if (scaledDose > _this.windowWidth) {scaledDose = _this.windowWidth;}
|
|
95
|
-
_this.skinDoseMapContext.fillStyle = _this.colourScale(scaledDose / _this.windowWidth).hex();
|
|
96
|
-
_this.skinDoseMapContext.fillRect(x*_this.mag, y*_this.mag, _this.mag, _this.mag);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Internal function to draw the overlay on the skin dose map
|
|
104
|
-
*/
|
|
105
|
-
this.drawOverlay = function () {
|
|
106
|
-
var _this = this;
|
|
107
|
-
_this.skinDoseMapContext.textAlign = "center";
|
|
108
|
-
_this.skinDoseMapContext.font = "12pt arial";
|
|
109
|
-
|
|
110
|
-
_this.skinDoseMapContext.fillStyle = "rgba(0, 80, 0, 0.85)";
|
|
111
|
-
_this.skinDoseMapContext.fillText("Superior", _this.skinDoseMapCanvas.width/2, 15);
|
|
112
|
-
_this.skinDoseMapContext.fillText("Inferior", _this.skinDoseMapCanvas.width/2, _this.skinDoseMapCanvas.height-10);
|
|
113
|
-
|
|
114
|
-
_this.skinDoseMapContext.save();
|
|
115
|
-
|
|
116
|
-
_this.skinDoseMapContext.rotate(0.5*Math.PI);
|
|
117
|
-
_this.skinDoseMapContext.fillStyle = "rgba(255, 0, 0, 0.85)";
|
|
118
|
-
_this.skinDoseMapContext.fillText("Anterior", _this.skinDoseMapCanvas.height/2, -_this.frontLeftBoundary/2);
|
|
119
|
-
_this.skinDoseMapContext.fillText("Posterior", _this.skinDoseMapCanvas.height/2, -_this.leftBackBoundary - (_this.backRightBoundary-_this.leftBackBoundary)/2);
|
|
120
|
-
_this.skinDoseMapContext.fillText("Left", _this.skinDoseMapCanvas.height/2, -_this.frontLeftBoundary - (_this.leftBackBoundary-_this.frontLeftBoundary)/2);
|
|
121
|
-
_this.skinDoseMapContext.fillText("Right", _this.skinDoseMapCanvas.height/2, -_this.rightFrontBoundary + (_this.rightFrontBoundary-_this.backRightBoundary)/2);
|
|
122
|
-
|
|
123
|
-
_this.skinDoseMapContext.restore();
|
|
124
|
-
|
|
125
|
-
_this.skinDoseMapContext.lineWidth = 1;
|
|
126
|
-
_this.skinDoseMapContext.setLineDash([5, 15]);
|
|
127
|
-
_this.skinDoseMapContext.strokeStyle = "rgba(255, 0, 0, 0.25)";
|
|
128
|
-
|
|
129
|
-
_this.skinDoseMapContext.beginPath();
|
|
130
|
-
_this.skinDoseMapContext.moveTo(_this.frontLeftBoundary, 0);
|
|
131
|
-
_this.skinDoseMapContext.lineTo(_this.frontLeftBoundary, _this.skinDoseMapCanvas.height-1);
|
|
132
|
-
_this.skinDoseMapContext.stroke();
|
|
133
|
-
|
|
134
|
-
_this.skinDoseMapContext.beginPath();
|
|
135
|
-
_this.skinDoseMapContext.moveTo(_this.leftBackBoundary, 0);
|
|
136
|
-
_this.skinDoseMapContext.lineTo(_this.leftBackBoundary, _this.skinDoseMapCanvas.height-1);
|
|
137
|
-
_this.skinDoseMapContext.stroke();
|
|
138
|
-
|
|
139
|
-
_this.skinDoseMapContext.beginPath();
|
|
140
|
-
_this.skinDoseMapContext.moveTo(_this.backRightBoundary, 0);
|
|
141
|
-
_this.skinDoseMapContext.lineTo(_this.backRightBoundary, _this.skinDoseMapCanvas.height-1);
|
|
142
|
-
_this.skinDoseMapContext.stroke();
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Internal function to write on the skin dose map information
|
|
148
|
-
*/
|
|
149
|
-
this.writeInformation = function () {
|
|
150
|
-
var _this = this;
|
|
151
|
-
_this.skinDoseMapContext.font = "8pt arial";
|
|
152
|
-
_this.skinDoseMapContext.textAlign = "left";
|
|
153
|
-
|
|
154
|
-
_this.skinDoseMapContext.fillStyle = "rgba(0, 0, 0, 1.0)";
|
|
155
|
-
_this.skinDoseMapContext.fillText("Calculated peak skin dose:", 5, 15);
|
|
156
|
-
_this.skinDoseMapContext.fillText("Phantom dimensions:", 5, 30);
|
|
157
|
-
_this.skinDoseMapContext.fillText(_this.patientHeightSource + " patient height:", 5, 45);
|
|
158
|
-
_this.skinDoseMapContext.fillText(_this.patientMassSource + " patient mass:", 5, 60);
|
|
159
|
-
_this.skinDoseMapContext.fillText(_this.patientOrientationSource + " patient orientation:", 5, 75);
|
|
160
|
-
_this.skinDoseMapContext.fillText("DAP percentage contributed:", 5, 90);
|
|
161
|
-
|
|
162
|
-
_this.skinDoseMapContext.fillText(_this.phantomDimensionsLabel + " (HxWxD)", 150, 30);
|
|
163
|
-
_this.skinDoseMapContext.fillText(_this.patientHeight + " m", 150, 45);
|
|
164
|
-
_this.skinDoseMapContext.fillText(_this.patientMass + " kg", 150, 60);
|
|
165
|
-
_this.skinDoseMapContext.fillText(_this.patientOrientation, 150, 75);
|
|
166
|
-
_this.skinDoseMapContext.fillText((_this.fractionDAP * 100).toFixed(1) + "%", 150, 90);
|
|
167
|
-
|
|
168
|
-
_this.skinDoseMapContext.font = "bold 8pt arial";
|
|
169
|
-
_this.skinDoseMapContext.fillText(_this.maxDoseLabel + " Gy", 150, 15);
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Internal function to resize the skin dose map
|
|
175
|
-
*/
|
|
176
|
-
this.resizeSkinDoseMap = function () {
|
|
177
|
-
var _this = this;
|
|
178
|
-
_this.skinDoseMapCanvas.width = _this.skinDoseMapWidth * _this.mag;
|
|
179
|
-
_this.skinDoseMapCanvas.height = _this.skinDoseMapHeight * _this.mag;
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Internal function to reset the skin dose map
|
|
185
|
-
*/
|
|
186
|
-
this.reset = function () {
|
|
187
|
-
var _this = this;
|
|
188
|
-
_this.updateWindowWidth(_this.maxDose - _this.minDose);
|
|
189
|
-
_this.updateWindowLevel(_this.minDose + (_this.windowWidth / 2.0));
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Internal function to toggle the display of the overlay
|
|
195
|
-
*/
|
|
196
|
-
this.toggleOverlay = function () {
|
|
197
|
-
var _this = this;
|
|
198
|
-
_this.showOverlay = _this.showOverlay ? _this.showOverlay = false : _this.showOverlay = true;
|
|
199
|
-
|
|
200
|
-
if (_this.showOverlay) {
|
|
201
|
-
_this.drawOverlay();
|
|
202
|
-
} else {
|
|
203
|
-
_this.draw();
|
|
204
|
-
_this.writeInformation();
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* Internal function to update the window level
|
|
211
|
-
* @param newWindowLevel
|
|
212
|
-
*/
|
|
213
|
-
this.updateWindowLevel = function (newWindowLevel) {
|
|
214
|
-
var _this = this;
|
|
215
|
-
if (newWindowLevel < 0) {newWindowLevel = 0;}
|
|
216
|
-
_this.windowLevel = parseFloat(newWindowLevel);
|
|
217
|
-
|
|
218
|
-
_this.minDisplayedDose = _this.windowLevel - (_this.windowWidth / 2.0);
|
|
219
|
-
_this.maxDisplayedDose = _this.windowLevel + (_this.windowWidth / 2.0);
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Internal function to update the window width
|
|
225
|
-
* @param newWindowWidth
|
|
226
|
-
*/
|
|
227
|
-
this.updateWindowWidth = function (newWindowWidth) {
|
|
228
|
-
var _this = this;
|
|
229
|
-
_this.windowWidth = newWindowWidth;
|
|
230
|
-
|
|
231
|
-
_this.minDisplayedDose = _this.windowLevel - (_this.windowWidth / 2.0);
|
|
232
|
-
_this.maxDisplayedDose = _this.windowLevel + (_this.windowWidth / 2.0);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Internal function to update the minimum displayed dose
|
|
238
|
-
* @param minDisplayedDose
|
|
239
|
-
*/
|
|
240
|
-
this.updateMinDisplayedDose = function (minDisplayedDose) {
|
|
241
|
-
var _this = this;
|
|
242
|
-
minDisplayedDose = parseFloat(minDisplayedDose);
|
|
243
|
-
|
|
244
|
-
if (minDisplayedDose <= _this.minDose) {
|
|
245
|
-
minDisplayedDose = _this.minDose;
|
|
246
|
-
}
|
|
247
|
-
else if (minDisplayedDose >= _this.maxDose) {
|
|
248
|
-
minDisplayedDose = _this.maxDose;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
_this.minDisplayedDose = minDisplayedDose;
|
|
252
|
-
|
|
253
|
-
// Prevent the minDisplatedDose exceeding the maxDisplayedDose
|
|
254
|
-
if (minDisplayedDose >= _this.maxDisplayedDose) {
|
|
255
|
-
_this.maxDisplayedDose = minDisplayedDose;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
259
|
-
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Internal function to update the maximum displayed dose
|
|
265
|
-
* @param maxDisplayedDose
|
|
266
|
-
*/
|
|
267
|
-
this.updateMaxDisplayedDose = function (maxDisplayedDose) {
|
|
268
|
-
var _this = this;
|
|
269
|
-
maxDisplayedDose = parseFloat(maxDisplayedDose);
|
|
270
|
-
|
|
271
|
-
if (maxDisplayedDose <= _this.minDose) {
|
|
272
|
-
maxDisplayedDose = _this.minDose;
|
|
273
|
-
}
|
|
274
|
-
else if (maxDisplayedDose >= _this.maxDose) {
|
|
275
|
-
maxDisplayedDose = _this.maxDose;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
_this.maxDisplayedDose = maxDisplayedDose;
|
|
279
|
-
|
|
280
|
-
// Prevent the maxDisplatedDose being smaller than the minDisplayedDose
|
|
281
|
-
if (maxDisplayedDose <= _this.minDisplayedDose) {
|
|
282
|
-
_this.minDisplayedDose = maxDisplayedDose;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
286
|
-
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Internal function to update the minimum displayed dose
|
|
292
|
-
* @param minDisplayedDose
|
|
293
|
-
*/
|
|
294
|
-
this.updateMinDisplayedDoseManual = function (minDisplayedDose) {
|
|
295
|
-
var _this = this;
|
|
296
|
-
minDisplayedDose = parseFloat(minDisplayedDose);
|
|
297
|
-
|
|
298
|
-
_this.minDisplayedDose = minDisplayedDose;
|
|
299
|
-
|
|
300
|
-
// Prevent the minDisplatedDose exceeding the maxDisplayedDose
|
|
301
|
-
if (minDisplayedDose >= _this.maxDisplayedDose) {
|
|
302
|
-
_this.maxDisplayedDose = minDisplayedDose;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
306
|
-
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
307
|
-
};
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Internal function to update the maximum displayed dose
|
|
312
|
-
* @param maxDisplayedDose
|
|
313
|
-
*/
|
|
314
|
-
this.updateMaxDisplayedDoseManual = function (maxDisplayedDose) {
|
|
315
|
-
var _this = this;
|
|
316
|
-
maxDisplayedDose = parseFloat(maxDisplayedDose);
|
|
317
|
-
|
|
318
|
-
_this.maxDisplayedDose = maxDisplayedDose;
|
|
319
|
-
|
|
320
|
-
// Prevent the maxDisplatedDose being smaller than the minDisplayedDose
|
|
321
|
-
if (maxDisplayedDose <= _this.minDisplayedDose) {
|
|
322
|
-
_this.minDisplayedDose = maxDisplayedDose;
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
326
|
-
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Internal function to initialise the skin dose map
|
|
332
|
-
* @param skinMapData
|
|
333
|
-
* @param skinMapWidth
|
|
334
|
-
* @param skinMapHeight
|
|
335
|
-
* @param phantomFlatWidth
|
|
336
|
-
* @param phantomCurvedEdgeWidth
|
|
337
|
-
*/
|
|
338
|
-
this.initialise = function (skinMapData, skinMapWidth, skinMapHeight, phantomFlatWidth, phantomCurvedEdgeWidth) {
|
|
339
|
-
var _this = this;
|
|
340
|
-
_this.skinDoseMap = skinMapData;
|
|
341
|
-
_this.skinDoseMapWidth = skinMapWidth;
|
|
342
|
-
_this.skinDoseMapHeight = skinMapHeight;
|
|
343
|
-
_this.minDose = Math.min.apply(null, _this.skinDoseMap);
|
|
344
|
-
_this.maxDose = Math.max.apply(null, _this.skinDoseMap);
|
|
345
|
-
_this.windowWidth = _this.maxDose - _this.minDose;
|
|
346
|
-
_this.windowLevel = _this.minDose + (_this.windowWidth / 2.0);
|
|
347
|
-
_this.minDisplayedDose = _this.minDose;
|
|
348
|
-
_this.maxDisplayedDose = _this.maxDose;
|
|
349
|
-
|
|
350
|
-
_this.phantomFlatWidth = phantomFlatWidth;
|
|
351
|
-
_this.phantomCurvedEdgeWidth = phantomCurvedEdgeWidth;
|
|
352
|
-
|
|
353
|
-
_this.resizeSkinDoseMap();
|
|
354
|
-
_this.updateBoundaries();
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* Internal function to update the boundaries of the phantom sections
|
|
360
|
-
*/
|
|
361
|
-
this.updateBoundaries = function () {
|
|
362
|
-
var _this = this;
|
|
363
|
-
_this.frontLeftBoundary = _this.phantomFlatWidth * _this.mag;
|
|
364
|
-
_this.leftBackBoundary = _this.frontLeftBoundary + (_this.phantomCurvedEdgeWidth * _this.mag);
|
|
365
|
-
_this.backRightBoundary = _this.leftBackBoundary + (_this.phantomFlatWidth * _this.mag);
|
|
366
|
-
_this.rightFrontBoundary = _this.backRightBoundary + (_this.phantomCurvedEdgeWidth * _this.mag);
|
|
367
|
-
};
|
|
1
|
+
/*global chroma*/
|
|
2
|
+
/*eslint no-undef: "error"*/
|
|
3
|
+
/*eslint security/detect-object-injection: "off" */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Function to create a 2D skin dose map object
|
|
7
|
+
* @param skinDoseMapCanvasName
|
|
8
|
+
* @param colourScaleName
|
|
9
|
+
*/
|
|
10
|
+
function skinDoseMapObject(skinDoseMapCanvasName, colourScaleName) {
|
|
11
|
+
|
|
12
|
+
this.skinDoseMapCanvasName = skinDoseMapCanvasName;
|
|
13
|
+
this.skinDoseMapCanvas = document.getElementById(this.skinDoseMapCanvasName);
|
|
14
|
+
this.skinDoseMapContext = this.skinDoseMapCanvas.getContext("2d");
|
|
15
|
+
|
|
16
|
+
this.colourScaleName = colourScaleName;
|
|
17
|
+
this.colourScale = chroma.scale(colourScaleName);
|
|
18
|
+
|
|
19
|
+
this.mag = 6;
|
|
20
|
+
|
|
21
|
+
this.skinDoseMap = [];
|
|
22
|
+
this.skinDoseMapWidth = 10;
|
|
23
|
+
this.skinDoseMapHeight = 10;
|
|
24
|
+
|
|
25
|
+
this.minDose = 0.0;
|
|
26
|
+
this.maxDose = 10.0;
|
|
27
|
+
|
|
28
|
+
this.maxDoseLabel = this.maxDose.toFixed(3);
|
|
29
|
+
this.phantomDimensionsLabel = "94x34x20";
|
|
30
|
+
this.patientHeight = "1.79";
|
|
31
|
+
this.patientMass = "73.2";
|
|
32
|
+
this.patientOrientation = "HFS";
|
|
33
|
+
this.patientHeightSource = "Assumed";
|
|
34
|
+
this.patientMassSource = "Assumed";
|
|
35
|
+
this.patientOrientationSource = "Assumed";
|
|
36
|
+
this.fractionDAP = "0";
|
|
37
|
+
|
|
38
|
+
this.phantomFlatWidth = 14;
|
|
39
|
+
this.phantomCurvedEdgeWidth = 31;
|
|
40
|
+
|
|
41
|
+
this.showOverlay = false;
|
|
42
|
+
|
|
43
|
+
this.frontLeftBoundary = this.phantomFlatWidth * this.mag;
|
|
44
|
+
this.leftBackBoundary = this.frontLeftBoundary + (this.phantomCurvedEdgeWidth * this.mag);
|
|
45
|
+
this.backRightBoundary = this.leftBackBoundary + (this.phantomFlatWidth * this.mag);
|
|
46
|
+
this.rightFrontBoundary = this.backRightBoundary + (this.phantomCurvedEdgeWidth * this.mag);
|
|
47
|
+
|
|
48
|
+
this.windowWidth = this.maxDose - this.minDose;
|
|
49
|
+
this.windowLevel = this.minDose + (this.windowWidth / 2.0);
|
|
50
|
+
this.minDisplayedDose = this.minDose;
|
|
51
|
+
this.maxDisplayedDose = this.maxDose;
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Internal function to create a new colour scale
|
|
56
|
+
* @param newScale
|
|
57
|
+
*/
|
|
58
|
+
this.useNewColourScale = function (newScale) {
|
|
59
|
+
var _this = this;
|
|
60
|
+
_this.colourScale = chroma.scale(newScale);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Internal function to set the rgba value of a pixel
|
|
66
|
+
* @param imageData
|
|
67
|
+
* @param x
|
|
68
|
+
* @param y
|
|
69
|
+
* @param r
|
|
70
|
+
* @param g
|
|
71
|
+
* @param b
|
|
72
|
+
* @param a
|
|
73
|
+
*/
|
|
74
|
+
this.setPixel = function (imageData, x, y, r, g, b, a) {
|
|
75
|
+
var index = (x + y * imageData.width) * 4;
|
|
76
|
+
imageData.data[index ] = r;
|
|
77
|
+
imageData.data[index + 1] = g;
|
|
78
|
+
imageData.data[index + 2] = b;
|
|
79
|
+
imageData.data[index + 3] = a;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Internal function to draw the skin dose map
|
|
85
|
+
*/
|
|
86
|
+
this.draw = function () {
|
|
87
|
+
var _this = this;
|
|
88
|
+
var x, y, dose, scaledDose;
|
|
89
|
+
for (x = 0; x < _this.skinDoseMapWidth; x++) {
|
|
90
|
+
for (y = 0; y < _this.skinDoseMapHeight; y++) {
|
|
91
|
+
dose = _this.skinDoseMap[(y) * _this.skinDoseMapWidth + x];
|
|
92
|
+
scaledDose = dose - (_this.windowLevel - (_this.windowWidth / 2.0));
|
|
93
|
+
if (scaledDose < 0) {scaledDose = 0;}
|
|
94
|
+
if (scaledDose > _this.windowWidth) {scaledDose = _this.windowWidth;}
|
|
95
|
+
_this.skinDoseMapContext.fillStyle = _this.colourScale(scaledDose / _this.windowWidth).hex();
|
|
96
|
+
_this.skinDoseMapContext.fillRect(x*_this.mag, y*_this.mag, _this.mag, _this.mag);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Internal function to draw the overlay on the skin dose map
|
|
104
|
+
*/
|
|
105
|
+
this.drawOverlay = function () {
|
|
106
|
+
var _this = this;
|
|
107
|
+
_this.skinDoseMapContext.textAlign = "center";
|
|
108
|
+
_this.skinDoseMapContext.font = "12pt arial";
|
|
109
|
+
|
|
110
|
+
_this.skinDoseMapContext.fillStyle = "rgba(0, 80, 0, 0.85)";
|
|
111
|
+
_this.skinDoseMapContext.fillText("Superior", _this.skinDoseMapCanvas.width/2, 15);
|
|
112
|
+
_this.skinDoseMapContext.fillText("Inferior", _this.skinDoseMapCanvas.width/2, _this.skinDoseMapCanvas.height-10);
|
|
113
|
+
|
|
114
|
+
_this.skinDoseMapContext.save();
|
|
115
|
+
|
|
116
|
+
_this.skinDoseMapContext.rotate(0.5*Math.PI);
|
|
117
|
+
_this.skinDoseMapContext.fillStyle = "rgba(255, 0, 0, 0.85)";
|
|
118
|
+
_this.skinDoseMapContext.fillText("Anterior", _this.skinDoseMapCanvas.height/2, -_this.frontLeftBoundary/2);
|
|
119
|
+
_this.skinDoseMapContext.fillText("Posterior", _this.skinDoseMapCanvas.height/2, -_this.leftBackBoundary - (_this.backRightBoundary-_this.leftBackBoundary)/2);
|
|
120
|
+
_this.skinDoseMapContext.fillText("Left", _this.skinDoseMapCanvas.height/2, -_this.frontLeftBoundary - (_this.leftBackBoundary-_this.frontLeftBoundary)/2);
|
|
121
|
+
_this.skinDoseMapContext.fillText("Right", _this.skinDoseMapCanvas.height/2, -_this.rightFrontBoundary + (_this.rightFrontBoundary-_this.backRightBoundary)/2);
|
|
122
|
+
|
|
123
|
+
_this.skinDoseMapContext.restore();
|
|
124
|
+
|
|
125
|
+
_this.skinDoseMapContext.lineWidth = 1;
|
|
126
|
+
_this.skinDoseMapContext.setLineDash([5, 15]);
|
|
127
|
+
_this.skinDoseMapContext.strokeStyle = "rgba(255, 0, 0, 0.25)";
|
|
128
|
+
|
|
129
|
+
_this.skinDoseMapContext.beginPath();
|
|
130
|
+
_this.skinDoseMapContext.moveTo(_this.frontLeftBoundary, 0);
|
|
131
|
+
_this.skinDoseMapContext.lineTo(_this.frontLeftBoundary, _this.skinDoseMapCanvas.height-1);
|
|
132
|
+
_this.skinDoseMapContext.stroke();
|
|
133
|
+
|
|
134
|
+
_this.skinDoseMapContext.beginPath();
|
|
135
|
+
_this.skinDoseMapContext.moveTo(_this.leftBackBoundary, 0);
|
|
136
|
+
_this.skinDoseMapContext.lineTo(_this.leftBackBoundary, _this.skinDoseMapCanvas.height-1);
|
|
137
|
+
_this.skinDoseMapContext.stroke();
|
|
138
|
+
|
|
139
|
+
_this.skinDoseMapContext.beginPath();
|
|
140
|
+
_this.skinDoseMapContext.moveTo(_this.backRightBoundary, 0);
|
|
141
|
+
_this.skinDoseMapContext.lineTo(_this.backRightBoundary, _this.skinDoseMapCanvas.height-1);
|
|
142
|
+
_this.skinDoseMapContext.stroke();
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Internal function to write on the skin dose map information
|
|
148
|
+
*/
|
|
149
|
+
this.writeInformation = function () {
|
|
150
|
+
var _this = this;
|
|
151
|
+
_this.skinDoseMapContext.font = "8pt arial";
|
|
152
|
+
_this.skinDoseMapContext.textAlign = "left";
|
|
153
|
+
|
|
154
|
+
_this.skinDoseMapContext.fillStyle = "rgba(0, 0, 0, 1.0)";
|
|
155
|
+
_this.skinDoseMapContext.fillText("Calculated peak skin dose:", 5, 15);
|
|
156
|
+
_this.skinDoseMapContext.fillText("Phantom dimensions:", 5, 30);
|
|
157
|
+
_this.skinDoseMapContext.fillText(_this.patientHeightSource + " patient height:", 5, 45);
|
|
158
|
+
_this.skinDoseMapContext.fillText(_this.patientMassSource + " patient mass:", 5, 60);
|
|
159
|
+
_this.skinDoseMapContext.fillText(_this.patientOrientationSource + " patient orientation:", 5, 75);
|
|
160
|
+
_this.skinDoseMapContext.fillText("DAP percentage contributed:", 5, 90);
|
|
161
|
+
|
|
162
|
+
_this.skinDoseMapContext.fillText(_this.phantomDimensionsLabel + " (HxWxD)", 150, 30);
|
|
163
|
+
_this.skinDoseMapContext.fillText(_this.patientHeight + " m", 150, 45);
|
|
164
|
+
_this.skinDoseMapContext.fillText(_this.patientMass + " kg", 150, 60);
|
|
165
|
+
_this.skinDoseMapContext.fillText(_this.patientOrientation, 150, 75);
|
|
166
|
+
_this.skinDoseMapContext.fillText((_this.fractionDAP * 100).toFixed(1) + "%", 150, 90);
|
|
167
|
+
|
|
168
|
+
_this.skinDoseMapContext.font = "bold 8pt arial";
|
|
169
|
+
_this.skinDoseMapContext.fillText(_this.maxDoseLabel + " Gy", 150, 15);
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Internal function to resize the skin dose map
|
|
175
|
+
*/
|
|
176
|
+
this.resizeSkinDoseMap = function () {
|
|
177
|
+
var _this = this;
|
|
178
|
+
_this.skinDoseMapCanvas.width = _this.skinDoseMapWidth * _this.mag;
|
|
179
|
+
_this.skinDoseMapCanvas.height = _this.skinDoseMapHeight * _this.mag;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Internal function to reset the skin dose map
|
|
185
|
+
*/
|
|
186
|
+
this.reset = function () {
|
|
187
|
+
var _this = this;
|
|
188
|
+
_this.updateWindowWidth(_this.maxDose - _this.minDose);
|
|
189
|
+
_this.updateWindowLevel(_this.minDose + (_this.windowWidth / 2.0));
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Internal function to toggle the display of the overlay
|
|
195
|
+
*/
|
|
196
|
+
this.toggleOverlay = function () {
|
|
197
|
+
var _this = this;
|
|
198
|
+
_this.showOverlay = _this.showOverlay ? _this.showOverlay = false : _this.showOverlay = true;
|
|
199
|
+
|
|
200
|
+
if (_this.showOverlay) {
|
|
201
|
+
_this.drawOverlay();
|
|
202
|
+
} else {
|
|
203
|
+
_this.draw();
|
|
204
|
+
_this.writeInformation();
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Internal function to update the window level
|
|
211
|
+
* @param newWindowLevel
|
|
212
|
+
*/
|
|
213
|
+
this.updateWindowLevel = function (newWindowLevel) {
|
|
214
|
+
var _this = this;
|
|
215
|
+
if (newWindowLevel < 0) {newWindowLevel = 0;}
|
|
216
|
+
_this.windowLevel = parseFloat(newWindowLevel);
|
|
217
|
+
|
|
218
|
+
_this.minDisplayedDose = _this.windowLevel - (_this.windowWidth / 2.0);
|
|
219
|
+
_this.maxDisplayedDose = _this.windowLevel + (_this.windowWidth / 2.0);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Internal function to update the window width
|
|
225
|
+
* @param newWindowWidth
|
|
226
|
+
*/
|
|
227
|
+
this.updateWindowWidth = function (newWindowWidth) {
|
|
228
|
+
var _this = this;
|
|
229
|
+
_this.windowWidth = newWindowWidth;
|
|
230
|
+
|
|
231
|
+
_this.minDisplayedDose = _this.windowLevel - (_this.windowWidth / 2.0);
|
|
232
|
+
_this.maxDisplayedDose = _this.windowLevel + (_this.windowWidth / 2.0);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Internal function to update the minimum displayed dose
|
|
238
|
+
* @param minDisplayedDose
|
|
239
|
+
*/
|
|
240
|
+
this.updateMinDisplayedDose = function (minDisplayedDose) {
|
|
241
|
+
var _this = this;
|
|
242
|
+
minDisplayedDose = parseFloat(minDisplayedDose);
|
|
243
|
+
|
|
244
|
+
if (minDisplayedDose <= _this.minDose) {
|
|
245
|
+
minDisplayedDose = _this.minDose;
|
|
246
|
+
}
|
|
247
|
+
else if (minDisplayedDose >= _this.maxDose) {
|
|
248
|
+
minDisplayedDose = _this.maxDose;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
_this.minDisplayedDose = minDisplayedDose;
|
|
252
|
+
|
|
253
|
+
// Prevent the minDisplatedDose exceeding the maxDisplayedDose
|
|
254
|
+
if (minDisplayedDose >= _this.maxDisplayedDose) {
|
|
255
|
+
_this.maxDisplayedDose = minDisplayedDose;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
259
|
+
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Internal function to update the maximum displayed dose
|
|
265
|
+
* @param maxDisplayedDose
|
|
266
|
+
*/
|
|
267
|
+
this.updateMaxDisplayedDose = function (maxDisplayedDose) {
|
|
268
|
+
var _this = this;
|
|
269
|
+
maxDisplayedDose = parseFloat(maxDisplayedDose);
|
|
270
|
+
|
|
271
|
+
if (maxDisplayedDose <= _this.minDose) {
|
|
272
|
+
maxDisplayedDose = _this.minDose;
|
|
273
|
+
}
|
|
274
|
+
else if (maxDisplayedDose >= _this.maxDose) {
|
|
275
|
+
maxDisplayedDose = _this.maxDose;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
_this.maxDisplayedDose = maxDisplayedDose;
|
|
279
|
+
|
|
280
|
+
// Prevent the maxDisplatedDose being smaller than the minDisplayedDose
|
|
281
|
+
if (maxDisplayedDose <= _this.minDisplayedDose) {
|
|
282
|
+
_this.minDisplayedDose = maxDisplayedDose;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
286
|
+
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Internal function to update the minimum displayed dose
|
|
292
|
+
* @param minDisplayedDose
|
|
293
|
+
*/
|
|
294
|
+
this.updateMinDisplayedDoseManual = function (minDisplayedDose) {
|
|
295
|
+
var _this = this;
|
|
296
|
+
minDisplayedDose = parseFloat(minDisplayedDose);
|
|
297
|
+
|
|
298
|
+
_this.minDisplayedDose = minDisplayedDose;
|
|
299
|
+
|
|
300
|
+
// Prevent the minDisplatedDose exceeding the maxDisplayedDose
|
|
301
|
+
if (minDisplayedDose >= _this.maxDisplayedDose) {
|
|
302
|
+
_this.maxDisplayedDose = minDisplayedDose;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
306
|
+
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Internal function to update the maximum displayed dose
|
|
312
|
+
* @param maxDisplayedDose
|
|
313
|
+
*/
|
|
314
|
+
this.updateMaxDisplayedDoseManual = function (maxDisplayedDose) {
|
|
315
|
+
var _this = this;
|
|
316
|
+
maxDisplayedDose = parseFloat(maxDisplayedDose);
|
|
317
|
+
|
|
318
|
+
_this.maxDisplayedDose = maxDisplayedDose;
|
|
319
|
+
|
|
320
|
+
// Prevent the maxDisplatedDose being smaller than the minDisplayedDose
|
|
321
|
+
if (maxDisplayedDose <= _this.minDisplayedDose) {
|
|
322
|
+
_this.minDisplayedDose = maxDisplayedDose;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
_this.windowWidth = _this.maxDisplayedDose - _this.minDisplayedDose;
|
|
326
|
+
_this.windowLevel = _this.minDisplayedDose + (_this.windowWidth / 2.0);
|
|
327
|
+
};
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Internal function to initialise the skin dose map
|
|
332
|
+
* @param skinMapData
|
|
333
|
+
* @param skinMapWidth
|
|
334
|
+
* @param skinMapHeight
|
|
335
|
+
* @param phantomFlatWidth
|
|
336
|
+
* @param phantomCurvedEdgeWidth
|
|
337
|
+
*/
|
|
338
|
+
this.initialise = function (skinMapData, skinMapWidth, skinMapHeight, phantomFlatWidth, phantomCurvedEdgeWidth) {
|
|
339
|
+
var _this = this;
|
|
340
|
+
_this.skinDoseMap = skinMapData;
|
|
341
|
+
_this.skinDoseMapWidth = skinMapWidth;
|
|
342
|
+
_this.skinDoseMapHeight = skinMapHeight;
|
|
343
|
+
_this.minDose = Math.min.apply(null, _this.skinDoseMap);
|
|
344
|
+
_this.maxDose = Math.max.apply(null, _this.skinDoseMap);
|
|
345
|
+
_this.windowWidth = _this.maxDose - _this.minDose;
|
|
346
|
+
_this.windowLevel = _this.minDose + (_this.windowWidth / 2.0);
|
|
347
|
+
_this.minDisplayedDose = _this.minDose;
|
|
348
|
+
_this.maxDisplayedDose = _this.maxDose;
|
|
349
|
+
|
|
350
|
+
_this.phantomFlatWidth = phantomFlatWidth;
|
|
351
|
+
_this.phantomCurvedEdgeWidth = phantomCurvedEdgeWidth;
|
|
352
|
+
|
|
353
|
+
_this.resizeSkinDoseMap();
|
|
354
|
+
_this.updateBoundaries();
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Internal function to update the boundaries of the phantom sections
|
|
360
|
+
*/
|
|
361
|
+
this.updateBoundaries = function () {
|
|
362
|
+
var _this = this;
|
|
363
|
+
_this.frontLeftBoundary = _this.phantomFlatWidth * _this.mag;
|
|
364
|
+
_this.leftBackBoundary = _this.frontLeftBoundary + (_this.phantomCurvedEdgeWidth * _this.mag);
|
|
365
|
+
_this.backRightBoundary = _this.leftBackBoundary + (_this.phantomFlatWidth * _this.mag);
|
|
366
|
+
_this.rightFrontBoundary = _this.backRightBoundary + (_this.phantomCurvedEdgeWidth * _this.mag);
|
|
367
|
+
};
|
|
368
368
|
}
|