We have a dicom series for which the scan was flipped upside down. The mosaic has a clear transverse orientation (as observed with xmedcon), but this bit of code went wrong (in parse_siemens_proto2 in dicom_to_minc.c) and determined the mosaic has coronal orientation, because the direction cosine along z was -0.99, and absolute values are not used when doing comparisons:
The solution was simply to change to tmp[i] = fabs(atof(value[i])) for the values in the tmp array.
The downstream effect with the orientation being set wrong is that EXT_Slice_inverted does not get set to 1 in add_siemens_info as it should when sSliceArray.ucImageNumbTra is 1, resulting in the flip:
We have a dicom series for which the scan was flipped upside down. The mosaic has a clear transverse orientation (as observed with xmedcon), but this bit of code went wrong (in parse_siemens_proto2 in dicom_to_minc.c) and determined the mosaic has coronal orientation, because the direction cosine along z was -0.99, and absolute values are not used when doing comparisons:
The solution was simply to change to tmp[i] = fabs(atof(value[i])) for the values in the tmp array. The downstream effect with the orientation being set wrong is that EXT_Slice_inverted does not get set to 1 in add_siemens_info as it should when sSliceArray.ucImageNumbTra is 1, resulting in the flip: