We are processing some relatively large CT data sets containing scans of multiple bones (non-human) where we extract regions of interest to be able to more easily process selected bones in detail. The location and orientation of the bones in the scans is rather arbitrary and random. We have used simple ITK to extract such regions and saved the results as nifti files.
We would like to do some of the processing of the extracted regions in ITK-SNAP but noted that, depending on the orientation, ITK-SNAP would fail to read some files while e.g. slicer is quite happy to do so.
We also noted that c3d seems to be happy to read these files, and we could perform some manipulation (e.g. extract a region) using c3d - and the results seem ok; but again, whilst slicer will read the file produced by c3d here, ITK-SNAP does not (the orientation did not change).
I wonder if there is any scope to make ITK-SNAP more acceptable of such more "wild" orientations?
The error message in the specific case here was:
Image has an invalid orientation (code RIL)
We tested this using a recent version of ITK-SNAP (4.2.0. rc1, 11th March 2024) and c3d ( 1.4.0; compile date: 16rth March 2024); I've included the print-out of a c3d -info-full command below to provide an idea of the direction cosine matrix.
It would be lovely to get your thoughts here!
Best wishes,
Markus
print-out of a c3d -info-full command is as follows:
Image #1:
Image Dimensions : [525, 1284, 588]
Bounding Box : {[28.7262 -7.79078 179.673], [61.5636 72.5201 216.451]}
Voxel Spacing : [0.0625474, 0.0625474, 0.0625474]
Intensity Range : [0, 255]
Mean Intensity : 23.5149
Canon. Orientation : Oblique, closest to RIL
Direction Cos Mtx. :
0.8030 -0.0105 -0.5958
-0.4325 0.6775 -0.5949
0.4099 0.7355 0.5395
Voxel->RAS x-form :
-0.05023 0.00066 0.03727 -28.72616
0.02705 -0.04237 0.03721 7.79078
0.02564 0.04600 0.03374 179.67319
0.00000 0.00000 0.00000 1.00000
Image Metadata:
ITK_original_direction of unsupported type class itk::Matrix<double,3,3>
ITK_original_spacing of unsupported type class std::vector<double,class std::allocator<double> >
bitpix = 8
cal_max = 0
cal_min = 0
datatype = 2
dim[0] = 3
dim[1] = 525
dim[2] = 1284
dim[3] = 588
dim[4] = 1
dim[5] = 1
dim[6] = 1
dim[7] = 1
dim_info = 0
intent_code = 0
intent_p1 = 0
intent_p2 = 0
intent_p3 = 0
nifti_type = 1
pixdim[0] = 0
pixdim[1] = 0.0625474
pixdim[2] = 0.0625474
pixdim[3] = 0.0625474
pixdim[4] = 0
pixdim[5] = 0
pixdim[6] = 0
pixdim[7] = 0
qform_code = 1
qform_code_name = NIFTI_XFORM_SCANNER_ANAT
qoffset_x = -28.7262
qoffset_y = 7.79078
qoffset_z = 179.673
quatern_b = 0.289378
quatern_c = 0.382784
quatern_d = 0.868904
scl_inter = 0
scl_slope = 1
sform_code = 1
sform_code_name = NIFTI_XFORM_SCANNER_ANAT
slice_code = 0
slice_duration = 0
slice_end = 0
slice_start = 0
srow_x = -0.0502278 0.000659004 0.0372681 -28.7262
srow_y = 0.0270543 -0.0423739 0.0372115 7.79078
srow_z = 0.02564 0.0460022 0.0337427 179.673
toffset = 0
vox_offset = 352
xyzt_units = 2