How can I place the cancerous area on the CT image and separate it into ROI and non-ROI?

4 次查看(过去 30 天)
I have dicom file (body picture) and one cancerous area image detected in that body picture. How can I merge these cancerous regions with the dicom file? My second question is how can I do this automatically to 494 images?
Note: Since the dicom file could not be uploaded to this platform, I uploaded the body image as .jpg. How can I overlap dicom and jpg files together?
  2 个评论
Joe Vinciguerra
Joe Vinciguerra 2023-4-6
What do you mean when you say "merge", and what is the final output you want? For example, do you want a single image showing the CT and highlighting the ROI?
Zeynep Fatma
Zeynep Fatma 2023-4-6
When I say merge, I meant that montaging the tumor region (ROI) on the body image. I want to get a single image by putting ROI on Dicom image(CT). I want to get a result like the image that I have uploaded.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2023-4-7
编辑:Image Analyst 2023-4-10

更多回答(2 个)

Image Analyst
Image Analyst 2023-4-6
It's a generic, general purpose demo of how to threshold an image to find blobs, and then measure things about the blobs, and extract certain blobs based on their areas or diameters.

Joe Vinciguerra
Joe Vinciguerra 2023-4-10
编辑:Joe Vinciguerra 2023-4-10
With the files you provided, and no special toolboxes:
CT = imread("Body-CT.jpg"); % import the CT image
ROI = imread("ROI.jpg"); % import the ROI image
CT(end+1, :) = 0; % make the CT array the same size as the ROI array
ROIN = ROI / 255; % normaize to 1
ROIN = uint8(ROIN); % convert to an integer
RGB = CT; % initialize a variable for the merged image
RGB(:,:,2) = RGB(:,:,2) - RGB(:,:,2).*ROIN; % reduce the amount of green in the ROI
RGB(:,:,3) = RGB(:,:,3) - RGB(:,:,3).*ROIN; % reduce the amount of blue in the ROI
indx = and(ROIN, RGB(:,:,1) < 64); % find areas within the ROI where red is too dim
RGB(:,:,1) = RGB(:,:,1) + 64*uint8(indx); % increase red within the ROI where it is too dim
% imshow(RGB) % display the results if you want to
imwrite(RGB, "output.png") % save the output to a file
Now put this code in a FOR loop to process a batch of images, where the file name variables change accordinly.
Some of this code (where you see uint8, 255, 64) assumes your images are 8-bit. This would need to change based on the dynamic range of the images. Additionally, I'm not familiar with dicom files, so check out this: DICOM file format in medical imaging - MATLAB & Simulink (mathworks.com)

类别

Help CenterFile Exchange 中查找有关 DICOM Format 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by