|
Bsoft 2.1.4
Bernard's software package
|
Header file for image processing from micrograph structures. More...
Functions | |
| Bstring | image_type (Bstring type) |
| Converts an image type string to a standard form. More... | |
| Bproject * | project_create_from_image (Bimage *p, Bstring type) |
| Creates a project structure using image file names. More... | |
| Bproject * | project_create_from_images (Bstring *file_list, Bstring type) |
| Creates a project structure using image file names. More... | |
| double | micrograph_intensity (Bmicrograph *mg, Bimage *p, int flag) |
| Gets the average of a micrograph and sets the dose. More... | |
| double | micrograph_intensity (Bmicrograph *mg, int flag=0) |
| Gets the average of a micrograph and sets the dose. More... | |
| int | project_mg_avg_intensities (Bproject *project) |
| Retrieves the average micrograph intensities. More... | |
| int | project_catenate_micrographs (Bproject *project) |
| Concatenates all micrograph image files into one file. More... | |
| Bimage * | particle_read_img (Bparticle *part, int readflag) |
| Reads a particle image file. More... | |
| int | particle_write_img (Bparticle *part, Bimage *p, int compression) |
| Writes a particle image file. More... | |
| int | project_check_particles (Bproject *project) |
| Checks particle numbers and box sizes. More... | |
| Vector3< long > | micrograph_get_size (Bmicrograph *mg) |
| Gets the size of a micrograph. More... | |
| Vector3< double > | micrograph_get_nominal_origin (Bmicrograph *mg) |
| Gets the nominal origin for a micrograph. More... | |
| int | project_set_nominal_mg_origins (Bproject *project) |
| Sets micrograph origins to the centers of the micrographs. More... | |
| int | project_reset_origins (Bproject *project) |
| Resets particle origins to nominal values. More... | |
| int | project_set_part_img_origins (Bproject *project) |
| Writes particle origins into particle image files. More... | |
| long | project_delesect_edge_particles (Bproject *project) |
| Deselects particles that are too close to the image edges. More... | |
| int | project_get_part_box_size (Bproject *project) |
| Gets the box size from particle image files. More... | |
| Vector3< long > | particle_get_box_size (Bparticle *part) |
| Gets the box size from particle image file. More... | |
| int | project_write_particle_classes (Bproject *project) |
| Writes particles to different stacks based on class. More... | |
| int | project_trim_class_averages (Bproject *project, Bstring &list) |
| Deletes selected class averages from the project.. More... | |
| int | project_flip_particle_coordinates (Bproject *project, int flip) |
| Reverses one or more particle coordinates. More... | |
| int | project_set_views_from_images (Bproject *project) |
| Gets views from particle images. More... | |
| int | project_set_views_in_images (Bproject *project) |
| Sets views in particle images from the project parameter structure. More... | |
| int | project_bin_micrographs (Bproject *project, int bin, Bstring mgpath, Bstring partpath) |
| Bins all micrographs a project. More... | |
| int | project_change_pixel_size (Bproject *project, Vector3< double > new_pixel_size, Bstring mgpath, Bstring partpath) |
| Changes all the micrograph fields linked to the pixel size. More... | |
Header file for image processing from micrograph structures.
Converts an image type string to a standard form.
| type | a string with a type definition. |
The input string is converted to the following strings: mg micrograph frame micrograph frames rec reconstruction part particle fil filament ps power spectrum ft Fourier transform
| Vector3< double > micrograph_get_nominal_origin | ( | Bmicrograph * | mg | ) |
Gets the nominal origin for a micrograph.
| *mg | micrograph parameter structure. |
The nominal origin is defined as the center of the micrograph.
| Vector3< long > micrograph_get_size | ( | Bmicrograph * | mg | ) |
Gets the size of a micrograph.
| *mg | micrograph parameter structure. |
The micrograph image header is read.
| double micrograph_intensity | ( | Bmicrograph * | mg, |
| Bimage * | p, | ||
| int | flag | ||
| ) |
Gets the average of a micrograph and sets the dose.
| *mg | micrograph parameter structure. |
| *p | image. |
| flag | 1=force calculation of statistics of not available; 2=check Poisson |
The micrograph image header is read.
| double micrograph_intensity | ( | Bmicrograph * | mg, |
| int | flag | ||
| ) |
Gets the average of a micrograph and sets the dose.
| *mg | micrograph parameter structure. |
| flag | flag to force calculation of statistics of not available. |
The micrograph image header is read.
Gets the box size from particle image file.
| *part | particle. |
Reads the particle file header and returns the box size.
Reads a particle image file.
| *part | particle. |
| readflag | flag to indicate reading the data. |
The file name is taken from the particle record by preference, otherwise from the micrograph record.
Writes a particle image file.
| *part | particle. |
| *p | image to be written. |
| compression | flag to indicate compression. |
The file name is taken from the particle record by preference, otherwise from the micrograph record.
Bins all micrographs a project.
| *project | project parameter structure. |
| bin | binning value. |
| mgpath | binned micrograph path (must be allocated). |
| partpath | binned particle path (must be allocated). |
All micrographs in a project are binned by the indicated value. New micrograph file names are generated with a "_b<n>" insert, where the n indicates the bin value. The path to the binned micrograph can be specified.
| int project_catenate_micrographs | ( | Bproject * | project | ) |
Concatenates all micrograph image files into one file.
| *project | project structure. |
The new file name is the common part of the original micrograph file names.
| int project_change_pixel_size | ( | Bproject * | project, |
| Vector3< double > | new_pixel_size, | ||
| Bstring | mgpath, | ||
| Bstring | partpath | ||
| ) |
Changes all the micrograph fields linked to the pixel size.
| *project | project parameter structure. |
| new_pixel_size | new pixel size. |
| mgpath | binned micrograph path (must be allocated). |
| partpath | binned particle path (must be allocated). |
The fields linked to pixel size are:
pixel_size
shift
box, bad and marker radii
particle origins and locations
bad area and marker locations
| int project_check_particles | ( | Bproject * | project | ) |
Checks particle numbers and box sizes.
| *project | project. |
Reads each particle file header, checks the number of particles and sets the box size for the micrograph.
Creates a project structure using image file names.
| *p | image. |
| type | type of images: mg, frame, rec, part, fil. |
The function sets up the project hierarchy from one image base on the type.
If the type is not specified, it is guessed based on the following rules:
#sub-images = 1
z=1 => micrograph
z>1 => reconstruction
#sub-images > 1
z=1 => frames
z>1
x=y => particles
x≠y => filaments
Creates a project structure using image file names.
| *file_list | list of file names. |
| type | type of images: mg, frame, rec, part, fil. |
The function sets up the project hierarchy from a list of file names. Each file may represent a micrograph or a picked particle file. If the image is equal or larger than 1024x1024, it is assumed to be a micrograph, its name will be assigned as a micrograph file name, and no particle tags will be added. If the image is smaller than 1024x1024 or the make_part flag is set, it is taken to be picked particles and the file name will be assigned as a particle file name.
| long project_delesect_edge_particles | ( | Bproject * | project | ) |
Deselects particles that are too close to the image edges.
| *project | project. |
| int project_flip_particle_coordinates | ( | Bproject * | project, |
| int | flip | ||
| ) |
Reverses one or more particle coordinates.
| *project | project parameter structure. |
| flip | axes to flip. |
The specification of axes to flip is embedded in the flip number:
first bit - x
second bit - y
third bit - z
| int project_get_part_box_size | ( | Bproject * | project | ) |
Gets the box size from particle image files.
| *project | project. |
Reads each particle file header and sets the box size for the micrograph.
| int project_mg_avg_intensities | ( | Bproject * | project | ) |
Retrieves the average micrograph intensities.
| *project | project parameter structure. |
For each micrograph the FOM is set to the micrograph average.
| int project_reset_origins | ( | Bproject * | project | ) |
Resets particle origins to nominal values.
| *project | project parameter structure. |
For each micrograph a particle image header is read and the origin is set to to the middle of the image.
| int project_set_nominal_mg_origins | ( | Bproject * | project | ) |
Sets micrograph origins to the centers of the micrographs.
| *project | project parameter structure. |
For each micrograph the micrograph origin is set to the center.
| int project_set_part_img_origins | ( | Bproject * | project | ) |
Writes particle origins into particle image files.
| *project | project. |
Sets the origins (offsets from the first voxel) in an image header to values set within a project. Rewrites image to file.
| int project_set_views_from_images | ( | Bproject * | project | ) |
Gets views from particle images.
| *project | project parameter structure. |
| int project_set_views_in_images | ( | Bproject * | project | ) |
Sets views in particle images from the project parameter structure.
| *project | project parameter structure. |
Deletes selected class averages from the project..
| *project | project parameter structure. |
| &list | selection list. |
The new class average file name has an insert of "_del".
| int project_write_particle_classes | ( | Bproject * | project | ) |
Writes particles to different stacks based on class.
| *project | project. |
Writes new particle image files, numbered by the selection number.