Xmipp
v3.23.11-Nereus
|
Classes | |
struct | blobtype |
Macros | |
#define | blob_val(r, blob) kaiser_value(r, blob.radius, blob.alpha, blob.order) |
#define | blob_proj(r, blob) kaiser_proj(r, blob.radius, blob.alpha, blob.order) |
#define | blob_Fourier_val(w, blob) kaiser_Fourier_value(w, blob.radius, blob.alpha, blob.order) |
#define | blob_mass(blob) basvolume(blob.radius, blob.alpha, blob.order,3) |
Functions | |
double | kaiser_value (double r, double a, double alpha, int m) |
double | kaiser_proj (double r, double a, double alpha, int m) |
double | kaiser_Fourier_value (double w, double a, double alpha, int m) |
double | basvolume (double a, double alpha, int m, int n) |
double | in_zeroarg (int n) |
double | inph_zeroarg (int n) |
double | i_nph (int n, double x) |
double | i_n (int n, double x) |
double | blob_freq_zero (struct blobtype b) |
double | blob_att (double w, struct blobtype b) |
double | blob_ops (double w, struct blobtype b) |
double | optimal_CC_grid_relative_size (struct blobtype b) |
double | optimal_BCC_grid_relative_size (struct blobtype b) |
double | optimal_FCC_grid_relative_size (struct blobtype b) |
blobtype | best_blob (double alpha_0, double alpha_F, double inc_alpha, double a_0, double a_F, double inc_a, double w, double *target_att, int target_length=1) |
void | footprint_blob (ImageOver &blobprint, const struct blobtype &blob, int istep=50, int normalise=0) |
double | sum_blob_Grid (const struct blobtype &blob, const Grid &grid, const Matrix2D< double > *D=nullptr) |
void | voxel_volume_shape (const GridVolume &vol_blobs, const struct blobtype &blob, const Matrix2D< double > *D, Matrix1D< int > &corner1, Matrix1D< int > &size) |
void | blobs2voxels (const GridVolume &vol_blobs, const struct blobtype &blob, MultidimArray< double > *vol_voxels, const Matrix2D< double > *D=nullptr, int threads=1, int Zdim=0, int Ydim=0, int Xdim=0) |
void | blobs2space_coefficients (const GridVolume &vol_blobs, const struct blobtype &blob, MultidimArray< double > *vol_coefs) |
void | voxels2blobs (const MultidimArray< double > *vol_voxels, const struct blobtype &blob, GridVolume &vol_blobs, int grid_type, double grid_relative_size, double lambda, const MultidimArray< double > *vol_mask=nullptr, const Matrix2D< double > *D=nullptr, double final_error_change=0.01, int tell=0, double R=-1, int threads=1) |
void | ART_voxels2blobs_single_step (GridVolume &vol_in, GridVolume *vol_out, const struct blobtype &blob, const Matrix2D< double > *D, double lambda, MultidimArray< double > *theo_vol, const MultidimArray< double > *read_vol, MultidimArray< double > *corr_vol, const MultidimArray< double > *mask_vol, double &mean_error, double &max_error, int eq_mode=VARTK, int threads=1) |
Variables | |
constexpr int | SHOW_CONVERSION = 1 |
constexpr int | VARTK = 1 |
constexpr int | VMAXARTK = 2 |
#define blob_Fourier_val | ( | w, | |
blob | |||
) | kaiser_Fourier_value(w, blob.radius, blob.alpha, blob.order) |
Fourier transform of a blob. This function returns the value of the Fourier transform of the blob at a given frequency (w). This frequency must be normalized by the sampling rate. For instance, for computing the Fourier Transform of a blob at 1/Ts (Ts in Amstrongs) you must provide the frequency Tm/Ts, where Tm is the sampling rate.
The Fourier Transform can be computed only for blobs with m=2 or m=0.
#define blob_mass | ( | blob | ) | basvolume(blob.radius, blob.alpha, blob.order,3) |
#define blob_proj | ( | r, | |
blob | |||
) | kaiser_proj(r, blob.radius, blob.alpha, blob.order) |
Blob projection. This function returns the value of the blob line integral through a straight line which passes at a distance 'r' (in Universal System units) from the center of the blob. Remember that a blob is spherically symmetrycal so the only parameter to know this blob line integral is its distance to the center of the blob. It doesn't matter if this distance is larger than the real blob spatial extension, in this case the function returns 0. \ Ex:
#define blob_val | ( | r, | |
blob | |||
) | kaiser_value(r, blob.radius, blob.alpha, blob.order) |
Blob value. This function returns the value of a blob at a given distance from its center (in Universal System units). The distance must be always positive. Remember that a blob is spherically symmetrycal so the only parameter to know the blob value at a point is its distance to the center of the blob. It doesn't matter if this distance is larger than the real blob spatial extension, in this case the function returns 0 as blob value. \ Ex:
void ART_voxels2blobs_single_step | ( | GridVolume & | vol_in, |
GridVolume * | vol_out, | ||
const struct blobtype & | blob, | ||
const Matrix2D< double > * | D, | ||
double | lambda, | ||
MultidimArray< double > * | theo_vol, | ||
const MultidimArray< double > * | read_vol, | ||
MultidimArray< double > * | corr_vol, | ||
const MultidimArray< double > * | mask_vol, | ||
double & | mean_error, | ||
double & | max_error, | ||
int | eq_mode = VARTK , |
||
int | threads = 1 |
||
) |
Voxels —> Blobs, single step. This is the basic step of the voxels to blobs conversion. It applies an ART step to the blob volume and produces its output in a different (or the same) volume. You must provide the blob structure, lambda and deformation matrix (typical for crystals). The theoretical volume and correction volume are resized inside and are output volumes meaning the conversion from blobs to voxels before this step and the correction applied to the blob volume. The read volume is the one to reproduce with blobs and the mask volume is used to select only one region to adjust.
If the mask is NULL then it is assumed that all voxels in the input voxel volume must be adjusted by the blobs. If the input voxel volume is NULL the it is assumed that it is equal to 0 and only those corresponding to the 1 positions within the mask must be adjusted. An exception is thrown if the mask and voxels volume are both NULL.
Then mean and maximum error committed for each blob are returned.
Valid eq_modes are \VARTK: ART by blocks for volumes. \VMAXARTK: update with the maximum update.
Definition at line 1094 of file blobs.cpp.
double basvolume | ( | double | a, |
double | alpha, | ||
int | m, | ||
int | n | ||
) |
blobtype best_blob | ( | double | alpha_0, |
double | alpha_F, | ||
double | inc_alpha, | ||
double | a_0, | ||
double | a_F, | ||
double | inc_a, | ||
double | w, | ||
double * | target_att, | ||
int | target_length = 1 |
||
) |
Choose the best blob within a region. You must select a resolution limit, the maximum attenuation allowed at that frequency and then the blob with less computational cost is returned. m=2 always. The resolution criterion is given by w (remind that this w=Tm*w(cont)).
If there is no blob meeting the specification then alpha=a=-1.
Definition at line 363 of file blobs.cpp.
double blob_att | ( | double | w, |
struct blobtype | b | ||
) |
double blob_freq_zero | ( | struct blobtype | b | ) |
double blob_ops | ( | double | w, |
struct blobtype | b | ||
) |
void blobs2space_coefficients | ( | const GridVolume & | vol_blobs, |
const struct blobtype & | blob, | ||
MultidimArray< double > * | vol_coefs | ||
) |
Blob coefficients as a voxel volume. This function returns a volume with the blob coefficients in their right position in space. The voxel size is g/2
Definition at line 1029 of file blobs.cpp.
void blobs2voxels | ( | const GridVolume & | vol_blobs, |
const struct blobtype & | blob, | ||
MultidimArray< double > * | vol_voxels, | ||
const Matrix2D< double > * | D = nullptr , |
||
int | threads = 1 , |
||
int | Zdim = 0 , |
||
int | Ydim = 0 , |
||
int | Xdim = 0 |
||
) |
Blobs —> Voxels. The voxel size is defined between two coordinates (Gcorner1 and Gcorner2) which accomplish
where SGcorner1(i) and SGcorner2(i) are the lowest and highest corners of each subgrid. These corners are expressed in Universal coordinates.
This quantity is then enlarged to be an integer voxel position and to take into account that the former computed Gcorner1 and 2 are the furthest centers of blobs, ie, there will be voxels even further affected by these blobs.
However, you might give a size, usually set to 0, i.e., no external size. If no size is provided a size is produced such that all blob centers fit into the output volume.
D is a 3x3 matrix specifying a volume deformation. It means that the sample at logical position (i,j,k) is really placed at space position D*(i,j,k)'.
Definition at line 926 of file blobs.cpp.
void footprint_blob | ( | ImageOver & | blobprint, |
const struct blobtype & | blob, | ||
int | istep = 50 , |
||
int | normalise = 0 |
||
) |
Footprint of a blob. In the actual implementation of the 3D reconstruction one of the most important things to save time is to have a precomputed blob projection. As it is spherically symmetrical all projections from different directions of the same blob happen to be the same. This function makes this precalculation storing it in an oversampled image. This is done so because the blob footprint might not be centered with respect to the universal grid needing so, the footprint at non-integer positions. As parameters to this function you may give the sampling rate in each direction, and an optional normalisation (usually disabled) at the end of the computation which divides the whole image by the sum of the whole image. \ Ex:
As the blob radius is 1.7, the function will create a normalised footprint of logical corners (-2,-2) to (2,2) (in the universal coord. system) (this size is the minimum integer number of pixels which contain entirely the blob), with 50 samples each pixel. The real size of the footprint is (550)x(550).
Definition at line 417 of file blobs.cpp.
double i_n | ( | int | n, |
double | x | ||
) |
double i_nph | ( | int | n, |
double | x | ||
) |
double in_zeroarg | ( | int | n | ) |
double inph_zeroarg | ( | int | n | ) |
double kaiser_Fourier_value | ( | double | w, |
double | a, | ||
double | alpha, | ||
int | m | ||
) |
double kaiser_proj | ( | double | r, |
double | a, | ||
double | alpha, | ||
int | m | ||
) |
double kaiser_value | ( | double | r, |
double | a, | ||
double | alpha, | ||
int | m | ||
) |
double optimal_BCC_grid_relative_size | ( | struct blobtype | b | ) |
double optimal_CC_grid_relative_size | ( | struct blobtype | b | ) |
double optimal_FCC_grid_relative_size | ( | struct blobtype | b | ) |
double sum_blob_Grid | ( | const struct blobtype & | blob, |
const Grid & | grid, | ||
const Matrix2D< double > * | D = nullptr |
||
) |
Sum of a single blob over a grid. As a normalisation factor, the sum of the blob values over a given grid is needed. What this function does is put a blob at coordinate (0,0,0) and sums all the blob values at points of the grid which are inside the blob. It doesn't matter if the grid is compound or not. \ Ex:
D is a 3x3 matrix specifying a volume deformation. It means that the sample at logical position (i,j,k) is really placed at space position D*(i,j,k)'.
Definition at line 320 of file blobs.cpp.
void voxel_volume_shape | ( | const GridVolume & | vol_blobs, |
const struct blobtype & | blob, | ||
const Matrix2D< double > * | D, | ||
Matrix1D< int > & | corner1, | ||
Matrix1D< int > & | size | ||
) |
Voxel shape for a blob volume. Given a blob volume this function returns the logical origin and size for the minimum voxel volume which holds it. See blobs2voxels for an explanation of the limit and V parameters.
Definition at line 851 of file blobs.cpp.
void voxels2blobs | ( | const MultidimArray< double > * | vol_voxels, |
const struct blobtype & | blob, | ||
GridVolume & | vol_blobs, | ||
int | grid_type, | ||
double | grid_relative_size, | ||
double | lambda, | ||
const MultidimArray< double > * | vol_mask = nullptr , |
||
const Matrix2D< double > * | D = nullptr , |
||
double | final_error_change = 0.01 , |
||
int | tell = 0 , |
||
double | R = -1 , |
||
int | threads = 1 |
||
) |
Voxels —> Blobs. The voxels to blobs procedure is an iterative process resolved by ART as an iterative technique to solve an equation system. The blobs to voxels process is the BASIC way to solve this problem. This applies the whole ART process. You can set a debugging level by setting the flag SHOW_CONVERSION in the tell argument.
If the mask is NULL then it is assumed that all voxels in the input voxel volume must be adjusted by the blobs. If the input voxel volume is NULL the it is assumed that it is equal to 0 and only those corresponding to the 1 positions within the mask must be adjusted.
R is the interest radius. If it is -1 two superimposed grids are created, otherwise a single grid with tilted axis is.
Valid grid types are defined in Some useful grids
Definition at line 1316 of file blobs.cpp.