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

#include <angular_assignment_mag.h>

Inheritance diagram for ProgAngularAssignmentMag:
Inheritance graph
[legend]
Collaboration diagram for ProgAngularAssignmentMag:
Collaboration graph
[legend]

Public Member Functions

void defineParams () override
 
void readParams () override
 
void show () const override
 
void preProcess () override
 
void processImage (const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut) override
 
void postProcess () override
 
 ProgAngularAssignmentMag ()
 
 ~ProgAngularAssignmentMag ()
 
void applyRotation (const MultidimArray< double > &, double &, MultidimArray< double > &) const
 
void applyShiftAndRotation (const MultidimArray< double > &MDaRef, double &rot, double &tx, double &ty, MultidimArray< double > &MDaRefRot) const
 
virtual void synchronize ()
 Synchronize with other processors. More...
 
- Public Member Functions inherited from XmippMetadataProgram
MetaDatagetInputMd ()
 
MetaDataVecgetOutputMd ()
 
 XmippMetadataProgram ()
 Empty constructor. More...
 
virtual int tryRead (int argc, const char **argv, bool reportErrors=true)
 
virtual void init ()
 
virtual void setup (MetaData *md, const FileName &o="", const FileName &oroot="", bool applyGeo=false, MDLabel label=MDL_IMAGE)
 
virtual ~XmippMetadataProgram ()
 
void setMode (WriteModeMetaData _mode)
 
void setupRowOut (const FileName &fnImgIn, const MDRow &rowIn, const FileName &fnImgOut, MDRow &rowOut) const
 Prepare rowout. More...
 
virtual void wait ()
 Wait for the distributor to finish. More...
 
virtual void checkPoint ()
 For very long programs, it may be needed to write checkpoints. More...
 
virtual void run ()
 Run over all images. More...
 
- Public Member Functions inherited from XmippProgram
const char * getParam (const char *param, int arg=0)
 
const char * getParam (const char *param, const char *subparam, int arg=0)
 
int getIntParam (const char *param, int arg=0)
 
int getIntParam (const char *param, const char *subparam, int arg=0)
 
double getDoubleParam (const char *param, int arg=0)
 
double getDoubleParam (const char *param, const char *subparam, int arg=0)
 
float getFloatParam (const char *param, int arg=0)
 
float getFloatParam (const char *param, const char *subparam, int arg=0)
 
void getListParam (const char *param, StringVector &list)
 
int getCountParam (const char *param)
 
bool checkParam (const char *param)
 
bool existsParam (const char *param)
 
void addParamsLine (const String &line)
 
void addParamsLine (const char *line)
 
ParamDefgetParamDef (const char *param) const
 
virtual void quit (int exit_code=0) const
 
virtual int tryRun ()
 
void initProgress (size_t total, size_t stepBin=60)
 
void setProgress (size_t value=0)
 
void endProgress ()
 
void processDefaultComment (const char *param, const char *left)
 
void setDefaultComment (const char *param, const char *comment)
 
void setProgramName (const char *name)
 
void addUsageLine (const char *line, bool verbatim=false)
 
void clearUsage ()
 
void addExampleLine (const char *example, bool verbatim=true)
 
void addSeeAlsoLine (const char *seeAlso)
 
void addKeywords (const char *keywords)
 
const char * name () const
 
virtual void usage (int verb=0) const
 
virtual void usage (const String &param, int verb=2)
 
int version () const
 
virtual void read (int argc, const char **argv, bool reportErrors=true)
 
virtual void read (int argc, char **argv, bool reportErrors=true)
 
void read (const String &argumentsLine)
 
 XmippProgram ()
 
 XmippProgram (int argc, const char **argv)
 
virtual ~XmippProgram ()
 

Public Attributes

size_t rank
 
size_t Nprocessors
 
- Public Attributes inherited from XmippMetadataProgram
FileName fn_in
 Filenames of input and output Metadata. More...
 
FileName fn_out
 
FileName baseName
 
FileName pathBaseName
 
FileName oextBaseName
 
bool apply_geo
 Apply geo. More...
 
size_t ndimOut
 Output dimensions. More...
 
