SIRF icon indicating copy to clipboard operation
SIRF copied to clipboard

Loading STIR.ImageData 4D gives unexpected results

Open ashgillman opened this issue 4 years ago • 2 comments

We have confirmed in an external viewer that the following 3D and 4D images align:

pet_image = pet.ImageData(f'simulation_results/pet_ground_truth_brainweb_3D_mask.nii.gz')
mask_image = pet.ImageData(f'simulation_results/pet_ground_truth_brainweb_4D_mask.nii.gz')

Header info is identical:

> mrinfo simulation_results/{pet_ground_truth_brainweb_3D_mask.nii.gz,pet_ground_truth_brainweb_4D_mask.nii.gz}
************************************************
Image name:          "simulation_results/pet_ground_truth_brainweb_3D_mask.nii.gz"
************************************************
  Dimensions:        187 x 227 x 197
  Voxel size:        1 x 1 x 1
  Data strides:      [ -1 -2 -3 ]
  Format:            NIfTI-1.1 (GZip compressed)
  Data type:         32 bit float (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1          -0           0         -93
                               -0           1           0        -113
                               -0          -0           1        -196
************************************************
Image name:          "simulation_results/pet_ground_truth_brainweb_4D_mask.nii.gz"
************************************************
  Dimensions:        187 x 227 x 197 x 4
  Voxel size:        1 x 1 x 1 x 0
  Data strides:      [ -1 -2 -3 4 ]
  Format:            NIfTI-1.1 (GZip compressed)
  Data type:         32 bit float (little endian)
  Intensity scaling: offset = 0, multiplier = 1
  Transform:                    1          -0           0         -93
                               -0           1           0        -113
                               -0          -0           1        -196

When we plot, our y axis is inverted and both images load as a 3D.

Probably a STIR Issue

Does STIR support loading of 4D NIfTI data? (I thought so)

Happy to write an MWE if this is unexpected.

ashgillman avatar Feb 25 '21 00:02 ashgillman