Skip to content

Visualization

villekf edited this page May 28, 2021 · 2 revisions

Visualization in OMEGA

OMEGA includes several ready-made visualization codes in visualize_pet.m. These are divided into sections separated by the double percentage sign (%%). All visualization is performed in loops, where all the slices from the selected view (transverse, sagittal or coronal) are looped through starting from the first slice.

The first section simply loads the struct variable that contains various information about the reconstruction that was saved. These include e.g. number of iterations, number of time steps, data type (sinogram or raw), projector used, implementation used, FOV size, etc. You can modify save_image_properties.m to add your own information.

The second section visualizes the selected algorithms for all slices at the last iteration. Any number of algorithms can be selected, though using more than 8 will most likely cause the image to be too small. Color scale (color_scale variable) can be adjusted as well as the algorithm from where the color scale is taken (color_from_algo). Using color_from_algo = 0 causes the color scale to be individual to each algorithm, i.e. there is no unified color scale.

Running any of the sections with algorithms selected that are not included in the input pz variable will show a message indicating what algorithms, and their cell numbers, are included.

Third section visualizes N last iterations of one algorithm. Note that if options.save_iter = false then only the last iteration is saved and thus you can only visualize the last iteration (making this section unnecessary).

Fourth section is similar to second, except now the original source image can be included to the visualization as well. The original source image always uses its own color scale.

Fifth section includes a 3D volumetric visualization with the help of vol3d v2. You need to download the function from file exchange and put it in the MATLAB/Octave path in order for it to work. Alpha scale can be adjusted in order to make areas with less counts more transparent.

Sixth section allows you to visualize all three different views (transverse, coronal, sagittal) at the same time for the selected algorithms.

Last section is dedicated to dynamic visualization and allows the selected slice to be viewed as a function of time. Original source image and different views are supported as well.

Other visualization possibilities

It is also possible to visualize the data with tools that are not included in OMEGA. Here are some tips that might be useful, but as the images are simple matrices you can use anything that can visualize matrices.

The reconstructed images are structured as follows: the pz-cell array contains all the algorithms that were reconstructed. Each cell element is of size Nx x Ny x Nz x Niter x Nt, where Nx/y/z is the image size in x/y/z-direction, Niter is the number of iterations (including initial value) and Nt is the number of time steps/slices (omitted if static reconstruction). Last iteration can be obtained with end, e.g. A = pz{2}(:,:,:,end) will extract the 3D OSEM image at the last iteration.

In case you wish to visualize the 3D images as slices with mouse control for the slice numbers, there are several different functions available. From MATLAB R2019b and up you can use sliceViewer if you have the image processing toolbox. Alternatively you can try imshow3dfull, viewer3d and volview. For 3D volumetric viewing, you can also use the volumeViewer app in MATLAB if you have image processing toolbox and at least MATLAB R2017a.

Clone this wiki locally