size_t zdimOut
 
size_t ydimOut
 
size_t xdimOut
 
DataType datatypeOut
 
size_t mdInSize
 Number of input elements. More...
 
- Public Attributes inherited from XmippProgram
bool doRun
 
bool runWithoutArgs
 
int verbose
 Verbosity level. More...
 
int debug
 

Additional Inherited Members

- Protected Member Functions inherited from XmippMetadataProgram
virtual void initComments ()
 
virtual bool getImageToProcess (size_t &objId, size_t &objIndex)
 
void show () const override
 
virtual void startProcessing ()
 
virtual void finishProcessing ()
 
virtual void writeOutput ()
 
virtual void showProgress ()
 
virtual void defineLabelParam ()
 
- Protected Member Functions inherited from XmippProgram
void defineCommons ()
 
- Protected Attributes inherited from XmippMetadataProgram
WriteModeMetaData mode
 Metadata writing mode: OVERWRITE, APPEND. More...
 
FileName oext
 Output extension and root. More...
 
FileName oroot
 
MDLabel image_label
 MDLabel to be used to read/write images, usually will be MDL_IMAGE. More...
 
bool produces_an_output
 Indicate that a unique final output is produced. More...
 
bool produces_a_metadata
 Indicate that the unique final output file is a Metadata. More...
 
bool each_image_produces_an_output
 Indicate that an output is produced for each image in the input. More...
 
bool allow_apply_geo
 
bool decompose_stacks
 Input Metadata will treat a stack file as a set of images instead of a unique file. More...
 
bool delete_output_stack
 Delete previous output stack file prior to process images. More...
 
bool get_image_info
 Get the input image file dimensions to further operations. More...
 
bool save_metadata_stack
 Save the associated output metadata when output file is a stack. More...
 
bool track_origin
 Include the original input image filename in the output stack. More...
 
bool keep_input_columns
 Keep input metadata columns. More...
 
bool remove_disabled
 Remove disabled images from the input selfile. More...
 
bool allow_time_bar
 Show process time bar. More...
 
bool input_is_metadata
 Input is a metadata. More...
 
bool single_image
 Input is a single image. More...
 
bool input_is_stack
 Input is a stack. More...
 
bool output_is_stack
 Output is a stack. More...
 
bool create_empty_stackfile
 
bool delete_mdIn
 
size_t time_bar_step
 Some time bar related counters. More...
 
size_t time_bar_size
 
size_t time_bar_done
 
- Protected Attributes inherited from XmippProgram
int errorCode
 
ProgramDefprogDef
 Program definition and arguments parser. More...
 
std::map< String, CommentListdefaultComments
 
int argc
 Original command line arguments. More...
 
const char ** argv
 

Detailed Description

Angular_Assignment_mag parameters.

Definition at line 49 of file angular_assignment_mag.h.

Constructor & Destructor Documentation

◆ ProgAngularAssignmentMag()

ProgAngularAssignmentMag::ProgAngularAssignmentMag ( )

Definition at line 39 of file angular_assignment_mag.cpp.

39  {
40  produces_a_metadata = true;
42  rank=0;
43  Nprocessors=1;
44 }
bool each_image_produces_an_output
Indicate that an output is produced for each image in the input.
bool produces_a_metadata
Indicate that the unique final output file is a Metadata.

◆ ~ProgAngularAssignmentMag()

ProgAngularAssignmentMag::~ProgAngularAssignmentMag ( )
default

Member Function Documentation

◆ applyRotation()

void ProgAngularAssignmentMag::applyRotation ( const MultidimArray< double > &  MDaRef,
double &  rot,
MultidimArray< double > &  MDaRefRot 
) const

Definition at line 993 of file angular_assignment_mag.cpp.

