Can we extract ROI of MRI images automatically?
6 views (last 30 days)
Show older comments
Hi every one, I have a set of dicom files and I am trying to extract ROI of approximate region of knee cartilage automatically? I don't need the whole image, because the size of voxels is big. I want to extract an approximate small area around the tibiofemoral joint (knee joints). Does anyone know how can I do ROI extraction automatically? Or is there any commands to crop a rectangular part of image as ROI automatically?Is there any function that can automatically do that ? Your help is appreciated.
0 Comments
Answers (2)
Image Analyst
on 13 Dec 2015
You might try the grayconnected() function, but I think that that ROI might be connected to a bunch of other pixels that you don't want. You could perhaps try to repair it afterwards with activecontour(), but no guarantees. Alternatively freehand tracing is probably your best option. I'm attaching demos for that.
Walter Roberson
on 13 Dec 2015
If you knew the ROI location in the image then you could imcrop() passing in the bounding box. Or simply index into the image array.
If you do not know the exact location then the difficulty is going to depend upon how difficult it is to recognize the appropriate area. We would find it easier to advise you on that if you were to post a few different images -- at least two different patients, and if the MRI is taken at different Z coordinates then at least two different Z for one of the patients.
3 Comments
Walter Roberson
on 13 Dec 2015
I think it is going to be tricky to get that ROI.
Once you have an ROI, you can use roi2mask and then use the mask to set values (and use the logical negation to set the other value). For example,
imgclass = zeros(size(TheROI), 'uint8');
rmask = roi2mask(TheROI);
imgclass(rmask) = 1; %foreground
imgclass(~rmask) = 0; %background
However in the particular case of those two values, you could use
rmask = roi2mask(TheROI);
imgclass = uint8(rmask);
as the mask is going to be logical 1 where the ROI is and logical 0 elsewhere. The uint8() part can be omitted if you are not planning to store values other than 0 and 1 there.
See Also
Categories
Find more on Biomedical Imaging in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!