mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 15:00:02 +02:00
Merge branch 'developer' into patsetbit
This commit is contained in:
commit
9328aadfa3
@ -249,7 +249,7 @@ template <class dataType> class analogDetector {
|
|||||||
\returns pointer to current gain map is file reading succeeded, NULL is file reading didn't work.
|
\returns pointer to current gain map is file reading succeeded, NULL is file reading didn't work.
|
||||||
*/
|
*/
|
||||||
double *readGainMap(const char * imgname) {
|
double *readGainMap(const char * imgname) {
|
||||||
uint32 nnx, nny;
|
uint32_t nnx, nny;
|
||||||
float *gm=ReadFromTiff( imgname, nny, nnx);
|
float *gm=ReadFromTiff( imgname, nny, nnx);
|
||||||
if (gm) {
|
if (gm) {
|
||||||
if (gmap) delete [] gmap;
|
if (gmap) delete [] gmap;
|
||||||
@ -688,7 +688,7 @@ template <class dataType> class analogDetector {
|
|||||||
\returns 0 if file reading didn't succed, otherwise 1
|
\returns 0 if file reading didn't succed, otherwise 1
|
||||||
*/
|
*/
|
||||||
int readPedestals(const char * imgname) {
|
int readPedestals(const char * imgname) {
|
||||||
uint32 nnx, nny;
|
uint32_t nnx, nny;
|
||||||
float *gm=ReadFromTiff( imgname, nny, nnx);
|
float *gm=ReadFromTiff( imgname, nny, nnx);
|
||||||
if (nnx>nx) nnx=nx;
|
if (nnx>nx) nnx=nx;
|
||||||
if (nny>ny) nny=ny;
|
if (nny>ny) nny=ny;
|
||||||
@ -713,7 +713,7 @@ template <class dataType> class analogDetector {
|
|||||||
\returns 0 if file reading didn't succed, otherwise 1
|
\returns 0 if file reading didn't succed, otherwise 1
|
||||||
*/
|
*/
|
||||||
int readImage(const char * imgname) {
|
int readImage(const char * imgname) {
|
||||||
uint32 nnx, nny;
|
uint32_t nnx, nny;
|
||||||
float *gm=ReadFromTiff( imgname, nny, nnx);
|
float *gm=ReadFromTiff( imgname, nny, nnx);
|
||||||
if (nnx>nx) nnx=nx;
|
if (nnx>nx) nnx=nx;
|
||||||
if (nny>ny) nny=ny;
|
if (nny>ny) nny=ny;
|
||||||
@ -764,7 +764,7 @@ template <class dataType> class analogDetector {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
int readPedestalRMS(const char * imgname) {
|
int readPedestalRMS(const char * imgname) {
|
||||||
uint32 nnx, nny;
|
uint32_t nnx, nny;
|
||||||
float *gm=ReadFromTiff( imgname, nny, nnx);
|
float *gm=ReadFromTiff( imgname, nny, nnx);
|
||||||
if (nnx>nx) nnx=nx;
|
if (nnx>nx) nnx=nx;
|
||||||
if (nny>ny) nny=ny;
|
if (nny>ny) nny=ny;
|
||||||
|
@ -145,8 +145,8 @@ class etaInterpolationBase : public slsInterpolation {
|
|||||||
|
|
||||||
etastepX=(etamax-etamin)/nbetaX;
|
etastepX=(etamax-etamin)/nbetaX;
|
||||||
etastepY=(etamax-etamin)/nbetaY;
|
etastepY=(etamax-etamin)/nbetaY;
|
||||||
uint32 nnx;
|
uint32_t nnx;
|
||||||
uint32 nny;
|
uint32_t nny;
|
||||||
float *gm=ReadFromTiff(imgname, nnx, nny);
|
float *gm=ReadFromTiff(imgname, nnx, nny);
|
||||||
/* if (nnx!=nny) { */
|
/* if (nnx!=nny) { */
|
||||||
/* cout << "different number of bins in x " << nnx << " and y " << nny<< " !"<< endl; */
|
/* cout << "different number of bins in x " << nnx << " and y " << nny<< " !"<< endl; */
|
||||||
|
@ -190,7 +190,7 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << "threshold is " << thr << endl;
|
cout << "threshold is " << thr << endl;
|
||||||
cout << "Nframes is " << nframes << endl;
|
cout << "Nframes is " << nframes << endl;
|
||||||
|
|
||||||
uint32 nnx, nny;
|
uint32_t nnx, nny;
|
||||||
double *gmap;
|
double *gmap;
|
||||||
|
|
||||||
// if (gainfname) {
|
// if (gainfname) {
|
||||||
|
@ -190,7 +190,7 @@ int main(int argc, char *argv[]) {
|
|||||||
cout << "threshold is " << thr << endl;
|
cout << "threshold is " << thr << endl;
|
||||||
cout << "Nframes is " << nframes << endl;
|
cout << "Nframes is " << nframes << endl;
|
||||||
|
|
||||||
uint32 nnx, nny;
|
uint32_t nnx, nny;
|
||||||
double *gmap;
|
double *gmap;
|
||||||
|
|
||||||
// if (gainfname) {
|
// if (gainfname) {
|
||||||
|
@ -587,8 +587,8 @@ public:
|
|||||||
|
|
||||||
int nx, ny;
|
int nx, ny;
|
||||||
dets[0]->getDetectorSize(nx,ny);
|
dets[0]->getDetectorSize(nx,ny);
|
||||||
uint32 nnx;
|
uint32_t nnx;
|
||||||
uint32 nny;
|
uint32_t nny;
|
||||||
float *gm=ReadFromTiff(imgname, nnx, nny);
|
float *gm=ReadFromTiff(imgname, nnx, nny);
|
||||||
if (ped) delete [] ped;
|
if (ped) delete [] ped;
|
||||||
if (nnx>(uint)nx) nx=nnx;
|
if (nnx>(uint)nx) nx=nnx;
|
||||||
|
@ -45,16 +45,16 @@ void *WriteToTiff(float * imgData, const char * imgname, int nrow, int ncol){
|
|||||||
return NULL;
|
return NULL;
|
||||||
};
|
};
|
||||||
|
|
||||||
float *ReadFromTiff( const char * imgname, uint32 &nrow, uint32 &ncol){
|
float *ReadFromTiff( const char * imgname, uint32_t &nrow, uint32_t &ncol){
|
||||||
// unsigned char * buff=NULL;
|
// unsigned char * buff=NULL;
|
||||||
|
|
||||||
TIFF * tif = TIFFOpen(imgname,"r");
|
TIFF * tif = TIFFOpen(imgname,"r");
|
||||||
if (tif){
|
if (tif){
|
||||||
uint32 bps;
|
uint32_t bps;
|
||||||
uint32 sampleperpixel=1;
|
uint32_t sampleperpixel=1;
|
||||||
//tsize_t linebytes;
|
//tsize_t linebytes;
|
||||||
|
|
||||||
uint32 imagelength;
|
uint32_t imagelength;
|
||||||
|
|
||||||
TIFFGetField(tif,TIFFTAG_IMAGEWIDTH,&ncol);
|
TIFFGetField(tif,TIFFTAG_IMAGEWIDTH,&ncol);
|
||||||
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &nrow);
|
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &nrow);
|
||||||
@ -65,7 +65,7 @@ float *ReadFromTiff( const char * imgname, uint32 &nrow, uint32 &ncol){
|
|||||||
float * imgData=new float[ncol*nrow];
|
float * imgData=new float[ncol*nrow];
|
||||||
//linebytes = sampleperpixel*ncol;
|
//linebytes = sampleperpixel*ncol;
|
||||||
// TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(tif, ncol*sampleperpixel));
|
// TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(tif, ncol*sampleperpixel));
|
||||||
for(uint32 irow=0; irow<nrow; irow++){
|
for(uint32_t irow=0; irow<nrow; irow++){
|
||||||
//tiffreadscanline(tif, buf, row);
|
//tiffreadscanline(tif, buf, row);
|
||||||
TIFFReadScanline(tif,&imgData[irow*ncol],irow);
|
TIFFReadScanline(tif,&imgData[irow*ncol],irow);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,6 @@
|
|||||||
|
|
||||||
void *WriteToTiff(float * imgData, const char * imgname, int nrow, int ncol);
|
void *WriteToTiff(float * imgData, const char * imgname, int nrow, int ncol);
|
||||||
|
|
||||||
float *ReadFromTiff( const char * imgname, uint32 &nrow, uint32 &ncol);
|
float *ReadFromTiff( const char * imgname, uint32_t &nrow, uint32_t &ncol);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user