Bsoft  2.1.0
Bernard's software package
ps_marker.cpp
Go to the documentation of this file.
1 
9 #include "ps_marker.h"
10 #include "ps_plot.h"
11 #include "linked_list.h"
12 #include "utilities.h"
13 
14 // Declaration of global variables
15 extern int verbose; // Level of output to the screen
16 
24 int ps_marker_plots(ofstream* fps, Bstring& title, Bproject* project)
25 {
26  long i(0), width(0), height(0), left(50), bottom(50), nmg(0), nmark(0);
27  double min_shift(1e10);
28 
29  Bfield* field = project->field;
30  Bmicrograph* mg_ref = project->field->mg;
31  Bmicrograph* mg;
32  Breconstruction* rec = project->rec;
33  Bmarker* mark;
34  Bimage* p;
35  Vector3<double> shift;
36 
37  if ( verbose & VERB_PROCESS )
38  cout << "Generating file with marker errors" << endl << endl;
39 
40  // Find the dimensions of the micrographs from the images
41  for ( field=project->field; field; field=field->next ) {
42  for ( mg=field->mg; mg; mg=mg->next ) {
43 // if ( fabs(mg_ref->tilt_angle) > fabs(mg->tilt_angle) ) mg_ref = mg;
44  shift = mg->origin - rec->origin;
45  shift[2] = 0;
46  if ( shift.length() < min_shift ) {
47  min_shift = shift.length();
48  mg_ref = mg;
49  p = read_img(mg->fmg, 0, 0);
50  if ( !p ) {
51  error_show("Error in ps_marker_errors", __FILE__, __LINE__);
52  cerr << "Micrograph " << mg->fmg << " not found" << endl;
53  return -1;
54  }
55  if ( width < p->sizeX() ) width = p->sizeX();
56  if ( height < p->sizeY() ) height = p->sizeY();
57  delete p;
58  }
59  nmg++;
60  }
61  }
62  if ( verbose & VERB_DEBUG )
63  cout << "DEBUG ps_marker_errors: width=" << width << " height=" << height << endl;
64 
65  for ( nmark=0, mark=mg_ref->mark; mark; mark=mark->next, nmark++ ) ;
66 
67  double scale(500.0/width);
68  if ( scale > 600.0/height ) scale = 600.0/height;
69 
70  long plot_width(scale*width);
71  long plot_height(scale*height);
72 
73  double mark_rad(2.5/scale);
74  double mark_diam(2*mark_rad);
75  double err_scale(5/scale);
76 
77  *fps << setprecision(4) << "/Scale " << scale << " def" << endl;
78  *fps << "/Height " << plot_height << " def\n/Width " << plot_width << " def" << endl;
79  *fps << "/Frame { newpath 0 0 moveto Width 0 lineto Width Height lineto 0 Height lineto closepath } def" << endl;
80 
82 
83  *fps << "/Axis { newpath " << mark_rad/2 << " setlinewidth [10 10] 0 setdash "
84  << mg_ref->origin[0]*(1 - cos(mg_ref->tilt_axis)) << " "
85  << mg_ref->origin[1]*(1 - sin(mg_ref->tilt_axis)) << " moveto "
86  << mg_ref->origin[0]*(1 + cos(mg_ref->tilt_axis)) << " "
87  << mg_ref->origin[1]*(1 + sin(mg_ref->tilt_axis)) << " lineto closepath} def" << endl;
88 
89  *fps << "/Ori { newpath " << mg_ref->origin[0] << " " << mg_ref->origin[1] << " 10 0 360 arc fill closepath} def" << endl;
90 
91  for ( field=project->field; field; field=field->next, i++ ) {
92  *fps << "%%Page: " << i+1 << " " << i+1 << endl;
93  *fps << "/Helvetica findfont 12 scalefont setfont" << endl;
94  *fps << "50 755 moveto (" << title << ": " << field->id << ") show" << endl;
95  *fps << "50 735 moveto (Marker traces) show" << endl;
96 
97  *fps << "/Pos [" << endl << "%mg";
98  for ( mark=mg_ref->mark; mark; mark=mark->next )
99  *fps << " " << mark->id << "x " << mark->id << "y";
100  *fps << endl;
101  for ( mg=field->mg; mg; mg=mg->next ) {
102  *fps << mg->img_num;
103  shift = mg_ref->origin - mg->origin;
104  for ( mark=mg->mark; mark; mark=mark->next )
105  *fps << " " << mark->loc[0] + shift[0] << " " << mark->loc[1] + shift[1];
106  *fps << endl;
107  }
108  *fps << "] def" << endl;
109 
110  *fps << "gsave" << endl;
111  *fps << " " << left << " " << bottom << " translate" << endl;
112  *fps << " Frame stroke" << endl;
113  *fps << " Scale Scale scale" << endl;
114  *fps << " /Helvetica findfont " << width/50 << " scalefont setfont" << endl;
115  *fps << " Ori stroke" << endl;
116  *fps << " Axis stroke" << endl;
117  *fps << " 1 setlinewidth [] 0 setdash" << endl;
118  *fps << " /nm 1 def" << endl;
119  *fps << " 1 1 " << nmark << " { " << endl;
120  *fps << " /Index exch def" << endl;
121  *fps << " /id Index def" << endl;
122  *fps << " /x Pos nm get def" << endl;
123  *fps << " /y Pos nm 1 add get def" << endl;
124  *fps << " x y moveto " << mark_diam << " " << mark_diam << " rmoveto id cvi (xxxx) cvs show stroke" << endl;
125  *fps << " x y " << mark_rad << " 0 360 arc closepath fill" << endl;
126  *fps << " x y moveto" << endl;
127  *fps << " " << 2*nmark+1 << " " << 2*nmark+1 << " Pos length " << 2*nmark+1 << " sub { " << endl;
128  *fps << " /Index2 exch def" << endl;
129  *fps << " /x Pos Index2 nm add get def" << endl;
130  *fps << " /y Pos Index2 nm add 1 add get def" << endl;
131  *fps << " x y lineto" << endl;
132  *fps << " } for stroke" << endl;
133  *fps << " x y " << mark_rad << " 0 360 arc closepath stroke" << endl;
134  *fps << " /nm nm 2 add def" << endl;
135  *fps << " } for" << endl;
136  *fps << "grestore" << endl;
137 
138  *fps << "showpage" << endl;
139  }
140 
141  for ( field=project->field; field; field=field->next, i++ ) {
142  *fps << "%%Page: " << i+1 << " " << i+1 << endl;
143  *fps << "/Helvetica findfont 12 scalefont setfont" << endl;
144  *fps << "50 755 moveto (" << title << ": " << field->id << ") show" << endl;
145  *fps << "50 735 moveto (Marker errors (x" << err_scale << ")) show" << endl;
146 
147  *fps << "/Loc [\n%id x y" << endl;
148  for ( nmark=0, mark=mg_ref->mark; mark; mark=mark->next, nmark++ )
149  *fps << mark->id << " " << mark->loc[0] << " " << mark->loc[1] << endl;
150  *fps << "] def" << endl;
151 
152  *fps << "/Err [" << endl << "%mg";
153  for ( mark=mg_ref->mark; mark; mark=mark->next )
154  *fps << " " << mark->id << "x " << mark->id << "y";
155  *fps << endl;
156  for ( mg=field->mg; mg; mg=mg->next ) {
157  *fps << mg->img_num;
158  for ( mark=mg->mark; mark; mark=mark->next )
159  *fps << " " << mark->err[0] << " " << mark->err[1];
160  *fps << endl;
161  }
162  *fps << "] def" << endl;
163 
164  *fps << "gsave" << endl;
165  *fps << " " << left << " " << bottom << " translate" << endl;
166  *fps << " Frame stroke" << endl;
167  *fps << " Scale Scale scale" << endl;
168  *fps << " /Helvetica findfont " << width/50 << " scalefont setfont" << endl;
169  *fps << " Ori stroke" << endl;
170  *fps << " Axis stroke" << endl;
171  *fps << " 1 setlinewidth [] 0 setdash" << endl;
172  *fps << " /nm -1 def" << endl;
173  *fps << " 0 3 Loc length 3 sub { " << endl;
174  *fps << " /Index exch def" << endl;
175  *fps << " /id Loc Index get def" << endl;
176  *fps << " /x Loc Index 1 add get def" << endl;
177  *fps << " /y Loc Index 2 add get def" << endl;
178  *fps << " /nm nm 2 add def" << endl;
179  *fps << " x y moveto " << mark_diam << " " << mark_diam << " rmoveto id cvi (xxxx) cvs show stroke" << endl;
180  *fps << " x y " << mark_rad << " 0 360 arc closepath fill" << endl;
181  *fps << " x y moveto" << endl;
182  *fps << " 0 " << 2*nmark+1 << " Err length " << 2*nmark+1 << " sub { " << endl;
183  *fps << " /Index2 exch def" << endl;
184  *fps << " /ex Err Index2 nm add get " << err_scale << " mul x add def" << endl;
185  *fps << " /ey Err Index2 nm add 1 add get " << err_scale << " mul y add def" << endl;
186  *fps << " ex ey lineto" << endl;
187  *fps << " } for stroke" << endl;
188  *fps << " } for" << endl;
189  *fps << "grestore" << endl;
190 
191  *fps << "showpage" << endl;
192  }
193 
194  if ( project->rec ) {
195  rec = project->rec;
196  *fps << "%%Page: " << i+1 << " " << i+1 << endl;
197  *fps << "/Helvetica findfont 12 scalefont setfont" << endl;
198  *fps << "50 755 moveto (" << title << ": " << rec->id << ") show" << endl;
199  *fps << "50 735 moveto (Marker error sum vectors) show" << endl;
200 
201  *fps << "/Vec [" << endl << "%id x y ex ey" << endl;
202  for ( mark=rec->mark; mark; mark=mark->next )
203  *fps << mark->id << " " << mark->loc[0] << " " <<
204  mark->loc[1] << " " << mark->err[0] << " " << mark->err[1] << endl;
205  *fps << "] def" << endl;
206 
207  *fps << "gsave" << endl;
208  *fps << " " << left << " " << bottom << " translate" << endl;
209  *fps << " Frame stroke" << endl;
210  *fps << " Scale Scale scale" << endl;
211  *fps << " /Helvetica findfont " << width/50 << " scalefont setfont" << endl;
212  *fps << " Ori stroke" << endl;
213  *fps << " Axis stroke" << endl;
214  *fps << " 1 setlinewidth [] 0 setdash" << endl;
215  *fps << " 0 5 Vec length 5 sub { " << endl;
216  *fps << " /Index exch def" << endl;
217  *fps << " /id Vec Index get def" << endl;
218  *fps << " /x Vec Index 1 add get def" << endl;
219  *fps << " /y Vec Index 2 add get def" << endl;
220  *fps << " /ex Vec Index 3 add get x add def" << endl;
221  *fps << " /ey Vec Index 4 add get y add def" << endl;
222  *fps << " /d ex x sub ey y sub add def" << endl;
223  *fps << " x y moveto " << mark_diam << " " << mark_diam << " rmoveto id cvi (xxxx) cvs show stroke" << endl;
224  *fps << " x y " << mark_rad << " 0 360 arc closepath fill" << endl;
225  *fps << " d 0 ne {" << endl;
226  *fps << " x y ex ey arrowline" << endl;
227 // *fps << " ex ey x y arrowline" << endl;
228  *fps << " } if" << endl;
229  *fps << " } for" << endl;
230  *fps << "grestore" << endl;
231 
232  *fps << "showpage" << endl;
233  }
234 
235  return 0;
236 }
237 
238 
252 int ps_marker_errors(Bstring& filename, Bmarker* set1, Bmarker* set2,
253  Transform t, Vector3<long> size, double err_scale)
254 {
255  if ( verbose & VERB_DEBUG )
256  cout << "DEBUG ps_marker_errors: Creating " << filename << endl;
257 
258  Bstring title("Matched deviations");
259 
260  ofstream* fps = ps_open_and_init(filename, title, 1, 600, 800);
261 
262  *fps << "/Helvetica-Bold findfont 18 scalefont setfont" << endl;
263  *fps << "40 770 moveto (" << filename << ": " << title << ") show" << endl;
264 
265  ps_marker_errors(fps, set1, set2, t, size, err_scale);
266 
267  ps_close(fps);
268 
269  return 0;
270 }
271 
272 int ps_marker_errors(ofstream* fps, Bmarker* set1, Bmarker* set2,
273  Transform t, Vector3<long> size, double err_scale)
274 {
275  if ( !set1 || !set2 ) {
276  cerr << "Error: The two sets must have the same number of points!" << endl;
277  return -1;
278  }
279 
280  long num(0);
281  double xdev(0), ydev(0);
282  Bmarker *m1, *m2;
283  Vector3<double> min = set1->loc;
284  Vector3<double> max = set1->loc;
285 
286  //determine the deviation of every point in set2 from its predicted
287  //coordinates using the tranfsform parameters
288  for ( m1=set1, m2=set2; m1; m1=m1->next, m2=m2->next ) {
289  min = min.min(m1->loc);
290  max = max.max(m1->loc);
291  m2->err[0] = t.scale[0]*(m1->loc[0] *cos(t.angle) +
292  m1->loc[1]*sin(t.angle)) + t.trans[0] - m2->loc[0];
293  m2->err[1] = t.scale[1]*(-1* m1->loc[0] *sin(t.angle) +
294  m1->loc[1]*cos(t.angle)) + t.trans[1] - m2->loc[1];
295  xdev += m2->err[0]*m2->err[0];
296  ydev += m2->err[1]*m2->err[1];
297  num++;
298  }
299  xdev = sqrt(xdev/num);
300  ydev = sqrt(ydev/num);
301 
302  long w = size[0];
303  long h = size[1];
304  double scale = 650.0/h;
305 
306  if ( verbose & VERB_DEBUG )
307  cout << "DEBUG ps_marker_errors: xdev " << xdev << " ydev " << ydev << endl;
308 
309  *fps << "/Helvetica-Bold findfont 10 scalefont setfont" << endl;
310  *fps << "40 60 moveto (Shift: " << t.trans[0] << " " << t.trans[1] << ") show" << endl;
311  *fps << "40 45 moveto (Scale: " << t.scale[0] << " " << t.scale[1] << ") show" << endl;
312  *fps << "40 30 moveto (Angle: " << t.angle*180.0/M_PI << ") show" << endl;
313  *fps << "40 15 moveto (Deviation: " << xdev << " " << ydev << " (scaled by " << err_scale << ")) show" << endl;
314  *fps << "/x_Origin 100 def \n/y_Origin 100 def \n/Height " << h << " def \n/Width " << w << " def" << endl;
315  *fps << "/Scale " << scale << " def" << endl;
316  *fps << "/err_scale " << err_scale << " def" << endl;
317  *fps << "/Frame { newpath 0 0 moveto 0 Height lineto Width Height lineto Width 0 lineto closepath } def" << endl;
318 
319  *fps << "/Data [" << endl;
320  for ( m2=set2; m2; m2=m2->next )
321  *fps << m2->loc[0] << " " << m2->loc[1] << " " << m2->err[0] << " " << m2->err[1] << endl;
322  *fps << "] def\n" << endl;
323 
324  *fps << "300 80 moveto (x axis) show" << endl;
325  *fps << "80 300 moveto gsave 90 rotate (y axis) show grestore" << endl;
326  *fps << "100 80 moveto 0 (xxxxx) cvs show\n 80 100 moveto 0 (xxxxx) cvs show" << endl;
327  *fps << w*scale+80 << " 80 moveto Width (xxxxx) cvs show" << endl;
328  *fps << "60 " << h*scale+100 << " moveto Height (xxxxx) cvs show" << endl;
329  *fps << "x_Origin y_Origin translate\nScale Scale scale" << endl;
330  *fps << "gsave \n\t5 setlinewidth \n\tFrame stroke \n\t1 setlinewidth" << endl;
331  *fps << "\t0 4 Data length 1 sub { \n\t\t/Index exch def" << endl;
332  *fps << "\t\tData Index get Data Index 1 add get err_scale 2 div 0 360 arc fill" << endl;
333  *fps << "\t\tData Index get Data Index 1 add get moveto" << endl;
334  *fps << "\t\tData Index 2 add get err_scale mul Data Index 3 add get err_scale mul rlineto stroke" << endl;
335  *fps << "\t} for \ngrestore" << endl;
336 
337  *fps << "showpage" << endl;
338 
339  return 0;
340 }
341 
351 int ps_marker_match(Bmarker* set1, Bmarker* set2, Bstring& filename)
352 {
353  if ( !set1 || !set2 ) {
354  cerr << "Error: The two sets must have the same number of points!" << endl;
355  return -1;
356  }
357 
358  long num = 0;
359  Bmarker *m1, *m2;
360  Vector3<double> min = set1->loc;
361  Vector3<double> max = set1->loc;
362 
363  //determine the deviation of every point in set2 from its predicted
364  //coordinates using the tranfsform parameters
365  for ( m1=set1, m2=set2; m1; m1=m1->next, m2=m2->next ) {
366  min = min.min(m1->loc);
367  max = max.max(m1->loc);
368  num++;
369  }
370 
371  long w = (long) (max[0] - min[0]);
372  long h = (long) (max[1] - min[1]);
373 
374  double scale = 540.0/w;
375 
376  Bstring title("Matched Features");
377  ofstream* fps = ps_open_and_init(filename, title, 1, 600, 800);
378 
379  *fps << "/Helvetica-Bold findfont 18 scalefont setfont" << endl;
380  *fps << "40 770 moveto \n(Matched Features) show" << endl;
381  *fps << "/x_Origin 50 def \n/y_Origin 50 def \n/Height " << h << " def \n/Width " << w << " def" << endl;
382  *fps << "/Frame { newpath 0 0 moveto 0 Height lineto Width Height lineto Width 0 lineto closepath } def" << endl;
383  *fps << "/Dot { newpath 0 0 moveto 0 0 5 0 360 arc fill closepath} def" << endl;
384  *fps << "/Ring { newpath 0 0 moveto 0 0 5 0 360 arc stroke closepath} def" << endl;
385  *fps << "/Scale " << scale << " def" << endl;
386 
387  *fps << "/Data [" << endl;
388  for ( m1=set1, m2=set2; m1; m1=m1->next, m2=m2->next )
389  *fps << m1->loc[0] << " " << m1->loc[1] << " " << m2->loc[0] << " " << m2->loc[1] << endl;
390  *fps << "] def\n" << endl;
391 
392  *fps << "300 20 moveto (x axis) show" << endl;
393  *fps << "30 350 moveto gsave 90 rotate (y axis) show grestore" << endl;
394  *fps << "50 20 moveto 0 (xxxx) cvs show\n 30 50 moveto 0 (xxxx) cvs show" << endl;
395  *fps << w*scale << " 20 moveto " << w << " (xxxx) cvs show" << endl;
396  *fps << "10 " << h*scale << " moveto " << h << " (xxxx) cvs show" << endl;
397  *fps << "x_Origin y_Origin translate\nScale Scale scale" << endl;
398  *fps << "gsave \n\t5 setlinewidth \n\tFrame stroke \n\t1 setlinewidth" << endl;
399  *fps << "\t0 4 Data length 1 sub { \n\t\t/Index exch def" << endl;
400  *fps << "\t\tData Index get Data Index 1 add get moveto" << endl;
401  *fps << "\t\tData Index 2 add get Data Index 3 add get lineto stroke" << endl;
402  *fps << "\t\tgsave \n\t\t\tData Index get Data Index 1 add get translate \n\t\t\tDot stroke" << endl;
403  *fps << "\t\tgrestore" << endl;
404  *fps << "\t\tgsave \n\t\t\tData Index 2 add get Data Index 3 add get translate \n\t\t\tRing stroke" << endl;
405  *fps << "\t\tgrestore \n\t} for \ngrestore" << endl;
406 
407  *fps << "showpage" << endl;
408 
409  ps_close(fps);
410 
411  return 0;
412 }
413 
414 
425 {
426  if ( !project->rec ) return -1;
427  if ( !project->rec->next ) return -1;
428 
429  Breconstruction* rec1 = project->rec;
430  Breconstruction* rec2 = project->rec->next;
431  Bmarker* mark1 = NULL;
432  Bmarker* mark2 = NULL;
433  Bstring x_label("X coordinate");
434  Bstring y_label("Y coordinate");
435  Bstring z_label("Z coordinate");
436  long i, npt;
437 
438  Vector3<double> cmin, cmax;
439 
440  for ( npt=0, mark1 = rec1->mark; mark1; mark1 = mark1->next ) if ( mark1->sel ) {
441  for ( mark2 = rec2->mark; mark2 && mark2->id != mark1->id; mark2 = mark2->next ) ;
442  if ( mark2 && mark2->sel ) npt++;
443  }
444 
445  if ( verbose )
446  cout << "Generating plot " << filename << endl << endl;
447 
448  Bstring title("Comparing dual tilt marker positions");
449  Bplot* plot = new Bplot(3, npt, 6);
450  plot->title(title);
451 
452  for ( i=0, mark1 = rec1->mark; mark1; mark1 = mark1->next ) if ( mark1->sel ) {
453  for ( mark2 = rec2->mark; mark2 && mark2->id != mark1->id; mark2 = mark2->next ) ;
454  if ( mark2 && mark2->sel ) {
455  cmin = cmin.min(mark1->loc);
456  cmin = cmin.min(mark2->loc);
457  cmax = cmax.max(mark1->loc);
458  cmax = cmax.max(mark2->loc);
459  (*plot)[i] = mark1->loc[0];
460  (*plot)[i+npt] = mark1->loc[1];
461  (*plot)[i+2*npt] = mark1->loc[2];
462  (*plot)[i+3*npt] = mark2->loc[0];
463  (*plot)[i+4*npt] = mark2->loc[1];
464  (*plot)[i+5*npt] = mark2->loc[2];
465  i++;
466  }
467  }
468 // cout << "Pages: " << plot->pages() << endl;
469  for ( i=0; i<3; i++ ) { // cout << "Setting up page " << plot->page(i).number() << endl;
470  plot->page(i).title(title);
471  plot->page(i).columns(2);
472  plot->page(i).column(0).axis(1);
473  plot->page(i).column(1).axis(3);
474  plot->page(i).column(1).type(0);
475  plot->page(i).column(1).element_size(3);
476  plot->page(i).axis(1).min(cmin[i]);
477  plot->page(i).axis(1).max(cmax[i]);
478  plot->page(i).axis(3).min(cmin[i]);
479  plot->page(i).axis(3).max(cmax[i]);
480  }
481  plot->page(0).column(0).label(x_label);
482  plot->page(0).column(1).label(x_label);
483  plot->page(1).column(0).label(y_label);
484  plot->page(1).column(1).label(y_label);
485  plot->page(2).column(0).label(z_label);
486  plot->page(2).column(1).label(z_label);
487  plot->page(0).column(0).number(0);
488  plot->page(0).column(1).number(3);
489  plot->page(1).column(0).number(1);
490  plot->page(1).column(1).number(4);
491  plot->page(2).column(0).number(2);
492  plot->page(2).column(1).number(5);
493 
494 // cout << "Zcompare setup done " << endl;
495 
496  ps_plot(filename, plot);
497 
498  delete plot;
499 
500  return 0;
501 }
verbose
int verbose
Bmicrograph
Definition: mg_processing.h:201
ps_marker.h
Header file for postscript tools dealing with Bmarkers.
Breconstruction::id
Bstring id
Definition: mg_processing.h:285
Breconstruction::mark
Bmarker * mark
Definition: mg_processing.h:310
ps_plot
int ps_plot(Bstring filename, Bplot *plot)
Generates postscript graphs.
Definition: ps_plot.cpp:129
Bproject::rec
Breconstruction * rec
Definition: mg_processing.h:347
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:116
Bstring
Definition: Bstring.h:29
Bproject::field
Bfield * field
Definition: mg_processing.h:346
ps_define_arrowline
int ps_define_arrowline(ofstream *fps)
Generates an arrow and line.
Definition: ps_plot.cpp:602
Vector3< double >
Bimage::sizeX
void sizeX(long nx)
Definition: Bimage.h:390
Bcolumn::element_size
double element_size()
Definition: Bplot.h:74
Bmicrograph::img_num
int img_num
Definition: mg_processing.h:212
error_show
int error_show(string message, string file, int line)
Displays the error with file and line reference.
Definition: utilities.cpp:719
Bplot
Definition: Bplot.h:146
Bfield::id
Bstring id
Definition: mg_processing.h:262
Bcolumn::type
long type()
Definition: Bplot.h:66
Bfield
Definition: mg_processing.h:260
VERB_PROCESS
#define VERB_PROCESS
Definition: utilities.h:111
Bcolumn::axis
long axis()
Definition: Bplot.h:68
ps_plot.h
Header file for postscript output functions.
Bmarker
Definition: marker.h:21
Bpage::axis
Baxis & axis(long id)
Definition: Bplot.h:117
Breconstruction::origin
Vector3< double > origin
Definition: mg_processing.h:296
Bpage::title
Bstring & title()
Definition: Bplot.h:100
project
Bproject * project
Definition: bshow.cpp:33
read_img
Bimage * read_img(char *filename, int readdata, int img_select)
General driver function to read multiple image formats.
Definition: rwimg.cpp:77
ps_close
int ps_close(ofstream *fps)
Closes a postscript file.
Definition: ps_plot.cpp:105
Bmarker::next
Bmarker * next
Definition: marker.h:22
Bimage::sizeY
void sizeY(long ny)
Definition: Bimage.h:391
ps_open_and_init
ofstream * ps_open_and_init(Bstring filename, Bstring title, int npages, int width, int height)
Opens and initializes a postscript file.
Definition: ps_plot.cpp:32
Bmarker::id
int id
Definition: marker.h:23
ps_dual_zcompare
int ps_dual_zcompare(Bstring &filename, Bproject *project)
Generates a PostScript file that displays X by X, Y by Y, and Z by Z plots for diagnostic purposes.
Definition: ps_marker.cpp:424
Bmicrograph::origin
Vector3< double > origin
Definition: mg_processing.h:223
Bmicrograph::tilt_axis
double tilt_axis
Definition: mg_processing.h:219
ps_marker_errors
int ps_marker_errors(Bstring &filename, Bmarker *set1, Bmarker *set2, Transform t, Vector3< long > size, double err_scale)
Output a postscript file that graphs the deviations of points in a Bmarker from their predicted locat...
Definition: ps_marker.cpp:252
Bimage
General image parameter class.
Definition: Bimage.h:177
Bpage::column
Bcolumn & column(long i)
Definition: Bplot.h:110
Bproject
Definition: mg_processing.h:336
Bmarker::err
Vector3< float > err
Definition: marker.h:26
Bplot::title
Bstring & title()
Definition: Bplot.h:194
ps_marker_plots
int ps_marker_plots(ofstream *fps, Bstring &title, Bproject *project)
Postscript plot of the errors associated with fiducial markers.
Definition: ps_marker.cpp:24
Transform::scale
Vector3< double > scale
Definition: Transform.h:31
Baxis::min
double min()
Definition: Bplot.h:30
Bmarker::loc
Vector3< float > loc
Definition: marker.h:25
M_PI
#define M_PI
Definition: utilities.h:63
utilities.h
Header file for general utilities.
Breconstruction
Definition: mg_processing.h:283
Bmicrograph::fmg
Bstring fmg
Definition: mg_processing.h:206
ps_marker_match
int ps_marker_match(Bmarker *set1, Bmarker *set2, Bstring &filename)
Output a postscript file that draws a line between matching features in a pair of coordinate sets.
Definition: ps_marker.cpp:351
Transform::trans
Vector3< double > trans
Definition: Transform.h:30
Bfield::next
Bfield * next
Definition: mg_processing.h:261
Bmicrograph::mark
Bmarker * mark
Definition: mg_processing.h:245
Bmarker::sel
int sel
Definition: marker.h:29
linked_list.h
Header file for generalized linked list functions.
Vector3::min
Type min()
Definition: Vector3.h:169
Transform::angle
double angle
Definition: Transform.h:29
Bcolumn::label
Bstring & label()
Definition: Bplot.h:63
Bplot::page
Bpage & page(long i)
Definition: Bplot.h:216
Transform
Definition: Transform.h:24
Vector3::length
double length()
Definition: Vector3.h:222
Bcolumn::number
long number()
Definition: Bplot.h:61
Baxis::max
double max()
Definition: Bplot.h:32
Bmicrograph::next
Bmicrograph * next
Definition: mg_processing.h:202
Bfield::mg
Bmicrograph * mg
Definition: mg_processing.h:267
Bpage::columns
void columns(long ncol)
Definition: Bplot.h:105
Breconstruction::next
Breconstruction * next
Definition: mg_processing.h:284
Vector3::max
Type max()
Definition: Vector3.h:175