48 addUsageLine(
"Operate with image files headers. By default in Xmipp, geometrical transformations");
49 addUsageLine(
"coming in images files headers are ignored. Instead this information is read from");
50 addUsageLine(
"the images metadata if exist. With this program geometrical transformations can be");
51 addUsageLine(
"extracted to a metadata or assigned to header, also allows print or reset image file headers.");
52 addParamsLine(
"[ --print <decompose=0>] : Print the geometrical transformations in image file headers.");
53 addParamsLine(
" : if input is stack and decompose=1 print header of each individual image.");
55 addParamsLine(
"or --extract : The output is a selfile with geometrical transformations read from image file headers.");
58 addParamsLine(
"or --assign : Write the geometrical transformations from selfile to the image file headers.");
60 addParamsLine(
"or --reset : Reset the geometrical transformations in image file headers.");
62 addParamsLine(
"or --tree : Print the tree scheme from file containers as hdf5 files.");
64 addParamsLine(
"or --sampling_rate <Ts=-1> : Change the sampling rate (in Angstrom units) in the image file header.");
65 addParamsLine(
" : If no value is passed then current value in header is print.");
68 addExampleLine(
"Print the header of the images in metadata: ",
false);
70 addExampleLine(
"Extract geometrical transformations from image file headers: ",
false);
71 addExampleLine(
"xmipp_image_header -i smallStack.stk --extract -o header.doc");
72 addExampleLine(
"Assign the geometrical transformations from the metadata to header: ",
false);
75 addKeywords(
"header, geometric, transformation, print");
122 msg =
"Printing headers...";
125 msg =
"Extracting image(s) geometrical transformations from header to metadata...";
128 msg =
"Assigning image(s) geometrical transformations from metadata to header...";
131 msg =
"Reseting geometrical transformations from headers...";
135 msg =
"Setting sampling rate into headers...";
137 msg =
"Showing sampling rate from headers...";
140 msg =
"Printing tree structure...";
143 std::cout << msg << std::endl <<
"Input: " <<
fn_in << std::endl;
146 std::cout <<
"Output: " <<
fn_out << std::endl;
155 aux = (double)
ROUND(aux);
160 aux = (double)
ROUND(aux);
203 std::cout << samplingRead << std::endl;
211 std::cout <<
"New sampling rate (Angstrom) = " << sampling << std::endl;
220 if (H5File.isHdf5(filename.c_str()))
void setDataMode(DataMode mode)
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)
MDRow & getGeometry(const size_t n=0)
double getDoubleParam(const char *param, int arg=0)
void showTree(std::ostream &out=std::cout)
#define REPORT_ERROR(nerr, ErrormMsg)
FileName removeFileFormat() const
void openFile(const H5std_string &name, unsigned int flags, const H5::FileAccPropList &access_plist=H5::FileAccPropList::DEFAULT)
void setValue(const MDObject &object) override
void initGeometry(const size_t n=0)
void addSeeAlsoLine(const char *seeAlso)
T & getValue(MDLabel label)
void addKeywords(const char *keywords)
FileName removeAllPrefixes() const
T & getValue(MDLabel label)
void addExampleLine(const char *example, bool verbatim=true)
int verbose
Verbosity level.
void setValue(MDLabel label, const T &d, bool addLabel=true)
int readApplyGeo(const FileName &name, const MDRow &row, const ApplyGeoParams ¶ms=DefaultApplyGeoParams)
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)
void addParamsLine(const String &line)