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

#include <tomo_extract_subvolume.h>

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

Public Member Functions

void defineParams ()
 Define the arguments accepted. More...
 
void readParams ()
 Read arguments from command line. More...
 
void show ()
 Show. More...
 
void processImage (const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
 
void postProcess ()
 
void preProcess ()
 
- 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

FileName fn_doc
 
FileName fn_root
 
FileName fn_sym
 
FileName fn_missing
 
FileName fn_mask
 
FileName fn_aux
 
int size
 
Matrix1D< double > center_ref
 
std::vector< Matrix1D< double > > centers_subvolumes
 
std::vector< Matrix2D< double > > rotations_subvolumes
 
int nr_exp_images
 
int nr_output_volumes
 
MetaDataVec DFout
 
double mindist
 
int symmetry
 
int sym_order
 
SymList SL
 
Image< double > vol
 
Image< double > volout
 
Matrix1D< double > center
 
Matrix1D< double > doccenter
 
Matrix2D< double > A
 
Matrix2D< double > R
 
Matrix2D< double > I
 
double rot
 
double tilt
 
double psi
 
double rotp
 
double tiltp
 
double psip
 
int x0
 
int xF
 
- 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

tomo_extract_subvolume parameters.

Definition at line 49 of file tomo_extract_subvolume.h.

Member Function Documentation

◆ defineParams()

void ProgTomoExtractSubvolume::defineParams ( )
virtual

Define the arguments accepted.

Reimplemented from XmippMetadataProgram.

Reimplemented in BasicMpiMetadataProgram< ProgTomoExtractSubvolume >.

Definition at line 31 of file tomo_extract_subvolume.cpp.

32 {
33  defaultComments["-i"].addComment("Metadata file with input volumes (and rotations/shifts)");
34 
36  addUsageLine("Extract subvolumes of the asymmetric parts of each subtomogram");
37 
38  addUsageLine("+++This program works closely together with the ml_tomo program, which is used to align");
39  addUsageLine("+++ (and classify) a series of subtomograms. Now, if each subtomogram contains some sort");
40  addUsageLine("+++ of (pseudo-) symmetry, tomo_extract_subvolume can be used to extract subvolumes of the");
41  addUsageLine("+++ asymmetric parts of each subtomogram. The metadata file that is output by this program orients");
42  addUsageLine("+++ each subvolume and its missing wedge in the correct orientation, so that it can be fed");
43  addUsageLine("+++ directly back into ml_tomo. There, the sub-subtomograms can be further aligned and/or classified");
44  addParamsLine("[--oroot <rootname=\"\">]: Rootname for output stacks of subvolumes");
45  addParamsLine("[-o <filename=\"\">] : Name of output metadata (\"oroot\".xmd by default)");
46  addParamsLine("--sym <sym=\"c1\"> : Symmetry group");
47  addParamsLine("--size <dim> : size output subvolumes");
48  addParamsLine("[--mindist <distance=-1>] : Minimum distance between subvolume centers, useful to avoid repetition of subvolumes place at simmetry axis");
49  addParamsLine(" : If set to -1 minsdist will be size/4");
50  addParamsLine("--center <x> <y> <z> : position of center of subvolume to be extracted");
51  addExampleLine("Extract 12 vertices (subvolumes) in boxes of size 21x21x21 pixels from each subtomogram in the data set: ", false);
52  addExampleLine("xmipp_extract_subvolume -i align/mltomo_1deg_it000001.doc -center 0 0 59 -size 21 -sym i3 -o vertices");
53 
54  addExampleLine("+++Imagine we have N subtomograms of a virus particle and we have aligned them",false);
55  addExampleLine("+++ with respect to a reference structure (or we have aligned them in a reference-free manner).",false);
56  addExampleLine("+++ Then, suppose we are interested in the vertices of the virus: perhaps because we suspect",false);
57  addExampleLine("+++ that one of them is 'special': e.g. it is a portal. All we have to do is:",false);
58 
59  addExampleLine("+++* Pass the metadata of the aligned subtomograms of the ml_tomo prgram",false);
60  addExampleLine("+++* Find the x,y,z coordinates of one of the vertices in the average (reference) map",false);
61  addExampleLine("+++* Pass the (pseudo) symmetry description of the virus (icosahedral, see Symmetries)",false);
62 
63  addExampleLine("+++The program will then extract all symmetry-related vertices in each of the N aligned subtomograms.",false);
64  addExampleLine("+++Each icosahedral has 12 vertices, so if the x,y,z coordinates coincided with a vertex (with an accuracy ",false);
65  addExampleLine("+++given by the --mindist option, see below)",false);
66  addExampleLine("+++, then we will end up with 12*N sub-subtomograms. The sub-subtomograms are not rotated ",false);
67  addExampleLine("+++to avoid interpolation. Instead, the output metadata holds the correct orientations ",false);
68  addExampleLine("+++and translation for each of them to subsequently superimpose them in the ml_tomo program. ",false);
69  addExampleLine("+++Also the missing wedges of all sub-subtomograms will be treated correctly in this way. Then, in the ",false);
70  addExampleLine("+++ml_tomo program one could attempt to classify the 12*N vertices, in an attempt to 'fish out' the N ",false);
71  addExampleLine("+++supposed portal structures.",false);
72 
73  addExampleLine("+++The format of the input and output files is as described for the ml_tomo program.",false);
74 
75  addExampleLine("+++ First, lets align our set of virus subtomograms (images.sel, with missing wedges defined ",false);
76  addExampleLine("+++ in images.doc and wedges.doc, see ml_tomo for details) ",false);
77  addExampleLine("+++. We will use a known virus structure (myreference.vol) as reference and will use ",false);
78  addExampleLine("+++ maximum cross-correlation (rather than maximum likelihood) to avoid problems with absolute ",false);
79  addExampleLine("+++ greyscales and the standard deviation in the noise. ",false);
80 
81  addExampleLine("+++ ml_tomo -i images.sel -doc images.doc -ref myreference.vol --oroot align/mltomo_10deg -missing wedges.doc -iter 1 -ang 10");
82  addExampleLine("+++ ml_tomo -i images.sel -doc align/mltomo_10deg_it000001.doc -ref myreference.vol --oroot align/mltomo_5deg -missing wedges.doc -iter 1 -ang 5 -ang_search 20");
83  addExampleLine("+++ ml_tomo -i images.sel -doc align/mltomo_5deg_it000001.doc -ref myreference.vol --oroot align/mltomo_2deg -missing wedges.doc -iter 1 -ang 2 -ang_search 8");
84  addExampleLine("+++ ml_tomo -i images.sel -doc align/mltomo_2deg_it000001.doc -ref myreference.vol --oroot align/mltomo_1deg -missing wedges.doc -iter 1 -ang 1 -ang_search 3");
85 
86  addExampleLine("+++ Now, we will identify the x,y,z coordinates of the vertex in the reference structure (which has symmetry i3): ",false);
87  addExampleLine("+++ -center 0 0 59. And we will extract 12 vertices (subvolumes) in boxes of size 12x12x12 pixels ",false);
88  addExampleLine("+++ from each subtomogram in the data set: ",false);
89 
90  addExampleLine("+++ xmipp_extract_subvolume -doc align/mltomo_1deg_it000001.doc -center 0 0 59 -size 21 -sym i3 -o vertices ",false);
91 
92  addExampleLine("+++ his has generated subvolumes in the same directory as the original subtomograms. For each subtomogram 12 ",false);
93  addExampleLine("+++ subvolumes, which are named in the same way as the original subtomograms, but ending in _sub000001.vol etc. ",false);
94  addExampleLine("+++ The orientations and translations are in a file called vertices.doc, the selection file is called vertices.sel. ",false);
95  addExampleLine("+++ These files are already in the correct format for the ml_tomo program. Therefore, classifying the vertices into ",false);
96  addExampleLine("+++ 4 classes using ML is now straightforward (see ml_tomo for details again) ",false);
97  addExampleLine("+++ : ",false);
98 
99  addExampleLine("+++ xmipp_ml_tomo -i vertices.sel -doc vertices.doc -dont_align -keep_angles -missing wedges.doc -nref 4 -reg0 5 -iter 25");
100 
101  addExampleLine("+++ Note that the whole functionality of ml_tomo can be employed on the sub-subtomograms: alignment, ",false);
102  addExampleLine("+++ classification, local angular searches, symmetry, etc. For example, in case of the vertices, on ",false);
103  addExampleLine("+++ could apply -sym c5, and/or one could allow the vertices to re-orient slightly (with respect ",false);
104  addExampleLine("+++ to the i3 symmetry) by using -ang 5 ang_search 15. ",false);
105 }
void addExampleLine(const char *example, bool verbatim=true)
void addUsageLine(const char *line, bool verbatim=false)
void addParamsLine(const String &line)
std::map< String, CommentList > defaultComments
Definition: xmipp_program.h:83

◆ postProcess()

void ProgTomoExtractSubvolume::postProcess ( )
virtual

Reimplemented from XmippMetadataProgram.

Definition at line 349 of file tomo_extract_subvolume.cpp.

350 {}

◆ preProcess()

void ProgTomoExtractSubvolume::preProcess ( )
virtual

Reimplemented from XmippMetadataProgram.

Reimplemented in BasicMpiMetadataProgram< ProgTomoExtractSubvolume >.

Definition at line 153 of file tomo_extract_subvolume.cpp.

154 {
155  // produceSideInfo();
156 #ifdef DEBUG
157  std::cerr<<"Start produceSideInfo"<<std::endl;
158 #endif
159 
160  // //Read in Docfile
161  // DF.read(fn_doc);
162  // nr_exp_images = DF.size();
163 
164  // Setup symmetry
166  REPORT_ERROR(ERR_PARAM_INCORRECT, "tomo_extract_subvolume: Invalid symmetry " + fn_sym);
168 
169  // Check which symmetry operators give unique output points
170  centers_subvolumes.clear();
171  rotations_subvolumes.clear();
172  Matrix2D<double> L(4, 4), R(4, 4);
173  Matrix2D<double> Iref(3,3);
174  Matrix1D<double> newcenter(3), distcenter(3);
175  double dist;
176  bool is_uniq;
177  Iref.initIdentity();
178 
179  centers_subvolumes.push_back(center_ref);
180  rotations_subvolumes.push_back(Iref);
181 
182  for (int isym = 0; isym < SL.symsNo(); isym++)
183  {
184  SL.getMatrices(isym, L, R);
185  L.resize(3,3);
186  R.resize(3,3);
187  newcenter = L * (center_ref.transpose() * R).transpose();
188  is_uniq=true;
189  for (size_t i = 0; i < centers_subvolumes.size(); i++)
190  {
191  distcenter = centers_subvolumes[i] - newcenter;
192  dist = sqrt(distcenter.sum2());
193  if (dist < mindist)
194  {
195  is_uniq=false;
196  break;
197  }
198  }
199  if (is_uniq)
200  {
201  centers_subvolumes.push_back(newcenter);
202  rotations_subvolumes.push_back(R);
203  }
204  }
205 //#define DEBUG
206 #ifdef DEBUG
207  for (int isym = 0; isym < SL.symsNo(); isym++)
208  {
209  std::cerr << "centers_subvolumes" << centers_subvolumes[isym] << std::endl;
210  std::cerr << "rotations_subvolumes" << rotations_subvolumes[isym] << std::endl;
211  } std::cerr<<"End produceSideInfo"<<std::endl;
212 #endif
213 
214  center.resizeNoCopy(3);
216  A.resizeNoCopy(3,3);
217  R.resizeNoCopy(3,3);
218  I.resizeNoCopy(3,3);
219  I.initIdentity();
220 }
Parameter incorrect.
Definition: xmipp_error.h:181
void getMatrices(int i, Matrix2D< double > &L, Matrix2D< double > &R, bool homogeneous=true) const
Definition: symmetries.cpp:348
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
void sqrt(Image< double > &op)
int readSymmetryFile(FileName fn_sym, double accuracy=SYM_ACCURACY)
Definition: symmetries.cpp:33
std::vector< Matrix1D< double > > centers_subvolumes
bool isSymmetryGroup(FileName fn_sym, int &pgGroup, int &pgOrder)
Definition: symmetries.cpp:601
int symsNo() const
Definition: symmetries.h:268
#define i
Matrix1D< T > transpose() const
Definition: matrix1d.cpp:644
void resizeNoCopy(int Ydim, int Xdim)
Definition: matrix2d.h:534
void transpose(double *array, int size)
std::vector< Matrix2D< double > > rotations_subvolumes
void resizeNoCopy(int Xdim)
Definition: matrix1d.h:458
void resize(size_t Ydim, size_t Xdim, bool noCopy=false)
Definition: matrix2d.cpp:1022
void initIdentity()
Definition: matrix2d.h:673

◆ processImage()

void ProgTomoExtractSubvolume::processImage ( const FileName fnImg,
const FileName fnImgOut,
const MDRow rowIn,
MDRow rowOut 
)
virtual

Implements XmippMetadataProgram.

Definition at line 222 of file tomo_extract_subvolume.cpp.

226 {
227 
228 #ifdef DEBUG
229  std::cerr<<"Start processImages"<<std::endl;
230 #endif
231 
232  // for (int imgno=imgno_start; imgno <imgno_end; imgno++)
233  rot = rowIn.getValueOrDefault(MDL_ANGLE_ROT, 0.);
235  psi = rowIn.getValueOrDefault(MDL_ANGLE_PSI, 0.);
236 
237  double auxD;
238  rowIn.getValue(MDL_ORIGIN_X,auxD);
239  XX(doccenter) = auxD;
240  rowIn.getValue(MDL_ORIGIN_Y,auxD);
241  YY(doccenter) = auxD;
242  rowIn.getValue(MDL_ORIGIN_Z,auxD);
243  ZZ(doccenter) = auxD;
244 
245  // Read volume
246  vol.read(fnImg2);
247  vol().setXmippOrigin();
248  FileName fnImg;
249  fnImg = fnImg2.removeFileFormat().removeLastExtension();
250 
253 
254  FileName fnOutStack, fnOutMd;
255 
256  size_t image_num = 0;
257  FileName dump;
258  if (mdInSize > 1)// Other case, is a unique volume name so there is no need to add the number
259  {
260  if (oroot.empty())
261  {
262  fn_aux = fnImg.removePrefixNumber().removeLastExtension()+ "_sub";
263 
264  if (fnImg.isInStack())
265  {
266  fnImg.decompose(image_num, dump);
267  fn_aux.compose(fn_aux,image_num);
268  }
269  }
270  else if (fnImg.isInStack())
271  {
272  fnImg.decompose(image_num, dump);
273  fn_aux.compose(oroot,image_num);
274  }
275  else
276  fn_aux = oroot + "_" + fnImg.afterLastOf("/");
277  }
278  else if (!oroot.empty())
279  fn_aux = oroot;
280  else
281  fn_aux = fnImg+"_sub";
282 
283  if (mdInSize > 1)
284  {
285  if (fn_out.empty())
286  fnOutMd = fn_aux.addExtension("xmd");
287  else if (fnImg.isInStack())
288  fnOutMd.compose(fn_out.removeLastExtension(), image_num, fn_out.getExtension());
289  else
290  fnOutMd = fn_out.insertBeforeExtension("_" + fnImg.getBaseName());
291  }
292  else if (!fn_out.empty())
293  fnOutMd = fn_out;
294  else
295  fnOutMd = fn_aux.addExtension("xmd");
296 
297  // Tomo_Extract each of the unique subvolumes
298  size_t oId;
300  for (size_t i = 0; i < centers_subvolumes.size(); i++)
301  {
303 
304  // 1. rotate center
305  Euler_angles2matrix(-psi,-tilt,-rot,A,false);
307  // 2. translate center
308  center -= doccenter;
309  // 3. Apply possible non-integer center to volume
310  //translations may be non-integer
312 
313  //vol().translate(-center, volout(), DONT_WRAP);
314  //4. Window operation and write subvolume to disc
315  volout().selfWindow(x0,x0,x0,xF,xF,xF);
316  //remove type if present
317  fnOutStack.compose(i+1,fn_aux,"stk");
318  volout.write(fnOutStack);
319 
320 
321  // 5. Calculate output angles: apply symmetry rotation to rot,tilt and psi
323  oId=DFout.addObject();
324 
325  DFout.setValue(MDL_IMAGE,fnOutStack,oId);
332  }
333  // 6. Output translations will be zero because subvolumes are centered by definition
337 
338  DFout.setComment("shift keeps the center of the box in the original virus");
339  DFout.write(fnOutMd);
340  DFout.clear();
341 
342 
343 
344 #ifdef DEBUG
345 
346  std::cerr<<"end processImages"<<std::endl;
347 #endif
348 }
Rotation angle of an image (double,degrees)
FileName removeLastExtension() const
size_t mdInSize
Number of input elements.
FileName removeFileFormat() const
void Euler_angles2matrix(T alpha, T beta, T gamma, Matrix2D< T > &A, bool homogeneous)
Definition: geometry.cpp:624
Tilting angle of an image (double,degrees)
FileName removePrefixNumber() const
FileName addExtension(const String &ext) const
Shift for the image in the X axis (double)
FileName insertBeforeExtension(const String &str) const
std::vector< Matrix1D< double > > centers_subvolumes
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)
void compose(const String &str, const size_t no, const String &ext="")
Special label to be used when gathering MDs in MpiMetadataPrograms.
void write(const FileName &outFile, WriteModeMetaData mode=MD_OVERWRITE) const
auxiliary label to be used as an index (long)
void decompose(size_t &no, String &str) const
void Euler_apply_transf(const Matrix2D< double > &L, const Matrix2D< double > &R, double rot, double tilt, double psi, double &newrot, double &newtilt, double &newpsi)
Definition: geometry.cpp:1038
#define i
virtual void setComment(const String &newComment="No comment")
FileName afterLastOf(const String &str) const
String getExtension() const
void clear() override
T & getValue(MDLabel label)
#define XX(v)
Definition: matrix1d.h:85
bool setValue(const MDObject &mdValueIn, size_t id)
size_t addObject() override
Origin for the image in the Y axis (double)
std::vector< Matrix2D< double > > rotations_subvolumes
bool setValueCol(const MDObject &mdValueIn) override
#define M3x3_BY_V3x1(a, M, b)
Definition: matrix2d.h:170
#define YY(v)
Definition: matrix1d.h:93
const T & getValueOrDefault(MDLabel label, const T &def) const
void translate(PDB *pdb_original, PDB *pdb_move, unsigned num_atoms, double x0, double y0, double z0)
Definition: lib_pwk.cpp:125
#define FIRST_XMIPP_INDEX(size)
Definition: xmipp_macros.h:439
Shift for the image in the Z axis (double)
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
Origin for the image in the Z axis (double)
Shift for the image in the Y axis (double)
#define LAST_XMIPP_INDEX(size)
Definition: xmipp_macros.h:448
FileName getBaseName() const
Name of an image (std::string)
#define ZZ(v)
Definition: matrix1d.h:101
bool isInStack() const
#define SPEED_UP_temps012
Definition: xmipp_macros.h:403

