cabouman / mbircone

BSD 3-Clause "New" or "Revised" License
11 stars 9 forks source link

Multires patch #88

Closed dyang37 closed 2 years ago

dyang37 commented 2 years ago

This PR is a patch to the multi-resolution functionality.

This PR includes:

  1. corner case fix. In lower resolution space recon, pass in downsampled init image and prox image (lr_init_image and lr_prox_image) if an init image is given at highest resolution space. We failed to catch this corner case previously, because non of our previous test cases cover the case of using multi-res and non default init image at the same time.

  2. memory efficency. Delete low resolution variables once the low resolution recon is done.

Testing:

  1. Ran demo_3D_shepp_logan.py and demo_mace3D.py, both experiments yield same results and convergence behavior as before.
  2. In demo_3D_shepp_logan.py, set init_image = phantom, and max_resolutions=2:
    init_image = np.copy(phantom)
    recon = mbircone.cone3D.recon(sino, angles, dist_source_detector, magnification, init_image=init_image, max_resolutions=2, sharpness=sharpness, T=T)

    We expect that the convergence in all resolution spaces are fast, because the initial condition is the perfect answer. So the lower resolution space only needs to correct the aliasing resulted from down-sampling. Before the fix: The lowest resolution recon takes 21 iterations to converge, as a result of incorrect init_image provided. After the fix: The lowest resolution recon takes 12 iterations to converge.

gbuzzard commented 2 years ago

I ran the demos. Looks good to me.