Xmipp  v3.23.11-Nereus
phantom.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 /* ------------------------------------------------------------------------- */
26 /* PHANTOMS */
27 /* ------------------------------------------------------------------------- */
28 
29 #ifndef _PHANTOM_HH
30 #define _PHANTOM_HH
31 
32 #include "core/matrix1d.h"
33 #include "core/matrix2d.h"
34 #include "core/xmipp_filename.h"
35 
36 class Metadata;
37 template<typename T>
38 class MultidimArray;
39 template<typename T>
40 class Image;
41 class Projection;
42 class MetaData;
43 class MDRow;
44 
86 /* FEATURE ================================================================= */
93 class Feature
94 {
95  /* Structure --------------------------------------------------------------- */
96 public:
101  std::string type;
102 
109 
114  double density;
115 
120 
126  double max_distance;
127 
128 public:
132  virtual void prepare() = 0;
133 
135  void assign(const Feature &F);
136 
140  virtual void rotate(const Matrix2D<double> &E);
141 
144  virtual void rotate_center(const Matrix2D<double> &E);
145 
146  /* Inside ------------------------------------------------------------------ */
154  virtual int point_inside(const Matrix1D<double> &r,
155  Matrix1D<double> &aux) const = 0;
156 
160  int point_inside(const Matrix1D<double> &r) const
161  {
162  Matrix1D<double> aux(3);
163  return point_inside(r, aux);
164  }
165 
176  virtual double density_inside(const Matrix1D<double> &r,
177  Matrix1D<double> &aux) const = 0;
178 
179 
186  int voxel_inside(const Matrix1D<double> &r, Matrix1D<double> &aux1,
187  Matrix1D<double> &aux2) const;
188 
192  int voxel_inside(const Matrix1D<double> &r) const
193  {
194  Matrix1D<double> aux1(3);
195  Matrix1D<double> aux2(3);
196  return voxel_inside(r, aux1, aux2);
197  }
198 
207  Matrix1D<double> &aux2) const;
208 
209 
215  int intersects_sphere(const Matrix1D<double> &r, double radius,
217  const;
218 
222  int intersects_sphere(const Matrix1D<double> &r, double radius) const
223  {
224  Matrix1D<double> aux1(3);
225  Matrix1D<double> aux2(3);
226  Matrix1D<double> aux3(3);
227  return intersects_sphere(r, radius, aux1, aux2, aux3);
228  }
229 
236  Feature *encircle(double radius = 0) const;
237 
246  virtual Feature *scale(double factor) const = 0;
247 
248 #define ENLARGE_MODE 1
249 #define SPHERE_MODE 2
250 
256  Feature *background(int back_mode, double back_param) const;
257 
267  virtual double intersection(const Matrix1D<double> &direction,
268  const Matrix1D<double> &passing_point, Matrix1D<double> &r,
269  Matrix1D<double> &u) const = 0;
270 
275  const Matrix1D<double> &passing_point) const
276  {
277  Matrix1D<double> r(3);
278  Matrix1D<double> u(3);
279  return intersection(direction, passing_point, r, u);
280  }
281 
285  virtual double volume() const = 0;
286 
293  void mean_variance_in_plane(Image<double> *V, double z, double &mean, double &var);
294 
311  void project_to(Projection &P, const Matrix2D<double> &VP,
312  const Matrix2D<double> &PV) const;
313 
327  void corners(const MultidimArray<double> &V, Matrix1D<double> &corner1,
328  Matrix1D<double> &corner2);
329 
330 #define INTERNAL 0
331 #define EXTERNAL 1
332 
356  void draw_in(MultidimArray<double> &V, int color_mode = INTERNAL, double colour = -1);
357 
364  void sketch_in(MultidimArray<double> &V, double colour = 2);
365 
369  void shift(double shiftX, double shiftY, double shiftZ);
370 
381  void selfApplyGeometry(const Matrix2D<double> &A);
382 
388  virtual void feat_printf(FILE *fh) const = 0;
389  virtual void feat_printm(MetaData &MD, size_t id) = 0;
394  void readCommon(char *line);
395  void readCommon(MDRow &row);
396 
397  // void read(char *line);
398  void read(MDRow &row);
399 
405 // virtual void read_specific(char *line) = 0;
406  virtual void read_specific(const std::vector<double> &vector) = 0;
407 
413  friend std::ostream& operator << (std::ostream &o, const Feature *F);
414 };
415 
416 /* ORIENTED FEATURE ======================================================== */
424 {
425 public:
427  double rot;
428 
430  double tilt;
431 
433  double psi;
434 
437 
440 public:
442  void prepare_Euler();
443 
445  void assign(const Oriented_Feature & OF);
446 
450  virtual void rotate(const Matrix2D<double> &E);
451 };
452 
453 /* SPHERES ================================================================= */
467 class Sphere: public Feature
468 {
469 public:
471  double radius;
472 public:
475  void prepare();
476 
478  void assign(const Sphere &F);
479 
483  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
484 
488  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const
489  {
490  return 1.;
491  }
492 
497  Feature *scale(double factor) const;
498 
500  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
501 
506  const Matrix1D<double> &passing_point,
507  Matrix1D<double> &r, Matrix1D<double> &u) const;
508 
512  double volume() const
513  {
514  return 4 / 3*PI*radius*radius*radius;
515  }
516 
520  void read_specific(char *line);
521  void read_specific(const std::vector<double> &vect);
522 
525  void feat_printf(FILE *fh) const;
526  void feat_printm(MetaData &MD, size_t id);
530  friend std::ostream& operator << (std::ostream &o, const Sphere &f);
531 
539  void init_rnd(
540  double minradius, double maxradius,
541  double minden = 1.0, double maxden = 1.0,
542  double minx0 = 0, double maxx0 = 0,
543  double miny0 = 0, double maxy0 = 0,
544  double minz0 = 0, double maxz0 = 0);
545 };
546 
547 /* BLOB ================================================================= */
563 class Blob: public Feature
564 {
565 public:
566 
567  /* I do not use the structure "blobtype" because common code with sphere becomes
568  more difficult*/
570  double radius;
572  double alpha;
574  int m;
575 public:
578  void prepare();
579 
581  void assign(const Blob &F);
582 
586  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
587 
590  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
591 
597  Feature *scale(double factor) const;
598 
600  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
601 
606  const Matrix1D<double> &passing_point,
607  Matrix1D<double> &r, Matrix1D<double> &u) const;
608 
612  double volume() const;
613 
617  void read_specific(char *line);
618  void read_specific(const std::vector<double> &vect);
619 
622  void feat_printf(FILE *fh) const;
623  void feat_printm(MetaData &MD, size_t id);
627  friend std::ostream& operator << (std::ostream &o, const Blob &f);
628 
636  void init_rnd(
637  double minradius, double maxradius,
638  double minalpha, double maxalpha,
639  double minorder, double maxorder,
640  double minden = 1.0, double maxden = 1.0,
641  double minx0 = 0, double maxx0 = 0,
642  double miny0 = 0, double maxy0 = 0,
643  double minz0 = 0, double maxz0 = 0);
644 };
645 
646 /* GAUSSIAN ================================================================ */
661 class Gaussian: public Feature
662 {
663 public:
664 
666  double sigma;
667 public:
670  void prepare();
671 
673  void assign(const Gaussian &F);
674 
678  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
679 
682  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
683 
689  Feature *scale(double factor) const;
690 
692  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
693 
698  const Matrix1D<double> &passing_point,
699  Matrix1D<double> &r, Matrix1D<double> &u) const;
700 
704  double volume() const
705  {
706  return 1;
707  }
708 
712  void read_specific(char *line);
713  void read_specific(const std::vector<double> &vect);
716  void feat_printf(FILE *fh) const;
717  void feat_printm(MetaData &MD, size_t id);
721  friend std::ostream& operator << (std::ostream &o, const Gaussian &f);
722 
730  void init_rnd(
731  double minsigma, double maxsigma,
732  double minden = 1.0, double maxden = 1.0,
733  double minx0 = 0, double maxx0 = 0,
734  double miny0 = 0, double maxy0 = 0,
735  double minz0 = 0, double maxz0 = 0);
736 };
737 
738 /* CYLINDERS =============================================================== */
763 {
764 public:
766  double xradius;
767 
769  double yradius;
770 
772  double height;
773 public:
778  void prepare();
779 
781  void assign(const Cylinder &F);
782 
786  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
787 
791  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const
792  {
793  return 1.;
794  }
795 
800  Feature *scale(double factor) const;
801 
803  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
804 
809  const Matrix1D<double> &passing_point,
810  Matrix1D<double> &r, Matrix1D<double> &u) const;
811 
815  double volume() const
816  {
817  return 4 / 3*PI*xradius*yradius*height;
818  }
819 
823  void read_specific(char *line);
824  void read_specific(const std::vector<double> &vect);
827  void feat_printf(FILE *fh) const;
828  void feat_printm(MetaData &MD, size_t id);
832  friend std::ostream& operator << (std::ostream &o, const Cylinder &f);
833 
841  void init_rnd(
842  double minxradius, double maxxradius,
843  double minyradius, double maxyradius,
844  double minheight, double maxheight,
845  double minden = 1.0, double maxden = 1.0,
846  double minx0 = 0, double maxx0 = 0,
847  double miny0 = 0, double maxy0 = 0,
848  double minz0 = 0, double maxz0 = 0,
849  double minrot = 0, double maxrot = 360,
850  double mintilt = 0, double maxtilt = 180,
851  double minpsi = 0, double maxpsi = 360);
852 };
853 
854 /* DOUBLE CYLINDERS ======================================================== */
891 {
892 public:
894  double radius;
895 
897  double height;
898 
900  double separation;
901 public:
907  void prepare();
908 
910  void assign(const DCylinder &F);
911 
915  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
916 
920  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const
921  {
922  return 1.;
923  }
924 
931  Feature *scale(double factor) const;
932 
934  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
935 
940  const Matrix1D<double> &passing_point,
941  Matrix1D<double> &r, Matrix1D<double> &u) const;
942 
946  double volume() const
947  {
948  return 2* 4 / 3*PI*radius*radius*height;
949  }
950 
954  void read_specific(char *line);
955  void read_specific(const std::vector<double> &vect);
958  void feat_printf(FILE *fh) const;
959  void feat_printm(MetaData &MD, size_t id);
963  friend std::ostream& operator << (std::ostream &o, const DCylinder &f);
964 
973  void init_rnd(
974  double minradius, double maxradius,
975  double minheight, double maxheight,
976  double minsep, double maxsep,
977  double minden = 1.0, double maxden = 1.0,
978  double minx0 = 0, double maxx0 = 0,
979  double miny0 = 0, double maxy0 = 0,
980  double minz0 = 0, double maxz0 = 0,
981  double minrot = 0, double maxrot = 360,
982  double mintilt = 0, double maxtilt = 180,
983  double minpsi = 0, double maxpsi = 360);
984 };
985 
986 /* CUBE ==================================================================== */
1010 class Cube: public Oriented_Feature
1011 {
1012 public:
1014  double xdim;
1015 
1017  double ydim;
1018 
1020  double zdim;
1021 public:
1026  void prepare();
1027 
1029  void assign(const Cube &F);
1030 
1034  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
1035 
1039  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const
1040  {
1041  return 1.;
1042  }
1043 
1048  Feature *scale(double factor) const;
1049 
1051  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
1052 
1056  double intersection(const Matrix1D<double> &direction,
1057  const Matrix1D<double> &passing_point,
1058  Matrix1D<double> &r, Matrix1D<double> &u) const;
1059 
1063  double volume() const
1064  {
1065  return xdim*ydim*zdim;
1066  }
1067 
1071  void read_specific(char *line);
1072  void read_specific(const std::vector<double> &vect);
1075  void feat_printf(FILE *fh) const;
1076  void feat_printm(MetaData &MD, size_t id);
1080  friend std::ostream& operator << (std::ostream &o, const Cube &f);
1081 
1090  void init_rnd(
1091  double minXdim, double maxXdim,
1092  double minYdim = 0, double maxYdim = 0,
1093  double minZdim = 0, double maxZdim = 0,
1094  double minden = 1.0, double maxden = 1.0,
1095  double minx0 = 0, double maxx0 = 0,
1096  double miny0 = 0, double maxy0 = 0,
1097  double minz0 = 0, double maxz0 = 0,
1098  double minrot = 0, double maxrot = 360,
1099  double mintilt = 0, double maxtilt = 180,
1100  double minpsi = 0, double maxpsi = 360);
1101 };
1102 
1103 /* ELLIPSOID =============================================================== */
1128 {
1129 public:
1131  double xradius;
1132 
1134  double yradius;
1135 
1137  double zradius;
1138 public:
1143  void prepare();
1144 
1146  void assign(const Ellipsoid &F);
1147 
1151  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
1152 
1156  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const
1157  {
1158  return 1.;
1159  }
1160 
1165  Feature *scale(double factor) const;
1166 
1168  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
1169 
1173  double intersection(const Matrix1D<double> &direction,
1174  const Matrix1D<double> &passing_point,
1175  Matrix1D<double> &r, Matrix1D<double> &u) const;
1176 
1180  double volume() const
1181  {
1182  return 4 / 3*PI*xradius*yradius*zradius;
1183  }
1184 
1188  void read_specific(char *line);
1189  void read_specific(const std::vector<double> &vect);
1192  void feat_printf(FILE *fh) const;
1193  void feat_printm(MetaData &MD, size_t id);
1197  friend std::ostream& operator << (std::ostream &o, const Ellipsoid &f);
1198 
1206  void init_rnd(
1207  double minXradius, double maxXradius,
1208  double minYradius, double maxYradius,
1209  double minZradius, double maxZradius,
1210  double minden = 1.0, double maxden = 1.0,
1211  double minx0 = 0, double maxx0 = 0,
1212  double miny0 = 0, double maxy0 = 0,
1213  double minz0 = 0, double maxz0 = 0,
1214  double minrot = 0, double maxrot = 360,
1215  double mintilt = 0, double maxtilt = 180,
1216  double minpsi = 0, double maxpsi = 360);
1217 };
1218 
1219 /* CONE ==================================================================== */
1244 class Cone: public Oriented_Feature
1245 {
1246 public:
1248  double radius;
1249 
1251  double height;
1252 
1253 public:
1258  void prepare();
1259 
1261  void assign(const Cone &F);
1262 
1266  int point_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const;
1267 
1271  double density_inside(const Matrix1D<double> &r, Matrix1D<double> &aux) const
1272  {
1273  return 1.;
1274  }
1275 
1280  Feature *scale(double factor) const;
1281 
1283  __attribute__ ((deprecated)) void scale(double factor, Feature **_f) const;
1284 
1288  double intersection(const Matrix1D<double> &direction,
1289  const Matrix1D<double> &passing_point,
1290  Matrix1D<double> &r, Matrix1D<double> &u) const;
1291 
1295  double volume() const
1296  {
1297  return 1 / 3*PI*radius*radius*height;
1298  }
1299 
1303  void read_specific(char *line);
1304  void read_specific(const std::vector<double> &vect);
1307  void feat_printf(FILE *fh) const;
1308  void feat_printm(MetaData &MD, size_t id);
1312  friend std::ostream& operator << (std::ostream &o, const Cone &f);
1313 
1321  void init_rnd(
1322  double minradius, double maxradius,
1323  double minheight, double maxheight,
1324  double minden = 1.0, double maxden = 1.0,
1325  double minx0 = 0, double maxx0 = 0,
1326  double miny0 = 0, double maxy0 = 0,
1327  double minz0 = 0, double maxz0 = 0,
1328  double minrot = 0, double maxrot = 360,
1329  double mintilt = 0, double maxtilt = 180,
1330  double minpsi = 0, double maxpsi = 360);
1331 };
1332 
1333 /* PHANTOM ================================================================= */
1352 class Phantom
1353 {
1354 public:
1357 
1359  int xdim;
1360 
1362  int ydim;
1363 
1365  int zdim;
1366 
1369 
1372 
1375 
1378 
1380  std::vector<Feature*> VF;
1381 public:
1385  Phantom();
1386 
1390  Phantom(const FileName &fn_phantom)
1391  {
1392  read(fn_phantom);
1393  }
1394 
1398  Phantom(const Phantom &other);
1399 
1403  {
1404  clear();
1405  }
1406 
1408  Phantom & operator = (const Phantom &P);
1409 
1412  void clear();
1413 
1415  int FeatNo()
1416  {
1417  return VF.size();
1418  }
1419 
1424  {
1425  return VF[i-1];
1426  }
1427 
1430  const Feature * operator()(int i) const
1431  {
1432  return VF[i-1];
1433  }
1434 
1438  void add(Feature *f)
1439  {
1440  VF.push_back(f);
1441  }
1442 
1444  void assign(const Phantom &P);
1445 
1447  void prepare();
1448 
1450  double max_distance() const;
1451 
1453  double volume() const;
1454 
1467  void read(const FileName &fn_phantom, bool apply_scale = true);
1468 
1471  friend std::ostream& operator << (std::ostream &o, const Phantom &f);
1472 
1475  void write(const FileName &fn_phantom = "");
1476 
1489  int voxel_inside_any_feat(const Matrix1D<double> &r,
1490  Matrix1D<double> &aux1, Matrix1D<double> &aux2) const;
1491 
1496  {
1497  Matrix1D<double> aux1(3);
1498  Matrix1D<double> aux2(3);
1499  return voxel_inside_any_feat(r, aux1, aux2);
1500  }
1501 
1508  int any_feature_intersects_sphere(const Matrix1D<double> &r, double radius,
1510  const;
1511 
1516  double radius) const
1517  {
1518  Matrix1D<double> aux1(3);
1519  Matrix1D<double> aux2(3);
1520  Matrix1D<double> aux3(3);
1521  return any_feature_intersects_sphere(r, radius, aux1, aux2, aux3);
1522  }
1523 
1528  void draw_in(MultidimArray<double> &V);
1529 
1537  void label(MultidimArray<double> &V);
1538 
1539 #define DONT_CLEAN 0
1540 #define CLEAN 1
1541 
1549  void sketch_in(MultidimArray<double> &V, int clean = DONT_CLEAN, double colour = 2);
1550 
1554  void shift(double shiftX, double shiftY, double shiftZ);
1555 
1558  void rotate(const Matrix2D<double> &E);
1559 
1568  void selfApplyGeometry(const Matrix2D<double> &A, int inv);
1569 
1581  void project_to(Projection &P, int Ydim, int Xdim,
1582  double rot, double tilt, double psi, const Matrix2D<double> *A = nullptr) const;
1583 
1588  void project_to(Projection &P,
1589  double rot, double tilt, double psi, const Matrix2D<double> *A = nullptr) const;
1590 
1602  void project_to(Projection &P, const Matrix2D<double> &VP, double disappearing_th = 1.0) const;
1603 
1604 #define POS_NEG 1
1605 #define NEG_POS 2
1606 
1621  void surface(double z0, double radius, int direction, Image<double> *P)
1622  const;
1623 };
1625 #endif
Phantom(const FileName &fn_phantom)
Definition: phantom.h:1390
friend std::ostream & operator<<(std::ostream &o, const Feature *F)
Definition: phantom.cpp:569
double height
Each cylinder height.
Definition: phantom.h:897
int voxel_inside_any_feat(const Matrix1D< double > &r) const
Definition: phantom.h:1495
double volume() const
Definition: phantom.h:1295
Definition: phantom.h:1244
Matrix2D< double > eulert
Inverse Euler matrix.
Definition: phantom.h:439
Definition: phantom.h:563
double phantom_scale
Param file scale.
Definition: phantom.h:1377
int ydim
Final volume Y dimension.
Definition: phantom.h:1362
double radius
Sphere radius.
Definition: phantom.h:471
void write(std::ostream &os, const datablock &db)
Definition: cif2pdb.cpp:3747
double volume() const
Definition: phantom.h:704
void readCommon(char *line)
Definition: phantom.cpp:177
void corners(const MultidimArray< double > &V, Matrix1D< double > &corner1, Matrix1D< double > &corner2)
Definition: phantom.cpp:967
double voxel_inside_by_normalized_density(const Matrix1D< double > &r, Matrix1D< double > &aux1, Matrix1D< double > &aux2) const
Definition: phantom.cpp:880
double volume() const
Definition: phantom.h:1063
double tilt
Second Euler angle.
Definition: phantom.h:430
void project_to(Projection &P, const Matrix2D< double > &VP, const Matrix2D< double > &PV) const
Definition: phantom.cpp:1293
double xradius
X radius before rotating.
Definition: phantom.h:1131
int intersects_sphere(const Matrix1D< double > &r, double radius) const
Definition: phantom.h:222
double sigma
Sigma.
Definition: phantom.h:666
Matrix2D< double > euler
Euler matrix.
Definition: phantom.h:436
void draw_in(MultidimArray< double > &V, int color_mode=INTERNAL, double colour=-1)
Definition: phantom.cpp:983
void sketch_in(MultidimArray< double > &V, double colour=2)
Definition: phantom.cpp:1051
double volume() const
Definition: phantom.h:1180
void read(MDRow &row)
Definition: phantom.cpp:213
int intersects_sphere(const Matrix1D< double > &r, double radius, Matrix1D< double > &aux1, Matrix1D< double > &aux2, Matrix1D< double > &aux3) const
Definition: phantom.cpp:936
Matrix1D< double > center
Definition: phantom.h:119
double density
Definition: phantom.h:114
virtual int point_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const =0
#define z0
const __attribute__((weak)) mrsrc const __attribute__((weak)) char gResourceData[]
#define DONT_CLEAN
Definition: phantom.h:1539
char add_assign
Definition: phantom.h:108
double volume() const
Definition: phantom.h:512
int point_inside(const Matrix1D< double > &r) const
Definition: phantom.h:160
void shift(double shiftX, double shiftY, double shiftZ)
Definition: phantom.cpp:1070
double volume() const
Definition: phantom.h:815
FileName fn
Filename.
Definition: phantom.h:1356
#define i
int FeatNo()
Definition: phantom.h:1415
virtual void rotate_center(const Matrix2D< double > &E)
Definition: phantom.cpp:151
int m
Definition: phantom.h:574
~Phantom()
Definition: phantom.h:1402
int voxel_inside(const Matrix1D< double > &r, Matrix1D< double > &aux1, Matrix1D< double > &aux2) const
Definition: phantom.cpp:845
double radius
Blob radius.
Definition: phantom.h:570
double density_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const
Definition: phantom.h:1271
double intersection(const Matrix1D< double > &direction, const Matrix1D< double > &passing_point) const
Definition: phantom.h:274
virtual void feat_printf(FILE *fh) const =0
virtual double intersection(const Matrix1D< double > &direction, const Matrix1D< double > &passing_point, Matrix1D< double > &r, Matrix1D< double > &u) const =0
virtual void rotate(const Matrix2D< double > &E)
Definition: phantom.cpp:159
int voxel_inside(const Matrix1D< double > &r) const
Definition: phantom.h:192
double * f
double height
Cone height.
Definition: phantom.h:1251
virtual void prepare()=0
Definition: phantom.h:1010
virtual Feature * scale(double factor) const =0
double density_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const
Definition: phantom.h:1156
double param_file_scale
Param file scale.
Definition: phantom.h:1374
double height
Cylinder height.
Definition: phantom.h:772
double Background_Density
Final volume background density.
Definition: phantom.h:1368
double z
double density_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const
Definition: phantom.h:920
virtual void feat_printm(MetaData &MD, size_t id)=0
virtual double volume() const =0
void add(Feature *f)
Definition: phantom.h:1438
int any_feature_intersects_sphere(const Matrix1D< double > &r, double radius) const
Definition: phantom.h:1515
void direction(const MultidimArray< double > &orMap, MultidimArray< double > &qualityMap, double lambda, int size, MultidimArray< double > &dirMap, int x, int y)
double separation
Separation between cylinders.
Definition: phantom.h:900
double ydim
Y dimension before rotating.
Definition: phantom.h:1017
double max_distance
Definition: phantom.h:126
double density_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const
Definition: phantom.h:1039
double density_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const
Definition: phantom.h:488
virtual double density_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const =0
Feature * operator()(int i)
Definition: phantom.h:1423
double yradius
Cylinder Y radius.
Definition: phantom.h:769
int zdim
Final volume Z dimension.
Definition: phantom.h:1365
const Feature * operator()(int i) const
Definition: phantom.h:1430
double alpha
Blob alpha.
Definition: phantom.h:572
std::string type
Definition: phantom.h:101
Feature * background(int back_mode, double back_param) const
Definition: phantom.cpp:1662
double volume() const
Definition: phantom.h:946
double rot
First Euler angle.
Definition: phantom.h:427
double psi(const double x)
double zdim
Z dimension before rotating.
Definition: phantom.h:1020
int xdim
Final volume X dimension.
Definition: phantom.h:1359
double current_scale
Has been the scale applied?
Definition: phantom.h:1371
double radius
Cylinder radius.
Definition: phantom.h:894
void mean_variance_in_plane(Image< double > *V, double z, double &mean, double &var)
Definition: phantom.cpp:1929
doublereal * u
double psi
Third Euler angle.
Definition: phantom.h:433
double density_inside(const Matrix1D< double > &r, Matrix1D< double > &aux) const
Definition: phantom.h:791
void assign(const Feature &F)
Definition: phantom.cpp:92
double zradius
Z radius before rotating.
Definition: phantom.h:1137
double yradius
Y radius before rotating.
Definition: phantom.h:1134
#define PI
Definition: tools.h:43
virtual void read_specific(const std::vector< double > &vector)=0
double radius
Cone base radius.
Definition: phantom.h:1248
double xradius
Cylinder X radius.
Definition: phantom.h:766
std::vector< Feature * > VF
List with the features.
Definition: phantom.h:1380
Feature * encircle(double radius=0) const
Definition: phantom.cpp:1644
double xdim
X dimension before rotating.
Definition: phantom.h:1014
void selfApplyGeometry(const Matrix2D< double > &A)
Definition: phantom.cpp:1078
#define INTERNAL
Definition: phantom.h:330