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

Header file for image utilities. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <math.h>
#include <time.h>
#include "rwimg.h"
#include "ps_plot.h"

Go to the source code of this file.

Functions

int img_multiply_by_fom (Bimage *p)
 Weighs a set of reflections by its figure-of-merit. More...
 
int img_divide_by_fom (Bimage *p, double wiener)
 Divides an image by its figure-of-merit. More...
 
int img_sqrt_amp (Bimage *p)
 Change the amlitudes to their square roots. More...
 
int img_square_amp (Bimage *p)
 Change the amlitudes to their squares. More...
 
int img_weigh_amplitudes_with_C_curve (Bimage *p, double resolution)
 Weighs an image's amplitudes with the carbon scattering curve. More...
 
int img_weigh_amplitudes_with_FSC_curve (Bimage *p, Bplot *plot, double resolution)
 Weighs an image's amplitudes with a given FSC curve. More...
 
int img_weigh_amplitudes (Bimage *p, Bimage *pref, Bimage *pmask, double resolution)
 Weighs an image's amplitudes with the radial power spectrum of another. More...
 
int img_normalize_amplitudes (Bimage *p, Bimage *pmask, double resolution)
 Normalizes an image's amplitudes. More...
 

Detailed Description

Header file for image utilities.

Author
Bernard Heymann
Date
Created: 20000430
Modified: 20150115

Definition in file img_ampweigh.h.

Function Documentation

int img_divide_by_fom ( Bimage *  p,
double  wiener 
)

Divides an image by its figure-of-merit.

Author
Juha Huiskonen
Parameters
*pimage structure with fom block.
wienerwiener factor
Returns
int 0.

Definition at line 50 of file img_ampweigh.cpp.

int img_multiply_by_fom ( Bimage *  p)

Weighs a set of reflections by its figure-of-merit.

Parameters
*pimage structure with fom block.
Returns
int error code.

Definition at line 24 of file img_ampweigh.cpp.

int img_normalize_amplitudes ( Bimage *  p,
Bimage *  pmask,
double  resolution 
)

Normalizes an image's amplitudes.

Parameters
*pimage (modified).
*pmaskreciprocal space mask (0 & 1, indicating inclusion of structure factors).
resolutionhigh resolution limit.
Returns
int 0.

Definition at line 531 of file img_ampweigh.cpp.

int img_sqrt_amp ( Bimage *  p)

Change the amlitudes to their square roots.

Parameters
*pimage (modified).
Returns
int 0.

Definition at line 78 of file img_ampweigh.cpp.

int img_square_amp ( Bimage *  p)

Change the amlitudes to their squares.

Parameters
*pimage (modified).
Returns
int 0.

Definition at line 110 of file img_ampweigh.cpp.

int img_weigh_amplitudes ( Bimage *  p,
Bimage *  pref,
Bimage *  pmask,
double  resolution 
)

Weighs an image's amplitudes with the radial power spectrum of another.

Parameters
*pimage to be modified.
*prefreference image.
*pmaskreciprocal space mask (0 & 1, indicating inclusion of structure factors).
resolutionhigh resolution limit.
Returns
int 0.
The two images must be of the same dimensions.
The two images are packed into a combined complex data set (the first
image in the real part and the second image in the imaginary part).
This is Fourier transformed and the individual transforms calculated
based on the Hermitian or Friedel symmetry of transforms of real space
data sets. The radial power spectra of the two images are calculated
and used to calculate the ratio of the second to the first in each shell.
This ratio is then used to rescale the amplitudes of the first image.

Definition at line 356 of file img_ampweigh.cpp.

int img_weigh_amplitudes_with_C_curve ( Bimage *  p,
double  resolution 
)

Weighs an image's amplitudes with the carbon scattering curve.

Parameters
*pimage to be modified.
resolutionhigh resolution limit.
Returns
int 0.
The image is Fourier transformed and the radial power spectrum calculated.
The ratio between the C curve and the average amplitudes in each shell
is calculated and used to rescale the amplitudes of the image.

Definition at line 267 of file img_ampweigh.cpp.

int img_weigh_amplitudes_with_FSC_curve ( Bimage *  p,
Bplot *  plot,
double  resolution 
)

Weighs an image's amplitudes with a given FSC curve.

Parameters
*pimage to be modified.
*plotFSC plot.
resolutionhigh resolution limit.
Returns
int 0.
The image is Fourier transformed and the radial power spectrum calculated.
The ratio between the square root of the FSC curve and the average 
amplitudes in each shell is calculated and used to rescale the amplitudes 
of the image.

Definition at line 306 of file img_ampweigh.cpp.