Bsoft 2.1.4
Bernard's software package
img_radon.cpp File Reference

Radon transform functions. More...

#include "kernlut.h"
#include "gal_ricoI.h"
#include "sin_gal.h"
#include "pocs_tool.h"
#include "proj_tool.h"
#include "radon_util.h"
#include "img_radon.h"
#include "mg_processing.h"
#include "Bimage.h"
#include "symmetry.h"
#include "Matrix.h"
#include "linked_list.h"
#include "utilities.h"

Functions

Bimageimg_radon_transform (Bimage *p, int type, int nkernel, int kernel_power, int padd, int ntheta)
 Calculates the Radon transform of an image. More...
 
Bimageimg_radon_inverse_transform (Bimage *p, int type, int nkernel, int kernel_power, int padd)
 Calculates a 3D image from a Radon transform. More...
 
int img_radon_pocs_filter (Bimage *p, int n_cyc_out, int n_cyc_in, double rad_3D, double rad_plane, int support, Bimage *pmask)
 Filters a radon transform using the POCS method. More...
 
Bimageimg_radon_reconstruction (Bproject *project, Bsymmetry &sym, Bstring &file_mask, int rec_size, int ntheta, int table_size, double threshold, Vector3< double > origin, int nkernel, int kernel_power)
 Reconstructs a Radon transform from a set of projections. More...
 
int img_resize_to_next_power2 (Bimage *p, int fill_type, double fill)
 Resizes without interpolation or rescaling to the next power of 2. More...
 

Variables

int verbose
 

Detailed Description

Radon transform functions.

Author
Salvatore Lanzavecchia, Francesca Cantele and Pier Luigi Bellon Dip. Chimica Strutturale e Stereochimica Inorganica, Via Venezian 21, 20133 Milano, Italy
Bernard Heymann Rm 1515, 50 South Dr., NIH, Bethesda, MD, 20892, USA
Date
Created: 2001 05 19
Modified: 20160728 (BH)

Function Documentation

◆ img_radon_inverse_transform()

Bimage * img_radon_inverse_transform ( Bimage p,
int  type,
int  nkernel,
int  kernel_power,
int  padd 
)

Calculates a 3D image from a Radon transform.

Parameters
*pradon transform to be back-transformed.
typetype of transformation.
nkernelkernel size.
kernel_powerkernel exponent (usually 2).
paddpadding flag (0=no padding, 1=padding twofold).
Returns
Bimage* transformed image.
Type:
1 = From single axis proj. to 3D structure, output is a 3D image with size (z,z,z)
2 = From quarter radon transform to single axis proj., output is a gallery of ntheta 2D image with size (z,z)
3 = From full radon transform to 3D structure, output is a 3D image with size (z,z,z)
4 = From quarter radon transform to 3D structure, output is a 3D image with size (z,z,z)

◆ img_radon_pocs_filter()

int img_radon_pocs_filter ( Bimage p,
int  n_cyc_out,
int  n_cyc_in,
double  rad_3D,
double  rad_plane,
int  support,
Bimage pmask 
)

Filters a radon transform using the POCS method.

Parameters
*pradon transform.
n_cyc_outouter cycles, swapping r,phi and r,theta planes
n_cyc_ininner cycles, within r,phi and r,theta planes
rad_3Dlimiting radius in 3D.
rad_planelimiting radius in plane.
supportflag to impose finiteness in real space.
*pmaskmask of dimension (ntheta/2,ntheta/2).
Returns
Bimage* transformed image.
Filters a Radon transform to impose consistency and/or to fill holes.
It can be used in two ways:
a) When the Radon transform is not completely filled, it fills the holes
    described in the mask file produced by proj_to_radon.
b) When the Radon transform is filled and noisy, it impose consistency.
The mask must have the same dimensions as a plane in the radon transform.

◆ img_radon_reconstruction()

Bimage * img_radon_reconstruction ( Bproject project,
Bsymmetry sym,
Bstring file_mask,
int  rec_size,
int  ntheta,
int  table_size,
double  threshold,
Vector3< double >  origin,
int  nkernel,
int  kernel_power 
)

Reconstructs a Radon transform from a set of projections.

Parameters
*projectimage processing parameter structure.
&sympoint group symmetry.
&file_maskoutput file name of mask of dimension (ntheta,ntheta).
rec_sizereconstruction size (x,y,z)
nthetanumber of angles in the 2*PI range.
table_sizelookup table size.
thresholdthreshold for rejecting images.
originorigin reference for shifts.
nkernelkernel size.
kernel_powerkernel exponent (usually 2).
Returns
Bimage* transformed image.
The parameters are defined in the hierarchical project structure.
The radon transform of each image is calculated and all its 
symmetry-related views are written into the reconstruction volume.
A mask image is calculated for the angular coverage of orientation
space and used to weigh the reconstruction.

◆ img_radon_transform()

Bimage * img_radon_transform ( Bimage p,
int  type,
int  nkernel,
int  kernel_power,
int  padd,
int  ntheta 
)

Calculates the Radon transform of an image.

Parameters
*pimage to be transformed.
typetype of transformation.
nkernelkernel size.
kernel_powerkernel exponent (usually 2).
paddpadding flag (0=no padding, 1=padding twofold).
nthetanumber of angles in the 2*PI range.
Returns
Bimage* transformed image.
Computes the Radon transform of a 3D image with all sides equal
(a cube) and a power of 2. The transform is calculated in spherical
coordinates where ntheta is the number of sampling points in the 
range 0 - 2*PI along the two angular axes. Because half of this 
range is redundant (0-PI is enough), a smaller output can be 
generated.
    Type:
1 = From 3D structure to single axis proj., output is a gallery of ntheta 2D image with size (x,x)
2 = From single axis proj. to quarter radon transform, output is a 3D image with size (x,ntheta/2,ntheta/2)
3 = From 3D structure to full radon transform, output is a 3D image with size (x,ntheta,ntheta)
4 = From 3D structure to quarter radon transform, output is a 3D image with size (x,ntheta/2,ntheta/2)

◆ img_resize_to_next_power2()

int img_resize_to_next_power2 ( Bimage p,
int  fill_type,
double  fill 
)

Resizes without interpolation or rescaling to the next power of 2.

Parameters
pimage (modified).
fill_typeFILL_AVERAGE, FILL_BACKGROUND, FILL_USER
fillvalue to fill in new regions.
Returns
int 0.
An image is resized to the next power of two in each dimension
greater than 1 with translation and filling of new regions with 
a given value.
The new data replaces the old data.

Variable Documentation

◆ verbose

int verbose
extern