Skip to content

Allow tilted rotation axis with parallel beam geometry for tigre projectors#2238

Draft
hrobarts wants to merge 8 commits into
masterfrom
tigre_arb_angle
Draft

Allow tilted rotation axis with parallel beam geometry for tigre projectors#2238
hrobarts wants to merge 8 commits into
masterfrom
tigre_arb_angle

Conversation

@hrobarts

@hrobarts hrobarts commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

Description

Calculate Euler angles for tilted parallel geometry

If geometry is parallel and advanced

  • Calculate roll, pitch and yaw as before
  • Calculate Euler angles based on roll, pitch and yaw
  • Reset tigre rotDetector to 0
  • Return Euler angles to be used with projection operator

Still needs:

  • Unit tests

Example Usage

TomographicImaging/CIL-Demos#281

Contribution Notes

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License
  • I confirm that the contribution does not violate any intellectual property rights of third parties

❤️ Thanks for your contribution!

@hrobarts hrobarts self-assigned this Nov 11, 2025
@gfardell

Copy link
Copy Markdown
Member

This seems to be tilting the object, not the rotation axis. The cuboid example shows the same so potentially something has dropped from the original code. It'll need a bit more thought so marking as draft for now.

#%%
from cil.utilities import dataexample
from cil.utilities.display import show2D
from cil.plugins.astra import ProjectionOperator as ProjectionOperator_A
from cil.plugins.tigre import ProjectionOperator as ProjectionOperator_T
from cil.framework import AcquisitionGeometry
from cil.utilities.display import show_geometry

import numpy as np
#%%
phantom = dataexample.SIMULATED_SPHERE_VOLUME.get()
data_orig = dataexample.SIMULATED_PARALLEL_BEAM_DATA.get()


plantom_thin = phantom.geometry.allocate(0)
plantom_thin.array[128//2-10:128//2+10,:,:] = phantom.array[128//2-10:128//2+10,:,:]

show2D(plantom_thin, slice_list=[(0,64),(1,64),(2,64)])
image
# %%
ag_tilt = AcquisitionGeometry.create_Parallel3D(rotation_axis_direction=[0,-np.sin(np.radians(20)),np.cos(np.radians(20))])\
                        .set_panel([128,128],[16.,16.])\
                        .set_angles(np.linspace(0,360,300,False))

show_geometry(ag_tilt)
image
#%%
#astra fp
ag_tilt.set_labels(['vertical', 'angle','horizontal'])
PO = ProjectionOperator_A(plantom_thin.geometry, ag_tilt)
fp_tilt_A = PO.direct(plantom_thin)

#tigre fp
ag_tilt.set_labels(['angle','vertical','horizontal'])
PO = ProjectionOperator_T(plantom_thin.geometry, ag_tilt)
fp_tilt_T = PO.direct(plantom_thin)

#%%
show2D([fp_tilt_A, fp_tilt_T],slice_list=('angle',0))
show2D([fp_tilt_A, fp_tilt_T],slice_list=('angle',75))
show2D([fp_tilt_A, fp_tilt_T],slice_list=('angle',150))
show2D([fp_tilt_A, fp_tilt_T],slice_list=('angle',225))
image image image image

@gfardell

Copy link
Copy Markdown
Member

Updated and it appears to work as expected for the interpolated direct method, but not for Siddon.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tigre projectors for parallel beam are limited to un-tilted rotation axis

2 participants