suyashkumar / dicom

⚡High Performance DICOM Medical Image Parser in Go.
MIT License
946 stars 138 forks source link

streaming frames #8

Open ghost opened 5 years ago

ghost commented 5 years ago

I would like to explore the options for building a GUI client as well as annotated tools in golang.

Is there any more info you have about the jpg files ? Are they in some special format ? https://github.com/suyashkumar/dicom/blob/master/dicomutil/dicomutil.go#L132

suyashkumar commented 5 years ago

Awesome!

Yep, so in dicom there are two broad types of image data: Encapsulated images (compressed in some way) and Native images (which are usually stored in the dicom as 16 bit ints). You can see how native pixel data is turned into a jpg here (autoscaling will need to be implemented at some point) and you can see how it's parsed out of the dicom here.

Thing with encapsulated data is that it can be encoded using one of many formats (JPEG-2000, JPEG-LS, MPEG, etc), though usually it's some type of JPG. Check out more here: http://dicom.nema.org/dicom/2013/output/chtml/part05/sect_8.2.html

Right now the dicomutil assumes the data is some sort of jpeg and writes the binary image data out to disk with a .jpg file name as you see here: https://github.com/suyashkumar/dicom/blob/master/dicomutil/dicomutil.go#L132 .

ghost commented 5 years ago

Thanks. I dont know much about DICOM. Too many things to keep track of with Medical Stards :)

I have a few usecases in mind:

Animated DICOM. So if i get a Dicom of from an Ultrasound machine then we are talking either a still or animated right ? I want to be able to play it animated and so suck out the images and then transcode to the Viewers video format.

3D Printing. So if i am making a prosthetic and want a perfect fit then i want to get a DICOM CT scan, suck out the data and turn into a 3D point cloud and then 3d mesh and then put it into a 3D viewer. But also from the point cloud i can convert it to a mesh and 3 print the implant.

I know these are broad examples. I just wanted to get your feedback on where we need to improve the code.