◆ readParams()

void ProgTomoExtractSubvolume::readParams ( )
virtual

Read arguments from command line.

Reimplemented from XmippMetadataProgram.

Reimplemented in BasicMpiMetadataProgram< ProgTomoExtractSubvolume >.

Definition at line 107 of file tomo_extract_subvolume.cpp.

108 {
110  oroot = getParam("--oroot");
111  fn_out = getParam("-o");
112  // Read command line
113  fn_sym = getParam( "--sym");
114  center_ref.resize(3);
115  size = getIntParam("--size");
116  XX(center_ref) = getIntParam( "--center",0);
117  YY(center_ref) = getIntParam( "--center",1);
118  ZZ(center_ref) = getIntParam( "--center",2);
119  mindist = getDoubleParam("--mindist");
120  if (mindist == -1)
121  mindist = size/4.;
122 }
double getDoubleParam(const char *param, int arg=0)
const char * getParam(const char *param, int arg=0)
#define XX(v)
Definition: matrix1d.h:85
void resize(size_t Xdim, bool copy=true)
Definition: matrix1d.h:410
#define YY(v)
Definition: matrix1d.h:93
int getIntParam(const char *param, int arg=0)
#define ZZ(v)
Definition: matrix1d.h:101

◆ show()

void ProgTomoExtractSubvolume::show ( )

