Skip to content
Adrian Quintana edited this page Dec 11, 2017 · 1 revision

Window

Purpose

This utility windows an image or volume. A selection file can also be windowed and then all images or volumes in the selfile.

But... what is windowing? Let's suppose we have an image 32x32, and we window it to 16x16, then the central part which contains this 16x16 square is returned, but if we window to 64x64 then the image is kept in the center of the final image and it is padded with 0's until the new size is reached (The padding value may be modified using-pad_value,-corner_pad_value or-average_pad_value).

With this idea in mind of padding or cutting, if you define two logical corners in the input image (the most negative -the top left in an image- and the most positive -bottom right in an image-) you can store the new image or volume generated by windowing with a square box (parallelepiped for volumes).

Usage


$ window ...


Parameters

  • __OR__ Window a single file

  • __OR__ If no output file is given, then the input one is rewritten

  • `` Window a bunch of files

  • __OR__ If no output extension neither root are given, then the input ones are rewritten

  • `` Do not produce on screen information

  • [new Ynew X] [new Z=new X] = Output dimension. The volume is windowed (expanded or cutted) in all directions such that the origin of the volume remains the same. If the Y and Z dimensions are not specified they are assumed to be the same as the X dimension.

  • `` New volume corners. The volume is windowed in such a way thatr0 and`rF` define the new volume corners.`r0` and`rF` must be in logical coordinates. For images the`z0` and`zF` parameters are not needed.

  • [crop Ycrop X] [crop Z=crop X] = How many pixels to crop in each direction. Half of the pixels will be cropped from the left, and the other half from the right.

  • `` Value used for padding

  • `` Use the value of the upper left corner for averaging

  • `` Use the image average for padding

  • `` Use physical instead of logical coordinates

Examples and Notes

Window a single image to 16x16, overwriting input image


$ window -i g0ta0001.xmp -size 16


Window a single volume to 32x64x64, writing in a different volume


$ window -i g0ta.vol -size 64 64 32


The same using logical indexes


$ window -i g0ta.vol -r0 -32 -32 -16 -rF 31 31 15


Notice thatr0 andrF are not symmetric because the volume is of an even size, if we wanted to get a 33x65x65 volume, the right indexes would be


$ window -i g0ta.vol -r0 -32 -32 -16 -rF 32 32 16


Reduce the volume by 10 pixels on each direction


$ window -i g0ta.vol -crop 10


Enlarge the volume by 10 pixels on each direction (negative crop)


$ window -i g0ta.vol -crop -10


--Main.AlfredoSolano - 22 Jan 2007

Clone this wiki locally