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

#include <tomo_detect_missing_wedge.h>

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

Public Member Functions

void readParams ()
 Read parameters from command line. More...
 
void produceSideInfo ()
 Produce side info. More...
 
void show () const
 Show parameters. More...
 
void defineParams ()
 Usage. More...
 
void run ()
 Run. 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)
 
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 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_vol
 Input volume. More...
 
double planeWidth
 Plane width. More...
 
double maxFreq
 Maximum frequency of the plane. More...
 
bool saveMarks
 Save marks. More...
 
bool saveMask
 Save mask. More...
 
Image< double > V
 
MultidimArray< double > * Vmag
 
double rotPos
 
double tiltPos
 
double rotNeg
 
double tiltNeg
 
- 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

Parameters for the program detecting the missing wedge

Definition at line 37 of file tomo_detect_missing_wedge.h.

Member Function Documentation

◆ defineParams()

void ProgDetectMissingWedge::defineParams ( )
virtual

Usage.

Reimplemented from XmippProgram.

Definition at line 306 of file tomo_detect_missing_wedge.cpp.

307 {
308  addUsageLine("Detect the orientation of the missing wedge in a tomogram. ");
309  addUsageLine("+For doing so it fits a couple of planes along which there is a maximum ");
310  addUsageLine("+variation between the energy of the Fourier transform on its left and ");
311  addUsageLine("+on its right. The missing wedge is coded with four angles (two for each ");
312  addUsageLine("+plane). You may also produce a mask with 1 where the missing wedge is, ");
313  addUsageLine("+and 0 where the data has been actually measured. Finally, you can also ");
314  addUsageLine("+produce a marked magnitude volume (i.e., the magnitude of the Fourier ");
315  addUsageLine("+transform where the position of the two planes have been marked). ");
316  addParamsLine(" -i <file> : Input tomogram");
317  addParamsLine(" [--maxFreq <f=0.25>] : Maximum frequency to fit the plane (normalized to 0.5)");
318  addParamsLine(" [--width <w=2>] : Width of the probe plane");
319  addParamsLine(" [--saveMarks] : Save the magnitude of the FFT with");
320  addParamsLine(" : marks showing the two planes");
321  addParamsLine(" [--saveMask] : Save a mask for the FFT of this tomogram");
322  addParamsLine(" : 1=Missing wedge, 0=non missing wedge");
323  addExampleLine("xmipp_tomo_detect_missing_wedge -i tomogram.vol");
324 }
void addExampleLine(const char *example, bool verbatim=true)
void addUsageLine(const char *line, bool verbatim=false)
void addParamsLine(const String &line)

◆ produceSideInfo()

void ProgDetectMissingWedge::produceSideInfo ( )

Produce side info.

Definition at line 281 of file tomo_detect_missing_wedge.cpp.

282 {
283  V.read(fn_vol);
284  FourierTransformer transformer;
286  transformer.FourierTransform(MULTIDIM_ARRAY(V),Vfft,false);
287  Vmag = new MultidimArray<double>();
288  Vmag->resize(Vfft);
290  (*Vmag)(k,i,j)=20*log10(abs(Vfft(k,i,j)));
291 }
void resize(size_t Ndim, size_t Zdim, size_t Ydim, size_t Xdim, bool copy=true)
#define MULTIDIM_ARRAY(v)
void abs(Image< double > &op)
MultidimArray< double > * Vmag
#define i
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
#define FOR_ALL_ELEMENTS_IN_ARRAY3D(V)
void log10(Image< double > &op)
void FourierTransform(T &v, T1 &V, bool getCopy=true)
Definition: xmipp_fftw.h:166
#define j
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
FileName fn_vol
Input volume.

◆ readParams()

void ProgDetectMissingWedge::readParams ( )
virtual

Read parameters from command line.

Reimplemented from XmippProgram.

Definition at line 271 of file tomo_detect_missing_wedge.cpp.

272 {
273  fn_vol = getParam("-i");
274  maxFreq = getDoubleParam("--maxFreq");
275  planeWidth = getDoubleParam("--width");
276  saveMarks = checkParam("--saveMarks");
277  saveMask = checkParam("--saveMask");
278 }
double getDoubleParam(const char *param, int arg=0)
double maxFreq
Maximum frequency of the plane.
const char * getParam(const char *param, int arg=0)
bool checkParam(const char *param)
FileName fn_vol
Input volume.

◆ run()

void ProgDetectMissingWedge::run ( )
virtual

Run.