Show.

Definition at line 125 of file tomo_extract_subvolume.cpp.

126 {
127 #ifdef DEBUG
128  std::cerr << "start show" <<std::endl;
129 #endif
130 
131  if (verbose)
132  {
133  std::cout << " -----------------------------------------------------------------" << std::endl;
134  std::cout << " | Read more about this program in the following publication: |" << std::endl;
135  std::cout << " | Scheres ea. (2009) Structure, 17, 1563-1572 |" << std::endl;
136  std::cout << " | |" << std::endl;
137  std::cout << " | *** Please cite it if this program is of use to you! *** |" << std::endl;
138  std::cout << " -----------------------------------------------------------------" << std::endl;
139 
140  std::cout << "Input Metadata File " << fn_in << std::endl;
141  std::cout << "Output volume root " << oroot << std::endl;
142  std::cout << "Output metadata file " << fn_out << std::endl;
143  std::cout << "Coordenate center " << center_ref << std::endl;
144  std::cout << "Size subvolume " << size << std::endl;
145  std::cout << "Symmetry group " << fn_sym << std::endl;
146  std::cout << "Minimum distance between subvolumes " << mindist << std::endl;
147  }
148 #ifdef DEBUG
149  std::cerr << "end show" <<std::endl;
150 #endif
151 }
FileName fn_in
Filenames of input and output Metadata.
int verbose
Verbosity level.

