HPImaging / sv-mbirct

High Performance Model Based Image Reconstruction for Computed Tomography
BSD 3-Clause "New" or "Revised" License
6 stars 7 forks source link

Reconstruction fails when supplied initial image is zero #2

Closed smajee closed 4 years ago

smajee commented 4 years ago

A) When performing a reconstruction with a supplied initial image (using -t flag) that is all zeros

  1. Reconstruction fails (output image remains zero)
  2. It does not produce any error messages
  3. The printed non-homogeneous iterations is wrong (Equivalent iterations = 0.0, (non-homogeneous iterations = 300))

B) If the InitImageValue parameter in reconparams is set to zero for the initial condition, it shows a warning: 'Warning in ../params/sv-mbirct/object.reconparams: InitImageValue should be positive. Reverting to default.'

I understand that using a small positive scalar as an initial value is beneficial for speeding up convergence in most cases. However, in my opinion, the user should be free to choose any initial value/image that is suitable for the application.

Here is an excerpt of the command line output for case (A):

SUPER-VOXEL MBIR RECONSTRUCTION FOR 3D PARALLEL-BEAM CT build time: Jul 4 2020, 15:14:06

Parsing command line... -> will perform reconstruction (QGGMRF) -> will read system matrix from file -> will read initial condition from file(s) -> will compute forward project of initial condition NOTE you may save run time by pre-computing the initial projection See help (-e option) -> will save projection of output image state to file(s)

Filenames provided: Sino params = /depot/bouman/users/smajee/codedExp_project/workDir/demo/sv-mbirct_params/object.sinoparams Image params = /depot/bouman/users/smajee/codedExp_project/workDir/demo/sv-mbirct_params/object.imgparams Recon params = /depot/bouman/users/smajee/codedExp_project/workDir/demo/sv-mbirct_params/object.reconparams Sinogram data = /depot/bouman/users/smajee/codedExp_project/workDir/data/sv-mbirct/sino/object_sliceNNN.2Dsinodata Weight data = /depot/bouman/users/smajee/codedExp_project/workDir/data/sv-mbirct/weight/object_sliceNNN.2Dweightdata Output images = /depot/bouman/users/smajee/codedExp_project/workDir/data/sv-mbirct/recon/object_sliceNNN.2Dimgdata Initial image = /depot/bouman/users/smajee/codedExp_project/workDir/data/sv-mbirct/init/object_sliceNNN.2Dimgdata System matrix = /depot/bouman/users/smajee/codedExp_project/workDir/data/sv-mbirct/sysmatrix/object.2Dsvmatrix Output projection = /depot/bouman/users/smajee/codedExp_project/workDir/data/sv-mbirct/proj/object_sliceNNN.2Dprojection SINOGRAM PARAMETERS:

Reading system matrix... Reading initial image... Projecting initial image... Projection time = 358 ms Reconstructing... No stopping condition--running fixed iterations Equivalent iterations = 0.0, (non-homogeneous iterations = 300) Average update in last iteration (relative) = 0.000000 % Average update in last iteration (magnitude) = 0.000000 mm^-1 Reconstruction time = 6350 ms Writing image files... Writing projection of image state... Done.

sjkisner commented 4 years ago

Result of "zero-skipping". Pixels surrounded by zeros are skipped from updating, so it skips everything and with no image change it looks like it's converged. A couple possible solutions: 1) Disable zero-skipping for the first iteration 2) Remove zero-skipping altogether. In the SV code the updates are relatively fast, so the additional branches and reads/writes with zero-skip checking for every pixel might offset the benefit of skipping some of the updates.

sjkisner commented 4 years ago

Added flag to disable zero-skipping. Currently set to disable zero-skipping only for 1st iteration.