ivmartel / dwv

DICOM Web Viewer: open source zero footprint medical image library.
https://ivmartel.github.io/dwv/
GNU General Public License v3.0
1.64k stars 588 forks source link

DICOM image to JPEG #401

Closed jagjotwadali closed 6 years ago

jagjotwadali commented 6 years ago

I need to convert DICOM image to JPEG image and then display it on the web page. Is there any dwv library to do this. Kindly help .

ivmartel commented 6 years ago

This is not something dwv can do for now, but it should not be that complicated to implement. Basically you need to convert an HTML canvas to a JPEG image.

anoob09 commented 6 years ago

@ivmartel @jagjotwadali I have the same question. Any solution?

jagjotwadali commented 6 years ago

Yes I have a solution for this .the code is in C#.If you need I will send .

On Fri, May 25, 2018 at 4:26 PM, anoob09 notifications@github.com wrote:

@ivmartel https://github.com/ivmartel @jagjotwadali https://github.com/jagjotwadali I have the same question. Any solution?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ivmartel/dwv/issues/401#issuecomment-392017467, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX40kMbLykpFyQYGIb1OHW1yjGGuEDQks5t1-NCgaJpZM4PlaSR .

anoob09 commented 6 years ago

@jagjotwadali I need php or javascipt if you can help me with that.. it would be awesome. Can you show me how to display DICOM image using location of the DICOM file. Basically any help would be appreciated. I don't have much knowledge about this. I just need to show the image in html.. I don't require other functionalities.

jagjotwadali commented 6 years ago

I dont have the code in javascript and php. I had made a DLL in .NET which converts DICOM image to JPEG and then I display that JPEG image on the webpage but when I click on that JPEG image the original DICOM image is displayed in the DICOM viewer.

You can display the DICOM image by providing the URL http://index.html?input=[path of DICOM image on the server]

On Sat, May 26, 2018 at 10:31 PM, anoob09 notifications@github.com wrote:

@jagjotwadali https://github.com/jagjotwadali I need php or javascipt if you can help me with that.. it would be awesome. Can you show me how to display DICOM image using location of the DICOM file. Basically any help would be appreciated. I don't have much knowledge about this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ivmartel/dwv/issues/401#issuecomment-392274317, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX40sT-sXsAPD5cdzQuh3Gj_lC_BdaCks5t2YpUgaJpZM4PlaSR .

anoob09 commented 6 years ago

@jagjotwadali Can you help me in displaying it as JPEG using html5 and php and javascript. I really need your help right now. Any article, repo blogs will do too.

jagjotwadali commented 6 years ago

Well ,I dont have any idea about html5 and php and javascript .You can refer the library cornerstone .It will be helpful in displaying the image .

search cornerstone library on github.

On Sat, May 26, 2018 at 10:41 PM, anoob09 notifications@github.com wrote:

@jagjotwadali https://github.com/jagjotwadali Can you help me in displaying it as JPEG using html5 and php and javascript. I really need your help right now. Any article, repo blogs will do too.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ivmartel/dwv/issues/401#issuecomment-392275018, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX40mZctaw-U-2BslRLQiP3yGIJDvmcks5t2YzZgaJpZM4PlaSR .

anoob09 commented 6 years ago

I had gone through the library but couldn't find anyway to upload the DICOM file. And which index.html you are referring to in the above comment? Could you provide me the link?

jagjotwadali commented 6 years ago

https://github.com/cornerstonejs/cornerstone.You can go through this library and you will find the results.

index.html -I am referring the the dwv web page .

I will send you the details on monday .Its a weekend and I dont have the code right now.

On Sat, May 26, 2018 at 10:46 PM, anoob09 notifications@github.com wrote:

I had gone through the library but couldn't find anyway to upload the DICOM file. And which index.html you are referring to in the above comment? Could you provide me the link?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ivmartel/dwv/issues/401#issuecomment-392275249, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX40pKIHiO4a9C9q609sgJH5q4JrVXLks5t2Y3YgaJpZM4PlaSR .

anoob09 commented 6 years ago

@jagjotwadali sure thanks for the help. I couldn't find which index you were talking about. But I can wait till monday. Enjoy the weekend .

anoob09 commented 6 years ago

about that index page code ? Can you get it now?

ivmartel commented 6 years ago