Member Data Documentation

◆ A

Matrix2D<double> ProgTomoExtractSubvolume::A

Definition at line 91 of file tomo_extract_subvolume.h.

◆ center

Matrix1D<double> ProgTomoExtractSubvolume::center

Definition at line 90 of file tomo_extract_subvolume.h.

◆ center_ref

Matrix1D<double> ProgTomoExtractSubvolume::center_ref

Coordinates of the center of the subvolume in the reference

Definition at line 59 of file tomo_extract_subvolume.h.

◆ centers_subvolumes

std::vector<Matrix1D<double> > ProgTomoExtractSubvolume::centers_subvolumes

Coordinates of the unique symmetry related centers in the reference

Definition at line 62 of file tomo_extract_subvolume.h.

◆ DFout

MetaDataVec ProgTomoExtractSubvolume::DFout

Definition at line 76 of file tomo_extract_subvolume.h.

◆ doccenter

Matrix1D<double> ProgTomoExtractSubvolume::doccenter

Definition at line 90 of file tomo_extract_subvolume.h.

◆ fn_aux

FileName ProgTomoExtractSubvolume::fn_aux

Definition at line 53 of file tomo_extract_subvolume.h.

◆ fn_doc

FileName ProgTomoExtractSubvolume::fn_doc

Filenames reference selfile/image, fraction metadata & output rootname

