CERN / CERN/TIGRE

Geometry utilities cast to single, casts integers to single too

Open
#678 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
MATLAB
Stars
803
Forks
262
Avg merge
9d 13h
Merged PRs (30d)
8

Description

This bit of code: https://github.com/CERN/TIGRE/blob/989615d8d6c33c2b88c060c14c826ff8b83cce6c/Python/tigre/utilities/geometry.py#L119-L130

## Expected Behavior
Expect anything in double precision is cast to single precision

## Actual Behavior
Casts everything to single precision including integers

## Code to reproduce the problem (If applicable)
This caused an issue when I did

```python
self.tigre_geom.cast_to_single()

img, qual= sart(
proj=self.tigre_projections,
geo=self.tigre_geom,
angles=self.tigre_angles,
init=self.tigre_initial,
niter=self.niter,
gpuids=self.gpuids,
**self.kwargs
```
because sart allocates internally based on `nVoxel` in the geometry which now isn't an integer.

## Specifications

- MATLAB/python version: python
- OS: linux
- CUDA version: 12.9

Contributor guide

Open the contributing guide

Research direction

Review Python/tigre/utilities/geometry.py lines 119-130 and the cast_to_single() call path used before sart(). Reproduce the shown sart scenario and verify that double-precision values become single while integer geometry fields such as nVoxel remain integers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.