Organising Your Images
Jim has six tools to help you get the best out of your images.
Slice Extractor. Allows you to select particular slices from a multi-slice image to produce a new multi-slice image.
Image Concatenator. Pastes two or more multi-slice images end-to-end to create a new multi-slice image with all the slices from all the images.
Image Interleaver. Interleaves the slices from two or more multi-slice images.
Dimensionality Changer. Changes the dimensionality of one or more multi-slice images.
To RGB. Converts three greyscale input images and produces a colour output image with each of the three input images contributing to one of the red, green or blue colour channels.
To Complex. Converts two greyscale input images representing the different channels of a complex image and produces a single complex output image (pixel data type Complex).
From Complex. Splits a complex input image into its complex components (either magnitude and phase, or real and imaginary) creating a separate image for each component.
De-Mosaic. De-Mosaics Siemens images stored in the mosaic format.
Slice Extractor
Selecting Slice Extractor from the Organise menu
of the main display frame brings up the Slice Extractor Tool:

The Slice Extractor tool takes a single input image, extracts some of its slice, and uses those extracted slices to create a new image. The new image will be of the same type as the input image, but with fewer slices. The new image can either be saved to disk, or loaded into Jim depending on your selection:

There are several options for your choice of slices to extract:
- Regular steps. Step through the image with the specified step size.

In the example above, every third slice is extracted. The start and end slices are specified in the Slice Range fields.

By default, the first slice is 1, and the last slice if the number of slices in the input image. In the example above, slice extraction would start at slice 5, and continue to the end of the image in steps of 3.
Note: if you want to reverse the order of the slices, specify a step of -1, with the first slice equal to the number of slices in the image, and the last slice as 1.
- Odd- or Even-numbered slices. Extract odd-numbered or even-numbered slices between the ranges specified in the Slice Range.

- Numbered slices. A list of slices and slice ranges is specified as a comma (,) separated list:

In the example above, slices 5, 7, 13, 20, 21, 22, 23, 24, 25 and 3 will be extracted from the input image. Note that a range of slices is specified using a hyphen as in the example above. Note also that the slices can be specified in any order, and the output image will be assembled in that order.
You can also specify extraction of all except the slices in the list by selecting 
When you have set up the slices you want to extract, select the Input Image by clicking on the
icon, or by typing in the folder (directory) and file name of the image, or by pressing the right mouse button and selecting from the menu of recently-used images.

Now click on the
button to do the extraction. 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 image. Otherwise, the result will be loaded into Jim.
Image Concatenator
Selecting Image Concatenator from the Organise menu
of the main display frame brings up the Image Concatenator Tool:

The Image Concatenator tool takes multiple input images and pastes all the slices from all the input images end-to-end, in order, to form a new image. The new image will be of the same type as the first input image. The new image can either be saved to disk, or loaded into Jim depending on your selection:

First, select the images to be concatenated by clicking on the on the
button. This will bring up a File Chooser from which you can select one or more input images. To select more than one image file, press the "Control" key down while making your selection. To select all files in a list, select one file at the top of the list, press the "Shift" key down, and select a file at the bottom of the list. You can select any files from the list in this way.
You can add further images to the list of images to be concatenated by clicking on the
button at any time.
Ensure that the images are in the order in which you want them to be concatenated. If they are not in the right order, select one or more images in the displayed list to move, and the click either the
button or
button to get them in the right order.
You can remove all the images from the list by clicking the
button, or remove just some of the images by first selecting them, and then clicking the
button.
Now click on the
button to do the concatenation. 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 image. Otherwise, the result will be loaded into Jim.
Image Interleaver
Selecting Image Interleaver from the Organise menu
of the main display frame brings up the Image Interleaver Tool:

The Image Interleaver tool takes multiple input images and interleaves their slices to form a new image with the same number of slices as all the input images combined. For example, if we have three input images, a, b and c, the new output image will have slices in the order a1,b1,c1,a2,b2,c2,a3,b3,c3 etc., where a1 is the first slice from image a, b1 is the first slice from image b, and c1 is the first slice from image c etc. The new image will be of the same type as the first input image. The new image can either be saved to disk, or loaded into Jim depending on your selection:

