Xmipp
v3.23.11-Nereus
|
#include <micrograph.h>
Classes | |
struct | Point |
Public Member Functions | |
void | clear () |
int | getDatatype () const |
int | getDatatypeDetph () const |
void | open_micrograph (const FileName &fn_micrograph) |
void | close_micrograph () |
const FileName & | micrograph_name () |
void | set_micrograph_name (const FileName &fn) |
void | set_ctfparams (const MDRowVec &ctf) |
const MDRow & | get_ctfparams () |
void | setStdevFilter (double d) |
void | write_coordinates (int label, double minCost, const FileName &fn_coords="") |
void | read_coordinates (int label, const FileName &fn_coords) |
void | transform_coordinates (const Matrix2D< double > &M) |
void | scale_coordinates (const double &c) |
int | ParticleNo () const |
std::vector< Particle_coords > & | Particles () |
void | get_Particles (std::vector< Particle_coords > &_coords) |
void | set_window_size (int _X_window_size, int _Y_window_size) |
void | set_transmitance_flag (bool flag_value) |
void | setDataType (DataType _datatype) |
bool | read_transmitance_flag (void) |
void | set_inverse_flag (bool flag_value) |
bool | read_inverse_flag (void) |
template<typename T > | |
int | templateScissor (const Image< T > &I, const Particle_coords &P, MultidimArray< double > &result, double Dmin, double Dmax, double scaleX, double scaleY, bool only_check, bool fillBorders) |
int | scissor (const Particle_coords &P, MultidimArray< double > &result, double Dmin, double Dmax, double scaleX=1, double scaleY=1, bool only_check=false, bool fillBorders=false) |
double | operator() (size_t y, size_t x) const |
void | computeDoubleMinMax (double &Dmin, double &Dmax) const |
void | set_val (int y, int x, double new_val) |
void | produce_all_images (int label, double minCost, const FileName &fn_root, const FileName &fn_image="", double ang=0, bool rmStack=false, bool fillBorders=false, bool extractNoise=false, int Nnoise=-1) |
int | search_coord_near (int x, int y, int prec=3) const |
void | invalidate_coord (int n) |
int | add_coord (int x, int y, int label, double cost) |
void | move_last_coord_to (int x, int y) |
Particle_coords & | coord (int n) |
void | get_coord (int n, Particle_coords &_coords) |
int | add_label (const std::string &label) |
int | LabelNo () |
std::string & | get_label (int n) |
void | get_label (int n, std::string &_label) |
void | size (int &_Xdim, int &_Ydim) const |
void | resize (int Xdim, int Ydim, const FileName &filename="") |
Set micrograph size (when you do not read the file from disk) More... | |
void | write (const FileName &fileName, CastWriteMode castMode=CW_CAST) |
Public Attributes | |
size_t | Xdim |
size_t | Ydim |
size_t | Zdim |
size_t | Ndim |
Point | point1 |
Point | point2 |
std::vector< Particle_coords > | coords |
Micrography class. This class manages a large micrograph on disk. The image is not loaded into memory, that should avoid memory problems
Definition at line 78 of file micrograph.h.
int Micrograph::add_coord | ( | int | x, |
int | y, | ||
int | label, | ||
double | cost | ||
) |
Add coordinate. It returns the index of the particle added within the coordinate list.
Definition at line 491 of file micrograph.cpp.
|
inline |
void Micrograph::clear | ( | ) |
void Micrograph::close_micrograph | ( | ) |
Close micrograpgh. After working with the file, you must close it.
Definition at line 135 of file micrograph.cpp.
|
inline |
Micrograph max min
Definition at line 388 of file micrograph.h.
|
inline |
Access to coordinate structure. If the index is out of range then an exception is thrown.
Definition at line 486 of file micrograph.h.
|
inline |
Another function for accessing the coordinate structure.
Definition at line 494 of file micrograph.h.
|
inline |
Return the row with CTF params.
Definition at line 160 of file micrograph.h.
|
inline |
Get a label. An exception is thrown if the index is greater than the number of labels
Definition at line 516 of file micrograph.h.
|
inline |
|
inline |
|
inline |
Get micrograph datatype.
Definition at line 124 of file micrograph.h.
int Micrograph::getDatatypeDetph | ( | ) | const |
Get micrograph datatype.
Definition at line 166 of file micrograph.cpp.
void Micrograph::invalidate_coord | ( | int | n | ) |
Remove a coordinate from the coordinate list. An exception is thrown if the index is out of range within the coordinate list
Definition at line 482 of file micrograph.cpp.
|
inline |
Number of labels.
Definition at line 508 of file micrograph.h.
|
inline |
Get micrograph filename.
Definition at line 140 of file micrograph.h.
void Micrograph::move_last_coord_to | ( | int | x, |
int | y | ||
) |
void Micrograph::open_micrograph | ( | const FileName & | fn_micrograph | ) |
Open micrograph. An exception is thrown if the file is not valid.
Definition at line 61 of file micrograph.cpp.
|
inline |
Pixel access for reading. These coordinates follow the physical Xmipp convention {../../../Extra_Docs/Conventions.html} for coordinates
Definition at line 354 of file micrograph.h.
|
inline |
Particle number. Number of particles in the coordinate list
Definition at line 188 of file micrograph.h.
|
inline |
void Micrograph::produce_all_images | ( | int | label, |
double | minCost, | ||
const FileName & | fn_root, | ||
const FileName & | fn_image = "" , |
||
double | ang = 0 , |
||
bool | rmStack = false , |
||
bool | fillBorders = false , |
||
bool | extractNoise = false , |
||
int | Nnoise = -1 |
||
) |
Produce all single particle images. The file fn_micrograph+".sel" is also generated. The angle is the angle from the Y axis to the tilt axis, angles are positive clockwise. Images are rotated by -ang. If this angle is 0 no rotation is applied.
Definition at line 317 of file micrograph.cpp.
void Micrograph::read_coordinates | ( | int | label, |
const FileName & | fn_coords | ||
) |
Read coordinates from disk. Coordinates are read into the selected family, the rest of families are untouched as well as the coordinates already belonging to this family
Definition at line 216 of file micrograph.cpp.
|
inline |
Get Log flag. When cutting images, the contrast is inverted if inverse flag=true. This function reads it
Definition at line 254 of file micrograph.h.
|
inline |
Get Transmitance flag. When cutting images, 1/log10 is computed over the pixel values if transmitance_flag=true. This function reads it Note: if pixel_value=0, no log is computed
Definition at line 235 of file micrograph.h.
void Micrograph::resize | ( | int | Xdim, |
int | Ydim, | ||
const FileName & | filename = "" |
||
) |
Set micrograph size (when you do not read the file from disk)
Definition at line 515 of file micrograph.cpp.
void Micrograph::scale_coordinates | ( | const double & | c | ) |
int Micrograph::scissor | ( | const Particle_coords & | P, |
MultidimArray< double > & | result, | ||
double | Dmin, | ||
double | Dmax, | ||
double | scaleX = 1 , |
||
double | scaleY = 1 , |
||
bool | only_check = false , |
||
bool | fillBorders = false |
||
) |
Scissor. The single particle is selected by an index within the particle coordinate list. If the index is beyond the number of particles ParticleNo , or the selfWindow size is not set (set_window_size ) an exception is thrown.
Make sure that index n represents a valid particle before cutting it
The scale affects the particle position, such that the position cut is pos*scale, but not the selfWindow size.
If only check is true then the particle is not scissored, but the routine only checks if it can be done.
Dmax and Dmin are used to invert the image and or compute the trnasmitance
Returns 0 if an error occurred and 1 if everything is all right
Definition at line 285 of file micrograph.cpp.
int Micrograph::search_coord_near | ( | int | x, |
int | y, | ||
int | prec = 3 |
||
) | const |
Search coordinate near a position. By default the precission is set to 3 pixels. The index of the coordinate within the list is returned. Returns -1 if none.
Definition at line 469 of file micrograph.cpp.
|
inline |
|
inline |
Set Log flag. When cutting images, the contrast is inverted if inverse flag is true.
Definition at line 244 of file micrograph.h.
|
inline |
Set micrograph filename.
Definition at line 146 of file micrograph.h.
|
inline |
Set Transmitance flag. When cutting images, 1/log10 is computed over the pixel values if this transmitance_flag=true. This function sets it Note: if pixel_value=0, no log is computed
Definition at line 220 of file micrograph.h.
|
inline |
Pixel access for writing.
Definition at line 422 of file micrograph.h.
|
inline |
Set selfWindow size. This selfWindow is set upon each coordinate and is used to cut all images.
Definition at line 209 of file micrograph.h.
|
inline |
Definition at line 226 of file micrograph.h.
|
inline |
Definition at line 165 of file micrograph.h.
|
inline |
|
inline |
Templated scissor function. This is the one actually doing the work
Definition at line 263 of file micrograph.h.
void Micrograph::transform_coordinates | ( | const Matrix2D< double > & | M | ) |
Transform all coordinates according to a 3x3 transformation matrix
Definition at line 251 of file micrograph.cpp.
void Micrograph::write | ( | const FileName & | fileName, |
CastWriteMode | castMode = CW_CAST |
||
) |
Write micrograph. Set adjust to true if the values should be scaled within the minimum and maximum of the output range. Ex: m.write(fn8bits+"%uint8");
Definition at line 555 of file micrograph.cpp.
void Micrograph::write_coordinates | ( | int | label, |
double | minCost, | ||
const FileName & | fn_coords = "" |
||
) |
Save coordinates to disk.
Definition at line 192 of file micrograph.cpp.
std::vector<Particle_coords> Micrograph::coords |
Definition at line 118 of file micrograph.h.
size_t Micrograph::Ndim |
Definition at line 115 of file micrograph.h.
Point Micrograph::point1 |
Definition at line 116 of file micrograph.h.
Point Micrograph::point2 |
Definition at line 117 of file micrograph.h.
size_t Micrograph::Xdim |
Definition at line 112 of file micrograph.h.
size_t Micrograph::Ydim |
Definition at line 113 of file micrograph.h.
size_t Micrograph::Zdim |
Definition at line 114 of file micrograph.h.