Matlab: Extracting a ROI with center coordinates

I have a mammographic image of size 1024 x 1024, and I have the center coordinates of the anomaly (338.314) and the radius (56) in pixels of the circle containing the anomaly. I desire to extract a region of interest of size 128 * 128 including the anomaly. I tried with
rect = [338-64,314-64,127,127]; crop = imcrop (img, rect) ; but I obtien an ROI that does not contain the desired anomaly. any suggestions please.

 Risposta accettata

Are you sure you're getting row, column correctly matched up with x,y? Remember x,y is column, row, NOT row, column. Try
rect = [314-64, 338-64,127,127];
and see if that fixes it.

11 Commenti

i tried it , it dos not fixe the problem , i dont obtain the desired ROI
the image format is pgm and it is not supported here, how can i send it to you?? thank you very much for your interest . i am really blocked in this step
Is the black block along the left hand side considered part of the image, or should the image's first column be where the image actually starts? What is the row of the anomaly - 338 or 314? And what is the column 338 or 114?
here is the info file attached to the database , i have only this file as information source
What do those numbers mean? Where did you get 338 and 314?
those numbers are coordinates of center of abnormality for image mdb028 (mdb028 F CIRC M 338 314 56)
Again, is that x,y or row,column?
5th,6th columns: x,y image-coordinates of centre of abnormality.
7th column: Approximate radius (in pixels) of a circle enclosing
And what about the big black block on the left edge of the image. Can you answer my question about that?
I really do not know obout the area in black, they specified anything, as I mentioned I only have the pictures and the info file that I attached

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Read, Write, and Modify Image in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by