994  {
995  // Transform matrix
996  Matrix2D<double> A(3, 3);
997  A.initIdentity();
998  double ang = DEG2RAD(rot);
999  double cosine = cos(ang);
1000  double sine = sin(ang);
1001 
1002  // rotation
1003  MAT_ELEM(A,0, 0) = cosine;
1004  MAT_ELEM(A,0, 1) = sine;
1005  MAT_ELEM(A,1, 0) = -sine;
1006  MAT_ELEM(A,1, 1) = cosine;
1007 
1008  // Shift
1009  MAT_ELEM(A,0, 2) = 0.;
1010  MAT_ELEM(A,1, 2) = 0.;
1011 
1012  applyGeometry(xmipp_transformation::LINEAR, MDaRefRot, MDaRef, A, xmipp_transformation::IS_NOT_INV, xmipp_transformation::DONT_WRAP);
1013 }
#define DEG2RAD(d)
Definition: xmipp_macros.h:312
void applyGeometry(int SplineDegree, MultidimArray< std::complex< double > > &V2, const MultidimArray< std::complex< double > > &V1, const Matrix2D< double > &A, bool inv, bool wrap, std::complex< double > outside, MultidimArray< double > *BcoeffsPtr)
#define MAT_ELEM(m, i, j)
Definition: matrix2d.h:116

◆ applyShiftAndRotation()

void ProgAngularAssignmentMag::applyShiftAndRotation ( const MultidimArray< double > &  MDaRef,
double &  rot,
double &  tx,
double &  ty,
MultidimArray< double > &  MDaRefRot 
) const

Definition at line 1043 of file angular_assignment_mag.cpp.

1044  {
1045  // Transform matrix
1046  Matrix2D<double> A(3, 3);
1047  A.initIdentity();
1048  double ang = DEG2RAD(rot);
1049  double cosine = cos(ang);
1050  double sine = sin(ang);
1051 
1052  // rotate in opposite direction
1053  double realTx = cosine * tx + sine * ty;
1054  double realTy = -sine * tx + cosine * ty;
1055 
1056  // rotation
1057  MAT_ELEM(A,0, 0) = cosine;
1058  MAT_ELEM(A,0, 1) = sine;
1059  MAT_ELEM(A,1, 0) = -sine;
1060  MAT_ELEM(A,1, 1) = cosine;
1061 
1062  // Shift
1063  MAT_ELEM(A,0, 2) = realTx;
1064  MAT_ELEM(A,1, 2) = realTy;
1065 
1066  applyGeometry(xmipp_transformation::LINEAR, MDaRefRot, MDaRef, A, xmipp_transformation::IS_NOT_INV, xmipp_transformation::DONT_WRAP);
1067 }
#define DEG2RAD(d)
Definition: xmipp_macros.h:312
void applyGeometry(int SplineDegree, MultidimArray< std::complex< double > > &V2, const MultidimArray< std::complex< double > > &V1, const Matrix2D< double > &A, bool inv, bool wrap, std::complex< double > outside, MultidimArray< double > *BcoeffsPtr)
#define MAT_ELEM(m, i, j)
Definition: matrix2d.h:116

◆ defineParams()

void ProgAngularAssignmentMag::defineParams ( )
overridevirtual

Function in which the param of each Program are defined.

Reimplemented from XmippMetadataProgram.

Definition at line 48 of file angular_assignment_mag.cpp.

48  {
50  //usage
51  addUsageLine( "Generates a list of candidates for angular assignment for each experimental image");
52  addParamsLine(" -ref <md_file> : Metadata file with input reference projections");
53  addParamsLine(" [-odir <outputDir=\".\">] : Output directory");
54  addParamsLine(" [--sym <symfile=c1>] : Enforce symmetry in projections");
55  addParamsLine(" [-sampling <sampling=1.>] : sampling");
56  addParamsLine(" [-angleStep <angStep=3.>] : angStep");
57  addParamsLine(" [--maxShift <maxShift=-1.>] : Maximum shift allowed (+-this amount)");
58  addParamsLine(" [--Nsimultaneous <Nprocessors=1>] : Nsimultaneous");
59  addParamsLine(" [--refVol <refVolFile=NULL>] : reference volume to be reprojected when comparing with previous alignment");
60  addParamsLine(" [--useForValidation] : Use the program for validation");
61  addParamsLine(" [--thr <threads=4>] : How many threads to use");
62 }
void addUsageLine(const char *line, bool verbatim=false)
void addParamsLine(const String &line)

◆ postProcess()

