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

CTFGroup program class. More...

#include <ctf_group.h>

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

Public Member Functions

void readParams ()
 
void defineParams ()
 
void show ()
 
void usage ()
 
bool isIsotropic (CTFDescription &ctf)
 
void produceSideInfo ()
 
void autoRun ()
 
void manualRun ()
 
void simpleRun ()
 
void writeOutputToDisc ()
 
void run ()
 
- 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)
 
virtual void initComments ()
 
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 show () 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

FileName fn_ctfdat
 Filenames. More...
 
FileName fn_root
 
FileName fn_split
 
FileName format
 
double max_error
 Maximum allowed error. More...
 
double resol_error
 Resolution for maximum allowed error (in dig. freq.) More...
 
int iresol_error
 Resolution for maximum allowed error (in pixels) More...
 
double pixel_size
 
bool phase_flipped
 Flag for phase-flipped data. More...
 
size_t dim
 
size_t xpaddim
 
size_t ypaddim
 
size_t paddim
 
size_t ctfxpaddim
 
double pad
 
bool do_auto
 
bool do_discard_anisotropy
 
bool do_wiener
 Flag for calculating Wiener filters. More...
 
double wiener_constant
 Wiener filter constant. More...
 
bool replaceSampling
 Replace ctf.param file sampling rate by this. More...
 
double samplingRate
 New ctf sampling rate. More...
 
int simpleBins
 Simple algorithm. More...
 
bool do1Dctf
 
double memory
 Available memory, set mmap to on if more memory is needed. More...
 
bool mmapOn
 do not use ram but map data to a file More...
 
MultidimArray< double > Mwien
 Matrix with denominator term of Wiener filter. More...
 
MultidimArray< double > diff
 auxiliary matrices to speed up process More...
 
MultidimArray< int > dd
 
MultidimArray< double > mics_ctf2d
 
std::vector< double > mics_defocus
 
MetaDataDb ImagesMD
 
MetaDataDb sortedCtfMD
 
std::vector< std::vector< int > > pointer_group2mic
 
std::vector< MDLabelgroupbyLabels
 
- Public Attributes inherited from XmippProgram
bool doRun
 
bool runWithoutArgs
 
int verbose
 Verbosity level. More...
 
int debug
 

Additional Inherited Members

- Protected Member Functions inherited from XmippProgram
void defineCommons ()
 
- 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

CTFGroup program class.

Definition at line 40 of file ctf_group.h.

Member Function Documentation

◆ autoRun()

void ProgCtfGroup::autoRun ( )

Produce the CTF groups automatically

Definition at line 420 of file ctf_group.cpp.

421 {
422  double diff=0.;
423  long int ctfMdSize=sortedCtfMD.size();
424  int c = XMIPP_MAX(1, ctfMdSize / 60);
425  int counter=0;
426  bool newgroup;
427 
428  //size_t id;
429  size_t orderOut, orderIn;
430  int defocusGroup;
431  int groupNumber = 1;
432  std::vector<size_t> vectorID;
433  sortedCtfMD.findObjects(vectorID);
435  //iterate
436  std::vector<size_t>::iterator itOut;
437  std::vector<size_t>::iterator itIn;
438  size_t begin=vectorID.at(0);
439  sortedCtfMD.setValue(MDL_DEFGROUP,groupNumber,begin);
440 
441  if (verbose!=0)
442  {
443  std::cout << "\nCompute differences between CTFs" <<std::endl;
444  init_progress_bar(ctfMdSize);
445  }
446 
447  for ( itOut=vectorID.begin()+1 ; itOut < vectorID.end(); itOut++ )
448  {
449  counter++;
450  newgroup = true;
451  sortedCtfMD.getValue(MDL_DEFGROUP,defocusGroup,*itOut);
452  if(defocusGroup!=-1)
453  continue;
454  sortedCtfMD.getValue(MDL_ORDER,orderOut,*itOut);//index in mics_ctf2d array
455  for ( itIn=vectorID.begin() ; itIn < itOut; itIn++ )
456  {
457  sortedCtfMD.getValue(MDL_ORDER,orderIn,*itIn);//index in mics_ctf2d array
458  for (int iresol=0; iresol<=iresol_error; iresol++)
459  {
460  //NZYX_ELEM(mics_ctf2d, orderIn, 1, 1, iresol);
461  diff = fabs( NZYX_ELEM(mics_ctf2d, orderIn, 0, 0, iresol) -
462  NZYX_ELEM(mics_ctf2d, orderOut, 0, 0, iresol) );
463  if (diff > max_error)
464  {
465  break;
466  }
467  }
468  if (diff < max_error)
469  {
470  newgroup=false;
471  break;
472  }
473  }
474  if(newgroup)
475  {
476  groupNumber++;
477 
478  }
479  sortedCtfMD.setValue(MDL_DEFGROUP,groupNumber,*itOut);
480  if (counter % c == 0 && verbose!=0)
481  progress_bar(counter);
482  }
483 
484  progress_bar(ctfMdSize);
485 }
void init_progress_bar(long total)
#define XMIPP_MAX(x, y)
Definition: xmipp_macros.h:193
MultidimArray< double > mics_ctf2d
Definition: ctf_group.h:108
doublereal * c
void findObjects(std::vector< size_t > &objectsOut, const MDQuery &query) const override
bool getValue(MDObject &mdValueOut, size_t id) const override
double max_error
Maximum allowed error.
Definition: ctf_group.h:48
MetaDataDb sortedCtfMD
Definition: ctf_group.h:117
Defocus group.
void progress_bar(long rlen)
int verbose
Verbosity level.
MultidimArray< double > diff
auxiliary matrices to speed up process
Definition: ctf_group.h:103
#define NZYX_ELEM(v, l, k, i, j)
size_t size() const override
bool setValue(const MDObject &mdValueIn, size_t id) override
Definition: metadata_db.cpp:90
bool setValueCol(const MDObject &mdValueIn) override
int iresol_error
Resolution for maximum allowed error (in pixels)
Definition: ctf_group.h:54

◆ defineParams()

void ProgCtfGroup::defineParams ( )
virtual

Define parameters.

Reimplemented from XmippProgram.

Definition at line 116 of file ctf_group.cpp.

