cabouman / svmbir

Fast code for parallel or fan beam tomographic reconstruction
BSD 3-Clause "New" or "Revised" License
21 stars 8 forks source link

Fan-beam projection needs to check num_channels is compatible with the input image size. #246

Closed dyang37 closed 2 years ago

dyang37 commented 2 years ago

This issue is spotted thanks to Surogit. Currently, num_channels is used as an input to the svmbir.project(). For fan-beam geometry we might need to check that this input is compatible with the number of image columns and the geometry parameters. Without considering detector offsets, we should roughly have num_channels*delta_channel ~= magnification*num_cols*delta_img. For example, in demo_fanbeam.py,changing num_channels from 256 to 128 would result in garbage reconstruction results due to mismatch between sinogram and image shapes, and this should be checked by the program. In mbircone, this is done by first calculating the correct image shape from the sinogram and geometry parameters, and comparing it with the input image shape.

XiaoWang-Github commented 2 years ago

I don't understand your comment. The number of channels in the sinogram should be independent to the image reconstruction size.

dyang37 commented 2 years ago

I don't understand your comment. The number of channels in the sinogram should be independent to the image reconstruction size.

I agree. In reality the detector and image sizes are independent. I'm saying that we might need to detect whether the two sizes are roughly compatible. For example, if the detector size is significantly smaller than magnification*num_cols*delta_img then we might need to through a warning.

cabouman commented 2 years ago

Diyu, I think this is not a problem for SVMBIR, but we there may be a problem with mbircone that we can set arbitrary reconstructed image sizes. That could bit use when doing laminography. But I will close this issue for SVMBIR.