Xmipp  v3.23.11-Nereus
project_crystal.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Carlos Oscar S. Sorzano (coss@cnb.csic.es)
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 #ifndef _PROG_PROJECT_CRYSTAL_HH
26 #define _PROG_PROJECT_CRYSTAL_HH
27 
29 class PROJECT_Side_Info;
31 
32 #include "project.h"
33 
37 /* Crystal Projection parameters ------------------------------------------- */
57 {
58 public:
64  bool orthogonal;
70  double Nshift_avg;
72  double Nshift_dev;
81 
82 public:
85 
89  void read(const FileName &fn_crystal, double scale = 1.0);
90 
95  void write(const FileName &fn_crystal);
96 };
97 
98 /* Project as crystal ------------------------------------------------------ */
101 void project_crystal(Phantom &phantom, Projection &P,
102  const ParametersProjection &prm,
103  PROJECT_Side_Info &side, const Crystal_Projection_Parameters &prm_crystal,
104  float rot, float tilt, float psi);
105 
117  const Matrix1D<double> &proj_corner1, const Matrix1D<double> &proj_corner2,
118  const Matrix1D<double> &corner1, const Matrix1D<double> &corner2,
119  const Matrix1D<double> &a, const Matrix1D<double> &b,
120  int &iamin, int &iamax, int &ibmin, int &ibmax);
121 
135 
147  Matrix1D<double> &aproj, Matrix1D<double> &bproj,
148  Matrix1D<double> &aprojd, Matrix1D<double> &bprojd,
149  Matrix1D<double> &corner1, Matrix1D<double> &corner2,
150  const Crystal_Projection_Parameters &prm_crystal,
151  MultidimArray<double> &cell_shiftX, MultidimArray<double> &cell_shiftY,
152  MultidimArray<double> &cell_shiftZ,
153  MultidimArray<int> &cell_inside,
154  MultidimArray<double> &exp_shifts_matrix_X,
155  MultidimArray<double> &exp_shifts_matrix_Y,
156  MultidimArray<double> &exp_shifts_matrix_Z);
162 void init_shift_matrix(const Crystal_Projection_Parameters &prm_crystal,
163  MultidimArray<int> &cell_inside,
164  MultidimArray<double> &exp_shifts_matrix_X,
165  MultidimArray<double> &exp_shifts_matrix_Y,
166  MultidimArray<double> &exp_shifts_matrix_Z,
167  MultidimArray<double> &exp_normal_shifts_matrix_X,
168  MultidimArray<double> &exp_normal_shifts_matrix_Y,
169  MultidimArray<double> &exp_normal_shifts_matrix_Z,
170  double param_file_scale);
171 
173 #endif
void read(const FileName &fn_crystal, double scale=1.0)
void write(const FileName &fn_crystal)
Matrix1D< double > b
Crustal vector b.
bool orthogonal
Orthogonalize projections.
Matrix1D< double > a
Crystal vector a.
bool DF_shift_bool
is doc file with shifts available
MetaDataVec DF_shift
Document File for shifts. Order: H K x_SHIFT y_SHIFT z_SHIFT.
void fill_cell_positions(Projection &P, Matrix1D< double > &aproj, Matrix1D< double > &bproj, Matrix1D< double > &aprojd, Matrix1D< double > &bprojd, Matrix1D< double > &corner1, Matrix1D< double > &corner2, const Crystal_Projection_Parameters &prm_crystal, MultidimArray< double > &cell_shiftX, MultidimArray< double > &cell_shiftY, MultidimArray< double > &cell_shiftZ, MultidimArray< int > &cell_inside, MultidimArray< double > &exp_shifts_matrix_X, MultidimArray< double > &exp_shifts_matrix_Y, MultidimArray< double > &exp_shifts_matrix_Z)
void find_crystal_limits(const Matrix1D< double > &proj_corner1, const Matrix1D< double > &proj_corner2, const Matrix1D< double > &corner1, const Matrix1D< double > &corner2, const Matrix1D< double > &a, const Matrix1D< double > &b, int &iamin, int &iamax, int &ibmin, int &ibmax)
double disappearing_th
Disappearing threshold.
double Nshift_dev
Standard deviation of the magnitude shift.
int crystal_Xdim
Crystal X dimension.
int crystal_Ydim
Crystal Y dimension.
void move_following_spiral(Matrix1D< double > &r, const MultidimArray< int > &visited)
double psi(const double x)
FileName fn_shift
file with shifts
void project_crystal(Phantom &phantom, Projection &P, const ParametersProjection &prm, PROJECT_Side_Info &side, const Crystal_Projection_Parameters &prm_crystal, float rot, float tilt, float psi)
ProgClassifyCL2D * prm
void init_shift_matrix(const Crystal_Projection_Parameters &prm_crystal, MultidimArray< int > &cell_inside, MultidimArray< double > &exp_shifts_matrix_X, MultidimArray< double > &exp_shifts_matrix_Y, MultidimArray< double > &exp_shifts_matrix_Z, MultidimArray< double > &exp_normal_shifts_matrix_X, MultidimArray< double > &exp_normal_shifts_matrix_Y, MultidimArray< double > &exp_normal_shifts_matrix_Z, double param_file_scale)
double Nshift_avg
Bias to apply to the magnitude shift.