33 defaultComments[
"-i"].addComment(
"Metadata file with input volumes (and rotations/shifts)");
36 addUsageLine(
"Extract subvolumes of the asymmetric parts of each subtomogram");
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)");
48 addParamsLine(
"[--mindist <distance=-1>] : Minimum distance between subvolume centers, useful to avoid repetition of subvolumes place at simmetry axis");
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");
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);
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);
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);
73 addExampleLine(
"+++The format of the input and output files is as described for the ml_tomo program.",
false);
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);
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");
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);
90 addExampleLine(
"+++ xmipp_extract_subvolume -doc align/mltomo_1deg_it000001.doc -center 0 0 59 -size 21 -sym i3 -o vertices ",
false);
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);
99 addExampleLine(
"+++ xmipp_ml_tomo -i vertices.sel -doc vertices.doc -dont_align -keep_angles -missing wedges.doc -nref 4 -reg0 5 -iter 25");
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);
128 std::cerr <<
"start show" <<std::endl;
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;
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;
149 std::cerr <<
"end show" <<std::endl;
157 std::cerr<<
"Start produceSideInfo"<<std::endl;
182 for (
int isym = 0; isym <
SL.
symsNo(); isym++)
207 for (
int isym = 0; isym <
SL.
symsNo(); isym++)
211 } std::cerr<<
"End produceSideInfo"<<std::endl;
229 std::cerr<<
"Start processImages"<<std::endl;
247 vol().setXmippOrigin();
256 size_t image_num = 0;
278 else if (!
oroot.empty())
338 DFout.
setComment(
"shift keeps the center of the box in the original virus");
346 std::cerr<<
"end processImages"<<std::endl;
double getDoubleParam(const char *param, int arg=0)
void getMatrices(int i, Matrix2D< double > &L, Matrix2D< double > &R, bool homogeneous=true) const
FileName removeLastExtension() const
#define REPORT_ERROR(nerr, ErrormMsg)
FileName removeFileFormat() const
void Euler_angles2matrix(T alpha, T beta, T gamma, Matrix2D< T > &A, bool homogeneous)
void sqrt(Image< double > &op)
FileName removePrefixNumber() const
FileName addExtension(const String &ext) const
int readSymmetryFile(FileName fn_sym, double accuracy=SYM_ACCURACY)
FileName insertBeforeExtension(const String &str) const
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)
bool isSymmetryGroup(FileName fn_sym, int &pgGroup, int &pgOrder)
void compose(const String &str, const size_t no, const String &ext="")
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)
Matrix1D< T > transpose() const
void resizeNoCopy(int Ydim, int Xdim)
FileName afterLastOf(const String &str) const
String getExtension() const
T & getValue(MDLabel label)
const char * getParam(const char *param, int arg=0)
void transpose(double *array, int size)
void resize(size_t Xdim, bool copy=true)
void addExampleLine(const char *example, bool verbatim=true)
int verbose
Verbosity level.
#define M3x3_BY_V3x1(a, M, b)
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)
#define FIRST_XMIPP_INDEX(size)
void resizeNoCopy(int Xdim)
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false, int mode=WRITE_READONLY)
void addUsageLine(const char *line, bool verbatim=false)
#define LAST_XMIPP_INDEX(size)
int getIntParam(const char *param, int arg=0)
FileName getBaseName() const
void resize(size_t Ydim, size_t Xdim, bool noCopy=false)
void addParamsLine(const String &line)
#define SPEED_UP_temps012
std::map< String, CommentList > defaultComments