First, select the images to be interleaved by clicking on the on the
button. This will bring up a File Chooser from which you can select one or more input images. To select more than one image file, press the "Control" key down while making your selection. To select all files in a list, select one file at the top of the list, press the "Shift" key down, and select a file at the bottom of the list. You can select any files from the list in this way.
You can add further images to the list of images to be interleaved by clicking on the
button at any time.
Ensure that the images are in the order in which you want them to be interleaved. If they are not in the right order, select one or more images in the displayed list to move, and the click either the
button or
button to get them in the right order.
You can remove all the images from the list by clicking the
button, or remove just some of the images by first selecting them, and then clicking the
button.
You can influence the slice spacing of the interleaved image by the setting of the
check-box:
- If the check-box is not selected, the slice spacing of the interleaved image will be equal to the slice spacing of the first input image divided by the number of interleaved images.
- If the check-box is selected, the slice spacing of the interleaved image will be the same as that of the first input image.
Now click on the
button to do the interleaving. 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 image. Otherwise, the result will be loaded into Jim.
Dimensionality Changer
Selecting Image Dimensionality Changer from the Organise menu
of the main display frame brings up the Dimensionality Changer Tool:

The Dimensionality Changer tool takes one or more input images and changes their dimensionality to that required. The result can be one or more images, depending one whether the dimensionality is increased or decreased:
- If the dimensionality is increased (for example, creating a 4-D image from several 3-D images), the result will always be a single image of the requested dimensionality.
- If the dimensionality is decreased (for example, creating a several 2-D images from a single 3-D image), the result will always be multiple images of the requested dimensionality.
Set the dimensionality required in the output image using the appropriate button:

Any new image will be of the same type as the first input image encountered. If the result is a single new image (dimensionality increased) the new image can either be saved to disk, or loaded into Jim depending on your selection:

If the result is multiple new images, these will automatically be saved to disk, regardless of the setting.
Select the image(s) whose dimensionality is to be changed by clicking on the on the
button. This will bring up a File Chooser from which you can select one or more input images. To select more than one image file, press the "Control" key down while making your selection. To select all files in a list, select one file at the top of the list, press the "Shift" key down, and select a file at the bottom of the list. You can select any files from the list in this way.
You can add further images to the list of images by clicking on the
button at any time.
Ensure that the images are in the order in which you want them end up in the final image(s). If they are not in the right order, select one or more images in the displayed list to move, and the click either the
button or
button to get them in the right order.
You can remove all the images from the list by clicking the
button, or remove just some of the images by first selecting them, and then clicking the
button.
Now click on the
button to do the dimensionality change. If you have chosen to save the result to disk, or if the result of the dimensionality change will be more than one image, then a File Chooser will pop up, prompting you to choose a base name for the newly-created image(s). Otherwise, the result will be loaded into Jim.
If you reduce the dimensionality, and the result is therefore multiple output images, the images will be named BaseName1, BaseName2, BaseName3, BaseName4 etc., where BaseName is the name you chose above. If you increase the dimensionality and the result is therefore a single output image, the image will be named BaseName.
To RGB
Selecting To RGB from the Organise menu
of the main display frame brings up the To RGB Tool:

The To RGB tool takes three input greyscale images and produces a single colour output image, with the three colour components (red, green and blue) coming from the three input images. This provides a way to combine and visualise the information from three separate images. Each of the three input images must have the same dimensions (number of columns, row and slices of pixels) in order that they can be combined. In order to achieve this, you may need to resample, or register them.
For each of the three colour channels (red, green and blue) of the output image:
- Select the input image using the input image selection panel for the colour. For example, for the red channel:

- Set the intensity range of the input image that will map to the colour intensities 0 and 255. Each of the colour components in the output image has an intensity range from 0 (no colour intensity) to 255 (full colour intensity). Input image intensities between the intensity range will map linearly to colour intensities from 0 to 255. You can either:
-
Have Jim select the intensity range automatically, by selecting the
check-box. In this case, the range will be the 2% and 98% intensity percentiles (excluding any background zero-intensity pixels). -
Set the intensity range manually by entering two image intensity values:

In the example above, image intensities of 10 or below will give a colour intensity of zero, and image intensities of 900 or above will give the maximum colour intensity of 255. If the image intensity that maps to a colour intensity of 255 is lower than the intensity that maps to a colour value of zero, then the colour scale for that colour will be "inverted". You may not enter two values that are equal.
When you have set the three input images, and selected the intensity range for each colour channel, press the
button. The result is a single colour output image, which can can either be saved to disk, or loaded into Jim depending on your selection:

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 colour image. Otherwise, the result will be loaded into Jim.
To Complex
Selecting To Complex from the Organise menu
of the main display frame brings up the To Complex Tool:

