TIGRE icon indicating copy to clipboard operation
TIGRE copied to clipboard

Geometry utilities cast to single, casts integers to single too

Open MargaretDuff opened this issue 4 months ago • 2 comments

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

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

MargaretDuff avatar Aug 13 '25 15:08 MargaretDuff

Thanks for the report! To be honest, I can't remember why that function exist, I am not sure its used explicitly anywhere. Fix should be easy (check if double), Will fix when I have time (or make a PR :) )

AnderBiguri avatar Aug 13 '25 15:08 AnderBiguri

Thanks Ander - We have it in CIL and can't remember why we use it either :)

MargaretDuff avatar Aug 13 '25 16:08 MargaretDuff