ivmartel / dwv-jqui

Medical image viewer based on DWV (DICOM Web Viewer) and jQuery UI.
https://ivmartel.github.io/dwv-jqui/
GNU General Public License v3.0
18 stars 18 forks source link

In which file the dicom files are read and showed in Canvas? #75

Closed gdet closed 2 years ago

gdet commented 2 years ago

Hello, sorry to ask again but I made an error and wrote to "dwv" issues. Can you point me to dwv-jqui files for reading dicom files and showing them to the canvas?

Thank you very much

ivmartel commented 2 years ago

dwv was the good place for your question! dwv-jqui uses dwv to parse the dicom files. dwv-jqui is just the frontend.

gdet commented 2 years ago

Ok thank you! So a final and silly question... I have installed dvw-jqui and everything is working (as I can tell). Should I also install dvw to have a fully working local tool? Or dvw files are included in dvw-jqui? And if they are included in which folder they are (I cannot find them in src etc).

ivmartel commented 2 years ago

If you are using the release package, dwv is included and can be found in the node_modules folder (the place for the dependencies).

gdet commented 2 years ago

thank you! you are very helpful!!

gdet commented 2 years ago

Hello and sorry to bother you again. I tried to look for the files and code that you suggested in the other thread but I cannot find it in node modules or anywhere in the code. I would like to get somehow the local dicom files path or maybe the images because I would like to run machine learning code which uses your state.json and the dicom files. Since it is a browser I cannot get the full path of the files when they load (for security reasons). I tried to find how you load the dicom to images and the closest I got was to print ImageData { width: 98, height: 10, data: Uint8ClampedArray(3920) } in colourMap.js but I am not sure if this is the correct path to follow. Could I somehow get the dicom local paths? Or maybe if this is not possible to download all images created from the dicom files?

ivmartel commented 2 years ago

The dicom files are either loaded from your local machine or from a url you provide to the viewer, this will give you their path. The viewer loads the dicom file via a 'loader' (see the io folder), for example the urls loader uses an XMLHttpRequest. Once loaded, the file is parsed in the dicom/dicomParser.js to extract its information. Meta data is stored as an object and the image as a dwv.image.Image object (see image/image.js). This image is accessible from the load events sent during the load or via the app class, see app.getImage() (here).

(all this happens in the dwv library)

gdet commented 2 years ago

Thank you for your detailed answer. But I cannot find any of these files in dwv-jqui or the code. I have also looked at node_modules. Have I done something wrong in the installation? I followed the instructions of dwv-jqui and it seems to work correctly though. This is how my files are: εικόνα εικόνα

ivmartel commented 2 years ago

The files are in the separate dwv repository: https://github.com/ivmartel/dwv