The To Complex tool takes two input greyscale images representing the complex components, and produces a single complex output image with a pixel data type of Complex. Each of the two input images must have the same dimensions (number of columns, row and slices of pixels) in order that they can be combined. The To Complex tool can combine either separate images of the real and imaginary parts of the complex image, or the magnitude and phase values of the complex image. Select which components you want to combine by selecting the appropriate button:

For each of the two complex components (real & imaginary, or magnitude and phase) of the output image, set the appropriate input image in the image selection panels below.
Note: if you select "Magnitude & Phase", the phase image can be in one of two forms:
- An image with floating-point pixel values with pixel intensities either:
- Between -π and +π
- Between 0 and 2π
- A image coming from a medical imaging device (typically in DICOM format) where phase values are represented by integer values typically with a range of [-3142..3142] or [0..4096].
Jim is able to automatically detect what sort of phase image you are using as input and apply the appropriate scaling to generate Complex output pixel values.
If you find the phase values in the resulting Complex image are reversed compared to what you expect or need (perhaps because alternating echoes in an MRI pulse sequence have phase reversal), then you can select:

When you have set the two input images, press the
button. The result is a single Complex (single-precision, 64-bits per pixel) output image, which can can either be saved to disk, or loaded into Jim depending on your selection:

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 Complex image. Otherwise, the result will be loaded into Jim.
From Complex
Selecting From Complex from the Organise menu
of the main display frame brings up the From Complex Tool:

The From Complex tool takes a single complex image (with interleaved real and imaginary components) and produces a pair of output images containing either the real and imaginary components, or the magnitude and phase components. Set the complex input image in the complex input image selection panel.
Choose which components you want to produce by selecting the appropriate button:

Then press the
button. The result is a pair of images, with names taken from the input image, but with suffixes "_R" and "_I", or "_M" and "_P", depending on the complex components you chose.
De-Mosaic
Selecting De-Mosaic from the Organise menu
of the main display frame brings up the De-Mosaic Tool:

The De-Mosaic tool takes one or more input images that contain mosaics of Siemens images (multiple images covering the whole head, usually created in fMRI studies) in a single slice. It de-mosaics them and creates multi-slice images where each real image slice has a slice of its own. The dimensionality of the de-mosaiced output image(s) is set using the appropriate button: button:

Select:
- One 3-D image if you want the resulting de-mosaiced image to be a single 3-D image containing all de-mosaiced slices from all input images.
- Multiple 3-D images (one per time point) if you want the resulting de-mosaiced image to consist of multiple 3-D images, with one 3-D image per mosaic.
- One 4-D image if you want the resulting de-mosaiced image to be a single 4-D image with multiple volumes, with one volume (time-point) per mosaic.
If the result is a single new image (3-D or 4-D) the new image can either be saved to disk, or loaded into Jim depending on your selection:

If the result is multiple 3-D images, these will automatically be saved to disk, regardless of the setting.
Select the image(s) to be de-mosaiced by clicking on the on the
button. This will bring up a File Chooser from which you can select one or more input images. To select more than one image file, press the "Control" key down while making your selection. To select all files in a list, select one file at the top of the list, press the "Shift" key down, and select a file at the bottom of the list. You can select any files from the list in this way.
You can add further images to the list of images by clicking on the
button at any time.
Ensure that the images are in the order in which you want them end up in the final image(s). If they are not in the right order, select one or more images in the displayed list to move, and the click either the
button or
button to get them in the right order.
You can remove all the images from the list by clicking the
button, or remove just some of the images by first selecting them, and then clicking the
button.
You can either set the layout (layout of individual slices in the mosaic manually, or you can have Jim make a guess at the layout. To have Jim guess the mosaic layout, select the
check-box. To do it manually, unselect "Auto configuration", and the set the number of rows and columns of slices in the mosaic using the
and
spinners. You do not have to take all the slices from the mosaic and copy them to the output image: you can select only the slices you want. In the grid showing the individual slices in the mosaic in the example below, slices 1,2,15 and 16 have been de-selected (by clicking on the square on the grid) so that the de-mosaiced image will contain only slices 3-14.

If you selected "Auto configuration", Jim will automatically not include any slices of the mosaic that contain no image data.
Now click on the
button to do the de-mosaic. If you have chosen to save the result to disk, or if the result of the de-mosaic will be more than one image, then a File Chooser will pop up, prompting you to choose a base name for the newly-created image(s). Otherwise, the result will be loaded into Jim.
If you chose to create multiple 3-D output images, the images will be named BaseName1, BaseName2, BaseName3, BaseName4 etc., where BaseName is the name you chose above.