The Crop command gives confusing dimension

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Crop command gives confusing dimension

Xiaoxiong Xing
I have an image that is 2048*2048. When I run the following macros:

makeRectangle(304, 304, 1450, 1450);
run("Crop");

it then results in an image of 1450*1450. Why not (1450-303)*(1450-303)?

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: The Crop command gives confusing dimension

Ed Simmons
On 18/11/13 19:02, Xiaoxiong Xing wrote:
> I have an image that is 2048*2048. When I run the following macros:
>
> makeRectangle(304, 304, 1450, 1450);
> run("Crop");
>
> it then results in an image of 1450*1450. Why not (1450-303)*(1450-303)?
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Hi Xing,

The second pair of parameters are the width and height of the ROI
rectangle you make, hence when the image is cropped, you get a new image
starting at pixel 304,304 in the original - with width and height of 1450.

Hope that helps,
Ed

--
Ed Simmons
[hidden email]
http://www.esimagingsolutions.com

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html