~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/covira/brain.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* brain.c
  2  *
  3  * @(#)Top level Brain View Tool
  4  *
  5  */
  6 
  7 #include <fcntl.h>
  8 #include <sys/file.h>
  9 #ifdef IBM
 10 #define O_RDONLY        00000000/** can't find **/
 11 #endif
 12 #include <tina/all_tina.h>
 13 #include <tina/brain.h>
 14 #include <tina/brainfuncs.h>
 15 
 16 /*
 17 input parameters
 18 */
 19 static int im_height = 128;
 20 static int im_width = 128;
 21 static Vartype im_vtype;
 22 static char directory[64] = "/bucket/images/covira/helix";
 23 static char fbasename[64] = "test";
 24 static char filename[64];
 25 static int lfile = 1, ufile = 31;
 26 static double zscale = 4.0;
 27 static int tv_val;
 28 
 29 /*
 30 snake parameters
 31 */
 32 static int steps = 100;
 33 
 34 /*
 35 statsnake parameters
 36 */
 37 static int ss_flag;
 38 static int ss_min = 3;
 39 static int ss_max = 7;
 40 static double k_s_d = 2.0;
 41 
 42 static void filename_make(int i)
 43 {
 44     char num[16];
 45     if (i >= 0)
 46     {
 47         sprintf(num, "%d", i);
 48         string_append(filename, directory, "/", fbasename, ".", num, NULL);
 49     } else
 50         string_append(filename, directory, "/", fbasename, NULL);
 51 }
 52 
 53 static void load_nema_files_proc(void)
 54 {
 55     int i;
 56     char     temp[512];
 57 
 58     ims_make(float_v, lfile, ufile + 1, fabs(zscale));
 59     tv_camera2_image(trans_tv_get(), im_width, im_height);
 60     for (i = lfile; i <= ufile; i++)
 61     {
 62         Imrect *im, *im1;
 63         filename_make(i);
 64         string_append(filename, directory, "/", fbasename, NULL);
 65         parse_fname(filename,temp,i);
 66         sprintf(filename, "%s%s", temp, ".ani");
 67         im1 = (Imrect *)nema_read_image(filename);
 68         im = imf_scale(im1, 0.0, 255.0);
 69         tv_imrect2(trans_tv_get(), im);
 70         ims_z_set(i);
 71         ims_image_set(im1);
 72         im_free(im);
 73     }
 74     if (zscale < 0.0)
 75         ims_reverse_image_order();
 76     ims_camera2(work_tv_get());
 77     ims_init_cursor();
 78     tv_free_background(sagit_tv_get());
 79     tv_free_background(front_tv_get());
 80     redraw_all();
 81 }
 82 
 83 static void load_dicom_files_proc(void)
 84 {
 85     int i;
 86     char     temp[512];
 87 
 88     ims_make(float_v, lfile, ufile + 1, fabs(zscale));
 89     tv_camera2_image(trans_tv_get(), im_width, im_height);
 90     for (i = lfile; i <= ufile; i++)
 91     {
 92         Imrect *im, *im1;
 93         filename_make(i);
 94         string_append(filename, directory, "/", fbasename, NULL);
 95         parse_fname(filename,temp,i);
 96         sprintf(filename, "%s%s", temp, ".ani");
 97         im1 = (Imrect *)dicom_read_image(filename);
 98         im = imf_scale(im1, 0.0, 255.0);
 99         tv_imrect2(trans_tv_get(), im);
100         ims_z_set(i);
101         ims_image_set(im1);
102         im_free(im);
103     }
104     if (zscale < 0.0)
105         ims_reverse_image_order();
106     ims_camera2(work_tv_get());
107     ims_init_cursor();
108     tv_free_background(sagit_tv_get());
109     tv_free_background(front_tv_get());
110     redraw_all();
111 }
112 
113 static void load_block_file_proc(void)
114 {
115     int i, fd;
116 
117     filename_make(-1);
118     if ((fd = open(filename, O_RDONLY, 0644)) == -1)
119     {
120         char temps[128];
121         (void) string_append(temps, "load_block_file_proc: cannot open file ",
122                              filename, 0);
123         error(temps, non_fatal);
124         return;
125     }
126     fd = open(filename, O_RDONLY, 0644);
127 
128     ims_make(im_vtype, lfile, ufile + 1, fabs(zscale));
129 
130     tv_camera2_image(trans_tv_get(), im_width, im_height);
131     for (i = lfile; i <= ufile; i++)
132     {
133         Imrect *im1, *im;
134         im1 = raw_fd_read_image(fd, im_width, im_height, im_vtype);
135         im = imf_scale(im1, 0.0, 255.0);
136         im_free(im1);
137         tv_imrect2(trans_tv_get(), im);
138         ims_z_set(i);
139         ims_image_set(im);
140     }
141     if (zscale < 0.0)
142         ims_reverse_image_order();
143 
144     (void) close(fd);
145 
146     ims_camera2(work_tv_get());
147     ims_init_cursor();
148     tv_free_background(sagit_tv_get());
149     tv_free_background(front_tv_get());
150     redraw_all();
151 }
152 
153 static void im_vtype_choice_proc(int val)
154 {
155     switch (val)
156     {
157             case 0:
158             im_vtype = uchar_v;
159             break;
160         case 1:
161             im_vtype = short_v;
162             break;
163         case 2:
164             im_vtype = ushort_v;
165             break;
166         case 3:
167             im_vtype = uint_v;
168             break;
169     }
170 }
171 
172 static void im_nvoi_choice_proc(int val)
173 {
174     if (val < NVOI)
175         ims_nvoi_set(val);
176     redraw_all();
177 }
178 
179 double gamma_factor = 1.0;
180 double lowthres = 0.0, highthres = 127.0;
181 void range_scale_proc()
182 {
183     ims_rescale_images(gamma_factor, lowthres, highthres);
184     redraw_all();
185 }
186 
187 static void bound_choice(int i)
188 {
189     switch (i)
190     {
191             case 0:
192             ss_flag = 0;
193             break;
194         default:
195             ss_flag = 1;
196             break;
197     }
198 }
199 
200 /* snake parameter dialog */
201 void snake_param_proc(void)
202 {
203     static int tool = 0;
204     if (tool != 0)
205     {
206         tw_show_dialog(tool);
207         return;
208     }
209     tool = tw_dialog("Snake Parameters");
210     tw_iglobal("Steps :", &steps, 6);
211     tw_newrow();
212     tw_fvalue("alpha:", ims_alpha_get, ims_alpha_set, 10);
213     tw_fvalue("beta:", ims_beta_get, ims_beta_set, 10);
214     tw_fvalue("pressure:", ims_pressure_get, ims_pressure_set, 10);
215     tw_newrow();
216     tw_fvalue("level:", ims_level_get, ims_level_set, 10);
217     tw_fvalue("window:", ims_window_get, ims_window_set, 10);
218     tw_fvalue("scale:", ims_scale_get, ims_scale_set, 10);
219     tw_newrow();
220     tw_fvalue("asnake:", ims_asnake_get, ims_asnake_set, 6);
221     tw_newrow();
222     tw_choice("Stat Snake: ", bound_choice, 1, "Static", "Dynamic", NULL);
223     tw_fglobal(" Range: ", &k_s_d, 5);
224     tw_iglobal(" Min gap: ", &ss_min, 5);
225     tw_iglobal(" Max gap: ", &ss_max, 5);
226     tw_end_dialog();
227 }
228 
229 static void down_proc(void)
230 {
231     ims_down();
232     redraw_all();
233 }
234 
235 static void up_proc(void)
236 {
237     ims_up();
238     redraw_all();
239 }
240 
241 static void bottom_proc(void)
242 {
243     ims_bottom();
244     redraw_all();
245 }
246 
247 static void top_proc(void)
248 {
249     ims_top();
250     redraw_all();
251 }
252 
253 static void make_movie_proc (void)
254 {
255   Tv     *tv = tv_get_next ();
256   double  theta;
257   double x_rot = 0;
258   double y_rot = 0.0314;
259   int count = 200;
260 
261   Vec3    v =
262   {Vec3_id};
263   int     i;
264 
265   if (tv == NULL || tv->tv_screen == NULL)
266     return;
267 
268   if (tv->zoomlevel != ZOOM3 && tv->zoomlevel != ZOOMGR)
269     return;
270 
271   if (tv->zoomlevel == ZOOMGR)
272     {                           /* can only rotate about z axis */
273       v = vec3_ez ();
274       theta = sqrt (x_rot * x_rot + y_rot * y_rot);
275       if (theta == 0.0)
276         return;
277 
278     }
279   else
280     {
281       v = vec3_sum (vec3_times (x_rot / count, tv->ex3),
282                     vec3_times (y_rot / count, tv->ey3));
283       theta = vec3_mod (v);
284       if (theta == 0.0)
285         return;
286       v = vec3_times (1 / theta, v);    /* to make it unit */
287     }
288   tv_start_movie (tv);
289   tv_repaint (tv);
290   tv_make_movie (tv);
291   for (i = 0; i < count; ++i)
292     {
293       tv_twist (tv, theta, v);
294       tv_repaint (tv);
295       tv_make_movie (tv);
296     }
297 }
298 
299 static void loop_proc(void)
300 {
301     Tv *tv = work_tv_get();
302 
303     if (tv_val!=3)
304     {
305        ims_loop_draw(tv);
306        tv_repaint(tv);
307     }
308     else make_movie_proc();
309 }
310 
311 static int voi_import_gap = 1;
312 
313 static void voi_down_proc(void)
314 {
315     int i;
316     ims_voi_mark();
317     for (i = 0; i < voi_import_gap; i++)
318         ims_down();
319     ims_voi_import();
320     redraw_all();
321 }
322 
323 static void voi_up_proc(void)
324 {
325     int i;
326     ims_voi_mark();
327     for (i = 0; i < voi_import_gap; i++)
328         ims_up();
329     ims_voi_import();
330     redraw_all();
331 }
332 
333 static void cursor_proc(void)
334 {
335     tv_set_mouse(work_tv_get(), work_cursor_mouse());
336     tv_set_mouse(front_tv_get(), front_cursor_mouse());
337     tv_set_mouse(sagit_tv_get(), sagit_cursor_mouse());
338 }
339 
340 static void spline_draw_proc(void)
341 {
342     tv_set_mouse(work_tv_get(), spline_periodic_draw_mouse());
343     tv_set_mouse(sagit_tv_get(), spline_tube_draw_mouse());
344 }
345 
346 static void spline_edit_proc(void)
347 {
348     tv_set_mouse(work_tv_get(), spline_edit_mouse());
349 }
350 
351 static void snake_edit_proc(void)
352 {
353     tv_set_mouse(work_tv_get(), snake_edit_mouse());
354 }
355 
356 static void string_draw_proc(void)
357 {
358     tv_set_mouse(work_tv_get(), string_draw_mouse());
359 }
360 
361 /******************************************************************************/
362 
363 static void snake_run_rts_proc(void)
364 {
365     int i;
366     double d;
367     Tv *tv = work_tv_get();
368 
369     tv_set_overlay(tv);
370     ims_snake_draw(tv);
371     for (i = 0; i < 1 + steps / 10; i++)
372     {
373         ims_snake_draw(tv);
374         d = ims_snake_run_rts(10);
375         ims_snake_draw(tv);
376     }
377     ims_snake_changed();
378     tv_reset_draw(tv);
379     tv_repaint(tv);
380 }
381 
382 static void snake_run_trans_proc(void)
383 {
384     int i;
385     double d;
386     Tv *tv = work_tv_get();
387 
388     tv_set_overlay(tv);
389     ims_snake_draw(tv);
390     for (i = 0; i < 1 + steps / 10; i++)
391     {
392         ims_snake_draw(tv);
393         d = ims_snake_run_trans(10);
394         ims_snake_draw(tv);
395     }
396     ims_snake_changed();
397     tv_reset_draw(tv);
398     tv_repaint(tv);
399 }
400 
401 static void snake_run_scale_proc(void)
402 {
403     int i;
404     double d;
405     Tv *tv = work_tv_get();
406 
407     tv_set_overlay(tv);
408     ims_snake_draw(tv);
409     for (i = 0; i < 1 + steps / 10; i++)
410     {
411         ims_snake_draw(tv);
412         d = ims_snake_run_scale(10);
413         ims_snake_draw(tv);
414     }
415     ims_snake_changed();
416     tv_reset_draw(tv);
417     tv_repaint(tv);
418 }
419 
420 static void snake_run_rot_proc(void)
421 {
422     int i;
423     double d;
424     Tv *tv = work_tv_get();
425 
426     tv_set_overlay(tv);
427     ims_snake_draw(tv);
428     for (i = 0; i < 1 + steps / 10; i++)
429     {
430         ims_snake_draw(tv);
431         d = ims_snake_run_rot(10);
432         ims_snake_draw(tv);
433     }
434     ims_snake_changed();
435     tv_reset_draw(tv);
436     tv_repaint(tv);
437 }
438 
439 static void snake_run_all_proc(void)
440 {
441     int i;
442     double d;
443     double alpha = ims_alpha_get();
444     double beta = ims_beta_get();
445     Tv *tv = work_tv_get();
446 
447     tv_set_overlay(tv);
448     ims_snake_draw(tv);
449     for (i = 0; i < steps; i++)
450     {
451         ims_snake_draw(tv);
452         d = ims_snake_run_all(alpha, beta, 1);
453         ims_snake_draw(tv);
454     }
455     ims_snake_changed();
456     tv_reset_draw(tv);
457     tv_repaint(tv);
458 }
459 
460 static void stat_snake_init_proc()
461 {
462     ims_stat_snake_init(ims_snake_get(), ims_image_get());
463 }
464 
465 static void stat_snake_run_proc()
466 {
467     int i;
468     double alpha = ims_alpha_get();
469     double beta = ims_beta_get();
470     double pressure = ims_pressure_get();
471     double k0 = pow(10.0, -1.0/steps), k = 1.0;
472     Tv *tv = work_tv_get();
473 
474     tv_set_overlay(tv);
475     ims_snake_draw(tv);
476     for (i = 0; i < steps; i++)
477     {
478         ims_snake_draw(tv);
479         ims_stat_snake_run(alpha, beta, pressure,
480             k_s_d, 1, ss_flag, ss_min, ss_max, k);
481         k *= k0;
482         ims_snake_draw(tv);
483     }
484     tv_reset_draw(tv);
485     tv_repaint(tv);
486 }
487 
488 static void stat_snake_trans_proc()
489 {
490     int i;
491     double alpha = ims_alpha_get();
492     double beta = ims_beta_get();
493     double pressure = ims_pressure_get();
494     double k0 = pow(10.0, -1.0/steps), k = 1.0;
495     Tv *tv = work_tv_get();
496 
497     tv_set_overlay(tv);
498     ims_snake_draw(tv);
499     for (i = 0; i < steps; i++)
500     {
501         ims_snake_draw(tv);
502         ims_stat_snake_trans(alpha, beta, pressure, k_s_d, 1, k);
503         k *= k0;
504         ims_snake_draw(tv);
505     }
506     tv_reset_draw(tv);
507     tv_repaint(tv);
508 }
509 
510 static void snake_force_proc(void)
511 {
512     Tv *tv = work_tv_get();
513     Snake *snake = ims_snake_get();
514     Imrect *pot = ims_pot_get();
515     if (tv!=NULL && snake!=NULL && pot !=NULL) /* NAT 27/2/2000 */
516     {
517        snake_gradient_forces(snake, pot);
518        snake_force_draw(tv, snake, 10.0);
519     }
520 }
521 
522 static void snake_edge_proc(void)
523 {
524     Tv *tv = work_tv_get();
525     Snake *snake = ims_snake_get();
526     Imrect *pot = ims_pot_get();
527 
528     if (tv!=NULL && snake!=NULL && pot !=NULL) /* NAT 27/2/2000 */
529           snake_normal_graphs(tv, snake, pot);
530 }
531 
532 static void interp_proc(void)
533 {
534     ims_interpolate_spline();
535     redraw_all();
536 }
537 
538 static void interp_all_proc(void)
539 {
540     int lz = ims_lz_get();
541     int uz = ims_uz_get();
542     ims_interpolate_all_splines_between(lz, uz);
543     redraw_all();
544 }
545 
546 static void snake_auto_proc(void)
547 {
548     int z, lz;
549 
550     lz = ims_lz_get();
551     for (z = ims_z_get(); z >= lz; z -= voi_import_gap)
552     {
553         voi_up_proc();
554         snake_run_rts_proc();
555         snake_run_all_proc();
556     }
557 
558     /**
559     interp_all_proc ();
560     **/
561 }
562 
563 static void stat_snake_auto_proc(void)
564 {
565     int z, lz;
566 
567     lz = ims_lz_get();
568     for (z = ims_z_get(); z >= lz; z -= voi_import_gap)
569     {
570         voi_up_proc();
571         stat_snake_run_proc();
572     }
573 
574     /**
575     interp_all_proc ();
576     **/
577 }
578 
579 static void voi_empty_proc(void)
580 {
581     ims_voi_empty();
582     redraw_all();
583 }
584 
585 static void voi_empty_all_proc(void)
586 {
587     int z, oldz = ims_z_get();
588 
589     for (z = ims_lz_get(); z < ims_uz_get(); z++)
590     {
591         ims_z_set(z);
592         ims_voi_empty();
593     }
594     ims_z_set(oldz);
595     redraw_all();
596 }
597 
598 static void view_tool_proc(void)
599 {
600     view_tool(100, 100);
601 }
602 
603 static void tv_choice_proc(int val)
604 {
605     switch (val)
606     {
607             case 0:
608             tv_set_next(work_tv_get());
609             break;
610         case 1:
611             tv_set_next(front_tv_get());
612             break;
613         case 2:
614             tv_set_next(sagit_tv_get());
615             break;
616         case 3:
617             tv_set_next(vis3d_tv_get());
618             break;
619     }
620     tv_val = val;
621 }
622 
623 static List *surf_list = NULL;
624 
625 static void clear_surf_proc()
626 {
627     void surface_free();
628     list_rm(surf_list, splinesurf3_free);
629     surf_list = NULL;
630 }
631 
632 static void add_surf_proc()
633 {
634     void *ims_surf_make(), *surf;
635     imstack_uniform_splines(ims_imstack_get());
636     surf = ims_splinesurf3_make();
637     surf_list = ref_addtostart(surf_list, surf, 0);
638 }
639 
640 static void shade_surf_proc()
641 {
642     List *ptr;
643     Tv *tv = vis3d_tv_get();
644     double z = tv_dist3(tv, vec3_zero());
645     tv_save_draw(tv);
646     tv_set_zbuff(tv, z - 500.0, z + 500.0);
647     tv_zbuff_shade_set(tv, spec_shade_inside_1);
648     tv_zbuff_epsilon_set(0.02);
649     tv_erase(tv);
650     for (ptr = surf_list; ptr != NULL; ptr = ptr->next)
651         if (ptr->to) splinesurf3_shade(tv, ptr->to);
652     tv_reset_draw(tv);
653 }
654 
655 static void draw_surf_proc()
656 {
657     List *ptr;
658     Tv *tv = vis3d_tv_get();
659     tv_erase(tv);
660     tv_save_draw(tv);
661     for (ptr = surf_list; ptr != NULL; ptr = ptr->next)
662     {
663         tv_color_set(tv, red);
664         if (ptr->to) splinesurf3_uslices_draw(tv, ptr->to);
665         tv_color_set(tv, green);
666         if (ptr->to) splinesurf3_vslices_draw(tv, ptr->to);
667     }
668     tv_reset_draw(tv);
669 }
670 
671 static void print_voi_proc()
672 {
673     char fullname[128];
674     char svoi[8];
675     FILE *fp=NULL;
676     sprintf(svoi,"voi%d\0",ims_nvoi_get());
677     string_append(fullname, fbasename, ".", svoi, NULL);
678     fp = fopen(fullname, "w");
679     if(fp!=NULL)
680     {
681        fprintf(fp,"%s %4.2f \n",fullname,ims_all_vois_area());
682        if(fp!=NULL) ims_voi_print(fp);
683        fclose(fp);
684     }
685 }
686 
687 static void read_voi_proc()
688 {
689     char fullname[128];
690     char svoi[8];
691     FILE *fp=NULL;
692     sprintf(svoi,"voi%d\0",ims_nvoi_get());
693     string_append(fullname, fbasename, ".", svoi, NULL);
694     fp = fopen(fullname, "r");
695     if(fp!=NULL)
696     {
697        fscanf(fp,"%*s %*s");
698        ims_voi_read(fp);
699        fclose(fp);
700     }
701     redraw_all();
702 }
703 
704 static void print_surf_proc()
705 {
706     List *ptr;
707     char fullname[128];
708     FILE *fp;
709 
710     string_append(fullname, fbasename, ".", "surf", NULL);
711     fp = fopen(fullname, "w");
712     for (ptr = surf_list; ptr != NULL; ptr = ptr->next)
713         if (ptr->to) splinesurf3_print(fp, ptr->to);
714     fclose(fp);
715 }
716 
717 static void read_surf_proc()
718 {
719     char fullname[128];
720     FILE *fp;
721     void *surf;
722     clear_surf_proc();
723     string_append(fullname, fbasename, ".", "surf", NULL);
724     fp = fopen(fullname, "r");
725     while ((surf = splinesurf3_read(fp)) != NULL)
726         surf_list = ref_addtostart(surf_list, surf, 0);
727     fclose(fp);
728     draw_surf_proc();
729 }
730 
731 
732 #define NU 20
733 #define NV 10
734 
735 /*
736 static void test_proc(void)
737 {
738     List *start = dd_list_make(1000, VEC3);
739     List *end = dd_get_end(start), *ptr;
740     Tstring *str = str_make(LOOP, start, end);
741     int i;
742     for(ptr = str->start, i = 0; ; ptr = ptr->next, i++)
743     {
744         double ang = TWOPI*i/1000;
745         double x = 64.5+32*sin(ang);
746         double y = 64.5+32*cos(ang);
747         double z = 16.5+10*sin(ang);
748         Vec3 p = vec3(x, y, z);
749         ptr->to = vec3_make(p);
750         if(ptr == str->end)
751             break;
752     }
753     aivru_multi_snake_set_occluding_boundary(str);
754     aivru_multi_snake_interpolate_tube();
755     redraw_all();
756 }
757 static void test_proc()
758 {
759     aivru_print_voi_surface("test.surf");
760 }
761 */
762 
763 void extrap_tube_proc()
764 {
765     ims_tube_interp();
766     redraw_all();
767 }
768 
769 /* Load & display image stack */
770 void file_proc(void)
771 {
772     int dialog = 0;
773     if (dialog)
774     {
775         tw_show_dialog(dialog);
776         return;
777     }
778     dialog = tw_dialog("File Management");
779     tw_label("Load :");
780     tw_button("Nema", load_nema_files_proc);
781     tw_button("Dicom", load_dicom_files_proc);
782     tw_button("Block", load_block_file_proc);
783     tw_choice("Type :", im_vtype_choice_proc,
784               0, "Uchar", "Short", "Ushort", "Uint", NULL);
785     tw_newrow();
786 
787     tw_sglobal("Directory: ", directory, 50);
788     tw_newrow();
789     tw_sglobal("Basename: ", fbasename, 50);
790     tw_newrow();
791 
792     tw_iglobal("First num: ", &lfile, 10);
793     tw_iglobal("Last num:  ", &ufile, 10);
794     tw_newrow();
795 
796     tw_iglobal("Height: ", &im_height, 10);
797     tw_iglobal("Width:   ", &im_width, 10);
798     tw_fglobal("Z scale: ", &zscale, 6);
799     tw_newrow();
800     tw_button("Rescale", range_scale_proc, NULL);
801     tw_fglobal("Gamma: ", &gamma_factor, 6);
802     tw_fglobal("Min: ", &lowthres, 6);
803     tw_fglobal("Max: ", &highthres, 6);
804     tw_newrow();
805     tw_choice("VOL: ", im_nvoi_choice_proc, 0,
806               "", "1", "2", "3", "4", "5", NULL);
807     tw_button("Interpolate VOL", interp_all_proc);
808     tw_button("Empty VOL ", voi_empty_all_proc);
809     tw_newrow();
810     tw_button("print vol", print_voi_proc);
811     tw_button("read vol", read_voi_proc);
812     tw_newrow();
813 
814     tw_label("Surface Builder ");
815     tw_button("clear", clear_surf_proc);
816     tw_button("add", add_surf_proc);
817     tw_button("draw", draw_surf_proc);
818     tw_button("shade", shade_surf_proc);
819     tw_newrow();
820     tw_button("print surf", print_surf_proc);
821     tw_button("read surf", read_surf_proc);
822     tw_end_dialog();
823 }
824 
825 
826 int main(int argc, char **argv)
827 {
828     tv_cmap_gamma_set(NULL, 1.0);
829     tw_init(&argc, argv);
830 
831     tw_tool("Scribe Tool", 560, 360);
832 
833     tw_choice("View tv  :", tv_choice_proc,
834               0, "wrk", "frnt", "sag", "3D", NULL);
835     tw_label("  ");
836     tw_button("View Tool", view_tool_proc, NULL);
837 /*
838     tw_button ("EPS Dump", epsf_dump_tool, NULL);
839 */
840     tw_save_button();
841 /*
842     tw_button("test", test_proc);
843 */
844     tw_newrow();
845 
846     tw_button("Image Files", file_proc);
847     tw_button(" << ", bottom_proc);
848     tw_button(" <  ", down_proc);
849     tw_button(" >  ", up_proc);
850     tw_button(" >> ", top_proc);
851     tw_button("animate", loop_proc);
852     tw_newrow();
853 
854     tw_button("   View    ", cursor_proc);
855     tw_label("  cursor  |  zoom  |  init");
856     tw_newrow();
857 
858     tw_button("Draw Spline", spline_draw_proc);
859     tw_label("  mark     | create | NULL    ");
860     tw_newrow();
861 
862     tw_button("Draw string", string_draw_proc);
863     tw_label("  draw     | NULL   | NULL    ");
864     tw_newrow();
865 
866     tw_button("Edit Spline", spline_edit_proc);
867     tw_label("  move     | insert | delete");
868     tw_newrow();
869 
870     tw_button("Edit Snake ", snake_edit_proc);
871     tw_label("  push      |  shift   | scale");
872     tw_newrow();
873 
874     tw_choice("Background Display:", work_image_choice_proc,
875               0, "Image", "Potential", "None", NULL);
876     tw_button("Potentials", ims_pots_get);
877     tw_newrow();
878 
879     tw_choice("Contour Display:", work_voi_choice_proc,
880               0, "Spline", " String", "Snake", NULL);
881     tw_button("Parameters", snake_param_proc);
882     tw_newrow();
883     tw_button(" voi <  ", voi_down_proc);
884     tw_button(" voi >  ", voi_up_proc);
885 /*
886     tw_iglobal("  Gap :", &voi_import_gap, 5);
887 */
888     tw_button("  Interpolate voi  ", interp_proc);
889     tw_button("  Empty voi  ", voi_empty_proc);
890     tw_newrow();
891 
892     tw_button("Translate", snake_run_trans_proc);
893     tw_button("Rotate", snake_run_rot_proc);
894     tw_button("Scale", snake_run_scale_proc);
895     tw_button("T+R+S", snake_run_rts_proc);
896     tw_button("T+R+S+Internal", snake_run_all_proc);
897     tw_newrow();
898 
899     tw_button("Get", stat_snake_init_proc);
900     tw_button("Run", stat_snake_run_proc);
901     tw_button("Trans", stat_snake_trans_proc);
902 /*
903     tw_button("Show Edges", snake_edge_proc);
904     tw_button("Show Forces", snake_force_proc);
905 */
906     tw_button("Auto Snakes", snake_auto_proc);
907     tw_button("Auto Stat", stat_snake_auto_proc);
908 
909 
910 /*
911     tw_button("Extrap", extrap_tube_proc);
912 */
913 
914     tw_end_tool();
915 
916     create_work_display();
917     create_trans_display();
918     create_sagit_display();
919     create_front_display();
920     create_vis3d_display();
921 
922     tw_main_loop();
923 
924     return (0);
925 }
926 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.