|
TPCCLIB
|
Image reconstruction using filtered back-projection. More...
#include "libtpcrec.h"Go to the source code of this file.
Functions | |
| int | fbp (float *sinogram, int rays, int views, int dim, int filter, float cutoff, float *image) |
| int | imgFBP (IMG *scn, IMG *img, int imgDim, float zoom, int filter, float cutoff, float shiftX, float shiftY, float rotation, int verbose) |
| int | fbpMakeFilter (float *sinFFT, float *cosFFT, float cutoff, int filter, int lenFFT, int views, float *fbpFilter, int verbose) |
| void | fbp_fft_bidir_complex_radix2 (float *real, float *imag, int direct, int n, float *sine, float *cosine) |
| void | fbp_back_proj (float *prj, float *imgCorner, int imgDim, int view, int views, int rays, float offsX, float offsY, float *sinB, float *sinBrot) |
| void | fbp_back_proj_round (float *prj, float *imgOrigin, int imgDim, int view, int views, int rays, float offsX, float offsY, float bpZoom, float *sinB, float *sinBrot) |
Image reconstruction using filtered back-projection.
Based on the program fbprec (May 1997) written by Sakari Alenius for Sun UNIX workstations.
Definition in file fbp.c.
| int fbp | ( | float * | sinogram, |
| int | rays, | ||
| int | views, | ||
| int | dim, | ||
| int | filter, | ||
| float | cutoff, | ||
| float * | image ) |
Filtered back-projection (FBP) reconstruction of one 2D data matrix given as an array of floats.
Image cannot be zoomed (zoom=1), rotated, or shifted.
| sinogram | Pointer to float array containing rays*views sinogram values. |
| rays | Nr of rays (bins or columns) in sinogram data. |
| views | Nr of views (rows) in sinogram data. |
| dim | Image x and y dimensions; must be an even number, preferrably the same as number of rays, but there is no reason for it to be any larger than that. |
| filter | Filter: 0=None, 1=Ramp, 2=Butter, 3=Hann, 4=Hamm, 5=Parzen, 6=Shepp. |
| cutoff | Noise cut-off (for example 0.3). |
| image | Pointer to pre-allocated image data; size must be at least dim*dim. |
Definition at line 20 of file fbp.c.
| void fbp_back_proj | ( | float * | prj, |
| float * | imgCorner, | ||
| int | imgDim, | ||
| int | view, | ||
| int | views, | ||
| int | rays, | ||
| float | offsX, | ||
| float | offsY, | ||
| float * | sinB, | ||
| float * | sinBrot ) |
Backprojection with all projection profiles overlapping the image area.
| prj | pointer to projection data |
| imgCorner | pointer to destination image (upper left corner) |
| imgDim | image dimension |
| view | projection view number |
| views | number of projection views |
| rays | number of rays |
| offsX | x offset |
| offsY | y offset |
| sinB | Sine tables |
| sinBrot | SinBrot array |
Definition at line 599 of file fbp.c.
Referenced by imgFBP().
| void fbp_back_proj_round | ( | float * | prj, |
| float * | imgOrigin, | ||
| int | imgDim, | ||
| int | view, | ||
| int | views, | ||
| int | rays, | ||
| float | offsX, | ||
| float | offsY, | ||
| float | bpZoom, | ||
| float * | sinB, | ||
| float * | sinBrot ) |
Backprojection with projection profiles NOT overlapping the image area.
The corner pixels are left unchanged.
| prj | pointer to projection data |
| imgOrigin | pointer to image origin (center) |
| imgDim | image dimension |
| view | projection view number |
| views | number of projection views |
| rays | number of rays |
| offsX | x offset in pixels |
| offsY | y offset in pixels |
| bpZoom | Zoom |
| sinB | Sine tables |
| sinBrot | sinBrot array |
Definition at line 655 of file fbp.c.
| void fbp_fft_bidir_complex_radix2 | ( | float * | real, |
| float * | imag, | ||
| int | direct, | ||
| int | n, | ||
| float * | sine, | ||
| float * | cosine ) |
In-place bidirectional radix-2 discrete FFT of complex data, applying pre-computed sine and cosine tables.
Adapted from subroutine FOUREA listed in Programs for Digital Signal Processing Edited by Digital Signal Processing Committee IEEE Acoustics Speech and Signal Processing Committee Chapter 1 Section 1.1 Page 1.1-4,5
| real | Array of real part complex data |
| imag | Array of imaginary part complex data |
| direct | direction: 0 and 1=forward FFT, -1=inverse FFT |
| n | Array length |
| sine | Sine table |
| cosine | Cosine table |
Definition at line 512 of file fbp.c.
| int fbpMakeFilter | ( | float * | sinFFT, |
| float * | cosFFT, | ||
| float | cutoff, | ||
| int | filter, | ||
| int | lenFFT, | ||
| int | views, | ||
| float * | fbpFilter, | ||
| int | verbose ) |
Compute filter coefficients for FBP reconstruction.
The filter is made by multiplying a ramp by a window function, according to the filter type.
| sinFFT | Sine table for FFT |
| cosFFT | Cosine table for FFT |
| cutoff | Noise cut-off |
| filter | Filter code: 0=None, 1=Ramp, 2=Butter, 3=Hann, 4=Hamm, 5=Parzen, 6=Shepp. |
| lenFFT | length of FFT array; must be 256, 512, 1024, 2048, ... |
| views | nr of scan views (dim y) |
| fbpFilter | filter array for FBP (output); allocated outside with size lenFFT+1 |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout |
Definition at line 382 of file fbp.c.
| int imgFBP | ( | IMG * | scn, |
| IMG * | img, | ||
| int | imgDim, | ||
| float | zoom, | ||
| int | filter, | ||
| float | cutoff, | ||
| float | shiftX, | ||
| float | shiftY, | ||
| float | rotation, | ||
| int | verbose ) |
Filtered back-projection (FBP) reconstruction using data in IMG struct.
| scn | Sinogram (input) data. |
| img | Image (output) data; allocated here. |
| imgDim | Image dimension (size, usually 128 or 256); must be an even number. |
| zoom | Zoom factor (for example 2.45) |
| filter | Filter code: 0=None, 1=Ramp, 2=Butter, 3=Hann, 4=Hamm, 5=Parzen, 6=Shepp. |
| cutoff | Noise cut-off (for example 0.3). |
| shiftX | Possible shifting in x dimension (mm). |
| shiftY | Possible shifting in y dimension (mm). |
| rotation | Possible image rotation (in degrees). |
| verbose | Verbose level; if zero, then nothing is printed to stderr or stdout. |
Definition at line 108 of file fbp.c.