void ProgAngularAssignmentMag::postProcess ( )
overridevirtual

Reimplemented from XmippMetadataProgram.

Definition at line 643 of file angular_assignment_mag.cpp.

643  {
644  // from angularContinousAssign2
645  MetaData &ptrMdOut = getOutputMd();
646 
647  ptrMdOut.removeDisabled();
648  double maxCC = -1.;
649  int j = 0;
650  for (size_t objId : ptrMdOut.ids())
651  {
652  double thisMaxCC;
653  ptrMdOut.getValue(MDL_MAXCC, thisMaxCC, objId);
654  if (thisMaxCC > maxCC)
655  maxCC = thisMaxCC;
656  if (thisMaxCC == 0.0)
657  ptrMdOut.removeObject(objId);
658  j++;
659  }
660  for (size_t objId : ptrMdOut.ids())
661  {
662  double thisMaxCC;
663  ptrMdOut.getValue(MDL_MAXCC, thisMaxCC, objId);
664  ptrMdOut.setValue(MDL_WEIGHT, thisMaxCC / maxCC, objId);
665  ptrMdOut.setValue(MDL_WEIGHT_SIGNIFICANT, thisMaxCC / maxCC,
666  objId);
667  }
668  ptrMdOut.write(XmippMetadataProgram::fn_out.replaceExtension("xmd"));
669 }
virtual void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const =0
virtual IdIteratorProxy< false > ids()
virtual bool getValue(MDObject &mdValueOut, size_t id) const =0
Weight due to Angular significance.
Maximum cross-correlation for the image (double)
#define j
bool setValue(const MDLabel label, const T &valueIn, size_t id)
virtual void removeDisabled()
virtual bool removeObject(size_t id)=0
< Score 4 for volumes

◆ preProcess()

void ProgAngularAssignmentMag::preProcess ( )
overridevirtual

Reimplemented from XmippMetadataProgram.

Definition at line 290 of file angular_assignment_mag.cpp.

290  {
291 
293  mdRef.read(fnRef);
294 
295  // size of images
296  size_t Zdim;
297  size_t Ndim;
298  getImageSize(mdIn, Xdim, Ydim, Zdim, Ndim);
299 
300  // some constants
301  n_rad = size_t((double)Xdim / 2.);
302  startBand = size_t((sampling * (double) Xdim) / 80.);
303  finalBand = size_t((sampling * (double) Xdim) / (sampling * 3));
304  n_bands = finalBand - startBand;
305  n_ang = size_t(180);
306  n_ang2 = 2 * n_ang;
307  if (maxShift==-1.){
308  maxShift = .10 * (double)Xdim;
309  }
310 
311  // read reference images
312  FileName fnImgRef;
313  sizeMdRef = (int)mdRef.size();
314 
315  // how many input images
316  sizeMdIn = (int)mdIn.size();
317 
318  computeCircular(); //pre-compute circular mask
319 
320  checkStorageSpace();
321 
322  processGallery(fnImgRef); // process reference gallery
323 
324  computeEigenvectors(); // eigenvectors for graph-signal-processing
325 
326  // Symmetry List
327  if (fnSym != "") {
328  SL.readSymmetryFile(fnSym);
329  for (int sym = 0; sym < SL.symsNo(); sym++) {
330  Matrix2D<double> auxL, auxR;
331  SL.getMatrices(sym, auxL, auxR);
332  auxL.resize(3, 3);
333  auxR.resize(3, 3);
334  L.push_back(auxL);
335  R.push_back(auxR);
336  }
337  } // */
338 
339  if(useForValidation){
340  // read reference volume to be re-projected when comparing previous assignment
341  // If there is no reference available, exit
342  refVol.read(inputReference_volume);
343 
344  refVol().setXmippOrigin();
345  refXdim = (int)XSIZE(refVol());
346  refYdim = (int)YSIZE(refVol());
347  refZdim = (int)ZSIZE(refVol());
348  }
349 }
#define YSIZE(v)
void getMatrices(int i, Matrix2D< double > &L, Matrix2D< double > &R, bool homogeneous=true) const
Definition: symmetries.cpp:348
void read(const FileName &inFile, const std::vector< MDLabel > *desiredLabels=nullptr, bool decomposeStack=true) override
int readSymmetryFile(FileName fn_sym, double accuracy=SYM_ACCURACY)
Definition: symmetries.cpp:33
void getImageSize(const MetaData &md, size_t &Xdim, size_t &Ydim, size_t &Zdim, size_t &Ndim, MDLabel image_label)
int symsNo() const
Definition: symmetries.h:268
size_t size() const override
FileName fn_in
Filenames of input and output Metadata.
#define sampling
#define XSIZE(v)
#define ZSIZE(v)
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
void resize(size_t Ydim, size_t Xdim, bool noCopy=false)
Definition: matrix2d.cpp:1022

