Resampling Images

Jim can resample an existing image to have different numbers of slices, rows, columns and frames (for multi-frame images). The Resampler can crop images, resize image pixels, pad images to a larger size, and reorient images to a different imaging plane. When resizing pixels, if the number of samples that you request is less than the original, Jim will average pixel values to sub-sample the image. If the number of samples that you request is greater than the original, Jim will interpolate pixel values to create an image with greater (digital) resolution.

When resizing pixels, you can either specify the new pixel size, or the number of samples that you require. Jim will then work out the best resampling strategy.

To resample an existing image, select Image Resampler from the Organise menu: of the main display frame. This brings up the Image Resampler tool:

The Image Resampler tool takes a single input image, and resamples it to create a new image. The new image will be of the same type as the input image, but with different numbers of samples (pixels) in each of its dimensions. The new image can either be saved to disk, or loaded into Jim depending on your selection:

Note: when performing more than one operation (cropping, padding, resampling and reorienting) the operations will be applied sequentially such that the cropped image is passed to the Resampler, which is passed to the padder, which is then passed on for reorientation, so that the specifications at each stage apply to the image that has been produced by the previous operation.

First select the Input Image either by clicking on the icon, or by typing in the folder (directory) and file name of the image.

Cropping

Cropping involves selecting only certain columns, rows, slices and frames of an image, to create an image that has been "trimmed" of excess pixels.

To crop an image, click the check box. Enter the start and end values for the row numbers, column numbers, slice numbers and frames numbers (if applicable) for the cropped image. You can set the default values (the full range as the original image) by clicking the button. (You must set an input image before the Set Defaults button will bring up the defaults.)

Note: the valid range of values goes from 1 to the number of samples in each dimension. Entering a value outside this range will cause an error message to be displayed.

Resizing pixels

To resize the pixels of an image, click the check box.

There are two ways to specify how you want the image pixels to be resized:

When you have set up the reampling scheme, click on the button to do the resampling. If you have chosen to save the result to disk, then a File Chooser will pop up, prompting you to choose a file name for the new (resampled) image; otherwise, the result will be loaded into Jim.

Type of Interpolation

If the number of samples you specify is greater than the original in any dimension, or if the pixel size is smaller than the original, then the image must be interpolated to obtain the new intensity values.

You can select from the four options:

Type of Sub-sampling

If the number of samples you specify is fewer than the original in any dimension, or if the pixel size is larger than the original, then the image must be sub-sampled to obtain the new intensity values.

You can select from the three options:
  • Nearest neighbour. The intensity of a pixel in the resampled image will be that of the pixel which is closest in the original image.
  • By averaging. The intensity of a pixel in the resampled image will contain a contribution from of all pixels of the original image that are contained within the new pixel, in proportion to the area contained.
  • Low-pass filtered. The original image is low-pass filtered with a filter width appropriate to the new pixel size, and then resampled using sinc interpolation.

    Padding

    Padding involves putting extra columns, rows, slices and frames in an image, to create an image that has a greater number of pixels than it had originally.

    To pad an image, click the check box. Enter the numbers of columns, rows, slices and frames (if applicable) for the padded image. Each value you enter should be at least as large as the number of samples in the original image (or, if you have performed cropping or resampling, in the result of these operations). You can set the default values (the same range as in the original image) by clicking the button.

    Note: image is padded evenly as is possible around the edges. For example suppose the image to be padded has 256 columns, and you specify that the padded image will have 261 columns. Three columns are added to the left hand side of the image, and two to the right to make up the difference in the number of columns.

    Reorienting

    Reorienting involves changing the imaging plane (for example, from axial to coronal).

    To reorient an image, click the check box. Select the orientation required by clicking on the appropriate button in the New orientation panel.

    Jim may be able to determine the orientation of the original image (which it needs in order to perform the reorientation correctly). If it cannot, you will see an error message; in this case, tell Jim the original orientation by selecting the check box and clicking on the appropriate button in the Current orientation panel.

    By default, Jim assumes that the ordering of the image slices follows the standard radiological convention (slice number increasing from right to left, from anterior to posterior, and from inferior to superior). If your image slices do not follow this convention, then the re-oriented image will also not follow convention. If this happens, and you see (for example) in your reoriented image that the anterior portion of the patient is towards the bottom of the screen, then click the check box to tell Jim that your image slice order does not follow the standard radiological convention.

    Jim Home