117 {
118  addUsageLine("Generate CTF (or defocus) groups from a single CTFdat file.");
119  addUsageLine("+The automated mode groups all images with absolute difference in");
120  addUsageLine("+CTF-values up to a given resolution below a given threshold.");
121  addUsageLine("+For example the example bellow groups all images together with");
122  addUsageLine("+absolute CTF differences smaller than 0.5 up to 15 Angstroms resolution).");
123  addUsageLine("+A complementary manual mode allows to combine different groups or to split)");
124  addUsageLine("+groups up even further.");
125  addExampleLine("Example of use: Sample using automated mode (resolution = 15 Ang.)",false);
126  addExampleLine(" xmipp_ctf_group --ctfdat all_images_new.ctfdat -o CtfGroupsNew/ctfAuto --wiener --wc -1 --pad 2 --phase_flipped --error 0.5 --resol 15 ");
127  addExampleLine("Example of use: Sample using manual mode (after manual editing of ctf_group_split.doc)",false);
128  addExampleLine(" xmipp_ctf_group --ctfdat all_images_new.ctfdat -o CtfGroupsNew/ctfManual --wiener --wc -1 --pad 2 --phase_flipped --split CtfGroupsNew/ctf_group_split.doc");
129 
130 
131  // addParamsLine(" -i <sel_file> : Input selfile");
132  addParamsLine(" --ctfdat <ctfdat_file> : Input CTFdat file for all data");
133  addParamsLine(" [-o <oext=\"ctf:stk\">] : Output root name, you may force format ctf:mrc");
134  addParamsLine(" [--pad <float=1>] : Padding factor ");
135  addParamsLine(" [--phase_flipped] : Output filters for phase-flipped data");
136  addParamsLine(" [--discard_anisotropy] : Exclude anisotropic CTFs from groups");
137  addParamsLine(" [--wiener] : Also calculate Wiener filters");
138  addParamsLine(" [--sampling_rate <s>] : This sampling rate overwrites the one in the ctf.param files");
139  addParamsLine(" [--memory <double=1.>] : Available memory in Gb");
140  addParamsLine(" [--do1Dctf] : Compute Groups using 1D CTF, select this option is you have many \
141  non astismatic CTFs");
142  addParamsLine(" [--wc <float=-1>] : Wiener-filter constant (if < 0: use FREALIGN default)");
143  addParamsLine(" == MODE 1: AUTOMATED: == ");
144  addParamsLine(" [--error <float=0.5> ] : Maximum allowed error");
145  addParamsLine(" [--resol <float=-1> ] : Resol. (in Ang) for error calculation. Default (-1) = Nyquist");
146  addParamsLine(" [--simple <bins=-1>] : Simple algorithm based on bins of size (max-min)/bins");
147  addParamsLine(" == MODE 2: MANUAL: == ");
148  addParamsLine(" [--split <docfile> ] : 1-column docfile with defocus values where to split the data ");
149 
150 }
void addExampleLine(const char *example, bool verbatim=true)
void addUsageLine(const char *line, bool verbatim=false)
void addParamsLine(const String &line)

◆ isIsotropic()

bool ProgCtfGroup::isIsotropic ( CTFDescription ctf)

Check anisotropy of a single CTF

Definition at line 392 of file ctf_group.cpp.

393 {
394  double cosp, sinp, ctfp, diff;
395  Matrix1D<double> freq(2);
396 
397  cosp = COSD(ctf.azimuthal_angle);
398  sinp = SIND(ctf.azimuthal_angle);
399 
400  for (double digres = 0; digres < resol_error; digres+= 0.001)
401  {
402  XX(freq) = cosp * digres;
403  YY(freq) = sinp * digres;
404  digfreq2contfreq(freq, freq, pixel_size);
405  ctf.precomputeValues(XX(freq), YY(freq));
406  ctfp = ctf.getValueAt();
407  ctf.precomputeValues(YY(freq), XX(freq));
408  diff = ABS(ctfp - ctf.getValueAt());
409  if (diff > max_error)
410  {
411  std::cout<<" Anisotropy!"<<digres<<" "<<max_error<<" "<<diff<<" "<<ctfp
412  <<" "<<ctf.getValueAt()<<std::endl;
413  return false;
414  }
415  }
416  return true;
417 }
#define SIND(x)
Definition: xmipp_macros.h:347
double max_error
Maximum allowed error.
Definition: ctf_group.h:48
double azimuthal_angle
Azimuthal angle (between X and U) in degrees.
Definition: ctf.h:832
#define XX(v)
Definition: matrix1d.h:85
double getValueAt(bool show=false) const
Compute CTF at (U,V). Continuous frequencies.
Definition: ctf.h:1050
#define ABS(x)
Definition: xmipp_macros.h:142
double resol_error
Resolution for maximum allowed error (in dig. freq.)
Definition: ctf_group.h:51
void precomputeValues(double X, double Y)
Precompute values for a given frequency.
Definition: ctf.h:1002
MultidimArray< double > diff
auxiliary matrices to speed up process
Definition: ctf_group.h:103
#define YY(v)
Definition: matrix1d.h:93
#define COSD(x)
Definition: xmipp_macros.h:329
double pixel_size
Definition: ctf_group.h:57
void digfreq2contfreq(const Matrix1D< double > &digfreq, Matrix1D< double > &contfreq, double pixel_size)
Definition: xmipp_fft.h:125

◆ manualRun()

void ProgCtfGroup::manualRun ( )

Split based onto defocus values given in a docfile

Definition at line 487 of file ctf_group.cpp.

