37 addUsageLine(
"Compute the deformation that properly fits two volumes using spherical harmonics");
40 addParamsLine(
" [-o <image=\"\">] : Output correlation image");
41 addParamsLine(
" [--degstep <d=5.0>] : Degrees step size for rot and tilt angles");
42 addParamsLine(
" [--thr <N=-1>] : Maximal number of the processing CPU threads");
43 addExampleLine(
"xmipp_compare_views -v1 vol1.vol -v2 vol2.vol -o corr_img.xmp");
58 V1().setXmippOrigin();
60 V2().setXmippOrigin();
67 tilt_v.resize(size_tlt + 1);
68 rot_v.resize(size_rot + 1);
69 CorrImg().initZeros(size_rot + 1, size_tlt + 1);
79 m_threadPool.
resize(threads);
87 <<
"First volume: " <<
fnVol1 << std::endl
88 <<
"Second volume: " <<
fnVol2 << std::endl
89 <<
"Output image: " <<
fnImgOut << std::endl
90 <<
"Degree step: " <<
degstep << std::endl
103 int size_x =
XSIZE(mV1);
104 int size_y =
YSIZE(mV1);
116 auto futures = std::vector<std::future<void>>();
117 futures.reserve(
V1().zdim);
119 auto routine = [
this](
int thrId,
int i) {
125 futures.emplace_back(m_threadPool.
push(routine,
i));
128 for (
auto &
f : futures) {
double getDoubleParam(const char *param, int arg=0)
Image< double > V1
Images.
auto push(F &&f, Rest &&... rest) -> std::future< decltype(f(0, rest...))>
#define DIRECT_A2D_ELEM(v, i, j)
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)
FileName fnImgOut
Output corelation image.
static unsigned findCores()
void resize(int nThreads)
void computeCorrImage(int i)
Compute corr image.
const char * getParam(const char *param, int arg=0)
std::vector< double > rot_v
void defineParams()
Define params.
void addExampleLine(const char *example, bool verbatim=true)
void projectVolume(FourierProjector &projector, Projection &P, int Ydim, int Xdim, double rot, double tilt, double psi, const MultidimArray< double > *ctf)
FileName fnVol1
Volumes to compare.
int verbose
Verbosity level.
std::vector< double > tilt_v
Rot and tilt vectors.
double degstep
Degree step.
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)
int getIntParam(const char *param, int arg=0)
void addParamsLine(const String &line)
void readParams()
Read arguments from command line.