50 <<
"Input classes: " <<
fnClasses << std::endl
51 <<
"Output root: " <<
fnRoot << std::endl
52 <<
"N. iterations: " <<
Niter << std::endl
53 <<
"Symmetry: " <<
fnSym << std::endl
60 addUsageLine(
"Produce a first volume split from a set of directional classes using K-means");
61 addParamsLine(
" -i <metadata> : Metadata with the list of directional classes with angles");
62 addParamsLine(
" [--oroot <fnroot=split>] : Rootname for the output");
65 addParamsLine(
" [--mpiCommand <mystr>] : MPI command to parallelize the reconstruction process");
73 for(
size_t i=0;
i<objIds.size();
i++){
78 mdOut.
write(fnRoot+
".xmd");
82 command=
formatString(
"xmipp_reconstruct_fourier -i %s.xmd -o %s.vol --max_resolution 0.25 --sym %s -v 0",
83 fnRoot.c_str(),fnRoot.c_str(),
fnSym.c_str());
85 command=
formatString(
" `which xmipp_mpi_reconstruct_fourier` -i %s.xmd -o %s.vol --max_resolution 0.25 --sym %s -v 0",
86 fnRoot.c_str(),fnRoot.c_str(),
fnSym.c_str());
90 int retval=system(command.c_str());
91 V.
read(fnRoot+
".vol");
101 double rot, tilt,
psi,
x,
y;
125 auto xdim = (int)
XSIZE(
V());
148 std::vector<size_t> objIds1, objIds2;
150 for (
size_t objId :
md.
ids()) {
152 objIds1.push_back(objId);
154 objIds2.push_back(objId);
172 size_t id1 = objIds1[idx1];
173 size_t id2 = objIds2[idx2];
184 double corrI1_P1, corrI2_P1, corrI2_P2, corrI1_P2;
190 if (corrI1_P2>corrI1_P1 && corrI2_P1>corrI2_P2){
202 objIds1.erase(objIds1.begin()+idx1);
203 objIds2.erase(objIds2.begin()+idx2);
204 objIds1.push_back(id2);
205 objIds2.push_back(id1);
223 std::cout <<
" Niter = " << Niter <<
" Images in set1 = " << objIds1.size() <<
" Images in set2 = " << objIds2.size() <<
" countRandomSwap = " <<
countRandomSwap <<
" countNormalSwap = " <<
countNormalSwap << std::endl;
void init_progress_bar(long total)
__host__ __device__ float2 floor(const float2 v)
double correlation(const MultidimArray< T > &x, const MultidimArray< T > &y, const MultidimArray< int > *mask=nullptr, int l=0, int m=0, int q=0)
void readParams()
Read argument from command line.
void updateVolume(MultidimArray< double > &V)
T & getValue(MDLabel label)
static void defineParams(XmippProgram *program, int allowed_data_types=ALL_KINDS, const char *prefix=nullptr, const char *comment=nullptr, bool moreOptions=false)
#define MAT_ELEM(m, i, j)
const char * getParam(const char *param, int arg=0)
void defineParams()
Define parameters.
void progress_bar(long rlen)
void projectVolume(FourierProjector &projector, Projection &P, int Ydim, int Xdim, double rot, double tilt, double psi, const MultidimArray< double > *ctf)
void readParams(XmippProgram *program)
MultidimArray< double > projV
int verbose
Verbosity level.
void calculateProjectedIms(size_t id, double &corrI_P1, double &corrI_P2)
FourierProjector * projectorV2
double psi(const double x)
void updateVolume(const std::vector< size_t > &objIds1, const FileName &fnOut, FourierProjector &projector)
String formatString(const char *format,...)
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)
unsigned int randomize_random_generator()
int getIntParam(const char *param, int arg=0)
FourierProjector * projectorV1
void addParamsLine(const String &line)