488 {
489  MetaDataDb DF;
490  int groupNumber = 1;
491  DF.read(fn_split);
492  int counter=0;
493  DF.setValueCol(MDL_DEFGROUP,-2);
495  //#define DEBUG
496 #ifdef DEBUG
497 
498  sortedCtfMD.write("sortedCtfMD1.xmd");
499 #endif
500 #undef DEBUG
501 
502  MetaDataDb unionMD;
503  DF.unionAll(sortedCtfMD);
504  unionMD.sort(DF,MDL_CTF_DEFOCUSA,false);
505  int n = unionMD.size();
507  int c = XMIPP_MAX(1, n / 60);
508  int defGroup;
509 
510  for (size_t objId : unionMD.ids())
511  {
512  unionMD.getValue(MDL_DEFGROUP,defGroup,objId);
513  if(defGroup==-2)
514  groupNumber++;
515  else
516  unionMD.setValue(MDL_DEFGROUP,groupNumber,objId);
517  if (counter % c == 0)
518  progress_bar(counter);
519  }
520  progress_bar(n);
521  //#define DEBUG
522 #ifdef DEBUG
523 
524  unionMD.write("unionMD.xmd");
525 #endif
526 #undef DEBUG
527 
529  //#define DEBUG
530 #ifdef DEBUG
531 
532  sortedCtfMD.write("sortedCtfMD3.xmd");
533 #endif
534 #undef DEBUG
535 
536 }
void init_progress_bar(long total)
#define XMIPP_MAX(x, y)
Definition: xmipp_macros.h:193
FileName fn_split
Definition: ctf_group.h:45
doublereal * c
bool getValue(MDObject &mdValueOut, size_t id) const override
virtual IdIteratorProxy< false > ids()
MetaDataDb sortedCtfMD
Definition: ctf_group.h:117
Defocus group.
average defocus (Angtroms)
void progress_bar(long rlen)
void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const override
size_t size() const override
void importObjects(const MetaData &md, const std::vector< size_t > &objectsToAdd, bool doClear=true) override
void sort(MetaDataDb &MDin, const MDLabel sortLabel, bool asc=true, int limit=-1, int offset=0)
bool setValue(const MDObject &mdValueIn, size_t id) override
Definition: metadata_db.cpp:90
void read(const FileName &inFile, const std::vector< MDLabel > *desiredLabels=NULL, bool decomposeStack=true) override
void unionAll(const MetaDataDb &mdIn)
bool setValueCol(const MDObject &mdValueIn) override
int * n

◆ produceSideInfo()

void ProgCtfGroup::produceSideInfo ( )

Produce side information.

Definition at line 153 of file ctf_group.cpp.

