56 fnCentralSlices=
getParam(
"--central_slices");
60 fnProjections=
getParam(
"--projections");
68 addUsageLine(
"Creates a representation for the web of the input volume");
70 addParamsLine(
" [--central_slices <imgFile> <n=-1>] : Output central slices (normally jpg); n=-1 for all slices");
71 addParamsLine(
" [--projections <imgFile>] : Output projections (normally jpg)");
73 addParamsLine(
" [--separation <s=2>] : Separation in pixels between slices");
74 addExampleLine(
"xmipp_volume_to_web -i volume.vol --central_slices central_slices.jpg --projections projections.jpg");
85 if (!fnCentralSlices.empty())
90 int kmiddle=
ZSIZE(mV)/2;
91 int k0=kmiddle-Nslices/2;
95 int NslicesPerRow=maxWidth/
XSIZE(mV);
98 else if (NslicesPerRow>Nslices)
100 auto Nrows=(int)ceil(((
float)Nslices)/NslicesPerRow);
103 I().resizeNoCopy(Nrows*
YSIZE(mV)+(Nrows-1)*sep,NslicesPerRow*
XSIZE(mV)+(NslicesPerRow-1)*sep);
108 for (
int k=k0;
k<=kF; ++
k)
112 for (
size_t i=0;
i<
YSIZE(mV); ++
i, ++outi)
115 if (outJ==NslicesPerRow)
121 I().rangeAdjust(0,255);
122 I.
write(fnCentralSlices);
124 if (fnProjections!=
"")
145 I().initConstant(maxVal);
147 for (
size_t i=0;
i<
YSIZE(pXY); ++
i, ++outi)
152 for (
size_t i=0;
i<
YSIZE(pXZ); ++
i, ++outi)
157 for (
size_t i=0;
i<
YSIZE(pYZ); ++
i, ++outi)
160 I().rangeAdjust(0,255);
161 I.
write(fnProjections);
#define A2D_ELEM(v, i, j)
int maxWidth
Maximum Width.
FileName fnVol
Volume to convert.
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)
FileName fnCentralSlices
Output central slices.
FileName fnProjections
Output projections.
ql0001_ & k(htemp+1),(cvec+1),(atemp+1),(bj+1),(bl+1),(bu+1),(x+1),(clamda+1), &iout, infoqp, &zero,(w+1), &lenw,(iw+1), &leniw, &glob_grd.epsmac
#define A3D_ELEM(V, k, i, j)
#define FOR_ALL_ELEMENTS_IN_ARRAY3D(V)
const char * getParam(const char *param, int arg=0)
int Nslices
Number of slices.
void max(Image< double > &op1, const Image< double > &op2)
void addExampleLine(const char *example, bool verbatim=true)
void readParams()
Read parameters from command line.
void defineParams()
define parameters
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)
int getIntParam(const char *param, int arg=0)
void addParamsLine(const String &line)
#define IMGPIXEL(I, i, j)