◆ processImage()

void ProgAngularAssignmentMag::processImage ( const FileName fnImg,
const FileName fnImgOut,
const MDRow rowIn,
MDRow rowOut 
)
overridevirtual

Implements XmippMetadataProgram.

Definition at line 371 of file angular_assignment_mag.cpp.

372  {
373 
374  // experimental image related
375  Image<double> ImgIn;
376  MultidimArray<double> MDaIn((int)Ydim, (int)Xdim);
379  MultidimArray<double> MDaInFM;
380  MultidimArray<double> MDaInFMs;
381  MultidimArray<double> MDaInFMs_polarPart((int)n_bands, (int)n_ang2);
382  MultidimArray<std::complex<double> > MDaInFMs_polarF;
383 
384  // processing experimental input image
385  ImgIn.read(fnImg);
386  MDaIn = ImgIn();
387  MDaIn.setXmippOrigin();
388  transformerImage.FourierTransform(MDaIn, MDaInF, true);
389  transformerImage.getCompleteFourier(MDaInF2);
390  FFT_magnitude(MDaInF2, MDaInFM);
391  completeFourierShift(MDaInFM, MDaInFMs);
392  MDaInFMs_polarPart = imToPolar(MDaInFMs, startBand, finalBand);
393  transformerPolarImage.FourierTransform(MDaInFMs_polarPart, MDaInFMs_polarF, true);
394 
395  // variables for an initial screening of possible "good" references
396  double psi;
397  double cc_coeff;
398  double Tx;
399  double Ty;
400  int maxAccepted = 8;
401 
402  std::vector<unsigned int> Idx(sizeMdRef, 0);
403 
404  Matrix1D<double> ccvec;
405  ccvec.initZeros(sizeMdRef);
406 
407  std::vector<double> bestTx(sizeMdRef, 0);
408  std::vector<double> bestTy(sizeMdRef, 0);
409  std::vector<double> bestPsi(sizeMdRef, 0);
410 
411  MultidimArray<double> ccMatrixRot;
412  MultidimArray<double> ccVectorRot;
413 
414  // loop over all reference images. Screening of possible "good" references
415  for (int k = 0; k < sizeMdRef; ++k) {
416  // computing relative rotation and shift
417  ccMatrix(MDaInFMs_polarF, vecMDaRefFMs_polarF[k], ccMatrixRot, ccMatrixProcessImageTransformer);
418  maxByColumn(ccMatrixRot, ccVectorRot);
419  peaksFound = 0;
420  std::vector<double> cand(maxAccepted, 0.);
421  psiCandidates(ccVectorRot, cand, XSIZE(ccMatrixRot));
422  bestCand(MDaIn, MDaInF, vecMDaRef[k], cand, psi, Tx, Ty, cc_coeff);
423  // all results are storage for posterior partial_sort
424  Idx[k] = k; // for sorting
425  VEC_ELEM(ccvec,k) = cc_coeff;
426  bestTx[k] = Tx;
427  bestTy[k] = Ty;
428  bestPsi[k] = psi;
429  }
430 
431  // variables for second loop. Selection of "best" reference image
432  std::vector<double> bestTx2(sizeMdRef, 0.);
433  std::vector<double> bestTy2(sizeMdRef, 0.);
434  std::vector<double> bestPsi2(sizeMdRef, 0.);
435 
436  MultidimArray<double> &MDaInAux = ImgIn();
437  MDaInAux.setXmippOrigin();
438  MultidimArray<double> mCurrentImageAligned;
439  double corr, scale;
440  bool flip;
441 
442  double minval, maxval;
443  ccvec.computeMinMax(minval, maxval);
444  double thres = 0.;
445  if (SL.symsNo()<=4)
446  thres = maxval - (maxval - minval) / 3.;
447  else
448  thres = maxval - (maxval - minval) / 2.;
449 
450  // loop over "good" reference images
451  for(int k = 0; k < sizeMdRef; ++k) {
452  if(VEC_ELEM(ccvec,k)>thres){
453  // find rotation and shift using alignImages
455  mCurrentImageAligned = MDaInAux;
456  mCurrentImageAligned.setXmippOrigin();
457  corr = alignImages(vecMDaRef[k], mCurrentImageAligned, M, xmipp_transformation::DONT_WRAP);
458  M = M.inv();
459  transformationMatrix2Parameters2D(M, flip, scale, Tx, Ty, psi);
460 
461  if (maxShift>0 && (fabs(Tx)>maxShift || fabs(Ty)>maxShift))
462  corr /= 3;
463 
464  VEC_ELEM(ccvec, k) = corr;
465  bestTx2[k] = Tx;
466  bestTy2[k] = Ty;
467  bestPsi2[k] = psi;
468 
469  }
470  else{
471  bestTx2[k] = bestTx[k];
472  bestTy2[k] = bestTy[k];
473  bestPsi2[k] = bestPsi[k];
474  }
475  }
476 
477  // === Graph Filter Process after best reference selection ========
478  Matrix1D<double> ccvec_filt;
479  graphFourierFilter(ccvec,ccvec_filt);
480 
481  // choose best of the candidates after 2nd loop
482  int idx = ccvec.maxIndex();
483 
484  // choose best candidate direction from graph filtered ccvect signal
485  int idxfilt = ccvec_filt.maxIndex();
486 
487  // angular distance between this two directions
488  Matrix1D<double> dirj;
489  Matrix1D<double> dirjp;
490  double sphericalDistance= angDistance(idx, idxfilt, dirj, dirjp);
491 
492  // set output alignment parameters values
493  double rotRef = referenceRot.at(idx);
494  double tiltRef = referenceTilt.at(idx);
495  double shiftX = bestTx2[idx];
496  double shiftY = bestTy2[idx];
497  double anglePsi = bestPsi2[idx];
498  corr = ccvec[idx];
499 
500  //save metadata of images with angles
501  rowOut.setValue(MDL_IMAGE, fnImgOut);
502  rowOut.setValue(MDL_ENABLED, 1);
503  rowOut.setValue(MDL_MAXCC, corr);
504  rowOut.setValue(MDL_ANGLE_ROT, rotRef);
505  rowOut.setValue(MDL_ANGLE_TILT, tiltRef);
506  rowOut.setValue(MDL_ANGLE_PSI, realWRAP(anglePsi, -180., 180.));
507  rowOut.setValue(MDL_SHIFT_X, -shiftX);
508  rowOut.setValue(MDL_SHIFT_Y, -shiftY);
509  rowOut.setValue(MDL_WEIGHT, 1.);
510  rowOut.setValue(MDL_WEIGHT_SIGNIFICANT, 1.);
511  rowOut.setValue(MDL_GRAPH_DISTANCE2MAX, sphericalDistance);
512 
513  // validate angular assignment
514  validateAssignment(idx, idxfilt, rotRef, tiltRef, rowIn, rowOut, MDaIn, dirjp);
515 }
Rotation angle of an image (double,degrees)
#define VEC_ELEM(v, i)
Definition: matrix1d.h:245
void transformationMatrix2Parameters2D(const Matrix2D< T > &A, bool &flip, T &scale, T &shiftX, T &shiftY, T &psi)
double alignImages(const MultidimArray< double > &Iref, const AlignmentTransforms &IrefTransforms, MultidimArray< double > &I, Matrix2D< double > &M, bool wrap, AlignmentAux &aux, CorrelationAux &aux2, RotationalCorrelationAux &aux3)
Definition: filters.cpp:2047
void computeMinMax(T &minval, T &maxval) const
Definition: matrix1d.cpp:571
Distance to graph filtered max.
Tilting angle of an image (double,degrees)
Shift for the image in the X axis (double)
void inv(Matrix2D< T > &result) const
Definition: matrix2d.cpp:663
Special label to be used when gathering MDs in MpiMetadataPrograms.
int symsNo() const
Definition: symmetries.h:268
Is this image enabled? (int [-1 or 1])
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
int maxIndex() const
Definition: matrix1d.cpp:610
Weight due to Angular significance.
void getCompleteFourier(T &V)
Definition: xmipp_fftw.h:234
#define XSIZE(v)
Maximum cross-correlation for the image (double)
void initZeros()
Definition: matrix1d.h:592
void FourierTransform(T &v, T1 &V, bool getCopy=true)
Definition: xmipp_fftw.h:166
void setValue(MDLabel label, const T &d, bool addLabel=true)
double psi(const double x)
#define realWRAP(x, x0, xF)
Definition: xmipp_macros.h:304
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
Shift for the image in the Y axis (double)
void FFT_magnitude(const MultidimArray< std::complex< double > > &v, MultidimArray< double > &mag)
Definition: xmipp_fftw.cpp:393
Name of an image (std::string)
< Score 4 for volumes

