Xmipp  v3.23.11-Nereus
Public Member Functions | Public Attributes | List of all members

#include <precompute_sampling.h>

Collaboration diagram for Prog_Sampling_Parameters:
Collaboration graph
[legend]

Public Member Functions

 Prog_Sampling_Parameters ()
 
void read (int argc, const char **argv)
 
void usage ()
 
void show ()
 
void run ()
 
void get_sym_vectors (std::vector< Matrix1D< double > > &sym_points)
 

Public Attributes

Sampling mysampling
 
double sampling
 
double neighborhood
 
std::string sampling_file_root
 
FileName fn_sym
 
int symmetry
 
int sym_order
 
double max_tilt_angle
 
double min_tilt_angle
 

Detailed Description

Parameter class for the PDB Phantom program

Definition at line 40 of file precompute_sampling.h.

Constructor & Destructor Documentation

◆ Prog_Sampling_Parameters()

Prog_Sampling_Parameters::Prog_Sampling_Parameters ( )

Empty constructor

sampling object 1 by default

Definition at line 30 of file precompute_sampling.cpp.

31 {
34 }
void setSampling(double sampling)
Definition: sampling.cpp:121

Member Function Documentation

◆ get_sym_vectors()

void Prog_Sampling_Parameters::get_sym_vectors ( std::vector< Matrix1D< double > > &  sym_points)

get all directions related by symmetry to (1,0,0)

◆ read()

void Prog_Sampling_Parameters::read ( int  argc,
const char **  argv 
)

Read from a command line. An exception might be thrown by any of the internal conversions, this would mean that there is an error in the command line and you might show a usage message.

Definition at line 38 of file precompute_sampling.cpp.

39 {
40  sampling_file_root = getParameter(argc, argv, "-o");
41  fn_sym = getParameter(argc, argv, "-sym");
42  //symmetry = getParameter(argc, argv, "-symmetry", "cn");
43  //sym_order = textToInteger(getParameter(argc, argv, "-sym_order", "1"));
44  sampling = textToFloat(getParameter(argc, argv, "-sampling_rate", "5"));
45  neighborhood = textToFloat(getParameter(argc, argv, "-neighborhood", "1"));
46  max_tilt_angle = textToFloat(getParameter(argc, argv, "-max_tilt_angle","0"));
47  min_tilt_angle = textToFloat(getParameter(argc, argv, "-min_tilt_angle","180"));
48 }
const char * getParameter(int argc, const char **argv, const char *param, const char *option)
Definition: args.cpp:30
float textToFloat(const char *str)

◆ run()

void Prog_Sampling_Parameters::run ( )

Run.

Definition at line 89 of file precompute_sampling.cpp.

90 {
91  show();
95  //mysampling.computeSamplingPoints(false);
99  //mysampling.computeNeighbors();
100  //#define DEBUG6
101 #ifdef DEBUG6
102  for (int i = 0; i < mysampling.no_redundant_sampling_points_vector.size(); i++)
103  {
104  std::cout << mysampling.no_redundant_sampling_points_vector[i].transpose() << " 1.1 2.2222 " << std::endl;
105  //std::cout << mysampling.no_redundant_sampling_points_angles[i].transpose() << " 1.21 1 " << std::endl;
106  }
107 #endif
108 #undef DEBUG6
109  //#define DEBUG6
110 #ifdef DEBUG6
111  { /* for sphere coverage only R is important.
112  for psi L and R are important
113  */
114  double rot, tilt, psi;
115  double rotp, tiltp, psip;
116  Matrix1D<double> row(3);
117  Matrix2D<double> L(4, 4), R(4, 4);
118  //std::cerr << "mysampling.SL.SymsNo():" << mysampling.SL.SymsNo() << std::endl;
119  for (int i = 0; i < mysampling.no_redundant_sampling_points_vector.size(); i++)
120  {
121  if (i == 50)
122  {
126  std::cerr << 1 << " " << 3 << " " << rot << " " << tilt << " " << psi << std::endl;
127  //std::cerr << mysampling.no_redundant_sampling_points_vector[i].transpose() << " 1 1" << std::endl;
128  }
129  for (int isym = 0; isym < mysampling.SL.SymsNo(); isym++)
130  {
131  //std::cerr << L << R << std::endl;
132  mysampling.SL.get_matrices(isym, L, R);
133  R.resize(3, 3); // as only the relative orientation
135  std::cout << row.transpose() << " 1 " << isym + 2 << std::endl;
136  if (i == 50)
137  {
138  //std::cerr << row.transpose() << " 1 " << isym +2 << std::endl;
139  L.resize(3, 3); // Erase last row and column
140  //std::cerr << L << R << std::endl;
141  Euler_apply_transf(L, R, rot, tilt, psi, rotp, tiltp, psip);
142  Euler_direction(rotp, tiltp, psip, row);
143  std::cerr << isym + 2 << " " << 3 << " " << rotp << " " << tiltp << " " << psip << std::endl;
144  }
145  }
146  }
147  }
148 #endif
149 #undef DEBUG6
150  //#define DEBUG6
151 #ifdef DEBUG6
152  for (int i = 0;
154  i++)
155  std::cout << mysampling.sampling_points_vector[i].transpose() << " 1 1 " << std::endl;
156 #endif
157 #undef DEBUG6
158  //#define DEBUG6
159 #ifdef DEBUG6
160  for (int i = 0; i < mysampling.no_redundant_sampling_points_vector.size();i++)
161  {
162  std::cout << mysampling.no_redundant_sampling_points_vector[i].transpose() << " 1.2 3 " << std::endl;
163  for (int j = 0; j < mysampling.my_neighbors[i].size();j++)
164  std::cout <<
166  << " 1.1 2 " << std::endl;
167  }
168 #endif
169 #undef DEBUG6
170 }
void setSampling(double sampling)
Definition: sampling.cpp:121
void removeRedundantPoints(const int symmetry, int sym_order)
Definition: sampling.cpp:691
void Euler_direction(double alpha, double beta, double gamma, Matrix1D< double > &v)
Definition: geometry.cpp:721
void createAsymUnitFile(const FileName &docfilename)
Definition: sampling.cpp:1440
void setNeighborhoodRadius(double neighborhood)
Definition: sampling.cpp:140
bool isSymmetryGroup(FileName fn_sym, int &pgGroup, int &pgOrder)
Definition: symmetries.cpp:601
std::vector< Matrix1D< double > > no_redundant_sampling_points_vector
Definition: sampling.h:118
void Euler_apply_transf(const Matrix2D< double > &L, const Matrix2D< double > &R, double rot, double tilt, double psi, double &newrot, double &newtilt, double &newpsi)
Definition: geometry.cpp:1038
#define i
void computeSamplingPoints(bool only_half_sphere=true, double max_tilt=180, double min_tilt=0)
Definition: sampling.cpp:155
#define XX(v)
Definition: matrix1d.h:85
std::vector< std::vector< size_t > > my_neighbors
Definition: sampling.h:87
#define j
#define YY(v)
Definition: matrix1d.h:93
std::vector< Matrix1D< double > > no_redundant_sampling_points_angles
Definition: sampling.h:121
double psi(const double x)
std::vector< Matrix1D< double > > sampling_points_vector
Definition: sampling.h:101
#define ZZ(v)
Definition: matrix1d.h:101
SymList SL
Definition: sampling.h:138

