Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is it possible to get to individual Pixels in dicom image? #287

Open
toli opened this issue Sep 29, 2023 · 4 comments
Open

Question: Is it possible to get to individual Pixels in dicom image? #287

toli opened this issue Sep 29, 2023 · 4 comments

Comments

@toli
Copy link

toli commented Sep 29, 2023

Hi

back with potentially stupid questions

I am helping out a friend who is a radiologist. He has MRI and CT (computer tomography) images that are in dicom format
Ideally, it'd be able to find a tumor on dicom image (visible with naked eye but need to find it programmatically)
He then applies radioactive isotopes, and later does a Nuclear Medicine scan
What i'd need to is look at NM scan, compare it to initial MRI/CT image and see what % of original tumor got radiation and how much radiation went to healthy liver tissues

So i don't have any dicom image processing experience, and i don't even know if what i want is possible
Ideally, i'd be able to scan the dicom image and find the tumor (bright color, for example)
Is that possible? I looked through the documentation but didn't find anything about getting the pixel

Now, i understand that dicom is usually a collection of images - let's say i have the same tumor scanned from top to bottom, there are about 100 images
is my only option to change one of these vertical dicom images to a regular png and examine to find the tumor (possibly lots of images from up to down)? or is there a different way?

apologies for asking basic questions - if there's some high-level reading i need to do, please let me know, with links if possible

@suyashkumar
Copy link
Owner

suyashkumar commented Sep 30, 2023

Hi there! Sounds like you need a couple pieces

  1. Tumor Segmentation in a set of CT slices
  2. Registration of the NM slices to the CT image slices (align them in 3D space)
  3. Compute the metric of interest

Doing 1 programmatically will probably require some kind of ML model if the radiologist hasn't already segmented the tumor. You can google CT tumor segmentation to learn more. There are various registration algorithms as well, some ML based and some heuristic based (worth googling with these terms as well).

is my only option to change one of these vertical dicom images to a regular png and examine to find the tumor (possibly lots of images from up to down)? or is there a different way?

it might be easiest to go slice by slice yes, but your model may take in adjacent "context" slices as well for help.

This library could potentially help you preprocess dicom image slices, but if you're going to be doing a lot of modeling work, it may make sense to do the whole project in python (where libraries like pydicom might be helpful).

I have considered potentially building python bindings for this library, but that would only be worth it if there's a performance benefit because IIUC pydicom is pretty complete as it is.

Hope this is a helpful starting point, and good luck!

@toli
Copy link
Author

toli commented Sep 30, 2023 via email

@toli
Copy link
Author

toli commented Oct 3, 2023

back with more questions
I looked at the API, didn't see a way to write one vertical image out (is there once and i'm just blind?)
say i read the file using dicom.ParseFile and then i want to go through and write out all the (PNG?) images that i can vertically for my CAT scan
and then i will process each resuting image to find the tumor

i'd prefer not to switch to python, i have lots more experience with Golang

@suyashkumar Is it possible to write out an image (PNG, JPG, whatever) from DICOM given all the x/y and z values?

@suyashkumar
Copy link
Owner

suyashkumar commented May 25, 2024

Hi @toli sorry for the delay--you'd have to manually get the pixel values out of the PixelDataInfo frames and create your own Golang image--which might be a bit of a pain, but should be doable. Right now there isn't much in the library to do this for you out of the box!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants