51 <<
"Input classes: " <<
fnClasses << std::endl
52 <<
"Output root: " <<
fnRoot << std::endl
53 <<
"N. reconstructions: " <<
Nrec << std::endl
54 <<
"N. samples: " <<
Nsamples << std::endl
55 <<
"Symmetry: " <<
fnSym << std::endl
56 <<
"Alpha: " <<
alpha << std::endl
63 addUsageLine(
"Produce a first volume split from a set of directional classes");
64 addParamsLine(
" -i <metadata> : Metadata with the list of directional classes with angles");
65 addParamsLine(
" [--oroot <fnroot=split>] : Rootname for the output");
66 addParamsLine(
" [--Nrec <n=100>] : Number of reconstructions");
67 addParamsLine(
" [--Nsamples <n=8>] : Number of images in each reconstruction");
69 addParamsLine(
" [--alpha <a=0.05>] : Alpha for the generation of the two separated volumes");
81 std::cerr <<
"Reconstructing average" << std::endl;
83 int retval=system(command.c_str());
86 Vavg().setXmippOrigin();
95 command=
formatString(
"xmipp_reconstruct_fourier -i %s -o %s --max_resolution 0.25 -v 0",fnSubset.c_str(),fnSubsetVol.c_str());
99 std::cerr <<
"Generating reconstructions from random subsets ...\n";
109 double rot, tilt,
psi, rotp, tiltp, psip;
110 for (
size_t objId : mdRec.
ids())
128 mdRec.
write(fnSubset);
131 retval=system(command.c_str());
133 V().setXmippOrigin();
160 double z1=znSorted(
int(
alpha/2*Nrec));
161 double z2=znSorted(
int((1-
alpha/2)*Nrec));
162 std::cout <<
"z1=" << z1 <<
" z2=" << z2 << std::endl;
180 command=
"xmipp_volume_align --i1 "+
fnRoot+
"_v1.vol --i2 "+
fnRoot+
"_v2mirrored.vol --rot 0 360 15 --tilt 0 360 15 --psi 0 360 15 --apply";
181 std::cout << command << std::endl;
182 int ok=system(command.c_str());
183 command=
"xmipp_volume_align --i1 "+fnRoot+
"_v1.vol --i2 "+fnRoot+
"_v2mirrored.vol --local --apply";
184 std::cout << command << std::endl;
185 ok=system(command.c_str());
186 V2.
read(fnRoot+
"_v2mirrored.vol");
188 std::cout <<
"Correlation unmirrored: " << corr << std::endl;
189 std::cout <<
"Correlation mirrored: " << corrM << std::endl;
191 copyImage(fnRoot+
"_v2mirrored.vol",fnRoot+
"_v2.vol");
194 V2.
read(fnRoot+
"_v2.vol");
195 V1().setXmippOrigin();
196 V2().setXmippOrigin();
199 Vdiff.
write(fnRoot+
"_pc1.vol");
void init_progress_bar(long total)
void volumeToVector(const MultidimArray< double > &V, MultidimArray< double > &v)
void updateWithNewVolume(const MultidimArray< double > &V)
Update with new volume.
double getDoubleParam(const char *param, int arg=0)
void getMatrices(int i, Matrix2D< double > &L, Matrix2D< double > &R, bool homogeneous=true) const
void sort(MultidimArray< T > &result) const
void copyImage(const FileName &source, const FileName &target)
void resizeNoCopy(const MultidimArray< T1 > &v)
void addVector(MultidimArray< double > &y)
int readSymmetryFile(FileName fn_sym, double accuracy=SYM_ACCURACY)
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)
double correlationIndex(const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > *mask=NULL, MultidimArray< double > *Contributions=NULL)
void Euler_apply_transf(const Matrix2D< double > &L, const Matrix2D< double > &R, double rot, double tilt, double psi, double &newrot, double &newtilt, double &newpsi)
MultidimArray< double > v
static void defineParams(XmippProgram *program, int allowed_data_types=ALL_KINDS, const char *prefix=nullptr, const char *comment=nullptr, bool moreOptions=false)
void vectorToVolume(const MultidimArray< double > &v, MultidimArray< double > &V)
const char * getParam(const char *param, int arg=0)
double getCurrentProjection()
Get current projection.
void progress_bar(long rlen)
#define FOR_ALL_DIRECT_ELEMENTS_IN_MULTIDIMARRAY(v)
#define DIRECT_MULTIDIM_ELEM(v, n)
void readParams(XmippProgram *program)
int verbose
Verbosity level.
void defineParams()
Define parameters.
MultidimArray< double > ysum
void generate_mask(bool apply_geo=false)
#define BINARY_CIRCULAR_MASK
double psi(const double x)
String formatString(const char *format,...)
void readParams()
Read argument from command line.
bool checkParam(const char *param)
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)
void initZeros(const MultidimArray< T1 > &op)
const MultidimArray< int > & get_binary_mask() const
int getIntParam(const char *param, int arg=0)
void addParamsLine(const String &line)
MultidimArray< double > c1