LLNL / LEAP

comprehensive library of 3D transmission Computed Tomography (CT) algorithms with Python and C++ APIs, a PyQt GUI, and fully integrated with PyTorch
https://leapct.readthedocs.io
MIT License
104 stars 10 forks source link

RWLS not working #10

Closed stephoog closed 9 months ago

stephoog commented 9 months ago

Hey! RWLS reconstruction returns all zeros. Could you look into this?

kylechampley commented 9 months ago

It would be helpful to have a little more information about this error. Could you send me the following: 1) The screen output of leapct.print_parameters() 2) The source of the data 3) The scaling of the data (min/ max) values 4) Do any of the other reconstruction algorithms return an expected result?

stephoog commented 9 months ago

The data is simulated medical CT. Yes FBP and LS reconstructions looks good. My screen output: RWLS iteration 1 of 10 lambda = 0.0 invalid step size; quitting!

kylechampley commented 9 months ago

OK, well, then, it must be that the weights are messing things up. It would be helpful if you sent me the output of leapct.print_parameters(). In any case, make sure the detector pixel sizes and reconstruction voxel sizes are specified in mm.

If you are simulating by forward projecting a voxelized volume, make sure the units of the voxel values are in mm^-1. Water should be around 0.02. If you see values above 1000, these are in Hounsfield units and need to be scaled by 1/50000 to put them in approximate mm^-1 units.

Here is why this matters. If the values in the volume are too high, then the values in the forward simulation will be too high and then weights in RWLS are set to exp(-g) by default and exp(-LARGE) = 0. So this will zero out everything. Remember this is a quantitative algorithm that requires that the weights model the noise in the data, so if it is off, the reconstruction won't work.

stephoog commented 9 months ago

That did it thanks!