Commit 31fafff0 by pwra

Updates README

parent 3bb35b52
......@@ -31,29 +31,43 @@ SIRT-LC | reco_type4
+ `stopping_rules.py` Examines the performance of the NCP stopping rule by calculating $`|x^{(k)}-\bar{x}|_2`$ for each time step.
#### Plotting and tables
+ `plotting_extreme_cases.py` Used to make plots used in the article with $`N_{\mathrm{proj}} = 45,120,360`$ and $`\rho=0.25\%,1.00\% and 5.00\%`$ alonng with a few other things.
+ `plotting_extreme_cases.py` Used to make plots used in the article with $`N_{\mathrm{proj}} = 45,120,360`$ and $`\rho=0.25\%,1.00\%`$ and $`5.00\%`$ alonng with a few other things.
+ `plotting_arbitrary.py` Used to make supplementary plots.
+ `stopping_plots.py` Used to make NCP test plots.
+ `table_maker.py` Used to make performance tables.
## Basic use
A CUDA capable GPU is required for most scripts. The code is developed using Spyder as it makes possible to run sections of code easily by seperating parts of the code using the symbols `# %%`. This is very prevelant and the scripts `simulation_attenuation.py` and `forward_simulation.py` are best run via Spyder as run parameters cannot be set in the command line. `plotting_extreme_cases.py`, `plotting_arbitrary.py` and `stopping_plots.py` take command line options but is not designed for it.
### Creating the simulation
`simulation_attenuation.py` takes information generated by the fluid simulation and reads it. It either reads a `.npy` with the phase and label information and uses it to calculate the attenuation coefficient of a given voxel. CuPy is used to blur the edges between fluid and grain which requires a CUDA capable GPU. Six files are generated four of which are necessary later on. The four used files are `simulation_attenuation_blur.npy` the blurred simulation used for forward projection, `simulation_attenuation_rotated.npy` used as ground truth, and `ground_truth_distribution.npy`/`ground_truth_distribution_time.npy` which are plotted along side the histograms of the reconstructions.
`simulation_attenuation.py` takes information generated by the fluid simulation and reads it. It either reads a `.npy` with the phase and label information and uses it to calculate the attenuation coefficient of a given voxel. CuPy is used to blur the edges between fluid and grain. Six files are generated four of which are necessary later on. The four used files are `simulation_attenuation_blur.npy` the blurred simulation used for forward projection, `simulation_attenuation_rotated.npy` used as ground truth, and `ground_truth_distribution.npy`/`ground_truth_distribution_time.npy` which are plotted along side the histograms of the reconstructions.
### Forward projection
The forward projection of the data is done in `forward_simulation.py` where four files should be generated. First it should be run with $`N_{\mathrm{proj}} = 720`$ and $`\rho=0.25\%`$ and afterwards with $`N_{\mathrm{proj}} = 360`$ and $`\rho=0.25\%,1.00\%`$ and $`5.00\%`$. The reconstruction scripts scan subsample the forward projections such that it is not necesarry to forward project with $`N_{\mathrm{proj}} = 120`$ or $`N_{\mathrm{proj}} = 45`$. The noise level is selected via the `intensity` parameter and applied with the function `add_noise` in the `auxiliary_functions.py` script. It requires a CUDA capable GPU.
The forward projection of the data is done in `forward_simulation.py` where four files should be generated. First it should be run with $`N_{\mathrm{proj}} = 720`$ and $`\rho=0.25\%`$ and afterwards with $`N_{\mathrm{proj}} = 360`$ and $`\rho=0.25\%,1.00\%`$ and $`5.00\%`$ to create the data for the static reconstruction and ideal FBP reconstruction and the dynamics reconstructions. The reconstruction scripts scan subsample the forward projections such that it is not necesarry to forward project with $`N_{\mathrm{proj}} = 120`$ or $`N_{\mathrm{proj}} = 45`$. The noise level is selected via the `intensity` parameter and applied with the function `add_noise` in the `auxiliary_functions.py` script.
### Static reconstruction
The static reconstruction is performed
The static reconstruction is performed with SIRT or SIRT-BC (SIRT-BC) on a forward projection with $`N_{\mathrm{proj}} = 720`$ and $`\rho=0.25\%`$ and creates the initialisation files used by SIRT-IC and SIRT-LC in `dynamic_reconstruction_SIRT.py`. The function `cuda_ncp()` from `auxiliary_functions.py` returns a comparison between the NCP of the residual and that of white noise.
#### Example
`python static_reconstruction.py -num_proj 720 -noise 0.25 -gpu 0 reco_type 2 -use_NCP 'True'`
### Dynamic reconstruction
## FBP
## SIRT
## Dynamic reconstruction
### FBP
`dynamic_reconstruction_FBP.py` performs a FBP reconstruction of the dynamic data. This is done on a slice by slice basis since ASTRA does not an implementation of FBP for 3D parallel beam geometry.
#### Example
`python dynamic_reconstruction_FBP.py -num_proj 360 -num_proj_used 45 -noise 1.00 -gpu 0`
### SIRT
#### Example
`python dynamic_reconstruction_SIRT.py -reco_type 3 -num_proj_used 45 -gpu 0 -noise 5.00 -use_NCP 'True'`
### Analysis
### Analysis#
### Example
Note that the `-mode 'gpu'` is deprecated and should not be used.
`python reconstruction_analysis.py -num_proj_used ${num_proj_used_arr[$idx_num_proj_used]} -reco_type ${reco_type_arr[$idx_reco_type]} -noise ${noise_arr[$idx_noise]} -file_list 'NCP' -mode 'cpu'`
### Plots
### Tables
### Cross checks
\ No newline at end of file
### Cross checks
### Example
`python stopping_rules.py -noise 5.00 -num_proj_used 120 -reco_type 1 -num_itr 700 -num_steps 40 -gpu 1`
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment