Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
img_powerspectrum.cpp File Reference

Functions for calculating and using power spectra in electron micrographs. More...

#include "img_fourier.h"
#include "img_complex.h"
#include "img_interpolate.h"
#include "img_colour.h"
#include "img_extract.h"
#include "img_combine.h"
#include "trigonometry.h"
#include "utilities.h"

Go to the source code of this file.

Functions

int img_power_spectrum (Bimage *p, int flags)
 Calculates a power spectrum. More...
 
Bimage * img_tiled_powerspectrum (Bimage *p, Vector3< int > tile_size, int flags)
 Prepares an image for determining CTF parameters. More...
 
Bimage * img_tilt_axis_powerspectrum (Bimage *p, Vector3< int > tile_size, double tilt_axis, double tilt_offset, int flags)
 Prepares an tilted image for determining CTF parameters. More...
 
Bimage * img_colour_power_spectrum (Bimage *p, float scale)
 Generates a power spectrum with phases coloured according to a colour wheel. More...
 

Variables

int verbose
 

Detailed Description

Functions for calculating and using power spectra in electron micrographs.

Author
Bernard Heymann
Date
Created: 20000426
Modified: 20130807

Definition in file img_powerspectrum.cpp.

Function Documentation

Bimage* img_colour_power_spectrum ( Bimage *  p,
float  scale 
)

Generates a power spectrum with phases coloured according to a colour wheel.

Parameters
*pimage.
scaleamplitude scaling.
Returns
Bimage* color power spectrum.
A polar data type image (such as a Fourier transform) is converted
to indicate the phases as colours. The primary colours are located
0 degrees (red), 120 degrees (green) and -120 degrees (blue). All
three colour values are down-weighted based on the amplitude. The
weighting is calculated as:
    weight = amplitude/(average+2*standard_deviation)
The origin specified in the image is used to shift the phases.
The scale is multiplied with the amplitude and cut off at one
to give the user the ability to enhance the image.
Default:
    scale = 1/(average_amplitude + standard_deviation_of_amplitude) 

Definition at line 255 of file img_powerspectrum.cpp.

int img_power_spectrum ( Bimage *  p,
int  flags 
)

Calculates a power spectrum.

Parameters
*pimage structure.
flags1=norm, 2=avg, 4=shift, 8=log.
Returns
int error code.
All the sub-images are Fourier transformed.
The flags variable controls options base don which bits are set:
    1   normalize image before transformation
    2   average all power spectra
    4   shift the origin to the center
    8   calculate the logarithm of the power spectrum

Definition at line 35 of file img_powerspectrum.cpp.

Bimage* img_tiled_powerspectrum ( Bimage *  p,
Vector3< int >  tile_size,
int  flags 
)

Prepares an image for determining CTF parameters.

Parameters
*pimage structure.
tile_sizetile size (if (0,0,0) don't tile).
flags1=norm, 2=avg, 4=shift, 8=log.
Returns
Bimage* power spectrum.
A large single image (a micrograph) is converted to a number of tiles
packed into a multi-image structure, while a multi-image structure
(picked particles) is used as is.
Extreme values in the image are set to the average - this is to eliminate
most of the edges and number panels in micrographs.
All the sub-images are Fourier transformed.

Definition at line 84 of file img_powerspectrum.cpp.

Bimage* img_tilt_axis_powerspectrum ( Bimage *  p,
Vector3< int >  tile_size,
double  tilt_axis,
double  tilt_offset,
int  flags 
)

Prepares an tilted image for determining CTF parameters.

Parameters
*pimage structure.
tile_sizetile size (if (0,0,0) don't tile).
tilt_axistilt axis angle (in radians).
tilt_offsetoffset perpendicular to tilt axis (in pixels).
flags1=norm, 2=avg, 4=shift, 8=log.
Returns
Bimage* power spectrum.
A large single image (a micrograph) is converted to a number of tiles
along the tilt axis packed into a multi-image structure.
Extreme values in the image are set to the average - this is to eliminate
most of the edges and number panels in micrographs.
All the sub-images are Fourier transformed.

Definition at line 161 of file img_powerspectrum.cpp.

Variable Documentation

int verbose