I was looking into the region of interest tutorial set here and there are a few things that escape my understanding.
The example given to create a binary mask for setting the ROI is
img = imread('pout.tif');
h_im = imshow(img);
e = imellipse(gca,[55 10 120 120]);
BW = createMask(e,h_im);
I understand that an ellipse imellipse
is used to create the ROI object. So following its own page here I read more about it but no where on that page does it explain what gca
is? all it says is that it is an hparent and specifies the HG parent of the ellipse. I do not understand this can some one please elaborate. Can I use something else in place of gca? and what is gca?
Also in this line the imshow
function is assigned to h_im
and then further used. When I did this with my installation with a sample image I got this value h_im = 1.740099
so h_im
is a double value.
This is further used here BW = createMask(e,h_im);
I understand that these are the parameters meaning:
BW = createMask(h,h_im) returns a mask the same size as the image h_im with 1s inside the ROI object h and 0s outside. This syntax is required when the axes that contain the ROI hold more than one image.
so is 1.740099
the size of the image? In which units is this measured?
Also when I wrote the last line in my Matlab I got the following error:
>> BW = createMask(h,h_im);
??? Invalid or deleted object.
Error in ==> imroi>imroi.parseInputsForCreateMask at 78
h_ax = ancestor(obj.h_group,'axes');
Error in ==> imroi>imroi.createMask at 264
[obj,h_im] = parseInputsForCreateMask(varargin{:});
Why am I getting this error?
Thank you