Hi, I created a fiddle to show how you can do it with dwv: https://jsfiddle.net/ivmartel/cuz4tsun/

It uses the canvas and its toDataURL method. Right click on the link and choose Save link as... to download as png.

anoob09 commented 6 years ago

@ivmartel I want to use local address of the DICOM file, not the URL. How to do that?

pandrode commented 6 years ago

you can use local url like app.loadURLs(["https://localhost/file/dicom/bbmri-53323851.dcm"]);

2018-05-28 10:36 GMT+01:00 anoob09 notifications@github.com:

@ivmartel https://github.com/ivmartel I want to use local address of the DICOM file, not the URL. How to do that?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ivmartel/dwv/issues/401#issuecomment-392475298, or mute the thread https://github.com/notifications/unsubscribe-auth/AU-3tsXOW2fDMgIUkjYwDZteAR9hczRbks5t28ULgaJpZM4PlaSR .

anoob09 commented 6 years ago

@AbdoulazizMaharou which javascript files do I need to include if I want to run this code https://jsfiddle.net/ivmartel/cuz4tsun/ on my web app ?

ivmartel commented 6 years ago

The only resource needed to run the code of this fiddle is dwv-0.23.4.min.js.

anoob09 commented 6 years ago

@ivmartel when I am using the local address http://localhost/0002.DCM. I am getting the following error. Error: No JPEG Baseline decoder provided at H.image.SynchPixelBufferDecoder.decode (dwv-0.23.4.min.js:3:278951) at H.image.PixelBufferDecoder.decode (dwv-0.23.4.min.js:3:279685) at H.image.DicomBufferToView.convert (dwv-0.23.4.min.js:3:280876) at H.io.DicomDataLoader.load (dwv-0.23.4.min.js:3:321542) at XMLHttpRequest. (dwv-0.23.4.min.js:3:321851) (15:10:10:582 | error, null) at dwv-0.23.4.min.js:3

And also I really need to use the local address of the file. Please tell me how to do that?

ivmartel commented 6 years ago

This simple example does not handle DICOM file with JPEG encoding, check out one of the more advanced examples such as dwv-jqmobile and look for dwv.image.decoderScripts.

I answered your second question in #506.

jagjotwadali commented 6 years ago

Hi ,I am sorry for the delay.Got stuck in some important work.You are online now ? I can help .

Well ,you can download the source code of this library DWV and then you can find the index.html page in the folder

dwv-master->viewers->mobile->index.html

use that index.html page like index.html?input=[path to dicom image]

On Tue, May 29, 2018 at 3:39 PM, ivmartel notifications@github.com wrote:

This simple example does not handle DICOM file with JPEG encoding, check out one of the more advanced examples such as dwv-jqmobile and look for dwv.image.decoderScripts.

I answered your second question in #506 https://github.com/ivmartel/dwv/issues/506.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ivmartel/dwv/issues/401#issuecomment-392724789, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX40v_If7c8tjrcfBKcQLywLRcvqPkxks5t3R5ygaJpZM4PlaSR .

anoob09 commented 6 years ago

@jagjotwadali I will try that.. And I want to store the annotation and its coordinates in database using php and mysql and javascript... Is it possible?

Sorry, I couldn't locate dwv-master->viewers->mobile->index.html folder. I don't even have dwv-master. I have dwv-develop. Do you have link to dwv-master ?

ivmartel commented 6 years ago

You can export a state.json file with the annotations.

The mobile demo was moved to dwv-jqmobile.

anoob09 commented 6 years ago

and state.json file will have coordinates and all the other data that I can use to create annotations again when I launch the app ?

jagjotwadali commented 6 years ago

I will explain you everything ,chat with me .my email id is jagjotwadali@gmail.com

On Tue, May 29, 2018 at 6:08 PM, anoob09 notifications@github.com wrote:

and state.json file will have coordinates and all the other data that I can use to create annotations again when I launch the app ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ivmartel/dwv/issues/401#issuecomment-392760910, or mute the thread https://github.com/notifications/unsubscribe-auth/AeX40vqOlzT3sf_NrXXgXMIi1WWwn8mmks5t3UFhgaJpZM4PlaSR .

anoob09 commented 6 years ago

Yeah sure I sent you an e-mail. Please check.