Dictionary: reordering of data

These commands swap pixels, or the clip or pad the data.


reverse-slice-order <stack list>

Swap the slice order front-to-back, so that the last slice becomes the first slice.


reorder-slices <stack list>

Work together with the “slice-order” variable to reorder the slices using an arbitrary reordering scheme. This could be useful, for instance, to reorder raw (untransformed) MRI data that has been collected in an every-other-slice scheme. For the every-other-slice scheme, one can bypass this command and use the jip “macro”

reorder-interleaved-slices [0 or 1] <stack list>

This macro sets the “slice-order” variable and uses the “reorder-slices” command. The integer in the argument controls whether or not the first slice in the original volume was collected first (0) or during the second pass (1).


shuffle [new stack name] <stack list>

Think of each stack in the list as a deck of cards, and this command will shuffle the stacks (all 1st points, all 2nd time points, …) into a new stack that contains all time points in the new order. This command can be useful for combining slices from separate files into a single stack. For that purpose, write the output into a jip-style file with an ASCII header, modify the slices and time dimensions, and then covert to NIFTI if desired.


slice [integer step size] [new stack name] <volume list>

Slice the volume list, stepping by the specified number of volumes, and put the result into the new stack name. This command can be useful for extracting the time series for a single slice from a larger volume, presuming that the slice by time indices have been modified to be 1 by slice x time.


mirror-left-right <volume list>

mirror-up-down <volume list>

shift-pixels [x shift] [y shift] [z shift] <volume list>

rotate-matrix [0 or 90 or -90- or 180] <volume list>

These are pixel-swapping commands.


clip-x [lower 2^n dimension] <stack list>                                 clip-x-to [specified dimension] <stack list>

clip-y [lower 2^n dimension] <stack list>                                 clip-x-to [specified dimension] <stack list>

clip-z [lower 2^n dimension] <stack list>                                 clip-z-to [specified dimension] <stack list>

Symmetrically clip volumes in one dimension.


pad-x [lower 2^n dimension] <stack list>                                 pad-x-to [specified dimension] <stack list>

pad-y [lower 2^n dimension] <stack list>                                 pad-x-to [specified dimension] <stack list>

pad-z [lower 2^n dimension] <stack list>                                 pad-z-to [specified dimension] <stack list>

Add zeroes symmetrically to the edges of the image (presumably in Fourier space) as a step in interpolation using Fourier transformation.

Joseph B. Mandeville, Athinoula A. Martinos Center for Biomedical Imaging at MGH/MIT/Harvard