add the ability to load by imageid
This commit is contained in:
@@ -1220,6 +1220,12 @@ export function loadStackIndex(new_index, dicom_element) {
|
|||||||
//c = cornerstone.getEnabledElement(dicom_element)
|
//c = cornerstone.getEnabledElement(dicom_element)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function loadImageById(imageId, dicom_element) {
|
||||||
|
cornerstone.loadImage(imageId).then(b => {
|
||||||
|
cornerstone.displayImage(dicom_element, b);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function urltoFile(url, filename, mimeType) {
|
function urltoFile(url, filename, mimeType) {
|
||||||
return fetch(url)
|
return fetch(url)
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
|
|||||||
+3
-1
@@ -24,11 +24,13 @@
|
|||||||
<main>
|
<main>
|
||||||
<h1>A dicom viewer</h1>
|
<h1>A dicom viewer</h1>
|
||||||
|
|
||||||
|
<div id="dicom-viewer" class="dicom-viewer" style="height: 600px;" data-images='["test_images/1.jpg","test_images/IMG1.dcm"]' data-annotations=""></div></div>
|
||||||
<!-- <div id="dicom-viewer" class="dicom-viewer" style="height: 600px;" data-images='["test_images/IMG1.dcm","test_images/IMG1.dcm"]' data-annotations='["{\"ArrowAnnotate\":{\"data\":[{\"visible\":true,\"active\":false,\"handles\":{\"start\":{\"x\":450.01249999999993,\"y\":592.8031510416666,\"highlight\":true,\"active\":false},\"end\":{\"x\":283.38750000000005,\"y\":343.976484375,\"highlight\":true,\"active\":false,\"moving\":false},\"textBox\":{\"active\":false,\"hasMoved\":false,\"movesIndependently\":false,\"drawnIndependently\":true,\"allowedOutsideImage\":true,\"hasBoundingBox\":true}},\"uuid\":\"51ca68b0-734c-4046-b3da-dd2886496fd5\",\"invalidated\":true}]}}", null]'></div></div> -->
|
<!-- <div id="dicom-viewer" class="dicom-viewer" style="height: 600px;" data-images='["test_images/IMG1.dcm","test_images/IMG1.dcm"]' data-annotations='["{\"ArrowAnnotate\":{\"data\":[{\"visible\":true,\"active\":false,\"handles\":{\"start\":{\"x\":450.01249999999993,\"y\":592.8031510416666,\"highlight\":true,\"active\":false},\"end\":{\"x\":283.38750000000005,\"y\":343.976484375,\"highlight\":true,\"active\":false,\"moving\":false},\"textBox\":{\"active\":false,\"hasMoved\":false,\"movesIndependently\":false,\"drawnIndependently\":true,\"allowedOutsideImage\":true,\"hasBoundingBox\":true}},\"uuid\":\"51ca68b0-734c-4046-b3da-dd2886496fd5\",\"invalidated\":true}]}}", null]'></div></div> -->
|
||||||
<div id="dicom-viewer" class="dicom-viewer" style="height: 600px;" data-images='["test_images/IMG1.dcm", "test_images/IMG2.dcm", "test_images/IMG3.dcm", "test_images/IMG4.dcm", "test_images/IMG5.dcm", "test_images/IMG6.dcm"]' data-annotations=''></div>
|
<!-- <div id="dicom-viewer" class="dicom-viewer" style="height: 600px;" data-images='["test_images/IMG1.dcm", "test_images/IMG2.dcm", "test_images/IMG3.dcm", "test_images/IMG4.dcm", "test_images/IMG5.dcm", "test_images/IMG6.dcm"]' data-annotations=''></div> -->
|
||||||
<!-- <div id="dicom-viewer2" class="dicom-viewer" style="height: 600px;" data-images='["test_images/IMG1.dcm", "test_images/IMG2.dcm", "test_images/IMG3.dcm", "test_images/IMG4.dcm", "test_images/IMG5.dcm", "test_images/IMG6.dcm"]' data-annotations=''></div> -->
|
<!-- <div id="dicom-viewer2" class="dicom-viewer" style="height: 600px;" data-images='["test_images/IMG1.dcm", "test_images/IMG2.dcm", "test_images/IMG3.dcm", "test_images/IMG4.dcm", "test_images/IMG5.dcm", "test_images/IMG6.dcm"]' data-annotations=''></div> -->
|
||||||
<!-- <div id="dicom-viewer" class="dicom-viewer" style="height: 600px;" data-images='["test_images/CXR.dcm"]' data-annotations=''></div></div> -->
|
<!-- <div id="dicom-viewer" class="dicom-viewer" style="height: 600px;" data-images='["test_images/CXR.dcm"]' data-annotations=''></div></div> -->
|
||||||
|
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
<footer></footer>
|
<footer></footer>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -79,4 +79,6 @@ function loadDicomViewer(images_to_load, annotations_to_load) {
|
|||||||
dicomViewer.loadCornerstone($(single_dicom2), null, images, annotations, load_as_stack);
|
dicomViewer.loadCornerstone($(single_dicom2), null, images, annotations, load_as_stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.dicomViewer = dicomViewer;
|
||||||
Reference in New Issue
Block a user