◆ show()

void Prog_Sampling_Parameters::show ( )

Show parameters.

Definition at line 73 of file precompute_sampling.cpp.

74 {
75  std::cout
76  << "Sampling rate: " << sampling << std::endl
77  << "output files root: " << sampling_file_root << std::endl
78  << "symmetry group: " << fn_sym << std::endl
79  //<< "symmetry order: " << sym_order << std::endl
80  << "neighborhood: " << neighborhood << std::endl
81  << "max_tilt_angle: " << max_tilt_angle << std::endl
82  << "min_tilt_angle: " << min_tilt_angle << std::endl
83  ;
84 }

◆ usage()

void Prog_Sampling_Parameters::usage ( )

Usage message. This function shows the way of introdustd::cing this parameters.

Definition at line 51 of file precompute_sampling.cpp.

52 {
53  std::cerr << "precompute_sampling\n"
54  << " -o root_file_name : Root for output files\n"
55  << " [-sym cn] :One of the 17 possible symmetries in\n"
56  << " single particle electronmicroscopy\n"
57  << " i.e. ci, cs, cn, cnv, cnh, sn, dn, dnv, dnh, t, td, th, o, oh, i, ih\n"
58  << " : where n may change from 1 to 99\n"
59  << " [-sampling_rate 5] : Distance in degrees between sampling points\n"
60  << " [-neighborhood 1] : A sampling point is neighbor if closer than this value in degrees\n"
61  << " [-max_tilt_angle <t=0>] : maximum tilt angle in degrees\n"
62  << " [-min_tilt_angle <t=-180>] : minimum tilt angle in degrees\n"
63  << "\n"
64  << "Example of use: Sample at 2degres and compute neighboor at "
65  << " 5 degrees for c6 symmetry\n"
66  << " xmipp_precompute_sampling -o out -sym c6 "
67  << " -sampling_rate 2 -neighborhood 5 -max_tilt_angle 70 "
68  << " -min_tilt_angle 50 \n"
69  ;
70 }

Member Data Documentation

◆ fn_sym

FileName Prog_Sampling_Parameters::fn_sym

Symmetry. One of the 17 possible symmetries in single particle electron microscopy. See details at url Possible values are: c1, ci, cs, cn, cnv, cnh, sn, dn, dnv, dnh, t, td, th, o, oh, i, ih

Definition at line 61 of file precompute_sampling.h.

◆ max_tilt_angle

double Prog_Sampling_Parameters::max_tilt_angle

fil vector with symmetry axis maximun tilt angle

Definition at line 73 of file precompute_sampling.h.

◆ min_tilt_angle

double Prog_Sampling_Parameters::min_tilt_angle

minimum tilt angle

Definition at line 76 of file precompute_sampling.h.

◆ mysampling

Sampling Prog_Sampling_Parameters::mysampling

sampling object

Definition at line 44 of file precompute_sampling.h.

◆ neighborhood

double Prog_Sampling_Parameters::neighborhood

A sampling point is neighbor if closer than this value in degrees

Definition at line 50 of file precompute_sampling.h.

◆ sampling

double Prog_Sampling_Parameters::sampling

Sampling rate. Distance between sampling points in degrees

Definition at line 47 of file precompute_sampling.h.

◆ sampling_file_root

std::string Prog_Sampling_Parameters::sampling_file_root

root for output files

Definition at line 54 of file precompute_sampling.h.

◆ sym_order

int Prog_Sampling_Parameters::sym_order

For infinite groups symmetry order

Definition at line 67 of file precompute_sampling.h.

◆ symmetry

int Prog_Sampling_Parameters::symmetry

1-17 symmetry grouips

Definition at line 64 of file precompute_sampling.h.


The documentation for this class was generated from the following files: