From 2cfc52ee239cad1840860a2b1f22621172e52569 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 18 Dec 2023 12:43:30 +0000 Subject: [PATCH] imrove truncation testing --- atlas/templates/atlas/series_viewer.html | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/atlas/templates/atlas/series_viewer.html b/atlas/templates/atlas/series_viewer.html index 54da5c82..b6d7c31b 100755 --- a/atlas/templates/atlas/series_viewer.html +++ b/atlas/templates/atlas/series_viewer.html @@ -65,7 +65,7 @@ End
-
+
{% endwith %} @@ -128,13 +128,18 @@ lower_bound = parseInt($("#lower-truncation-bound-input").val()) - 1; upper_bound = parseInt($("#upper-truncation-bound-input").val()) - 1; + $("#lower-truncation-bound-input").prop("disabled", true); + $("#upper-truncation-bound-input").prop("disabled", true); + $("#set-lower-truncation-bound-button").remove(); + $("#set-upper-truncation-bound-button").remove(); + $("#truncate-test-button").remove(); if (lower_bound >= upper_bound) { alert("The lower bound must be less than the upper bound."); return; } dicom_element = $(".cornerstone-element").get(0); stack = cornerstone.getEnabledElement(dicom_element).toolStateManager.toolState.stack.data[0] - stack.imageIds = stack.imageIds.slice(lower_bound, upper_bound) + stack.imageIds = stack.imageIds.slice(lower_bound, upper_bound+1) // inclusive stack.currentImageIdIndex = 0 //let id = stack.imageIds[0]; @@ -143,6 +148,8 @@ //}); cornerstone.reset(dicom_element); + $("#truncate-output").text("The truncated images are shown above. If you wish to make changes refresh the page. To continue click the trucated series button.") + }) $("#truncate-button").click(() => { lower_bound = parseInt($("#lower-truncation-bound-input").val()) - 1; @@ -154,7 +161,7 @@ } if(confirm(`Trucated series. This will leave ${upper_bound - lower_bound + 1} images.`) == true) { - htmx.ajax("GET", `{% url 'api-1:series_truncate' series.id '****' '++++' %}`.replace("****", lower_bound).replace("++++", upper_bound), "#trucate-output") + htmx.ajax("GET", `{% url 'api-1:series_truncate' series.id '****' '++++' %}`.replace("****", lower_bound).replace("++++", upper_bound), "#truncate-output") }