Definition at line 53 of file tomo_extract_subvolume.h.

◆ fn_mask

FileName ProgTomoExtractSubvolume::fn_mask

Definition at line 53 of file tomo_extract_subvolume.h.

◆ fn_missing

FileName ProgTomoExtractSubvolume::fn_missing

Definition at line 53 of file tomo_extract_subvolume.h.

◆ fn_root

FileName ProgTomoExtractSubvolume::fn_root

Definition at line 53 of file tomo_extract_subvolume.h.

◆ fn_sym

FileName ProgTomoExtractSubvolume::fn_sym

Definition at line 53 of file tomo_extract_subvolume.h.

◆ I

Matrix2D<double> ProgTomoExtractSubvolume::I

Definition at line 91 of file tomo_extract_subvolume.h.

◆ mindist

double ProgTomoExtractSubvolume::mindist

Minimum distance between unique subvolumes

Definition at line 82 of file tomo_extract_subvolume.h.

◆ nr_exp_images

int ProgTomoExtractSubvolume::nr_exp_images

Number of input volumes

Definition at line 66 of file tomo_extract_subvolume.h.

◆ nr_output_volumes

int ProgTomoExtractSubvolume::nr_output_volumes

Number of subvolumes per input volume

Definition at line 69 of file tomo_extract_subvolume.h.