Reimplemented from XmippProgram.

Definition at line 327 of file tomo_detect_missing_wedge.cpp.

328 {
329  produceSideInfo();
330  FileName fn_root=V.name().withoutExtension();
331 
333 
334  // Detect one of the planes
336 
337  auto * Vdraw = new Image<double>();
338 
339  if (saveMarks)
340  {
341  (*Vdraw)()=(*Vmag);
342 
344  1, &(*Vdraw)());
345  }
346 
347  // Detect the other plane
349 
350  if (saveMarks)
351  {
353  -1, &(*Vdraw)());
354  Vdraw->write(fn_root+"_marks.vol");
355  }
356 
357  if (saveMask)
358  {
359  Vdraw->clear();
360  drawWedge(rotPos, tiltPos, rotNeg, tiltNeg, mdaV, Vmag, &(*Vdraw)());
361  Vdraw->write(fn_root+"_mask.vol");
362  }
363 
364  std::cout << "Plane1: " << rotPos << " " << tiltPos << std::endl;
365  std::cout << "Plane2: " << rotNeg << " " << tiltNeg << std::endl;
366 
367  delete Vdraw;
368  delete Vmag;
369 }
void drawWedge(double rotPos, double tiltPos, double rotNeg, double tiltNeg, const MultidimArray< double > *V, const MultidimArray< double > *Vmag, MultidimArray< double > *Vdraw)
#define MULTIDIM_ARRAY(v)
const FileName & name() const
void lookForPlane(const MultidimArray< double > *V, const MultidimArray< double > *Vmag, double maxFreq, double planeWidth, int direction, double &rot, double &tilt, bool setPos=false, double rotPos=0, double tiltPos=0)
MultidimArray< double > * Vmag
double maxFreq
Maximum frequency of the plane.
FileName withoutExtension() const
double evaluatePlane(double rot, double tilt, const MultidimArray< double > *V, const MultidimArray< double > *Vmag, double maxFreq, double planeWidth, int direction, MultidimArray< double > *Vdraw=nullptr, bool setPos=false, double rotPos=0, double tiltPos=0)
void produceSideInfo()
Produce side info.

◆ show()

void ProgDetectMissingWedge::show ( ) const
virtual

Show parameters.

Reimplemented from XmippProgram.

Definition at line 294 of file tomo_detect_missing_wedge.cpp.

295 {
296  std::cout << "Detecting a missing wedge\n";
297  std::cout << "Input volume: " << fn_vol << std::endl
298  << "Maximum Freq.: " << maxFreq << std::endl
299  << "Plane width: " << planeWidth << std::endl
300  << "saveMarks: " << saveMarks << std::endl
301  << "saveMask: " << saveMask << std::endl
302  ;
303 }
double maxFreq
Maximum frequency of the plane.
FileName fn_vol
Input volume.

Member Data Documentation

◆ fn_vol

FileName ProgDetectMissingWedge::fn_vol

Input volume.

Definition at line 41 of file tomo_detect_missing_wedge.h.

◆ maxFreq

double ProgDetectMissingWedge::maxFreq

Maximum frequency of the plane.

Definition at line 47 of file tomo_detect_missing_wedge.h.

◆ planeWidth

double ProgDetectMissingWedge::planeWidth

Plane width.

Definition at line 44 of file tomo_detect_missing_wedge.h.

◆ rotNeg

double ProgDetectMissingWedge::rotNeg

Definition at line 65 of file tomo_detect_missing_wedge.h.

◆ rotPos

double ProgDetectMissingWedge::rotPos

Definition at line 62 of file tomo_detect_missing_wedge.h.

◆ saveMarks

bool ProgDetectMissingWedge::saveMarks

Save marks.

Definition at line 50 of file tomo_detect_missing_wedge.h.

◆ saveMask

bool ProgDetectMissingWedge::saveMask

Save mask.

Definition at line 53 of file tomo_detect_missing_wedge.h.

◆ tiltNeg

double ProgDetectMissingWedge::tiltNeg

Definition at line 65 of file tomo_detect_missing_wedge.h.

◆ tiltPos

double ProgDetectMissingWedge::tiltPos

Definition at line 62 of file tomo_detect_missing_wedge.h.

◆ V

Image<double> ProgDetectMissingWedge::V

Definition at line 56 of file tomo_detect_missing_wedge.h.

◆ Vmag

MultidimArray<double>* ProgDetectMissingWedge::Vmag

Definition at line 59 of file tomo_detect_missing_wedge.h.


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