44 addUsageLine(
"Center a set of images (preferably with a good SNR, e.g., class averages).");
45 addUsageLine(
"After calling the program, all classes will be centered and they will tend ");
46 addUsageLine(
"to show the same orientation. The program centers the images by comparing ");
47 addUsageLine(
"the image with its X, Y, and XY mirrors. The orientation is determined by ");
50 addExampleLine(
"Center images in smallStack.stk and store results in a different file:",
false);
51 addExampleLine(
"xmipp_transform_center_image -i smallStack.stk -o stackCentered.stk ");
54 addParamsLine(
" [--limit] : Limit the maximum shift allowed");
55 addParamsLine(
" [--save_metadata_transform] : Save in the output metadata the transform parameters");
64 saveMdTransform =
checkParam(
"--save_metadata_transform");
72 std::cout <<
"iterations = " << Niter << std::endl;
73 std::cout <<
"limit shift = " << limitShift << std::endl;
80 double scale, shiftX, shiftY,
psi;
83 img().checkDimensionWithDebug(2,__FILE__,__LINE__);
84 A =
centerImage(img(), aux, aux2, Niter, limitShift);
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)
int readApplyGeo(const FileName &name, const MDRow &row, const ApplyGeoParams ¶ms=DefaultApplyGeoParams)
Matrix2D< double > centerImage(MultidimArray< double > &I, CorrelationAux &aux, RotationalCorrelationAux &aux2, int Niter, bool limitShift)
void addExampleLine(const char *example, bool verbatim=true)
RotationalCorrelationAux aux2
void setValue(MDLabel label, const T &d, bool addLabel=true)
double psi(const double x)
bool checkParam(const char *param)
void addUsageLine(const char *line, bool verbatim=false)
int getIntParam(const char *param, int arg=0)
void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
void addParamsLine(const String &line)