Bsoft  2.1.0
Bernard's software package
Bimage_combine.cpp
Go to the documentation of this file.
1 
9 #include "Bimage.h"
10 #include "utilities.h"
11 
12 // Declaration of global variables
13 extern int verbose; // Level of output to the screen
14 
23 void Bimage::sum(long m, Bimage** p)
24 {
25  long i, j, k, cc, ds(x*y*z*n);
26 
27  clear();
28 
29  vector<double> b(n);
30  for ( i=0; i<n; i++ ) b[i] = 0;
31 
32  for ( j=0; j<m; j++ ) {
33  for ( i=0; i<ds; i++ )
34  for ( cc=0, k=i*c; cc<c; cc++, k++ )
35  add(k, (*p[j])[k]);
36  for ( i=0; i<n; i++ ) b[i] += p[j]->image[i].background();
37  }
38 
39  for ( i=0; i<n; i++ ) image[i].background(b[i]);
40 
41  statistics();
42 }
43 
52 void Bimage::catenate(long m, Bimage** p)
53 {
54  long i, j, k, l, ds;
55  long imgsize(c*x*y*z);
56 
57  for ( i=n=0; i<m; i++ ) if ( p[i] ) n += p[i]->n;
58 
59  if ( n < 1 ) {
60  error_show("Error: No images to concatenate!", __FILE__, __LINE__);
61  return;
62  }
63 
64  data_type(p[0]->datatype);
65  compoundtype = p[0]->compoundtype;
66  c = p[0]->c;
67  x = p[0]->x;
68  y = p[0]->y;
69  z = p[0]->z;
70 
71  images(n);
72 
74 
75  if ( verbose & VERB_PROCESS )
76  cout << "Catenating " << n << " images" << endl;
77 
78  for ( i=j=0; i<m; i++ ) if ( p[i] ) {
79  ds = imgsize*p[i]->n;
80  for ( k=j*imgsize, l=0; l<ds; k++, l++ ) set(k, (*p[i])[l]);
81  for ( k=0; k<p[i]->n; k++, j++ )
82  image[j] = p[i]->image[k];
83  }
84 
85  statistics();
86 }
87 
88 
106 Bimage* Bimage::blend(Bimage* p, long number)
107 {
108  if ( !check_if_same_size(p) ) {
109  error_show("Bimage::blend", __FILE__, __LINE__);
110  return NULL;
111  }
112 
113  if ( number < 3 ) number = 3;
114 
115  if ( verbose & VERB_LABEL )
116  cout << "Blending two images to create a series of " << number << " sub-images" << endl;
117 
118  long i, j, nn;
119  double fraction1, fraction2;
120 
123 
124  // Copy the first image into the new image structure with a new number of sub-images
125  Bimage* pnu = copy_header(number);
126  pnu->data_type(Float);
127  pnu->data_alloc();
128 
129 // cout << pnu->meta_data() << endl;
130 
131  if ( verbose & VERB_DEBUG )
132  cout << "DEBUG img_morph_blend: datasize=" << datasize << endl;
133 
134  for ( i=nn=0; nn<number; nn++ ) {
135  fraction2 = nn*1.0/(number - 1.0);
136  fraction1 = 1 - fraction2;
137  if ( verbose & VERB_PROCESS )
138  cout << "Calculating image " << nn+1 << ": dnew = " << fraction1
139  << " x image1 + " << fraction2 << " x image2" << endl;
140  for ( j=0; j<datasize; j++, i++ )
141  pnu->set(i, fraction1*(*this)[j] + fraction2*(*p)[j]);
142 // pnu->image[nn].background(fraction1*image->background() +
143 // fraction2*p->image->background());
144  pnu->image[nn].background(fraction1*background(long(0)) +
145  fraction2*p->background(long(0)));
146  }
147  if ( verbose & VERB_PROCESS ) cout << endl;
148 
149  pnu->statistics();
150 
151  return pnu;
152 }
153 
176 int Bimage::place(long nn, Bimage* p, Vector3<double> loc,
177  double radius, double scale, double shift, int operation)
178 {
179  if ( radius <= 0 ) radius = (x > y)? x: y;
180 
181  long i, si, xx, yy, zz;
182  long sz, sy, sx;
183  double sx2, sy2, sz2, r2(radius*radius), v;
184  Vector3<double> start = loc - p->image[nn].origin() + 0.5;
185  Vector3<long> lo(start);
186  Vector3<long> hi(p->size());
187  hi += lo;
188  lo = lo.max(0);
189  hi = hi.max(1);
190  hi = hi.min(size());
191 
192  if ( verbose & VERB_FULL ) {
193  cout << "Placing a small image into a larger image:" << endl;
194  cout << "Small image size: " << p->size() << endl;
195  cout << "Location: " << loc << endl;
196  cout << "Low limits: " << lo << endl;
197  cout << "High limits: " << hi << endl << endl;
198  }
199 
200  for ( zz=lo[2]; zz<hi[2]; zz++ ) {
201  sz = (long) zz - start[2];
202  sz2 = p->image[nn].origin()[2] - sz;
203  sz2 *= sz2;
204  for ( yy=lo[1]; yy<hi[1]; yy++ ) {
205  sy = (long) yy - start[1];
206  sy2 = p->image[nn].origin()[1] - sy;
207  sy2 *= sy2;
208  for ( xx=lo[0]; xx<hi[0]; xx++ ) {
209  sx = (long) xx - start[0];
210  sx2 = p->image[nn].origin()[0] - sx;
211  sx2 *= sx2;
212  if ( sx2 + sy2 + sz2 <= r2 ) {
213  i = index(xx, yy, zz, nn);
214  si = p->index(sx, sy, sz);
215  v = (*p)[si] * scale + shift;
216  switch ( operation ) {
217  case 1: if ( v < (*this)[i] ) set(i, v); break;
218  case 2: if ( v > (*this)[i] ) set(i, v); break;
219  default: add(i, v);
220  }
221  }
222  }
223  }
224  }
225 
226  return 0;
227 }
228 
241 {
242  if ( !next ) next = new Bimage(Float, compoundtype, size(), n);
243 
244  long i, j, cc, tx, ty, tz, xx, yy, zz;
245  float* count = (float *) next->data_pointer();
246 
247  if ( verbose & VERB_FULL ) {
248  cout << "Adding tile:" << endl;
249  cout << "Location: " << p->image[nn].origin() << endl;
250  }
251 
252  zz = p->image[nn].origin()[2];
253  for ( tz=0; tz<p->z && zz<z; tz++, zz++ ) {
254  yy = p->image[nn].origin()[1];
255  for ( ty=0; ty<p->y && yy<y; ty++, yy++ ) {
256  xx = p->image[nn].origin()[0];
257  for ( tx=0; tx<p->x && xx<x; tx++, xx++ ) {
258  i = p->index(0, tx, ty, tz, nn);
259  j = index(0, xx, yy, zz, 0);
260  for ( cc=0; cc<c; cc++, i++, j++ ) {
261  add(j, (*p)[i]);
262  count[j] += 1;
263  }
264  }
265  }
266  }
267 
268  return 0;
269 }
270 
283 {
284  long i, j, cc, tx, ty, tz, xx, yy, zz;
285  double wvol;
286  Vector3<double> d, w, imin, imax(p->size());
287 
288  // Determine overlap in all dimensions
289  for ( i=0; i<p->n; i++ ) if ( i != nn ) {
290  d = p->image[nn].origin() - p->image[i].origin();
291  if ( d.abs() < p->size() ) {
292  if ( d[0] > p->x/2 ) imin[0] = p->x - d[0];
293  if ( d[0] < -p->x/2 ) imax[0] = -d[0];
294  if ( d[1] > p->y/2 ) imin[1] = p->y - d[1];
295  if ( d[1] < -p->y/2 ) imax[1] = -d[1];
296  if ( d[2] > p->z/2 ) imin[2] = p->z - d[2];
297  if ( d[2] < -p->z/2 ) imax[2] = -d[2];
298  }
299  }
300  imin = imin.max(0);
301  imax = imax.min(p->size());
302 
303  Vector3<double> wmin(1,1,1);
304  Vector3<double> wmax(1,1,1);
305 
306  for ( i=0; i<3; ++i ) {
307  if ( imin[i] ) wmin[i] = 1.0L/imin[i];
308  if ( imax[i] ) wmax[i] = 1.0L/(p->size()[i] - imax[i]);
309  }
310 
311  if ( verbose & VERB_FULL ) {
312  cout << "Placing tile:" << endl;
313  cout << "Location: " << p->image[nn].origin() << endl;
314  cout << "Tile size: " << p->size() << endl;
315  cout << "Overlap minima: " << imin << endl;
316  cout << "Overlap maxima: " << imax << endl << endl;
317  }
318 
319  zz = p->image[nn].origin()[2];
320  for ( tz=0; tz<p->z; tz++, zz++ ) {
321  w[2] = 1;
322  if ( tz < imin[2] ) w[2] = tz*wmin[2];
323  else if ( tz > imax[2] ) w[2] = (p->z - tz)*wmax[2];
324  yy = p->image[nn].origin()[1];
325  for ( ty=0; ty<p->y; ty++, yy++ ) {
326  w[1] = 1;
327  if ( ty < imin[1] ) w[1] = ty*wmin[1];
328  else if ( ty > imax[1] ) w[1] = (p->y - ty)*wmax[1];
329  xx = p->image[nn].origin()[0];
330  for ( tx=0; tx<p->x; tx++, xx++ ) {
331  w[0] = 1;
332  if ( tx < imin[0] ) w[0] = tx*wmin[0];
333  else if ( tx > imax[0] ) w[0] = (p->x - tx)*wmax[0];
334  i = p->index(0, tx, ty, tz, nn);
335  j = index(0, xx, yy, zz, 0);
336  wvol = w[0]*w[1]*w[2];
337 // wvol = 1;
338  for ( cc=0; cc<c; cc++, i++, j++ ) add(j, (*p)[i] * wvol);
339  }
340  }
341  }
342 
343  return 0;
344 }
345 
357 {
358  long i, j, cc, tx, ty, tz, xx, yy, zz, w;
359  Vector3<long> imin, imax(p->size());
360  Vector3<double> d;
361 
362  // Determine overlap in all dimensions
363  for ( i=0; i<p->n; i++ ) if ( i != nn ) {
364  d = p->image[nn].origin() - p->image[i].origin();
365  for ( j=0; j<3; ++j ) {
366  if ( d[j] && fabs(d[j]) <= p->size()[j] ) {
367  if ( d[j] > 0 ) imin[j] = (long)(p->size()[j] - d[j])/2;
368  else imax[j] = (long)(p->size()[j] - d[j])/2;
369  }
370  }
371  }
372 
373  // Special cases: The edges of the image
374  for ( i=0; i<3; ++i )
375  if ( p->image[nn].origin()[i] + p->size()[i] >= size()[i] )
376  imax[i] = size()[i] - p->image[nn].origin()[i];
377 
378  if ( verbose & VERB_FULL ) {
379  cout << "Placing tile:" << endl;
380  cout << "Location: " << p->image[nn].origin() << endl;
381  cout << "Tile size: " << p->size() << endl;
382  cout << "Overlap minima: " << imin << endl;
383  cout << "Overlap maxima: " << imax << endl << endl;
384  }
385 
386 // if ( p->image[nn].origin()[0] < 1 ) cout << nn << tab << imin << endl;
387 
388  zz = long(p->image[nn].origin()[2] + 0.5);
389  for ( tz=0; tz<p->z; tz++, zz++ ) {
390  w = 1;
391  if ( tz < imin[2] ) w = 0;
392  else if ( tz > imax[2] ) w = 0;
393  if ( w ) {
394  yy = long(p->image[nn].origin()[1] + 0.5);
395  for ( ty=0; ty<p->y; ty++, yy++ ) {
396  w = 1;
397  if ( ty < imin[1] ) w = 0;
398  else if ( ty > imax[1] ) w = 0;
399  if ( w ) {
400  xx = long(p->image[nn].origin()[0] + 0.5);
401  for ( tx=0; tx<p->x; tx++, xx++ ) {
402  w = 1;
403  if ( tx < imin[0] ) w = 0;
404  else if ( tx > imax[0] ) w = 0;
405  if ( w ) {
406  i = p->index(tx, ty, tz, nn);
407  j = index(xx, yy, zz);
408  for ( cc=0; cc<c; cc++, i++, j++ ) set(j, (*p)[i]);
409  }
410  }
411  }
412  }
413  }
414  }
415 
416  return 0;
417 }
418 
433 int Bimage::assemble_tiles(Bimage* pt, int flag)
434 {
435  clear();
436 
437  for ( long nn=0; nn<pt->n; nn++ ) {
438  if ( flag == 1 ) {
439  place_with_overlap(pt, nn);
440  } else if ( flag == 2 ) {
441  place_central_part(pt, nn);
442  } else {
443  place_with_addition(pt, nn);
444  }
445  }
446 
447  if ( flag == 0 && next ) {
448  for ( long i=0; i<data_size(); ++i )
449  if ( (*next)[i] > 1 ) set(i, (*this)[i]/(*next)[i]);
450  delete next;
451  next = NULL;
452  }
453 
454  return 0;
455 }
456 
477 double Bimage::linear_fit(Bimage* p, Bimage* pmask, double max_exclude)
478 {
479  if ( !check_if_same_size(p) ) {
480  error_show("Bimage::linear_fit", __FILE__, __LINE__);
481  return -1.0;
482  }
483 
484  if ( max_exclude >= 1 ) max_exclude /= 100; // Assume it is a percentage
485  if ( max_exclude > 0.5 ) max_exclude = 0.5; // At least half of the data must be fit
486 
487  long i, j, nn, nm, nfit, best_excl(0);
488  long imgsize(x*y*z*c), num(imgsize);
489  int bin;
490  double sx, sx2, sy, sxy, sd, dy, denominator, a, b, R, bestR(1e30), best_a(0), best_b(0);
491  double excl_voxels, diff, maxdiff, diff_cutoff;
492 
493  int hist[1024];
494  for ( i=0; i<1024; i++ ) hist[i] = 0;
495  int* inc_mask = new int[imgsize];
496  for ( i=0; i<imgsize; i++) inc_mask[i] = 1;
497 
498  if ( pmask ) pmask->change_type(UCharacter);
499 
500  if ( verbose & VERB_LABEL ) {
501  cout << "Linear least squares fit: image2 = intercept + slope x image1" << endl;
502  cout << "Maximum voxels to exclude: " << 100.0*max_exclude << " %" << endl;
503  }
504 
505  if ( verbose & VERB_FULL )
506  cout << " %Set\t Voxels \t%Excluded\tIntercept\tSlope\t\tR" << endl;
507  else if ( verbose & VERB_PROCESS )
508  cout << "Intercept\t Slope\t R-factor\tExcluded\t%" << endl;
509 
510  for ( nn=0; nn<n; nn++) {
511  best_excl = 0;
512  best_a = best_b = 0;
513  bestR = 1e30;
514  if ( pmask ) {
515  nm = nn;
516  if ( pmask->images() < n ) nm = 0;
517  for ( num=j=0, i=nm*imgsize; j<imgsize; j++,i++ ) {
518  if ( (*pmask)[i] ) {
519  inc_mask[i] = 1;
520  num++;
521  } else inc_mask[j] = -1;
522  }
523  }
524  for ( excl_voxels = 0; excl_voxels < max_exclude+0.01; excl_voxels += 0.01 ) {
525  nfit = 0;
526  a = b = sx = sx2 = sy = sxy = sd = dy = maxdiff = 0;
527  for ( j=0, i=nn*imgsize; j<imgsize; j++, i++ ) if ( inc_mask[j] > 0 ) {
528  sx += (*this)[i];
529  sy += (*p)[i];
530  sx2 += (*this)[i]*(*this)[i];
531  sxy += (*this)[i]*(*p)[i];
532  nfit++;
533  }
534  denominator = nfit*sx2 - sx*sx;
535  if ( denominator ) {
536  a = (sx2*sy - sx*sxy)/denominator;
537  b = (nfit*sxy - sx*sy) /denominator;
538  }
539  sy /= nfit;
540 
541  for ( j=0, i=nn*imgsize; j<imgsize; j++, i++ ) if ( inc_mask[j] >= 0 ) {
542  diff = a + b*(*this)[i] - (*p)[i];
543  if ( inc_mask[j] ) {
544  dy += diff*diff;
545  sd += ((*p)[i]-sy)*((*p)[i]-sy);
546  }
547  diff = fabs(diff);
548  if ( maxdiff < diff ) maxdiff = diff;
549  }
550  R = 1e30;
551  if ( dy < 1e-30 ) R = 0;
552  else if ( sd ) R = sqrt(dy/sd);
553  if ( bestR > R ) {
554  bestR = R;
555  best_a = a;
556  best_b = b;
557  best_excl = num - nfit;
558  }
559 
560  if ( verbose & VERB_FULL )
561  cout<< 100*excl_voxels << tab << nfit << tab
562  << 100.0-nfit*100.0/num << tab << a << tab << b << tab << R << endl;
563 
564  if ( verbose & VERB_DEBUG )
565  cout << "DEBUG img_linear_fit: maxdiff=" << maxdiff << endl;
566  if ( maxdiff < 1e-30 ) maxdiff = 1;
567  for ( i=0; i<1024; i++ ) hist[i] = 0;
568  for ( j=0, i=nn*imgsize; j<imgsize; j++, i++ ) if ( inc_mask[j] >= 0 ) {
569  diff = fabs(a + b*(*this)[i] - (*p)[i]);
570  bin = (int) (1000*diff/maxdiff);
571  if ( bin > 999 ) bin = 999;
572  hist[bin]++;
573  }
574 
575  i = 999;
576  j = hist[i];
577  while ( i > 1 && j < num*excl_voxels ) {
578  i--;
579  j += hist[i];
580  }
581  diff_cutoff = i*maxdiff/1000.0;
582 
583  for ( j=0, i=nn*imgsize; j<imgsize; j++, i++ ) if ( inc_mask[j] >= 0 ) {
584  diff = fabs(a + b*(*this)[i] - (*p)[i]);
585  inc_mask[j] = 1;
586  if ( diff > diff_cutoff ) inc_mask[j] = 0;
587  }
588  }
589 
590  for ( j=0, i=nn*imgsize; j<imgsize; j++, i++ )
591  set(i, best_a + best_b*(*this)[i] - (*p)[i]);
592 
593  image[nn].FOM(bestR);
594 
595  if ( verbose & VERB_PROCESS )
596  cout << best_a << tab << best_b << tab << bestR << tab << best_excl << tab << best_excl*100.0/num << " %" << endl;
597  }
598 
599  delete[] inc_mask;
600 
601  if ( verbose >= VERB_PROCESS ) cout << endl;
602 
603  return bestR;
604 }
605 
615 int Bimage::histomatch(Bimage* p, long bins)
616 {
617  if ( !check_if_same_size(p) ) {
618  error_show("Bimage::histomatch", __FILE__, __LINE__);
619  return -1;
620  }
621 
622  long i;
623  long h1, h2;
624  double denom, fraction;
625  int* hist1 = new int[bins];
626  int* hist2 = new int[bins];
627  int* map = new int[bins];
628  double* dens = new double[bins];
629 
630  for ( i=0; i<bins; i++ )
631  hist1[i] = hist2[i] = 0;
632 
633  if ( verbose & VERB_LABEL )
634  cout << "Matching histograms in " << bins << " bins:" << endl << endl;
635 
636  for ( i=0; i<datasize; i++ ) {
637  h1 = (long) (bins*((*this)[i] - min)/(max - min));
638  h2 = (long) (bins*((*p)[i] - p->minimum())/(p->maximum() - p->minimum()));
639  if ( h1 >= bins ) h1 = bins - 1;
640  if ( h2 >= bins ) h2 = bins - 1;
641  hist1[h1]++;
642  hist2[h2]++;
643  }
644 
645  if ( verbose & VERB_DEBUG )
646  cout << "Histograms done" << endl;
647 
648  for ( i=bins-1; i>0; i-- ) {
649  hist1[i-1] += hist1[i];
650  hist2[i-1] += hist2[i];
651  }
652 
653  if ( verbose & VERB_DEBUG )
654  cout << "Integration done" << endl;
655 
656  for ( h2=0; h2<bins; h2++ ) {
657  h1 = 0;
658  while ( ( h1 < bins ) && ( hist1[h1] > hist2[h2] ) ) h1++;
659  if ( h1 > 0 ) h1--;
660  if ( h2 < bins - 1 )
661  denom = hist1[h1+1] - hist1[h1] - hist2[h2+1] + hist2[h2];
662  else
663  denom = hist1[h1] - hist1[h1-1] - hist2[h2] + hist2[h2-1];
664  if ( denom != 0 )
665  fraction = (hist2[h2] - hist1[h1])/denom;
666  else
667  fraction = 0.5;
668  map[h2] = h1;
669  dens[h2] = (h2 + fraction)*(max - min)/bins + min;
670  }
671 
672  if ( verbose & VERB_DEBUG ) {
673  cout << "Mapping calculated" << endl;
674  cout << "Bin\tHist1\tHist2\tMapping\tDensity" << endl;
675  for ( i=0; i<bins; i++ )
676  cout << i << tab << hist1[i] << tab << hist2[i] << tab
677  << map[i] << tab << dens[i] << endl;
678  }
679 
680  for ( i=0; i<datasize; i++ ) {
681  h2 = (int) (bins*((*p)[i] - p->minimum())/(p->maximum() - p->minimum()));
682  if ( h2 >= bins ) h2 = bins - 1;
683  set(i, dens[map[h2]]);
684  }
685 
686  statistics();
687 
688  if ( verbose & VERB_DEBUG )
689  cout << "Histogram matching done" << endl;
690 
691  delete[] hist1;
692  delete[] hist2;
693  delete[] map;
694  delete[] dens;
695 
696  return 0;
697 }
698 
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:116
Bimage::shift
int shift(Vector3< double > vec, int fill_type=0, double fill=0)
Shifts an image.
Definition: Bimage_transform.cpp:589
UCharacter
@ UCharacter
Definition: utilities.h:153
Bimage::set
void set(long j, double v)
Sets a single value at the given index.
Definition: Bimage.cpp:1118
Bimage::next
Bimage * next
Definition: Bimage.h:179
Bimage::Bimage
Bimage()
Initializes an image.
Definition: Bimage.cpp:43
Vector3< double >
Bimage::sum
void sum(long m, Bimage **p)
Sums an array of images with their FOM blocks.
Definition: Bimage_combine.cpp:23
error_show
int error_show(string message, string file, int line)
Displays the error with file and line reference.
Definition: utilities.cpp:719
Bimage::background
double background(long nn)
Definition: Bimage.h:549
Bimage::size
Vector3< long > size() const
Definition: Bimage.h:386
Bimage::calculate_background
int calculate_background(long nn, int flag)
Calculates the background for one sub-image.
Definition: Bimage_background.cpp:27
Bimage::place_with_addition
int place_with_addition(Bimage *p, long nn)
Packs a tile into a new composite image with addition within overlap.
Definition: Bimage_combine.cpp:240
Bsub_image::FOM
double FOM()
Definition: Bimage.h:165
Bimage::image
Bsub_image * image
Definition: Bimage.h:202
VERB_PROCESS
#define VERB_PROCESS
Definition: utilities.h:111
Bimage::maximum
double maximum()
Definition: Bimage.h:542
Bimage::place_central_part
int place_central_part(Bimage *p, long nn)
Packs a tile into a new composite image, retaining only the central part.
Definition: Bimage_combine.cpp:356
Bimage::images
long images()
Definition: Bimage.h:504
Bsub_image::background
double background()
Definition: Bimage.h:125
Bsub_image::origin
void origin(double x, double y, double z)
Definition: Bimage.h:136
Bimage::add
void add(long j, double v)
Definition: Bimage.h:321
Bimage::data_size
long data_size()
Definition: Bimage.h:270
Bimage::place_with_overlap
int place_with_overlap(Bimage *p, long nn)
Packs a tile into a new composite image with weighted overlap.
Definition: Bimage_combine.cpp:282
Bimage
General image parameter class.
Definition: Bimage.h:177
Bimage::data_alloc
unsigned char * data_alloc()
Definition: Bimage.h:271
Bimage::place
int place(long nn, Bimage *p, Vector3< double > loc, double radius=0, double scale=1, double shift=0, int operation=0)
Places a small image into a large image.
Definition: Bimage_combine.cpp:176
Bimage::clear
void clear()
Definition: Bimage.h:705
Bimage::assemble_tiles
int assemble_tiles(Bimage *pt, int flag=0)
Assembles overlapping tiles into this image.
Definition: Bimage_combine.cpp:433
Bimage.h
Header file for image class.
Bimage::data_alloc_and_clear
unsigned char * data_alloc_and_clear()
Definition: Bimage.h:272
Bimage::data_type
DataType data_type()
Definition: Bimage.h:362
utilities.h
Header file for general utilities.
tab
ostream & tab(ostream &out)
Definition: utilities.cpp:22
verbose
int verbose
Bimage::change_type
void change_type(char letter)
Get the data type indicated by a single letter code.
Definition: Bimage.cpp:1765
Bimage::index
long index(long nx, long ny) const
Definition: Bimage.h:396
Bimage::copy_header
Bimage * copy_header()
Definition: Bimage.h:658
Bimage::linear_fit
double linear_fit(Bimage *p, Bimage *pmask, double max_exclude)
Linear least squares fit of two images.
Definition: Bimage_combine.cpp:477
Bimage::catenate
void catenate(long m, Bimage **p)
Catenates an array of images of the same size into a multi-image structure.
Definition: Bimage_combine.cpp:52
VERB_FULL
#define VERB_FULL
Definition: utilities.h:113
Bimage::data_pointer
unsigned char * data_pointer()
Definition: Bimage.h:284
Vector3::min
Type min()
Definition: Vector3.h:169
Bimage::minimum
double minimum()
Definition: Bimage.h:541
Bimage::blend
Bimage * blend(Bimage *p, long number)
Blends the two images, creating a new set of sub-images.
Definition: Bimage_combine.cpp:106
Float
@ Float
Definition: utilities.h:161
VERB_LABEL
#define VERB_LABEL
Definition: utilities.h:110
Bimage::histomatch
int histomatch(Bimage *p, long bins)
Fits two images by matching the histogram of the second to the first.
Definition: Bimage_combine.cpp:615
Bimage::statistics
long statistics()
Calculates the statistics for an image.
Definition: Bimage_stats.cpp:22
Bimage::check_if_same_size
bool check_if_same_size(Bimage *p)
Check if two images are the same size.
Definition: Bimage.cpp:566
Vector3::abs
Vector3 abs()
Definition: Vector3.h:201
Vector3::max
Type max()
Definition: Vector3.h:175