mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-05 17:40:40 +02:00
2 - Jf rawdataprocess fmt (#725)
* Fix ROI mapping * Formatting * Minor edit * intial draft of cmake for jungfrau executables Makefile.rawdataprocess * added the cmake file * missed Makefile * added libfmt * Fix some compiler warnings * Fix some compiler warnings * Create filename usining fmt::format * Rewrite command line parsing with std::string and fmt::format * Fix file reading * Fix root string extraction * Fix ifstream file reading * Clean up comments * Add requested changes to helper functions * fix const& --------- Co-authored-by: vhinger182 <hinger_v@hv_home_lt1.localdomain> Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
This commit is contained in:
parent
f4e05f7a01
commit
72c992bc74
@ -406,9 +406,9 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
|
|||||||
np = 0;
|
np = 0;
|
||||||
//int pn;
|
//int pn;
|
||||||
|
|
||||||
// std::cout << dataSize << std::endl;
|
//std::cout << dataSize << std::endl;
|
||||||
if (ff >= 0)
|
//if (ff >= 0) {
|
||||||
// fnum = ff;
|
// fnum = ff; }
|
||||||
|
|
||||||
if (filebin.is_open()) {
|
if (filebin.is_open()) {
|
||||||
if (filebin.read(data, dataSize)) {
|
if (filebin.read(data, dataSize)) {
|
||||||
@ -417,7 +417,10 @@ class jungfrauLGADStrixelsData : public slsDetectorData<uint16_t> {
|
|||||||
np = getPacketNumber(data);
|
np = getPacketNumber(data);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
std::cout << "#";
|
||||||
|
} else {
|
||||||
|
std::cout << "File not open" << std::endl;
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,12 +41,37 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
|
|
||||||
|
std::string getRootString( const std::string& filepath ) {
|
||||||
|
size_t pos1 = filepath.find_last_of("/");
|
||||||
|
size_t pos2 = filepath.find_last_of(".");
|
||||||
|
std::cout << "pos1 " << pos1 << " pos2 " << pos2 << " size " << filepath.length() << std::endl;
|
||||||
|
return filepath.substr( pos1+1, pos2-pos1-1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
//Create file name string according to slsDetectorPackage format
|
||||||
|
// dir: directory
|
||||||
|
// fprefix: fileprefix (without extension)
|
||||||
|
// fsuffix: filesuffix (for output files, e.g. "ped")
|
||||||
|
// fext: file extension (e.g. "raw")
|
||||||
|
// mindex: module index ("d0" in standard)
|
||||||
|
// findex: file index for one acquisition ("f0")
|
||||||
|
// aindex: acquisition index (i.e. "run number")
|
||||||
|
std::string createFileName( const std::string& dir, const std::string& fprefix="run", const std::string& fsuffix="", const std::string& fext="raw", int aindex=0, int mindex=0, int findex=0, int outfilecounter=-1 ) {
|
||||||
|
std::string filename{};
|
||||||
|
if (outfilecounter >= 0)
|
||||||
|
return fmt::format("{:s}/{:s}_d{:d}_f{:d}_{:d}_f{:05d}.{:s}", dir, fprefix, mindex, findex, aindex, outfilecounter, fext);
|
||||||
|
else if (fsuffix.length()!=0)
|
||||||
|
return fmt::format("{:s}/{:s}_{:s}.{:s}", dir, fprefix, fsuffix, fext);
|
||||||
|
else
|
||||||
|
return fmt::format("{:s}/{:s}_d{:d}_f{:d}_{:d}.{:s}", dir, fprefix, mindex, findex, aindex, fext);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
if (argc < 5) {
|
if (argc < 5) {
|
||||||
std::cout
|
std::cout
|
||||||
<< "Usage is " << argv[0]
|
<< "Usage is " << argv[0]
|
||||||
<< "indir outdir fname(with formatting, no extension) fextension "
|
<< "indir outdir fprefix(excluding slsDetector standard suffixes and extension) fextension "
|
||||||
"[runmin] [runmax] [pedfile (raw or tiff)] [threshold] "
|
"[runmin] [runmax] [pedfile (raw or tiff)] [threshold] "
|
||||||
"[nframes] [xmin xmax ymin ymax] [gainmap]"
|
"[nframes] [xmin xmax ymin ymax] [gainmap]"
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
@ -75,11 +100,11 @@ int main(int argc, char *argv[]) {
|
|||||||
int ff, np;
|
int ff, np;
|
||||||
// cout << " data size is " << dsize;
|
// cout << " data size is " << dsize;
|
||||||
|
|
||||||
ifstream filebin;
|
//ifstream filebin;
|
||||||
char *indir = argv[1];
|
std::string indir(argv[1]);
|
||||||
char *outdir = argv[2];
|
std::string outdir(argv[2]);
|
||||||
char *fformat = argv[3];
|
std::string fprefix(argv[3]);
|
||||||
char *fext = argv[4];
|
std::string fext(argv[4]);
|
||||||
int runmin = 0;
|
int runmin = 0;
|
||||||
|
|
||||||
// cout << "argc is " << argc << endl;
|
// cout << "argc is " << argc << endl;
|
||||||
@ -93,9 +118,9 @@ int main(int argc, char *argv[]) {
|
|||||||
runmax = atoi(argv[6]);
|
runmax = atoi(argv[6]);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *pedfile = NULL;
|
std::string pedfilename{};
|
||||||
if (argc >= 8) {
|
if (argc >= 8) {
|
||||||
pedfile = argv[7];
|
pedfilename = argv[7];
|
||||||
}
|
}
|
||||||
double thr = 0;
|
double thr = 0;
|
||||||
double thr1 = 1;
|
double thr1 = 1;
|
||||||
@ -109,12 +134,7 @@ int main(int argc, char *argv[]) {
|
|||||||
if (argc >= 10) {
|
if (argc >= 10) {
|
||||||
nframes = atoi(argv[9]);
|
nframes = atoi(argv[9]);
|
||||||
}
|
}
|
||||||
|
|
||||||
char ffname[10000];
|
|
||||||
char fname[10000];
|
|
||||||
char imgfname[10000];
|
|
||||||
char cfname[10000];
|
|
||||||
|
|
||||||
// Define decoders...
|
// Define decoders...
|
||||||
#if !defined JFSTRX && !defined JFSTRXOLD && !defined JFSTRXCHIP1 && \
|
#if !defined JFSTRX && !defined JFSTRXOLD && !defined JFSTRXCHIP1 && \
|
||||||
!defined JFSTRXCHIP6
|
!defined JFSTRXCHIP6
|
||||||
@ -137,36 +157,38 @@ int main(int argc, char *argv[]) {
|
|||||||
uint16_t yymax = 0;
|
uint16_t yymax = 0;
|
||||||
|
|
||||||
#ifndef ALDO
|
#ifndef ALDO
|
||||||
using header = sls::defs::sls_receiver_header;
|
{ //THIS SCOPE IS IMPORTANT! (To ensure proper destruction of ifstream)
|
||||||
// check if there is a roi in the header
|
using header = sls::defs::sls_receiver_header;
|
||||||
typedef struct {
|
// check if there is a roi in the header
|
||||||
|
typedef struct {
|
||||||
uint16_t xmin;
|
uint16_t xmin;
|
||||||
uint16_t xmax;
|
uint16_t xmax;
|
||||||
uint16_t ymin;
|
uint16_t ymin;
|
||||||
uint16_t ymax;
|
uint16_t ymax;
|
||||||
} receiverRoi_compact;
|
} receiverRoi_compact;
|
||||||
receiverRoi_compact croi;
|
receiverRoi_compact croi;
|
||||||
sprintf(ffname, "%s/%s.%s", indir, fformat, fext);
|
std::string fsuffix{};
|
||||||
sprintf(fname, (const char *)ffname, runmin);
|
auto filename = createFileName( indir, fprefix, fsuffix, fext, runmin );
|
||||||
std::cout << "Reading header of file " << fname << " to check for ROI "
|
std::cout << "Reading header of file " << filename << " to check for ROI "
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
filebin.open((const char *)(fname), ios::in | ios::binary);
|
ifstream firstfile(filename, ios::in | ios::binary);
|
||||||
if (filebin.is_open()) {
|
if (firstfile.is_open()) {
|
||||||
header hbuffer;
|
header hbuffer;
|
||||||
std::cout << "sizeof(header) = " << sizeof(header) << std::endl;
|
std::cout << "sizeof(header) = " << sizeof(header) << std::endl;
|
||||||
if (filebin.read((char *)&hbuffer, sizeof(header))) {
|
if (firstfile.read((char *)&hbuffer, sizeof(header))) {
|
||||||
memcpy(&croi, &hbuffer.detHeader.detSpec1, 8);
|
memcpy(&croi, &hbuffer.detHeader.detSpec1, 8);
|
||||||
std::cout << "Read ROI [" << croi.xmin << ", " << croi.xmax << ", "
|
std::cout << "Read ROI [" << croi.xmin << ", " << croi.xmax << ", "
|
||||||
<< croi.ymin << ", " << croi.ymax << "]" << std::endl;
|
<< croi.ymin << ", " << croi.ymax << "]" << std::endl;
|
||||||
xxmin = croi.xmin;
|
xxmin = croi.xmin;
|
||||||
xxmax = croi.xmax;
|
xxmax = croi.xmax;
|
||||||
yymin = croi.ymin;
|
yymin = croi.ymin;
|
||||||
yymax = croi.ymax;
|
yymax = croi.ymax;
|
||||||
} else
|
} else
|
||||||
std::cout << "reading error" << std::endl;
|
std::cout << "reading error" << std::endl;
|
||||||
filebin.close();
|
firstfile.close();
|
||||||
} else
|
} else
|
||||||
std::cout << "Could not open " << fname << " for reading " << std::endl;
|
std::cout << "Could not open " << filename << " for reading " << std::endl;
|
||||||
|
} //end of protective scope
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
jungfrauLGADStrixelsData *decoder =
|
jungfrauLGADStrixelsData *decoder =
|
||||||
@ -213,14 +235,13 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
std::time_t end_time;
|
std::time_t end_time;
|
||||||
|
|
||||||
FILE *of = NULL;
|
|
||||||
std::cout << "input directory is " << indir << std::endl;
|
std::cout << "input directory is " << indir << std::endl;
|
||||||
std::cout << "output directory is " << outdir << std::endl;
|
std::cout << "output directory is " << outdir << std::endl;
|
||||||
std::cout << "input file is " << fformat << std::endl;
|
std::cout << "input file prefix is " << fprefix << std::endl;
|
||||||
std::cout << "runmin is " << runmin << std::endl;
|
std::cout << "runmin is " << runmin << std::endl;
|
||||||
std::cout << "runmax is " << runmax << std::endl;
|
std::cout << "runmax is " << runmax << std::endl;
|
||||||
if (pedfile)
|
if (pedfilename.length()!=0)
|
||||||
std::cout << "pedestal file is " << pedfile << std::endl;
|
std::cout << "pedestal file is " << pedfilename << std::endl;
|
||||||
if (thr > 0)
|
if (thr > 0)
|
||||||
std::cout << "threshold is " << thr << std::endl;
|
std::cout << "threshold is " << thr << std::endl;
|
||||||
std::cout << "Nframes is " << nframes << std::endl;
|
std::cout << "Nframes is " << nframes << std::endl;
|
||||||
@ -256,8 +277,6 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
char *buff;
|
char *buff;
|
||||||
|
|
||||||
// multiThreadedAnalogDetector *mt=new
|
|
||||||
// multiThreadedAnalogDetector(filter,nthreads,fifosize);
|
|
||||||
multiThreadedCountingDetector *mt =
|
multiThreadedCountingDetector *mt =
|
||||||
new multiThreadedCountingDetector(filter, nthreads, fifosize);
|
new multiThreadedCountingDetector(filter, nthreads, fifosize);
|
||||||
mt->setClusterSize(csize, csize);
|
mt->setClusterSize(csize, csize);
|
||||||
@ -285,84 +304,75 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
int ifr = 0;
|
int ifr = 0;
|
||||||
|
|
||||||
char froot[1000];
|
if (pedfilename.length()!=0) {
|
||||||
double *ped = new double[nx * ny]; //, *ped1;
|
|
||||||
|
|
||||||
int pos, pos1;
|
std::string froot = getRootString(pedfilename);
|
||||||
|
|
||||||
if (pedfile) {
|
std::cout << "PEDESTAL " << std::endl;
|
||||||
|
|
||||||
if (string(pedfile).find(".dat") != std::string::npos) {
|
if (pedfilename.find(".tif") == std::string::npos) {
|
||||||
pos1 = string(pedfile).rfind("/");
|
std::string fname = pedfilename;
|
||||||
strcpy(froot, pedfile + pos1);
|
std::cout << fname << std::endl;
|
||||||
pos = string(froot).find(".dat");
|
std::time(&end_time);
|
||||||
froot[pos] = '\0';
|
std::cout << "aaa " << std::ctime(&end_time) << std::endl;
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "PEDESTAL " << std::endl;
|
mt->setFrameMode(ePedestal);
|
||||||
// sprintf(imgfname, "%s/pedestals.tiff", outdir);
|
|
||||||
|
|
||||||
if (string(pedfile).find(".tif") == std::string::npos) {
|
ifstream pedefile(fname, ios::in | ios::binary);
|
||||||
sprintf(fname, "%s", pedfile);
|
// //open file
|
||||||
std::cout << fname << std::endl;
|
if (pedefile.is_open()) {
|
||||||
std::time(&end_time);
|
std::cout << "bbbb " << std::ctime(&end_time) << std::endl;
|
||||||
std::cout << "aaa" << std::ctime(&end_time) << std::endl;
|
|
||||||
|
ff = -1;
|
||||||
|
while (decoder->readNextFrame(pedefile, ff, np, buff)) {
|
||||||
|
// if (np == 40) {
|
||||||
|
if ((ifr + 1) % 100 == 0) {
|
||||||
|
std::cout
|
||||||
|
<< " ****"
|
||||||
|
<< decoder->getValue(buff, 20, 20); // << std::endl;
|
||||||
|
}
|
||||||
|
mt->pushData(buff);
|
||||||
|
mt->nextThread();
|
||||||
|
mt->popFree(buff);
|
||||||
|
ifr++;
|
||||||
|
if (ifr % 100 == 0) {
|
||||||
|
std::cout << " ****" << ifr << " " << ff << " " << np
|
||||||
|
<< std::endl;
|
||||||
|
} // else
|
||||||
|
//std::cout << ifr << " " << ff << " " << np << std::endl;
|
||||||
|
if (ifr >= 1000)
|
||||||
|
break;
|
||||||
|
ff = -1;
|
||||||
|
}
|
||||||
|
pedefile.close();
|
||||||
|
while (mt->isBusy()) {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
mt->setFrameMode(ePedestal);
|
std::cout << "froot " << froot << std::endl;
|
||||||
// sprintf(fn,fformat,irun);
|
auto imgfname = createFileName( outdir, froot, "ped", "tiff");
|
||||||
filebin.open((const char *)(fname), ios::in | ios::binary);
|
mt->writePedestal(imgfname.c_str());
|
||||||
// //open file
|
imgfname = createFileName( outdir, froot, "rms", "tiff");
|
||||||
if (filebin.is_open()) {
|
mt->writePedestalRMS(imgfname.c_str());
|
||||||
std::cout << "bbbb" << std::ctime(&end_time) << std::endl;
|
|
||||||
|
|
||||||
ff = -1;
|
} else
|
||||||
while (decoder->readNextFrame(filebin, ff, np, buff)) {
|
std::cout << "Could not open pedestal file " << fname
|
||||||
// if (np == 40) {
|
<< " for reading " << std::endl;
|
||||||
if ((ifr + 1) % 100 == 0) {
|
|
||||||
std::cout
|
|
||||||
<< " ****"
|
|
||||||
<< decoder->getValue(buff, 20, 20); // << endl;
|
|
||||||
}
|
|
||||||
mt->pushData(buff);
|
|
||||||
mt->nextThread();
|
|
||||||
mt->popFree(buff);
|
|
||||||
ifr++;
|
|
||||||
if (ifr % 100 == 0) {
|
|
||||||
std::cout << " ****" << ifr << " " << ff << " " << np
|
|
||||||
<< std::endl;
|
|
||||||
} // else
|
|
||||||
// cout << ifr << " " << ff << " " << np << endl;
|
|
||||||
if (ifr >= 1000)
|
|
||||||
break;
|
|
||||||
ff = -1;
|
|
||||||
}
|
|
||||||
filebin.close();
|
|
||||||
while (mt->isBusy()) {
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
sprintf(imgfname, "%s/%s_ped.tiff", outdir, froot);
|
|
||||||
mt->writePedestal(imgfname);
|
|
||||||
sprintf(imgfname, "%s/%s_rms.tiff", outdir, froot);
|
|
||||||
mt->writePedestalRMS(imgfname);
|
|
||||||
|
|
||||||
} else
|
|
||||||
std::cout << "Could not open pedestal file " << fname
|
|
||||||
<< " for reading " << std::endl;
|
|
||||||
} else {
|
} else {
|
||||||
float *pp = ReadFromTiff(pedfile, nny, nnx);
|
std::vector<double> ped(nx * ny);
|
||||||
if (pp && (int)nnx == nx && (int)nny == ny) {
|
float *pp = ReadFromTiff(pedfilename.c_str(), nny, nnx);
|
||||||
for (int i = 0; i < nx * ny; i++) {
|
if (pp && (int)nnx == nx && (int)nny == ny) {
|
||||||
ped[i] = pp[i];
|
for (int i = 0; i < nx * ny; i++) {
|
||||||
}
|
ped[i] = pp[i];
|
||||||
delete[] pp;
|
}
|
||||||
mt->setPedestal(ped);
|
delete[] pp;
|
||||||
std::cout << "Pedestal set from tiff file " << pedfile
|
mt->setPedestal(ped.data());
|
||||||
<< std::endl;
|
std::cout << "Pedestal set from tiff file " << pedfilename
|
||||||
} else {
|
<< std::endl;
|
||||||
std::cout << "Could not open pedestal tiff file " << pedfile
|
} else {
|
||||||
<< " for reading " << std::endl;
|
std::cout << "Could not open pedestal tiff file " << pedfilename
|
||||||
}
|
<< " for reading " << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::time(&end_time);
|
std::time(&end_time);
|
||||||
std::cout << std::ctime(&end_time) << std::endl;
|
std::cout << std::ctime(&end_time) << std::endl;
|
||||||
@ -373,27 +383,26 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
mt->setFrameMode(eFrame);
|
mt->setFrameMode(eFrame);
|
||||||
|
|
||||||
|
FILE *of = NULL;
|
||||||
|
|
||||||
for (int irun = runmin; irun <= runmax; irun++) {
|
for (int irun = runmin; irun <= runmax; irun++) {
|
||||||
std::cout << "DATA ";
|
std::cout << "DATA ";
|
||||||
// sprintf(fn,fformat,irun);
|
std::string fsuffix{};
|
||||||
sprintf(ffname, "%s/%s.%s", indir, fformat, fext);
|
auto fname = createFileName( indir, fprefix, fsuffix, fext, irun );
|
||||||
sprintf(fname, (const char *)ffname, irun);
|
auto imgfname = createFileName( outdir, fprefix, fsuffix, "tiff", irun );
|
||||||
sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
auto cfname = createFileName( outdir, fprefix, fsuffix, "clust", irun );
|
||||||
sprintf(imgfname, (const char *)ffname, irun);
|
|
||||||
sprintf(ffname, "%s/%s.clust", outdir, fformat);
|
|
||||||
sprintf(cfname, (const char *)ffname, irun);
|
|
||||||
std::cout << fname << " ";
|
std::cout << fname << " ";
|
||||||
std::cout << imgfname << std::endl;
|
std::cout << imgfname << std::endl;
|
||||||
std::time(&end_time);
|
std::time(&end_time);
|
||||||
std::cout << std::ctime(&end_time) << std::endl;
|
std::cout << std::ctime(&end_time) << std::endl;
|
||||||
// cout << fname << " " << outfname << " " << imgfname << endl;
|
// std::cout << fname << " " << outfname << " " << imgfname << std::endl;
|
||||||
filebin.open((const char *)(fname), ios::in | ios::binary);
|
ifstream filebin(fname, ios::in | ios::binary);
|
||||||
// //open file
|
// //open file
|
||||||
ifile = 0;
|
ifile = 0;
|
||||||
if (filebin.is_open()) {
|
if (filebin.is_open()) {
|
||||||
if (thr <= 0 && cf != 0) { // cluster finder
|
if (thr <= 0 && cf != 0) { // cluster finder
|
||||||
if (of == NULL) {
|
if (of == NULL) {
|
||||||
of = fopen(cfname, "w");
|
of = fopen(cfname.c_str(), "w");
|
||||||
if (of) {
|
if (of) {
|
||||||
mt->setFilePointer(of);
|
mt->setFilePointer(of);
|
||||||
std::cout << "file pointer set " << std::endl;
|
std::cout << "file pointer set " << std::endl;
|
||||||
@ -414,7 +423,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
if ((ifr + 1) % 100 == 0) {
|
if ((ifr + 1) % 100 == 0) {
|
||||||
std::cout << " ****"
|
std::cout << " ****"
|
||||||
<< decoder->getValue(buff, 20, 20); // << endl;
|
<< decoder->getValue(buff, 20, 20); // << std::endl;
|
||||||
}
|
}
|
||||||
mt->pushData(buff);
|
mt->pushData(buff);
|
||||||
// // //pop
|
// // //pop
|
||||||
@ -426,16 +435,14 @@ int main(int argc, char *argv[]) {
|
|||||||
std::cout << " " << ifr << " " << ff << std::endl;
|
std::cout << " " << ifr << " " << ff << std::endl;
|
||||||
if (nframes > 0) {
|
if (nframes > 0) {
|
||||||
if (ifr % nframes == 0) {
|
if (ifr % nframes == 0) {
|
||||||
sprintf(ffname, "%s/%s_f%05d.tiff", outdir, fformat,
|
imgfname = createFileName( outdir, fprefix, fsuffix, "tiff", irun, 0, 0, ifile );
|
||||||
ifile);
|
mt->writeImage(imgfname.c_str(), thr1);
|
||||||
sprintf(imgfname, (const char *)ffname, irun);
|
|
||||||
mt->writeImage(imgfname, thr1);
|
|
||||||
mt->clearImage();
|
mt->clearImage();
|
||||||
ifile++;
|
ifile++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// } else
|
// } else
|
||||||
// cout << ifr << " " << ff << " " << np << endl;
|
//std::cout << ifr << " " << ff << " " << np << std::endl;
|
||||||
ff = -1;
|
ff = -1;
|
||||||
}
|
}
|
||||||
std::cout << "--" << std::endl;
|
std::cout << "--" << std::endl;
|
||||||
@ -444,16 +451,11 @@ int main(int argc, char *argv[]) {
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
if (nframes >= 0) {
|
if (nframes >= 0) {
|
||||||
if (nframes > 0) {
|
if (nframes > 0)
|
||||||
sprintf(ffname, "%s/%s_f%05d.tiff", outdir, fformat, ifile);
|
imgfname = createFileName( outdir, fprefix, fsuffix, "tiff", irun, 0, 0, ifile );
|
||||||
sprintf(imgfname, (const char *)ffname, irun);
|
|
||||||
} else {
|
|
||||||
sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
|
||||||
sprintf(imgfname, (const char *)ffname, irun);
|
|
||||||
}
|
|
||||||
std::cout << "Writing tiff to " << imgfname << " " << thr1
|
std::cout << "Writing tiff to " << imgfname << " " << thr1
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
mt->writeImage(imgfname, thr1);
|
mt->writeImage(imgfname.c_str(), thr1);
|
||||||
mt->clearImage();
|
mt->clearImage();
|
||||||
if (of) {
|
if (of) {
|
||||||
fclose(of);
|
fclose(of);
|
||||||
@ -468,10 +470,9 @@ int main(int argc, char *argv[]) {
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
}
|
}
|
||||||
if (nframes < 0) {
|
if (nframes < 0) {
|
||||||
sprintf(ffname, "%s/%s.tiff", outdir, fformat);
|
auto imgfname = createFileName( outdir, fprefix, "sum", "tiff", -1, 0, 0, -1 );
|
||||||
strcpy(imgfname, ffname);
|
|
||||||
std::cout << "Writing tiff to " << imgfname << " " << thr1 << std::endl;
|
std::cout << "Writing tiff to " << imgfname << " " << thr1 << std::endl;
|
||||||
mt->writeImage(imgfname, thr1);
|
mt->writeImage(imgfname.c_str(), thr1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user