ReadImage – Window Arguments

A “window” is a 4-number argument that outlines a rectangular region of interest on an image: the x and y position of the upper-left corner, then the width and height of the rectangle, in pixels. x is 0 at the left edge and increases to the right; y is 0 at the top and increases downward.

Drawing a window in Show

One way to define a window is to display the image in Show and draw a box around the region of interest: hold down the Shift key, press the left mouse button, and drag the cursor to the opposite corner.

Drawing a window on an image in Show

If you then select the Save button in Show, the window coordinates are copied to the system clipboard, and you can paste them into the “window” argument of ReadImage or of another module. Saved windows are also listed in the Windows menu.

The window coordinates in Show

Adjusting a window

To move the window, press and drag the cursor inside it. You can also edit the four numbers in the window text box and press Return or Enter.

Adjusting the window

Using the window

However you get the 4 numbers into the “window” argument, they tell ReadImage to use only the image data in that rectangle.

The window entered in ReadImage