TomographicImaging / CCPi-Regularisation-Toolkit

The set of CPU/GPU optimised regularisation modules for iterative image reconstruction and other image processing tasks
Apache License 2.0
49 stars 25 forks source link

Issue with 3D GPU regularisers in v. 24.0.0 #204

Closed dkazanc closed 3 months ago

dkazanc commented 4 months ago

Thanks a lot for refactoring guys! While I was fiddling with the toolkit to make it work for ToMoBAR, I noticed that the output volumes in demo_gpu_regularisers3D.py are not good (see the image below). That is also consistent across all regularisers.

I've tested 2D regularisers and they seem to be OK, so it is only 3D by the look of it. I know that input parameters have been slightly reshuffled for modules, so I checked that they in accordance to low-level functions. Doesn't seem to be the issue. In addition, the CuPy methods do produce correct results, so it must be something else. See that to reproduce the image below I've changed parameters slightly. We need to add 3D tests :)

Screenshot from 2024-05-03 15-36-45

paskino commented 3 months ago

Looking at the reconstructed volume on the other directions I see:

image

paskino commented 3 months ago

I think it is a general problem that you are seeing only in 3D because the X-Y dimensions are equal. This seems to be due to inversion of the dimensions passed to the underlying C functions, which I believe I fixed:

image

dkazanc commented 3 months ago

Thanks @paskino, are you currently running CPU 3D regularisers or the GPU one? I can confirm only that I saw it with GPU. I'll come back to it later today, I also did some corrections so that the CuPy part gets installed as well (as it wasn't before).

paskino commented 3 months ago

I fixed both CPU and GPU regularisers.

@dkazanc I suggest we merge #205 and open an issue about adding unit tests.