154 {
155  FileName fnt_ctf,aux;
156  CTFDescription ctf;
159  size_t ydim, zdim, ndim;
160  double avgdef;
161 
163  getImageSize(ImagesMD,dim,ydim,zdim,ndim);
164  //set output format
166  if(format=="")
167  format=aux.getFileFormat();
168 
169  if ( dim != ydim )
170  REPORT_ERROR(ERR_MULTIDIM_SIZE,"Only squared images are allowed!");
171 
172  if (simpleBins>0)
173  return;
174 
176  ypaddim=1;
177  ctfxpaddim = (size_t)(sqrt(2.) * xpaddim + 1);
178  Mctf.resize(ypaddim,ctfxpaddim);
179 
180  if (do_wiener)
181  {
183  Mwien.initZeros();
184  }
185 
188  {
189  double d;
190  int ii,jj;
192  {
193  if (i <= paddim/2 )
194  ii=i;
195  else
196  ii=(paddim-i);
197 
198  if (j <= paddim/2)
199  jj=j;
200  else
201  jj=(paddim-j);
202 
203  d = sqrt(ii*ii+jj*jj);
204  auto idd = (int) d ;
205  dAij(diff, i,j)=d-idd;
206  dAij(dd, i,j)=idd;
207  }
208  }
209 
210 
211  MetaDataDb ctfMD;
213 
214  int nCTFs = ctfMD.size();
215  //how much memory do I need to store them
216  double _sizeGb = (double) ypaddim * xpaddim * sizeof(double) * nCTFs /1073741824.;
217  mmapOn = _sizeGb > memory;
220 
221  int c = XMIPP_MAX(1, nCTFs / 60);
222  init_progress_bar(nCTFs);
223 
224  //use this sampling instead of the one in the CTFparam file
225  if(replaceSampling)
226  {
228  }
229  ctf.readFromMetadataRow(ctfMD,ctfMD.firstRowId());
230 
231  //do not read directly Tm from metadata because it may be not there
232  pixel_size = ctf.Tm;
233 
234  if (do_auto)
235  {
236  if (resol_error < 0)
237  {
238  // Set to Nyquist
239  resol_error = 2. * pixel_size;
240  }
241  // Set resolution limits in dig freq:
244  // and in pixels:
245 
247  }
248 
249  //fill multiarray with ctfs
250  size_t count;
251  size_t counter=0;
252  if (verbose!=0)
253  std::cout << "\nFill multiarray with ctfs" <<std::endl;
254  for (size_t objId : ctfMD.ids())
255  {
256  ctf.readFromMetadataRow(ctfMD, objId);
257  ctf.enable_CTF = true;
258  ctf.enable_CTFnoise = false;
259  ctf.produceSideInfo();
260  if (pixel_size != ctf.Tm)
262  "Cannot mix CTFs with different sampling rates!");
263  ctf.Tm /= sqrt(2.);
264  if (!do_discard_anisotropy || isIsotropic(ctf))
265  {
266  avgdef = (ctf.DeltafU + ctf.DeltafV)/2.;
267  ctf.DeltafU = avgdef;
268  ctf.DeltafV = avgdef;
269  ctf.generateCTF(ypaddim, ctfxpaddim, ctfmask);
271  {
272  if (phase_flipped)
273  dAij(Mctf, i, j) = fabs(dAij(ctfmask, i, j).real());
274  else
275  dAij(Mctf, i, j) = dAij(ctfmask, i, j).real();
276  }
277 
278  //#define DEBUG
279 #ifdef DEBUG
280  {
281  MetaDataVec md1;
282  size_t id;
283  static int counter=0;
284 
286  {
287  id=md1.addObject();
288  md1.setValue(MDL_ORDER,(size_t)(id-1),id);
289  md1.setValue(MDL_RESOLUTION_FRC,dAij(Mctf, 0, j),id );
290  }
291  std::stringstream ss;
292  ss << counter;//add number to the stream
293  md1.write(std::string("NEW/CTF_") + ss.str());
294  counter++;
295  }
296  ctf.write("new.ctfparam");
297 #endif
298 #undef DEBUG
299  // Fill vectors
300  ctfMD.setValue(MDL_ORDER,counter, objId);
301  ctfMD.setValue(MDL_CTF_DEFOCUSA,avgdef, objId);
302  mics_ctf2d.setSlice(0,Mctf,counter++);
303  }
304  else
305  {
306  std::cout<<" Discard CTF "<<fnt_ctf<<" because of too large anisotropy"<<std::endl;
307  ctfMD.removeObject(objId);
308  }
309  if (counter % c == 0 && verbose!=0)
310  progress_bar(counter);
311  }
312  // Precalculate denominator term of the Wiener filter
313  if (do_wiener)
314  {
315 
316  if (verbose!=0)
317  std::cout << "\nPrecalculate denominator term of the Wiener filter" <<std::endl;
318 
319  double sumimg = 0.;
320  double result;
321  for (size_t objId : ctfMD.ids())
322  {
323  ctfMD.getValue(MDL_COUNT,count, objId);
324  ctfMD.getValue(MDL_ORDER,counter,objId);
325  auto dCount = (double)count;
326  sumimg += dCount;
328  {
329  //change DIRECT_N__X_ELEM by DIRECT_N_YX_ELEM if you want to process a 2D ctf
330  result = dAij(diff, i,j) * DIRECT_N__X_ELEM(mics_ctf2d, counter, dAij(dd,i,j)+1) +
331  (1.-dAij(diff, i,j)) * DIRECT_N__X_ELEM(mics_ctf2d, counter, dAij(dd,i,j));
332  dAij(Mwien,i,j) += dCount * result *result;
333 
334  }
335  //#define DEBUG
336 #ifdef DEBUG
337 
338  {
339  std::cerr << "no_micro_per_Group order " << count
340  << " " << counter
341  << " " << NZYX_ELEM(mics_ctf2d, counter, 0, 0, 141)
342  << " " << dAij(Mwien,100,100)
343  << std::endl;
344  Image<double> save;
345  save()=Mwien;
346  save.write("vienertempnew.spi");
347  std::cout << "Press any key\n";
348  char c;
349  std::cin >> c;
350  }
351 #endif
352 #undef DEBUG
353 
354  }
355  // Divide by sumimg (Wiener filter is for summing images, not averaging!)
356  //#define DEBUG
357 #ifdef DEBUG
358 
359  {
360  Image<double> save;
361  save()=Mwien;
362  save.write("vienerB.spi");
363  }
364 #endif
365 #undef DEBUG
366  Mwien /= sumimg;
367  // Add Wiener constant
368  if (wiener_constant < 0.)
369  {
370  // Use Grigorieff's default for Wiener filter constant: 10% of average over all Mwien terms
371  // Grigorieff JSB 157(1) (2006), pp 117-125
372  wiener_constant = 0.1 * Mwien.computeAvg();
373  }
375  //#define DEBUG
376 #ifdef DEBUG
377 
378  {
379  Image<double> save;
380  save()=Mwien;
381  save.write("vienerA.spi");
382  }
383 #endif
384 #undef DEBUG
385 
386  }
387  // Sort by average defocus
388  sortedCtfMD.sort(ctfMD,MDL_CTF_DEFOCUSA,false);
389 
390 }
void init_progress_bar(long total)
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
#define XMIPP_MAX(x, y)
Definition: xmipp_macros.h:193
bool phase_flipped
Flag for phase-flipped data.
Definition: ctf_group.h:60
MultidimArray< double > mics_ctf2d
Definition: ctf_group.h:108
bool do_wiener
Flag for calculating Wiener filters.
Definition: ctf_group.h:75
bool replaceSampling
Replace ctf.param file sampling rate by this.
Definition: ctf_group.h:81
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
#define FOR_ALL_DIRECT_ELEMENTS_IN_ARRAY2D(m)
doublereal * c
#define dAij(M, i, j)
void sqrt(Image< double > &op)
bool getValue(MDObject &mdValueOut, size_t id) const override
double DeltafV
Defocus in V (in Angstroms). Negative values are underfocused.
Definition: ctf.h:830
void groupCTFMetaData(const MetaDataDb &imgMd, MetaDataDb &ctfMd, std::vector< MDLabel > &groupbyLabels)
Definition: ctf.cpp:41
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
MultidimArray< double > Mwien
Matrix with denominator term of Wiener filter.
Definition: ctf_group.h:100
double wiener_constant
Wiener filter constant.
Definition: ctf_group.h:78
void write(const FileName &fn)
Definition: ctf.cpp:1275
void getImageSize(const MetaData &md, size_t &Xdim, size_t &Ydim, size_t &Zdim, size_t &Ndim, MDLabel image_label)
void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const
Incorrect MultidimArray size.
Definition: xmipp_error.h:174
virtual IdIteratorProxy< false > ids()
double memory
Available memory, set mmap to on if more memory is needed.
Definition: ctf_group.h:94
MetaDataDb ImagesMD
Definition: ctf_group.h:114
#define i
doublereal * d
double DeltafU
Global gain. By default, 1.
Definition: ctf.h:828
bool enable_CTF
Enable CTF part.
Definition: ctf.h:275
MetaDataDb sortedCtfMD
Definition: ctf_group.h:117
size_t paddim
Definition: ctf_group.h:63
Number of elements of a type (int) [this is a genereic type do not use to transfer information to ano...
FileName fn_ctfdat
Filenames.
Definition: ctf_group.h:45
bool setValue(const MDObject &mdValueIn, size_t id)
size_t addObject() override
void readFromMetadataRow(const MetaData &MD, size_t id, bool disable_if_not_K=true)
Definition: ctf.cpp:1214
void setSlice(int k, const MultidimArray< T1 > &v, size_t n=0)
average defocus (Angtroms)
void setMmap(bool mmap)
FileName format
Definition: ctf_group.h:45
bool do_discard_anisotropy
Definition: ctf_group.h:72
void progress_bar(long rlen)
double Tm
Sampling rate (A/pixel)
Definition: ctf.h:240
double resol_error
Resolution for maximum allowed error (in dig. freq.)
Definition: ctf_group.h:51
#define ROUND(x)
Definition: xmipp_macros.h:210
bool mmapOn
do not use ram but map data to a file
Definition: ctf_group.h:97
int verbose
Verbosity level.
MultidimArray< double > diff
auxiliary matrices to speed up process
Definition: ctf_group.h:103
#define NZYX_ELEM(v, l, k, i, j)
size_t size() const override
#define XMIPP_MIN(x, y)
Definition: xmipp_macros.h:181
#define j
size_t firstRowId() const override
void generateCTF(const MultidimArray< T1 > &sample_image, MultidimArray< T2 > &CTF, double Ts=-1)
Definition: ctf.h:1194
void sort(MetaDataDb &MDin, const MDLabel sortLabel, bool asc=true, int limit=-1, int offset=0)
bool do_auto
Definition: ctf_group.h:69
bool setValue(const MDObject &mdValueIn, size_t id) override
Definition: metadata_db.cpp:90
void produceSideInfo()
Produce Side information.
Definition: ctf.cpp:1392
#define DIRECT_N__X_ELEM(v, l, j)
void read(const FileName &inFile, const std::vector< MDLabel > *desiredLabels=NULL, bool decomposeStack=true) override
String getFileFormat() const
double samplingRate
New ctf sampling rate.
Definition: ctf_group.h:84
MultidimArray< int > dd
Definition: ctf_group.h:104
size_t ypaddim
Definition: ctf_group.h:63
size_t xpaddim
Definition: ctf_group.h:63
bool setValueCol(const MDObject &mdValueIn) override
void initZeros(const MultidimArray< T1 > &op)
std::vector< MDLabel > groupbyLabels
Definition: ctf_group.h:129
double computeAvg() const
bool enable_CTFnoise
Enable CTFnoise part.
Definition: ctf.h:273
bool isIsotropic(CTFDescription &ctf)
Definition: ctf_group.cpp:392
size_t ctfxpaddim
Definition: ctf_group.h:63
Incorrect value received.
Definition: xmipp_error.h:195
int simpleBins
Simple algorithm.
Definition: ctf_group.h:87
Name of an image (std::string)
double pad
Definition: ctf_group.h:66
size_t dim
Definition: ctf_group.h:63
double pixel_size
Definition: ctf_group.h:57
bool removeObject(size_t id) override
int iresol_error
Resolution for maximum allowed error (in pixels)
Definition: ctf_group.h:54
Fourier shell correlation (double)

◆ readParams()

void ProgCtfGroup::readParams ( )
virtual

Read parameters from command line.

Reimplemented from XmippProgram.

Definition at line 34 of file ctf_group.cpp.

35 {
36  // fn_sel = getParam("-i");
37  fn_ctfdat = getParam("--ctfdat");
38  fn_root = getParam("-o");
39 
42 
43  phase_flipped = checkParam("--phase_flipped");
44  do_discard_anisotropy = checkParam("--discard_anisotropy");
45  do_auto = !checkParam("--split");
46  pad = XMIPP_MAX(1., getDoubleParam("--pad"));
47  if (do_auto)
48  {
49  max_error = getDoubleParam("--error");
50  resol_error = getDoubleParam("--resol");
51  }
52  else
53  {
54  fn_split = getParam("--split");
55  }
56  do_wiener = checkParam("--wiener");
57  replaceSampling = checkParam("--sampling_rate");
58  if(replaceSampling)
59  samplingRate = getDoubleParam("--sampling_rate");
60  memory = getDoubleParam("--memory");
61  do1Dctf = checkParam("--do1Dctf");
63  simpleBins = getIntParam("--simple");
64 }
#define XMIPP_MAX(x, y)
Definition: xmipp_macros.h:193
double getDoubleParam(const char *param, int arg=0)
bool phase_flipped
Flag for phase-flipped data.
Definition: ctf_group.h:60
bool do_wiener
Flag for calculating Wiener filters.
Definition: ctf_group.h:75
bool replaceSampling
Replace ctf.param file sampling rate by this.
Definition: ctf_group.h:81
FileName removeFileFormat() const
FileName fn_split
Definition: ctf_group.h:45
double wiener_constant
Wiener filter constant.
Definition: ctf_group.h:78
double memory
Available memory, set mmap to on if more memory is needed.
Definition: ctf_group.h:94
double max_error
Maximum allowed error.
Definition: ctf_group.h:48
const char * getParam(const char *param, int arg=0)
FileName fn_ctfdat
Filenames.
Definition: ctf_group.h:45
FileName format
Definition: ctf_group.h:45
bool do_discard_anisotropy
Definition: ctf_group.h:72
double resol_error
Resolution for maximum allowed error (in dig. freq.)
Definition: ctf_group.h:51
FileName fn_root
Definition: ctf_group.h:45
bool do_auto
Definition: ctf_group.h:69
String getFileFormat() const
double samplingRate
New ctf sampling rate.
Definition: ctf_group.h:84
bool checkParam(const char *param)
bool do1Dctf
Definition: ctf_group.h:91
int getIntParam(const char *param, int arg=0)
int simpleBins
Simple algorithm.
Definition: ctf_group.h:87
double pad
Definition: ctf_group.h:66

◆ run()

void ProgCtfGroup::run ( )
virtual

Do the job

Reimplemented from XmippProgram.

Definition at line 758 of file ctf_group.cpp.

759 {
760  produceSideInfo();
761  if (simpleBins>0)
762  simpleRun();
763  else
764  {
765  if (do_auto)
766  autoRun();
767  else
768  manualRun();
770  }
771 }
void manualRun()
Definition: ctf_group.cpp:487
void autoRun()
Definition: ctf_group.cpp:420
void writeOutputToDisc()
Definition: ctf_group.cpp:538
bool do_auto
Definition: ctf_group.h:69
void simpleRun()
Definition: ctf_group.cpp:721
int simpleBins
Simple algorithm.
Definition: ctf_group.h:87
void produceSideInfo()
Definition: ctf_group.cpp:153

◆ show()

void ProgCtfGroup::show ( )

Show.

Definition at line 67 of file ctf_group.cpp.

68 {
69  std::cout << " Input ctfdat file : "<< fn_ctfdat << std::endl;
70  std::cout << " Output rootname : "<< fn_root << std::endl;
71  if (pad > 1.)
72  {
73  std::cout << " Padding factor : "<< pad << std::endl;
74  }
76  {
77  std::cout << " -> Exclude anisotropic CTFs from the groups"<<std::endl;
78  }
79  if (do_auto)
80  {
81  std::cout << " -> Using automated mode for making groups"<<std::endl;
82  std::cout << " -> With a maximum allowed error of "<<max_error
83  <<" at "<<resol_error<<" dig. freq."<<std::endl;
84  }
85  else
86  {
87  std::cout << " -> Group based on defocus values in "<<fn_split<<std::endl;
88  }
89  if (phase_flipped)
90  {
91  std::cout << " -> Assume that data are PHASE FLIPPED"<<std::endl;
92  }
93  else
94  {
95  std::cout << " -> Assume that data are NOT PHASE FLIPPED"<<std::endl;
96  }
97  if (do_wiener)
98  {
99  std::cout << " -> Also calculate Wiener filters, with constant= "<<wiener_constant<<std::endl;
100  }
101  std::cout << " Available memory (Gb) : "<< memory << std::endl;
102  if (do1Dctf)
103  {
104  std::cout << " -> compute CTF groups using 1D CTFs= "<<std::endl;
105  }
106  else
107  {
108  std::cout << " -> compute CTF groups using 2D CTFs= "<<std::endl;
109  }
110  if (simpleBins>0)
111  std::cout << "Simple algorithm: " << simpleBins << std::endl;
112  std::cout << "----------------------------------------------------------"<<std::endl;
113 }
bool phase_flipped
Flag for phase-flipped data.
Definition: ctf_group.h:60
bool do_wiener
Flag for calculating Wiener filters.
Definition: ctf_group.h:75
FileName fn_split
Definition: ctf_group.h:45
double wiener_constant
Wiener filter constant.
Definition: ctf_group.h:78
double memory
Available memory, set mmap to on if more memory is needed.
Definition: ctf_group.h:94
double max_error
Maximum allowed error.
Definition: ctf_group.h:48
FileName fn_ctfdat
Filenames.
Definition: ctf_group.h:45
bool do_discard_anisotropy
Definition: ctf_group.h:72
double resol_error
Resolution for maximum allowed error (in dig. freq.)
Definition: ctf_group.h:51
FileName fn_root
Definition: ctf_group.h:45
bool do_auto
Definition: ctf_group.h:69
bool do1Dctf
Definition: ctf_group.h:91
int simpleBins
Simple algorithm.
Definition: ctf_group.h:87
double pad
Definition: ctf_group.h:66

◆ simpleRun()

void ProgCtfGroup::simpleRun ( )

Split based on bins

Definition at line 721 of file ctf_group.cpp.

722 {
723  // Maximum and minimum defocus
724  double minDefocus=ImagesMD.getColumnMin(MDL_CTF_DEFOCUSU);
725  double maxDefocus=ImagesMD.getColumnMax(MDL_CTF_DEFOCUSU);
726  double iStepDefocus=1.0/((maxDefocus-minDefocus)/simpleBins);
727 
728  double defocus;
729  for (size_t objId : ImagesMD.ids())
730  {
731  ImagesMD.getValue(MDL_CTF_DEFOCUSU,defocus, objId);
732  int defGroup=floor((defocus-minDefocus)*iStepDefocus)+1;
733  ImagesMD.setValue(MDL_DEFGROUP,defGroup, objId);
734  }
735 
736  unlink( (fn_root+"_images.sel").c_str());
737  FileName imagesInDefoculGroup;
738  MetaDataVec auxMetaData;
739  auxMetaData.clear();
740  auxMetaData.setComment("images (particles) per defocus group, block name is defocusgroup No");
741  FileName fnGroup;
742  if (verbose>0)
743  {
744  std::cerr << "Writing defocus groups ...\n";
746  }
747  for(int i=1;i<=simpleBins+1; i++)
748  {
750  fnGroup.assign( formatString("ctfGroup%06d@%s_images.sel", i, fn_root.c_str()) );
751  auxMetaData.write( fnGroup, i > 1 ? MD_APPEND : MD_OVERWRITE);
752  if (verbose>0)
753  progress_bar(i);
754  }
756 }
void init_progress_bar(long total)
Defocus U (Angstroms)
__host__ __device__ float2 floor(const float2 v)
bool getValue(MDObject &mdValueOut, size_t id) const override
void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const
virtual IdIteratorProxy< false > ids()
MetaDataDb ImagesMD
Definition: ctf_group.h:114
#define i
virtual void setComment(const String &newComment="No comment")
void clear() override
double getColumnMin(MDLabel column)
Defocus group.
void importObjects(const MetaData &md, const std::vector< size_t > &objectsToAdd, bool doClear=true) override
void progress_bar(long rlen)
FileName fn_root
Definition: ctf_group.h:45
int verbose
Verbosity level.
bool setValue(const MDObject &mdValueIn, size_t id) override
Definition: metadata_db.cpp:90
String formatString(const char *format,...)
int simpleBins
Simple algorithm.
Definition: ctf_group.h:87
double getColumnMax(MDLabel column)

◆ usage()

void ProgCtfGroup::usage ( )

Usage.

◆ writeOutputToDisc()

void ProgCtfGroup::writeOutputToDisc ( )

Write output

Definition at line 538 of file ctf_group.cpp.

539 {
540  //(1) compute no of micrographs, no of images , minimum defocus ,maximum defocus, average defocus per ctf group
541  MetaDataDb ctfInfo,ctfImagesGroup,auxMetaData;
542 
543  const AggregateOperation MyaggregateOperations[] =
544  {
546  };
547  std::vector<AggregateOperation> aggregateOperations(MyaggregateOperations,MyaggregateOperations+5);
548 
549  const MDLabel MyoperateLabels[] =
550  {
552  };
553  std::vector<MDLabel> operateLabels(MyoperateLabels,MyoperateLabels+5);
554 
555  const MDLabel MyresultLabels[] =
556  {
558  };
559  std::vector<MDLabel> resultLabels(MyresultLabels,MyresultLabels+6);
560 
561  ctfInfo.aggregate(sortedCtfMD,aggregateOperations,operateLabels,resultLabels);
562  ctfInfo.setComment("N. of micrographs, N. of particles, min defocus, max defocus and avg defocus");
563  ctfInfo.write("groups@"+fn_root+"Info.xmd");
564  size_t numberDefGroups=ctfInfo.size();
565  MetaDataVec MD;
566  size_t idctf = MD.addObject();
567  MD.setValue(MDL_COUNT,numberDefGroups,idctf);
568  MD.setColumnFormat(false);
569  MD.write("numberGroups@"+fn_root+"Info.xmd",MD_APPEND);
570 
571  //(2)save auxiliary file for defocus split
572 
573  double maxDef,minDef;
574  auto it = ctfInfo.ids().begin();
575  size_t id1,id2,id;
576  auxMetaData.clear();
577  auxMetaData.setComment(formatString("Defocus values to split into %lu ctf groups", ctfInfo.size()));
578 
579  id1 = *it;
580  ++it;
581  const auto totalSize = ctfInfo.ids().end();
582  while (it != totalSize)
583  {
584  id2 = *it;
585  ctfInfo.getValue(MDL_MIN,minDef,id1);
586  ctfInfo.getValue(MDL_MAX,maxDef,id2);
587  id1=id2;
588 
589  id=auxMetaData.addObject();
590  auxMetaData.setValue(MDL_CTF_DEFOCUSA,(minDef+maxDef)/2.,id);
591  ++it;
592  }
593  auxMetaData.write(fn_root+"_split.doc");
594 
595 
596  //(3) make block-sel per image group
601  ctfImagesGroup.join1(ImagesMD, sortedCtfMD, MDL_CTF_MODEL, INNER );
602  else
603  {
604  ctfImagesGroup.join1(ImagesMD,
605  sortedCtfMD,
607  //ctfImagesGroup.joinNatural(ImagesMD, sortedCtfMD);
608 //#define DEBUG
609 #ifdef DEBUG
610  ImagesMD.write("/tmp/ImagesMD.sqlite");
611  sortedCtfMD.write("/tmp/sortedCtfMD.sqlite");
612  ctfImagesGroup.write("/tmp/ctfImagesGroup.sqlite");
613  ImagesMD.write("/tmp/ImagesMD.xmd");
614  sortedCtfMD.write("/tmp/sortedCtfMD.xmd");
615  ctfImagesGroup.write("/tmp/ctfImagesGroup.xmd");
616 
617 #endif
618  }
619 
620  //
621  unlink( (fn_root+"_images.sel").c_str());
622  FileName imagesInDefoculGroup;
623  auxMetaData.clear();
624  auxMetaData.setComment("images (particles) per defocus group, block name is defocusgroup No");
625  int ctfInfoSize;
626  ctfInfoSize = (int) ctfInfo.size();
627  for(int i=1;i<= ctfInfoSize; i++)
628  {
629  auxMetaData.importObjects(ctfImagesGroup,MDValueEQ(MDL_DEFGROUP,i));
630  imagesInDefoculGroup.assign( formatString("ctfGroup%06d@%s_images.sel", i, fn_root.c_str()) );
631  auxMetaData.write( imagesInDefoculGroup, i > 1 ? MD_APPEND : MD_OVERWRITE);
632  }
633 
634  //(4)create average ctf
635  int olddefGroup=-1;
636  int defGroup=-1;
637  size_t order, count;
638  double sumimg=0.;
639 
641  Image<double> Ictf2D;
642  Ictf2D.data.alias(ctf2D);
643 
644  FileName outFileNameCTF,outFileNameWIEN,outFileName;
645  outFileNameCTF = fn_root + "_ctf."+format;
646  outFileNameWIEN = fn_root + "_wien."+format;
647  if (verbose!=0)
648  {
649  std::cout << "Saving CTF Images" <<std::endl;
650  }
651  for (size_t objId : sortedCtfMD.ids())
652  {
653  sortedCtfMD.getValueOrDefault(MDL_DEFGROUP,defGroup,objId,-1);
654  if (olddefGroup<0)
655  olddefGroup=defGroup;
656  sortedCtfMD.getValue(MDL_ORDER,order,objId);
657  sortedCtfMD.getValue(MDL_COUNT,count,objId);
658  auto dCount = (double)count;
659 
660  if (defGroup != olddefGroup)
661  {
662  if (sumimg!=0)
663  {
664  ctf2D /= sumimg;
665  outFileName.compose(olddefGroup,outFileNameCTF);
666  //save CTF
667  Ictf2D.write(outFileName);
668  //save winer filter
669  if (do_wiener)
670  {
672  {
673  dAij(ctf2D,i,j) /= dAij(Mwien,i,j);
674  }
675  outFileName.compose(olddefGroup,outFileNameWIEN);
676  Ictf2D.write(outFileName);
677  }
678 
679  ctf2D.initZeros();
680  olddefGroup=defGroup;
681  sumimg=0.;
682  }
683  }
684 
685  sumimg += dCount;
687  {
688  double result;
689  //interpolate ctf point from table
690  //change DIRECT_N__X_ELEM by DIRECT_N_YX_ELEM if you want to process a 2D ctf
691 
692  result = dAij(diff, i,j) * DIRECT_N__X_ELEM(mics_ctf2d, order, dAij(dd,i,j)+1) +
693  (1.-dAij(diff, i,j)) * DIRECT_N__X_ELEM(mics_ctf2d, order, dAij(dd,i,j));
694  dAij(ctf2D,i,j) += dCount * result ;
695  }
696  }
697  //Save last CTF
698  if (defGroup == olddefGroup)
699  {
700  if (sumimg!=0)
701  {
702  ctf2D /= sumimg;
703  outFileName.compose(defGroup,outFileNameCTF);
704  //save CTF
705  Ictf2D.write(outFileName);
706  //save winer filter
707  if (do_wiener)
708  {
710  {
711  dAij(ctf2D,i,j) /= dAij(Mwien,i,j);
712  }
713  outFileName.compose(defGroup,outFileNameWIEN);
714  Ictf2D.write(outFileName);
715  }
716  }
717  }
718 
719 }
MultidimArray< double > mics_ctf2d
Definition: ctf_group.h:108
bool do_wiener
Flag for calculating Wiener filters.
Definition: ctf_group.h:75
#define FOR_ALL_DIRECT_ELEMENTS_IN_ARRAY2D(m)
Sum of elements of a given type (double) [this is a genereic type do not use to transfer information ...
#define dAij(M, i, j)
bool getValue(MDObject &mdValueOut, size_t id) const override
Maximum value (double)
void write(const FileName &name="", size_t select_img=ALL_IMAGES, bool isStack=false, int mode=WRITE_OVERWRITE, CastWriteMode castMode=CW_CAST, int _swapWrite=0)
MultidimArray< double > Mwien
Matrix with denominator term of Wiener filter.
Definition: ctf_group.h:100
void compose(const String &str, const size_t no, const String &ext="")
Name for the CTF Model (std::string)
void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const
virtual IdIteratorProxy< false > ids()
MetaDataDb ImagesMD
Definition: ctf_group.h:114
bool removeLabel(const MDLabel label) override
#define i
virtual void setComment(const String &newComment="No comment")
void aggregate(const MetaDataDb &mdIn, AggregateOperation op, MDLabel aggregateLabel, MDLabel operateLabel, MDLabel resultLabel)
MetaDataDb sortedCtfMD
Definition: ctf_group.h:117
MultidimArray< T > data
Definition: xmipp_image.h:55
Minimum value (double)
size_t paddim
Definition: ctf_group.h:63
Number of elements of a type (int) [this is a genereic type do not use to transfer information to ano...
FileName fn_ctfdat
Filenames.
Definition: ctf_group.h:45
bool setValue(const MDObject &mdValueIn, size_t id)
size_t addObject() override
size_t addObject() override
Defocus group.
average defocus (Angtroms)
FileName format
Definition: ctf_group.h:45
void clear() override
Definition: metadata_db.cpp:54
FileName fn_root
Definition: ctf_group.h:45
int verbose
Verbosity level.
void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const override
void alias(const MultidimArray< T > &m)
MultidimArray< double > diff
auxiliary matrices to speed up process
Definition: ctf_group.h:103
size_t size() const override
#define j
void importObjects(const MetaData &md, const std::vector< size_t > &objectsToAdd, bool doClear=true) override
const T getValueOrDefault(const MDLabel label, size_t id, const T &_default) const
virtual void setColumnFormat(bool column)
bool setValue(const MDObject &mdValueIn, size_t id) override
Definition: metadata_db.cpp:90
#define DIRECT_N__X_ELEM(v, l, j)
String formatString(const char *format,...)
void read(const FileName &inFile, const std::vector< MDLabel > *desiredLabels=NULL, bool decomposeStack=true) override
MultidimArray< int > dd
Definition: ctf_group.h:104
void join1(const MetaDataDb &mdInLeft, const MetaDataDb &mdInRight, const MDLabel label, JoinType type=LEFT)
average value (double)
std::vector< MDLabel > groupbyLabels
Definition: ctf_group.h:129
MDLabel
bool containsLabel(const MDLabel label) const override
Definition: metadata_db.h:305

Member Data Documentation

◆ ctfxpaddim

size_t ProgCtfGroup::ctfxpaddim

Definition at line 63 of file ctf_group.h.

◆ dd

MultidimArray<int> ProgCtfGroup::dd

Definition at line 104 of file ctf_group.h.

◆ diff

MultidimArray<double> ProgCtfGroup::diff

auxiliary matrices to speed up process

Definition at line 103 of file ctf_group.h.

◆ dim

size_t ProgCtfGroup::dim

Definition at line 63 of file ctf_group.h.

◆ do1Dctf

bool ProgCtfGroup::do1Dctf

Compute 1D CTF using avg(defocusU + defocusV)/2 as defocus. This approach speed up the computation and is recommended for very large data sets

Definition at line 91 of file ctf_group.h.

◆ do_auto

bool ProgCtfGroup::do_auto

Definition at line 69 of file ctf_group.h.

◆ do_discard_anisotropy

bool ProgCtfGroup::do_discard_anisotropy

Definition at line 72 of file ctf_group.h.

◆ do_wiener

bool ProgCtfGroup::do_wiener

Flag for calculating Wiener filters.

Definition at line 75 of file ctf_group.h.

◆ fn_ctfdat

FileName ProgCtfGroup::fn_ctfdat

Filenames.

Definition at line 45 of file ctf_group.h.

◆ fn_root

FileName ProgCtfGroup::fn_root

Definition at line 45 of file ctf_group.h.

◆ fn_split

FileName ProgCtfGroup::fn_split

Definition at line 45 of file ctf_group.h.

◆ format

FileName ProgCtfGroup::format

Definition at line 45 of file ctf_group.h.

◆ groupbyLabels

std::vector<MDLabel> ProgCtfGroup::groupbyLabels

Definition at line 129 of file ctf_group.h.

◆ ImagesMD

MetaDataDb ProgCtfGroup::ImagesMD

Definition at line 114 of file ctf_group.h.

◆ iresol_error

int ProgCtfGroup::iresol_error

Resolution for maximum allowed error (in pixels)

Definition at line 54 of file ctf_group.h.

◆ max_error

double ProgCtfGroup::max_error

Maximum allowed error.

Definition at line 48 of file ctf_group.h.

◆ memory

double ProgCtfGroup::memory

Available memory, set mmap to on if more memory is needed.

Definition at line 94 of file ctf_group.h.

◆ mics_ctf2d

MultidimArray<double> ProgCtfGroup::mics_ctf2d

Definition at line 108 of file ctf_group.h.

◆ mics_defocus

std::vector<double> ProgCtfGroup::mics_defocus

Definition at line 111 of file ctf_group.h.

◆ mmapOn

bool ProgCtfGroup::mmapOn

do not use ram but map data to a file

Definition at line 97 of file ctf_group.h.

◆ Mwien

MultidimArray<double> ProgCtfGroup::Mwien

Matrix with denominator term of Wiener filter.

Definition at line 100 of file ctf_group.h.

◆ pad

double ProgCtfGroup::pad

Definition at line 66 of file ctf_group.h.

◆ paddim

size_t ProgCtfGroup::paddim

Definition at line 63 of file ctf_group.h.

◆ phase_flipped

bool ProgCtfGroup::phase_flipped

Flag for phase-flipped data.

Definition at line 60 of file ctf_group.h.

◆ pixel_size

double ProgCtfGroup::pixel_size

Definition at line 57 of file ctf_group.h.

◆ pointer_group2mic

std::vector< std::vector <int> > ProgCtfGroup::pointer_group2mic

Definition at line 126 of file ctf_group.h.

◆ replaceSampling

bool ProgCtfGroup::replaceSampling

Replace ctf.param file sampling rate by this.

Definition at line 81 of file ctf_group.h.

◆ resol_error

double ProgCtfGroup::resol_error

Resolution for maximum allowed error (in dig. freq.)

Definition at line 51 of file ctf_group.h.

◆ samplingRate

double ProgCtfGroup::samplingRate

New ctf sampling rate.

Definition at line 84 of file ctf_group.h.

◆ simpleBins

int ProgCtfGroup::simpleBins

Simple algorithm.

Definition at line 87 of file ctf_group.h.

◆ sortedCtfMD

MetaDataDb ProgCtfGroup::sortedCtfMD

Definition at line 117 of file ctf_group.h.

◆ wiener_constant

double ProgCtfGroup::wiener_constant

Wiener filter constant.

Definition at line 78 of file ctf_group.h.

◆ xpaddim

size_t ProgCtfGroup::xpaddim

Definition at line 63 of file ctf_group.h.

◆ ypaddim

size_t ProgCtfGroup::ypaddim

Definition at line 63 of file ctf_group.h.


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