46 addUsageLine(
"+You can select different ways to resize your image/volumes.");
48 addKeywords(
"transform, dimension, pyramid, fourier, scale");
51 addExampleLine(
"xmipp_image_resize -i images.xmd --factor 0.5 --oroot halvedOriginal");
52 addExampleLine(
"For pyramid resizing(increase volume size 4 times):",
false);
53 addExampleLine(
"xmipp_image_resize -i input/bacteriorhodopsin.vol --pyramid 2 -o bdr_x4.vol");
55 addExampleLine(
"xmipp_image_resize -i images.xmd --fourier 64 --oroot halvedFourierDim");
57 addParamsLine(
"--factor <n=0.5> : Resize a factor of dimensions, 0.5 halves and 2 doubles (uses splines or linear interpolation).");
59 addParamsLine(
"or --dim <x> <y=x> <z=x> : New x,y and z dimensions (uses splines / linear interpolation or nearest neighbour method).");
61 addParamsLine(
"or --fourier <x> <y=x> <z=x> <thr=1> : Use padding/windowing in Fourier Space to resize. thr=number of threads");
63 addParamsLine(
"or --pyramid <levels=1> : Use positive value to expand and negative to reduce");
65 addParamsLine(
" [--interp <interpolation_type=spline>] : Interpolation type to be used. ");
68 addParamsLine(
" linear : Use bilinear/trilinear interpolation");
69 addParamsLine(
" nearest : Use nearest neighbour to set new value");
77 if (degree ==
"spline")
79 else if (degree ==
"linear")
81 else if (degree ==
"nearest")
133 reportWarning(
"Do not apply large scale factor using B-splines " 134 "choose fourier option.");
192 #define SCALE_SHIFT(shiftLabel, resizeFactor) if (rowIn.containsLabel(shiftLabel)) {\ 193 rowIn.getValue(shiftLabel, aux); aux *= (resizeFactor); rowOut.setValue(shiftLabel, aux); } 209 img().setXmippOrigin();
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 getDoubleParam(const char *param, int arg=0)
void reportWarning(const String &what)
#define REPORT_ERROR(nerr, ErrormMsg)
void processImage(const FileName &fnImg, const FileName &fnImgOut, const MDRow &rowIn, MDRow &rowOut)
FileName addExtension(const String &ext) const
DataType getDatatype() const
void addKeywords(const char *keywords)
String getExtension() const
const char * getParam(const char *param, int arg=0)
void addExampleLine(const char *example, bool verbatim=true)
void selfScaleToSizeFourier(int Zdim, int Ydim, int Xdim, MultidimArray< double > &mda, int nThreads)
virtual void resetGeo(bool addLabels=true)
#define STR_EQUAL(str1, str2)
void setDatatype(DataType _datatype)
Matrix1D< double > resizeFactor
void resizeNoCopy(int Xdim)
bool checkParam(const char *param)
void addUsageLine(const char *line, bool verbatim=false)
int getIntParam(const char *param, int arg=0)
int read(const FileName &name, DataMode datamode=DATA, size_t select_img=ALL_IMAGES, bool mapData=false)
Incorrect value received.
#define SCALE_SHIFT(shiftLabel, resizeFactor)
void addParamsLine(const String &line)