diff --git a/src/bundles/dicom/src/dicom_hierarchy.py b/src/bundles/dicom/src/dicom_hierarchy.py index 0cb5e0722c..7f0e2fbade 100644 --- a/src/bundles/dicom/src/dicom_hierarchy.py +++ b/src/bundles/dicom/src/dicom_hierarchy.py @@ -890,14 +890,21 @@ def pixel_spacing(self): return x_scale, y_scale, z_scale def rotation(self): - affine = self.affine - x_scale, y_scale, z_scale = self.pixel_spacing() - rotation_matrix = [ - [affine[0][0] / x_scale, affine[0][1] / y_scale, affine[0][2] / z_scale], - [affine[1][0] / x_scale, affine[1][1] / y_scale, affine[1][2] / z_scale], - [affine[2][0] / x_scale, affine[2][1] / y_scale, affine[2][2] / z_scale], - ] - return rotation_matrix + #affine = self.affine + #x_scale, y_scale, z_scale = self.pixel_spacing() + #rotation_matrix = [ + # [affine[0][0] / x_scale, affine[0][1] / y_scale, affine[0][2] / z_scale], + # [affine[1][0] / x_scale, affine[1][1] / y_scale, affine[1][2] / z_scale], + # [affine[2][0] / x_scale, affine[2][1] / y_scale, affine[2][2] / z_scale], + #] + # We're ignoring the rotation given by the DICOM files until someone complains about it. + # Doing this simplifies other areas of the codebase significantly. + # 1) The plane viewers use orthographic cameras pointed down the X, Y, and Z axes, and + # ignoring the rotations of the files means we don't have to calculate new axes to + # point the cameras down when files aren't axis aligned. + # 2) We don't have to modify the raycasting shader to do such calculations either. + return [[1, 0, 0], [0, 1, 0], [0, 0, 1]] + #return rotation_matrix def origin(self): affine = self.affine