◆ readParams()

void ProgAngularAssignmentMag::readParams ( )
overridevirtual

Function in which each program will read parameters that it need. If some error occurs the usage will be printed out.

Reimplemented from XmippMetadataProgram.

Definition at line 65 of file angular_assignment_mag.cpp.

65  {
67  fnRef = getParam("-ref");
68  fnDir = getParam("-odir");
69  sampling = getDoubleParam("-sampling");
70  angStep= getDoubleParam("-angleStep");
72  fnSym = getParam("--sym");
73  maxShift = getDoubleParam("--maxShift");
74  inputReference_volume = getParam("--refVol");
75  useForValidation=checkParam("--useForValidation");
76  threads = getIntParam("--thr");
77  threadPool.resize(threads);
78  transformersForImages.resize(threads);
79  ccMatrixBestCandidTransformers.resize(threads);
80  ccMatrixShifts.resize(threads);
81 }
double getDoubleParam(const char *param, int arg=0)
void resize(int nThreads)
Definition: ctpl.h:70
const char * getParam(const char *param, int arg=0)
#define sampling
bool checkParam(const char *param)
int getIntParam(const char *param, int arg=0)

◆ show()

void ProgAngularAssignmentMag::show ( ) const
overridevirtual

Show parameters

Reimplemented from XmippProgram.

