Bsoft function
img_to_surface
Source:
src/img/img_afm.c
Description:
Converts a 2D AFM image to a 3D density map.
Algorithm:
The 2D image is expanded in the z direction according to:
voxel_density
dens[x,y,z] = --------------------------------------
1+exp(factor*(z-zdis[x,y])/sigma[x,y])
where voxel_density is the total density attributed to a voxel
factor = 1.618
z - zdis[x,y] is the z distance from the surface
sigma is a standard deviation term to describe the surface variability.
The sigma term can be set automatically or given by an input standard deviation map.
The position of the surface is calculated as:
zdis[x,y] = loz + (hiz - loz)*(image[x,y] - min)/(max - min)
where loz and hiz are the lowest and highest points of the surface in the 3D map
min and max are the image minimum and maximum values
Arguments:
| Bimage* p | 2D AFM image.
|
| Bimage* psd | 2D standard deviation image.
|
| int nz | z dimension of the new 3D map.
|
| float density | density inside the surface (Da/A3).
|
Returns:
int 0.
Prototype:
int img_to_surface(Bimage* p, Bimage* psd, int nz, float density)
Functions used:
balloc
bfree
copy_img_header
img_stats
Other objects included:
struct Bimage
constant GOLDEN
constant VERB_
Generated by bdoc.pl on Mon Jun 15 11:47:12 2009
Back to the Bsoft home