CIL icon indicating copy to clipboard operation
CIL copied to clipboard

Rotation direction is always CCW in 2D geometry

Open tommheik opened this issue 2 years ago • 0 comments

Issue: rotation direction is always CCW in 2D geometry

Tested in CIL 23.0.1

In short: it is possible to change the direction of rotation for 3D geometry by changing the rotation axis direction. For 2D geometry this is not currently possible and if a 2D geometry is created from such a 3D geometry, the directions get messed up. This does not happen with the default rotation axis direction.

Here is a minimal working example:

from cil.framework import AcquisitionGeometry
from cil.utilities.display import show_geometry

# 3D geometry with different direction of rotation
geom3D = AcquisitionGeometry.create_Cone3D(source_position=[0,-1, 0], 
                                           detector_position=[0,1, 0], 
                                           rotation_axis_direction=[0, 0, -1], 
                                           detector_direction_x=[1, 0, 0], 
                                           detector_direction_y=[0, 0, 1], 
                                           rotation_axis_position=[0, 0, 0],
                                           units='units distance')
geom3D.set_panel((1,1), pixel_size=(1, 1), origin='bottom-left')
geom3D.set_angles((range(180)))
show_geometry(geom3D)

# Create 2D geometry from it
geom2D = geom3D.get_slice(vertical="centre")
show_geometry(geom2D)

The rotation direction, image x-axis and detector x-axis do not match the original 3D geometry.

tommheik avatar Nov 15 '23 12:11 tommheik