◆ psi

double ProgTomoExtractSubvolume::psi

Definition at line 92 of file tomo_extract_subvolume.h.

◆ psip

double ProgTomoExtractSubvolume::psip

Definition at line 92 of file tomo_extract_subvolume.h.

◆ R

Matrix2D<double> ProgTomoExtractSubvolume::R

Definition at line 91 of file tomo_extract_subvolume.h.

◆ rot

double ProgTomoExtractSubvolume::rot

Definition at line 92 of file tomo_extract_subvolume.h.

◆ rotations_subvolumes

std::vector<Matrix2D<double> > ProgTomoExtractSubvolume::rotations_subvolumes

Definition at line 63 of file tomo_extract_subvolume.h.

◆ rotp

double ProgTomoExtractSubvolume::rotp

Definition at line 92 of file tomo_extract_subvolume.h.

◆ size

int ProgTomoExtractSubvolume::size

Size of the output subvolume

Definition at line 56 of file tomo_extract_subvolume.h.

◆ SL

SymList ProgTomoExtractSubvolume::SL

Definition at line 86 of file tomo_extract_subvolume.h.

◆ sym_order

int ProgTomoExtractSubvolume::sym_order

Definition at line 85 of file tomo_extract_subvolume.h.

◆ symmetry

int ProgTomoExtractSubvolume::symmetry

Definition at line 85 of file tomo_extract_subvolume.h.

◆ tilt

double ProgTomoExtractSubvolume::tilt

Definition at line 92 of file tomo_extract_subvolume.h.

◆ tiltp

double ProgTomoExtractSubvolume::tiltp

Definition at line 92 of file tomo_extract_subvolume.h.

◆ vol

Image<double> ProgTomoExtractSubvolume::vol

Definition at line 89 of file tomo_extract_subvolume.h.

◆ volout

Image<double> ProgTomoExtractSubvolume::volout

Definition at line 89 of file tomo_extract_subvolume.h.

◆ x0

int ProgTomoExtractSubvolume::x0

Definition at line 93 of file tomo_extract_subvolume.h.

◆ xF

int ProgTomoExtractSubvolume::xF

Definition at line 93 of file tomo_extract_subvolume.h.


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