0

I have two CT image . How can I draw multiple ROIs on both image and calculate mean difference between each the corresponding ROIs with matlab ? I've used the 'imrect' or 'imellipse' but this commands creates the Mask which makes the image as binary image then I would have problem with to calculate mean difference .

How to show the images with the ROIs draw on them?

1 Answers1

0

Not very sure about what you want to do with imrect. This is an idea; the way I would do it. You have to get your hands dirty with actual programming instead of GUI, but it's VERY basic stuff, and easy as soon as you understand indexing, which is very nice in MatLab and the thing you should take with you from this answer:

First of you define the size of your ROIs, which can be easily made with a variable

width=20; %or whatever you wish
height=10;

then define the multiple ROIs using their upper left corner for the position

ROI11=Image1(corner1:corner1+width,corner1:corner1+height); %(width and height eventually the other way around, whatever)
ROI12=Image1(corner2:corner2+width,corner2:corner2+height);
%...
ROI21=Image2(corner1:corner1+width,corner1:corner1+height);
ROI22=Image2(corner2:corner2+width,corner2:corner2+height);
%...

and then calculate the mean however you please, like for example:

Mean1=sum(ROI11-ROI21)/length(ROI11(:));
Mean2=sum(ROI11-ROI21)/length(ROI11(:));
%...

or something along those lines.

Give it a try and play a bit with it.

McMa
  • 1,568
  • 7
  • 22