#

# Spatial and temporal dimensions

The codes below can be used in xyzt_units to indicate the units of pixdim. As noted earlier, dimensions 1,2,3 are for x,y,z; dimension 4 is for time (t).

- If dim[4]=1 or dim[0] < 4, there is no time axis.

- A single time series (no space) would be specified with

- dim[0] = 4 (for scalar data) or dim[0] = 5 (for vector data)

- dim[1] = dim[2] = dim[3] = 1

- dim[4] = number of time points

- pixdim[4] = time step

- xyzt_units indicates units of pixdim[4]

- dim[5] = number of values stored at each time point

Bits 0..2 of xyzt_units specify the units of pixdim[1..3] (e.g., spatial units are values 1..7). Bits 3..5 of xyzt_units specify the units of pixdim[4] (e.g., temporal units are multiples of 8).

This compression of 2 distinct concepts into 1 byte is due to the limited space available in the 348 byte ANALYZE 7.5 header. The macros XYZT_TO_SPACE and XYZT_TO_TIME can be used to mask off the undesired bits from the xyzt_units fields, leaving "pure" space and time codes. Inversely, the macro SPACE_TIME_TO_XYZT can be used to assemble a space code (0,1,2,...,7) with a time code (0,8,16,32,...,56) into the combined value for xyzt_units. Note that codes are provided to indicate the "time" axis units are actually frequency in Hertz (_HZ) or in part-per-million (_PPM).

The toffset field can be used to indicate a nonzero start point for the time axis. That is, time point #m is at t=toffset+m*pixdim[4] for m=0..dim[4]-1.

#### MRI-SPECIFIC SPATIAL AND TEMPORAL INFORMATION

A few fields are provided to store some extra information that is sometimes important when storing the image data from an FMRI time series experiment. (After processing such data into statistical images, these fields are not likely to be useful.)

{ freq_dim } = These fields encode which spatial dimension (1,2, or 3)

{ phase_dim } = corresponds to which acquisition dimension for MRI data.

{ slice_dim } =

Examples:

Rectangular scan multi-slice EPI:

freq_dim = 1 phase_dim = 2 slice_dim = 3 (or some permutation)

Spiral scan multi-slice EPI:

freq_dim = phase_dim = 0 slice_dim = 3

since the concepts of frequency- and phase-encoding directions don't apply to spiral scan

slice_duration = If this is positive, AND if slice_dim is nonzero, indicates the amount of time used to acquire 1 slice.

slice_duration*dim[slice_dim] can be less than pixdim[4] with a clustered acquisition method, for example.

slice_code = If this is nonzero, AND if slice_dim is nonzero, AND if slice_duration is positive, indicates the timing

pattern of the slice acquisition. The following codes are defined:

NIFTI_SLICE_SEQ_INC

NIFTI_SLICE_SEQ_DEC

NIFTI_SLICE_ALT_INC

NIFTI_SLICE_ALT_DEC

{ slice_start } = Indicates the start and end of the slice acquisition

{ slice_end } = pattern, when slice_code is nonzero. These values are present to allow for the possible addition of

"padded" slices at either end of the volume, which don't fit into the slice timing pattern. If there

are no padding slices, then slice_start=0 and lice_end=dim[slice_dim]-1 are the correct values.

For these values to be meaningful, slice_start must be non-negative and slice_end must be greater than slice_start.

The following table indicates the slice timing pattern, relative to time=0 for the first slice acquired, for some sample cases. Here,

dim[slice_dim]=7 (there are 7 slices, labeled 0..6), slice_duration=0.1, and slice_start=1, slice_end=5 (1 padded slice on each end).

slice

index SEQ_INC SEQ_DEC ALT_INC ALT_DEC

6 -- n/a n/a n/a n/a n/a = not applicable

5 -- 0.4 0.0 0.2 0.0 (slice time offset

4 -- 0.3 0.1 0.4 0.3 doesn't apply to

3 -- 0.2 0.2 0.1 0.1 slices outside range

2 -- 0.1 0.3 0.3 0.4 slice_start..slice_end)

1 -- 0.0 0.4 0.0 0.2

0 -- n/a n/a n/a n/a

The fields freq_dim, phase_dim, slice_dim are all squished into the single byte field dim_info (2 bits each, since the values for each field are

limited to the range 0..3). This unpleasantness is due to lack of space in the 348 byte allowance.

The macros DIM_INFO_TO_FREQ_DIM, DIM_INFO_TO_PHASE_DIM, and DIM_INFO_TO_SLICE_DIM can be used to extract these values from the

dim_info byte. T he macro FPS_INTO_DIM_INFO can be used to put these 3 values into the dim_info byte.

Documentation from nifti1.h by RW Cox, NIH