Definition at line 84 of file angular_assignment_mag.cpp.

84  {
85  if (verbose > 0) {
86  printf("%d reference images of %d x %d\n",int(sizeMdRef),int(Xdim),int(Ydim));
87  printf("%d exp images of %d x %d in this group\n", int(sizeMdIn),int(Xdim), int(Ydim));
88  std::cout << "Sampling: " << sampling << std::endl;
89  std::cout << "Angular step: " << angStep << std::endl;
90  std::cout << "Maximum shift: " << maxShift << std::endl;
91  std::cout << "threads: " << threads << std::endl;
92  if(useForValidation){
93  std::cout << "ref vol size: " << refXdim <<" x "<< refYdim <<" x "<< refZdim << std::endl;
94  std::cout << "useForValidation : " << useForValidation << std::endl;
95  }
97  std::cout << "Input references: " << fnRef << std::endl;
98  }
99 }
#define sampling
int verbose
Verbosity level.
void show() const override

◆ synchronize()

virtual void ProgAngularAssignmentMag::synchronize ( )
inlinevirtual

Synchronize with other processors.

Reimplemented in MpiProgAngularAssignmentMag.

Definition at line 64 of file angular_assignment_mag.h.

64 {}

Member Data Documentation

◆ Nprocessors

size_t ProgAngularAssignmentMag::Nprocessors

Definition at line 67 of file angular_assignment_mag.h.

◆ rank

size_t ProgAngularAssignmentMag::rank

Definition at line 66 of file angular_assignment_mag.h.


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