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

Linux Cross Reference
Tina5/tina-tools/tinatool/tlmedical/tlmedAnl_mouse.c

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

  1 /**********
  2  *
  3  * Copyright (c) 2003, Division of Imaging Science and Biomedical Engineering,
  4  * University of Manchester, UK.  All rights reserved.
  5  * 
  6  * Redistribution and use in source and binary forms, with or without modification, 
  7  * are permitted provided that the following conditions are met:
  8  * 
  9  *   . Redistributions of source code must retain the above copyright notice, 
 10  *     this list of conditions and the following disclaimer.
 11  *    
 12  *   . Redistributions in binary form must reproduce the above copyright notice,
 13  *     this list of conditions and the following disclaimer in the documentation 
 14  *     and/or other materials provided with the distribution.
 15  * 
 16  *   . Neither the name of the University of Manchester nor the names of its
 17  *     contributors may be used to endorse or promote products derived from this 
 18  *     software without specific prior written permission.
 19  * 
 20  * 
 21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  * POSSIBILITY OF SUCH DAMAGE.
 32  *
 33  **********
 34  *
 35  * Program :    TINA
 36  * File    :  $Source: /home/tina/cvs/tina-tools/tinatool/tlmedical/tlmedAnl_mouse.c,v $
 37  * Date    :  $Date: 2007/02/15 01:55:50 $
 38  * Version :  $Revision: 1.8 $
 39  * CVS Id  :  $Id: tlmedAnl_mouse.c,v 1.8 2007/02/15 01:55:50 paul Exp $
 40  *
 41  * Notes : 
 42  *
 43  *********
 44 */
 45 
 46 #include "tlmedAnl_mouse.h"
 47 
 48 #if HAVE_CONFIG_H
 49 #   include <config.h>
 50 #endif
 51 
 52 #include <stdio.h>
 53 #include <math.h>
 54 #include <float.h>
 55 
 56 #include <tina/sys/sysDef.h>
 57 #include <tina/sys/sysPro.h>
 58 #include <tina/math/mathDef.h>
 59 #include <tina/math/mathPro.h>
 60 #include <tina/image/imgDef.h>
 61 #include <tina/image/imgPro.h>
 62 #include <tina/medical/medDef.h>
 63 #include <tina/medical/medPro.h>
 64 #include <tina/geometry/geomImg_poly_crop.h>
 65 #include <tinatool/draw/drawDef.h>
 66 #include <tinatool/draw/drawPro.h>
 67 #include <tinatool/tlbase/tlbaseDef.h>
 68 #include <tinatool/tlbase/tlbasePro.h>
 69 #include <tinatool/tlmedical/tlmedAnl_mouse.h>
 70 
 71 static void ***imptrs = NULL;
 72 static Vec2 start_line;
 73 static Vec2 end_line;
 74 static Vec2 p1 = {Vec2_id};
 75 static Vec2 p2 = {Vec2_id};
 76 static List *roi_poly = NULL;
 77 
 78 static void  line_length_print()
 79 {
 80   Imrect  *im = NULL;
 81   Sequence *seq = NULL;
 82   /*List *store = get_seq_start_el(seq);*/
 83   Vec3    *scale = NULL;
 84   double   o, a, theta, length_p, length_s;
 85   
 86   /*if (store != NULL)
 87     im = (Imrect *)(store->to);
 88     if (im != NULL)*/
 89   if((seq = seq_get_current()) != NULL)
 90     {
 91       scale = seq_dim_to_vec3();
 92       /*store = get_seq_start_el(seq);*/
 93     }
 94   o = fabs(vec2_y(start_line) - vec2_y(end_line));
 95   a = fabs(vec2_x(start_line) - vec2_x(end_line));
 96 
 97   if (o < 0.01)
 98     length_p = a;
 99   else if (a < 0.01)
100     length_p = o;
101   else
102     {
103       theta = atan2(o, a);
104       length_p = o/sin(theta);
105     }
106 
107 
108   if (scale != NULL)
109     {
110       o = (scale->el[1])*o;
111       a = (scale->el[0])*a;
112       if (o < 0.01)
113         length_s = a;
114       else if (a < 0.01)
115         length_s = o;
116       else
117       {
118         theta = atan2(o, a);
119         length_s = o/sin(theta);
120       }
121     }
122 
123   if (scale != NULL)
124     format("line length %4.2f pixels and %4.2f mm\n", length_p, length_s);
125   else
126     format("line length %4.2f pixels\n", length_p);
127 
128   return;
129 }
130 
131 
132 static void set_start_down(Tv * tv, Ipos pos)
133 {
134     start_line = tv_backproj2(tv, pos);
135     end_line = tv_backproj2(tv, pos);
136     tv_set_overlay(tv);
137 }
138 
139 
140 static void draw_line_drag(Tv * tv, Ipos pos)
141 {
142     tv_line2(tv, start_line, end_line);
143     end_line = tv_backproj2(tv, pos);
144     tv_line2(tv, start_line, end_line);
145 }
146 
147 
148 static void draw_line_up(Tv *tv, Ipos pos)
149 {
150     tv_line2(tv, start_line, end_line);
151     end_line = tv_backproj2(tv, pos);
152     tv_reset_draw(tv);
153     tv_set_overlay(tv);
154     tv_line2(tv, start_line, end_line);
155     tv_reset_draw(tv);
156     line_length_print();
157 }
158 
159 
160 
161 static  void   mask_size_start_d(Tv *tv, Ipos pos)
162 {
163   tv_set_overlay(tv);    
164   p1 = p2 = tv_backproj2(tv, pos);
165   tv_rect2(tv, p1, p2);
166 }
167 
168 
169 static  void   mask_size_start_u(Tv *tv, Ipos pos)
170 {
171   tv_rect2(tv, p1, p2);
172   if (vec2_x(p1) < vec2_x(p2))
173     {
174       vec2_x(tv->ul) = vec2_x(p1);
175       vec2_x(tv->lr) = vec2_x(p2);
176     } 
177   else
178     {
179       vec2_x(tv->ul) = vec2_x(p2);
180       vec2_x(tv->lr) = vec2_x(p1);
181     }
182   if (vec2_y(p1) < vec2_y(p2))
183     {
184       vec2_y(tv->ul) = vec2_y(p1);
185       vec2_y(tv->lr) = vec2_y(p2);
186     } 
187   else
188     {
189       vec2_y(tv->ul) = vec2_y(p2);
190       vec2_y(tv->lr) = vec2_y(p1);
191     }
192   tv_reset_draw(tv);
193   p1 = p2; 
194   if (roi_poly!=NULL) dd_list_rm(roi_poly,vec2_free);
195   roi_poly = NULL;
196 }
197 
198 static  void   mask_size_point_d(Tv *tv, Ipos pos)
199 {
200   tv_set_overlay(tv);    
201   p2 = tv_backproj2(tv, pos);
202   tv_line2(tv,p1,p2);
203 }
204 
205 static  void   mask_size_point_u(Tv *tv, Ipos pos)
206 {
207   if (roi_poly==NULL) 
208     roi_poly = dd_ref_addtostart(roi_poly,(void *)vec2_copy
209                               (&p1),VEC2);
210   roi_poly = dd_ref_addtostart(roi_poly,(void *)vec2_copy(&p2),VEC2);
211   tv_reset_draw(tv);
212   p1 = p2;
213   if (vec2_x(p1)<vec2_x(tv->ul)) vec2_x(tv->ul) = vec2_x(p1);
214   if (vec2_x(p1)>vec2_x(tv->lr)) vec2_x(tv->lr) = vec2_x(p1);
215   if (vec2_y(p1)<vec2_y(tv->ul)) vec2_y(tv->ul) = vec2_y(p1);
216   if (vec2_y(p1)>vec2_y(tv->lr)) vec2_y(tv->lr) = vec2_y(p1);
217 }
218 
219 int    calc_mask_size(Imrect *mask)
220 {
221   int      cs_area = 0;
222   int      i, j;
223 
224   if (mask == NULL || mask->vtype != uchar_v)
225     return (cs_area);
226 
227   for (i = mask->region->ly; i < mask->region->uy; i++)
228     for (j = mask->region->lx; j < mask->region->ux; j++)
229       {
230         if (IM_CHAR(mask, i, j) == 1)
231           cs_area++;
232       }
233 
234   return(cs_area);
235 }
236 
237 static void   mask_size_show(Tv *tv, Ipos pos)
238 {
239   Imrect  *im = NULL, *mask = NULL;
240   Imrect  *reg = NULL, *res = NULL;
241   Sequence *seq = seq_get_current();
242   /*List *store = get_seq_start_el(seq);*/
243   Vec3    *scale = NULL;
244   int      cs_area = 0;
245   int      i, j, type;
246 
247   if (stack_check_types(IMRECT, NULL) == false)
248     {
249       error("mask_size_show: wrong type on stack", warning);
250       return;
251     }
252 
253   mask = (Imrect *) stack_pop(&type);
254   reg = im_alloc(mask->height, mask->width, NULL, char_v);
255   for (i = mask->region->ly; i < mask->region->uy; i++)
256     for (j = mask->region->lx; j < mask->region->ux; j++)
257       IM_CHAR(reg, i, j) = 1;
258   im_poly_crop(reg, roi_poly);
259   res = im_prod(mask, reg);
260   cs_area = calc_mask_size(res);
261 
262   /*if (store != NULL)
263     im = (Imrect *)(store->to);
264     if (im != NULL)*/
265   if (seq != NULL)
266     {
267       scale = seq_dim_to_vec3();
268     }     
269 
270   if (scale != NULL)
271     format("mask area %d pixels and %4.2f mm^2\n", cs_area, 
272            (scale->el[0])*(scale->el[1])*(double)cs_area);
273   else
274     format("mask area %d pixels\n", cs_area);
275 
276   stack_push((void *)mask, IMRECT, im_free);
277 
278   im_free(reg);
279   im_free(res);
280   return;
281 }
282 
283 static void   region_size_show(Tv *tv, Ipos pos)
284 {
285   Imrect  *im = NULL, *mask = NULL, *sim = NULL;
286   Sequence *seq = seq_get_current();
287   /*List *store = get_seq_start_el(seq);*/
288   Vec3    *scale = NULL;
289   int      cs_area = 0;
290   int      i, j, type;
291 
292  if (stack_check_types(IMRECT, NULL) == false)
293     {
294       error("region_size_show: wrong type on stack", warning);
295       return;
296     }
297 
298   sim = (Imrect *) stack_pop(&type);
299 
300   mask = im_alloc(sim->height, sim->width, NULL, char_v);
301   for (i = mask->region->ly; i < mask->region->uy; i++)
302     for (j = mask->region->lx; j < mask->region->ux; j++)
303       IM_CHAR(mask, i, j) = 1;
304   im_poly_crop(mask, roi_poly);
305    
306   /*if (store != NULL)
307     im = (Imrect *)(store->to);
308     if (im != NULL)*/
309   if (seq != NULL)
310     {
311       scale = seq_dim_to_vec3();
312     }
313   for (i = mask->region->ly; i < mask->region->uy; i++)
314       for (j = mask->region->lx; j < mask->region->ux; j++)
315         {
316           if (IM_CHAR(mask, i, j) == 1)
317             cs_area++;
318         }
319 
320   stack_push((void *)sim, IMRECT, im_free);
321 
322   if (scale != NULL)
323     format("region area %4.2f mm^2\n", (scale->el[0])*(scale->el[1])*(double)cs_area);
324   else
325     format("region area %d pixels\n", cs_area);
326 
327   im_free(mask);
328 
329   return;
330 }
331 
332 static void   pixel_ft_plot(Tv *tv, Ipos pos)
333 { 
334   Pl_flow  *plot_data = pl_flow_alloc();
335   Vec2      v = {Vec2_id};
336   Vec3     *scale = NULL;
337   Sequence *seq = seq_get_current();
338   List   *store = get_seq_start_el(seq);
339   Imrect   *im;
340   Tv       *tv_graph = imcalc_graph_tv_get();
341   float    *flow, *time;
342   float    single_time;
343   int       imptrlx, imptrux, imptrly, imptruy, imptrlz, imptruz;
344   int       length, x, y, k;
345   float    *row;
346 
347 
348   if (tv == NULL || tv->tv_screen == NULL)
349     return;
350   if (tv_graph == NULL || tv_graph->tv_screen == NULL)
351     return;
352   if ((store == NULL) || (store->to == NULL))
353     return;
354 
355   seq = (Sequence *)seq_get_current();
356   im = (Imrect *)(store->to);
357 
358   if ((single_time = seq->dim[3]) == 1.0)
359     {
360       error("pixel_ft_plot: timing info may be missing, aborting", warning);
361       return;
362     }
363   scale = (Vec3 *)seq_dim_to_vec3();
364 
365 
366   seq_slice_init(seq);
367   imptrs = seq_limits(&imptrlz, &imptruz, &imptrly, &imptruy, &imptrlx, 
368                         &imptrux);
369   length = imptruz - imptrlz;    
370   flow = (float *)fvector_alloc(0, length);
371   time = (float *)fvector_alloc(0, length);
372 
373   v = tv_backproj2(tv, pos);
374   x = tina_int(vec2_x(v));
375   y = tina_int(vec2_y(v));
376 
377   for (k = 0; k < length; k++)
378     {
379       row = imptrs[k+imptrlz][y];
380       flow[k] = row[x];
381       flow[k] *= ((scale->el[0])*(scale->el[1])/100);
382       time[k] = k*single_time;
383     }
384 
385   tv_erase(tv_graph);
386   plot(PL_INIT, PL_TV, tv_graph,
387        PL_AXIS_COLOR, black,
388        PL_X_TEXT, true,
389        PL_Y_TEXT, true,
390        PL_TITLE, "Signal v Time",
391        PL_STYLE, PL_CROSS,
392        PL_COLOR, red,
393        PL_GRAPH_DATA, length, time, flow,
394        PL_PLOT,
395        NULL);
396 
397   plot_data->mask = NULL;
398   plot_data->y1 = flow;
399   plot_data->x = fvector_copy((void *)time, 0, length);
400   plot_data->y1_n2 = plot_data->x_n2 = length;
401   plot_data->y1_n1 = plot_data->x_n1 = 0;
402   set_pl_flow(plot_data);
403   
404   return;
405 }
406 
407 static void   pixel_gfit_plot(Tv *tv, Ipos pos)
408 {
409   Perfusion *p = NULL;
410   Vec2       loc = {Vec2_id};  
411   Sequence *seq = seq_get_current();
412   Tv        *tv_g = (Tv *)imcalc_graph_tv();
413   float     *time, *x, *y1, *y2;
414   void    ***imptrs;
415   int        length, i;
416   float      single_time;
417   
418   if ((tv_g == NULL) || (tv_g->tv_screen == NULL))
419     return;
420 
421   loc = tv_backproj2(tv, pos);
422   p = perfusion_alloc();
423   seq = (Sequence *)seq_get_current();
424 
425   if ((single_time = seq->dim[3]) == 1.0)
426     {
427       error("gamma_fit_proc: timing info may be missing", warning);
428       return;
429     }
430 
431   imptrs = seq_slice_init(seq);
432   gamma_fit_pixel(p, loc, imptrs);
433   length = (p->n2 -  p->n1);
434   time = (float *)fvector_alloc(0, length);
435   for (i = 0; i < length; i++)
436     {
437       time[i] = i * single_time;
438     }
439 
440   x = time;
441   if (p->r2 != NULL && p->r2_ther !=NULL)
442   {
443     y1 = &(p->r2[p->n1]);
444     y2 = &(p->r2_ther[p->n1]);
445       
446     tv_erase(tv_g);
447     plot(PL_INIT, PL_TV, tv_g,
448          PL_AXIS_COLOR, black,
449          PL_X_TEXT, true, 
450          PL_Y_TEXT, true, 
451          PL_TITLE, "Gamma Fit",
452          PL_STYLE, PL_CROSS,
453          PL_COLOR, red,
454          PL_GRAPH_DATA, length, x, y1,
455          PL_STYLE, PL_CROSS,
456          PL_COLOR, blue,
457          PL_GRAPH_DATA, length, x, y2,
458          PL_STYLE, PL_LINE, 
459          PL_GRAPH_DATA, length, x, y2,
460          PL_PLOT,
461          NULL);
462 
463   }
464   return;
465 }
466 
467 static void   pixel_pfit_plot(Tv *tv, Ipos pos)
468 {
469   Permeability *p = NULL;
470   Vec2       loc = {Vec2_id};  
471   Sequence *seq = seq_get_current();
472   /*List *store = get_seq_start_el(seq);*/
473   Imrect    *im = NULL;
474   Imrect    *t1im = NULL;
475   Tv        *tv_g = imcalc_graph_tv();
476   float     *time, *x, *y1, *y2;
477   int        imptrlx, imptrux, imptrly, imptruy, imptrlz, imptruz;
478   void    ***imptrs;
479   int        length, i;
480   float     single_time; 
481 
482   if ((tv_g == NULL) || (tv_g->tv_screen == NULL))
483     return;
484 
485   loc = tv_backproj2(tv, pos);
486   p = permeability_alloc();
487 
488   /*im = (Imrect *)(store->to);*/
489 
490 
491 
492   if ((single_time = seq->dim[3]) == 1.0)
493     {
494       error("gamma_fit_proc: timing info may be missing", warning);
495       return;
496     }
497 
498   imptrs = seq_slice_init(seq);
499   if ((t1im = (Imrect *)mono_image_get()) == NULL) 
500                 return;
501                 
502   if (perm_fit_pixel(p, loc, imptrs, t1im) == -1)
503   {
504       permeability_free(p);
505       return;
506   }
507   if (p->ve!=FLT_MAX) format("vp = %4.3f ve = %4.3f k = %4.7f t = %3.1f \n",
508           p->vp, p->ve, p->kin, p->tt*p->tscale);
509   else format("vp = %4.3f ve = FLT_MAX k = %4.7f t = %3.1f \n",
510           p->vp, p->kin, p->tt*p->tscale);
511 
512   imptrs = seq_limits(&imptrlz, &imptruz, &imptrly, &imptruy, &imptrlx, 
513                         &imptrux);
514 /*  length = (p->st_r2_n2 -  p->st_r2_n1);
515 */
516   length =  imptruz - imptrlz;/* 61-1 = 60 */
517   time = fvector_alloc(0, length); /* 60-0 = 60 */
518   for (i=0; i<length; i++)
519     {
520       time[i] = i * single_time;
521     }
522   x = time;
523   if ((p->conc1 != NULL) && (p->conc1_ther !=NULL))
524   {
525    
526     y1 = &(p->conc1[imptrlz]);
527     y2 = &(p->conc1_ther[imptrlz]);
528     
529     tv_erase(tv_g);
530     pl_free_set(false);
531     plot(PL_INIT, PL_TV, tv_g,
532          PL_AXIS_COLOR, black,
533          PL_X_TEXT, true, 
534          PL_Y_TEXT, true, 
535          PL_TITLE, "Permeability Fit",
536          PL_STYLE, PL_CROSS,
537          PL_COLOR, red,
538          PL_GRAPH_DATA, length, x, y1,
539          PL_STYLE, PL_CROSS,
540          PL_COLOR, blue,
541          PL_GRAPH_DATA, length, x, y2,
542          PL_STYLE, PL_LINE, 
543          PL_GRAPH_DATA, length, x, y2,
544          PL_PLOT,
545          NULL);
546 
547   }
548   permeability_free(p);
549   return;
550 }
551 
552 /*
553  *   Altered to improve lib / tool separation - GAB 19 Feb 2003
554  *   Stack manipulation from gamma_fit_region moved here.
555  */
556 double   pixel_gfit_region(Tv *tv, Ipos pos)
557 {
558   Perfusion *p = NULL;
559   Vec2       loc = {Vec2_id};
560   Sequence  *seq = seq_get_current();
561   /*List      *store = get_seq_start_el(seq);*/
562   Imrect    *im = NULL, *mask = NULL;
563   Tv        *tv_g = imcalc_graph_tv();
564   float      single_time, *time, *x, *y1, *y2;
565   int        i;
566   void    ***imptrs;
567   int        length, type;
568   double     t0;
569  
570 
571   p = perfusion_alloc();
572 
573   /*im = (Imrect *)(store->to);*/
574     
575   if ((single_time = seq->dim[3]) == 1.0)
576     {
577       error("gamma_fit_proc: timing info may be missing", warning);
578       return(0.0);
579     }
580 /*
581   imptrs = coreg_slice_init(seq, (Vec3 *)NULL);
582 */
583   imptrs = seq_slice_init(seq);
584   
585 /* old call a.lacey 22.01.03 
586   t0 = gamma_fit_region(p, loc, imptrs);
587 */
588 
589 /*
590  *   Stack manipulation from gamma_fit_region - GAB 19 Feb 2003
591  */
592   if (stack_check_types(IMRECT, NULL) == false)
593   {
594      error("gamma_fit: wrong type on stack", warning);
595      t0 = 0.0;
596   }
597   else
598   {
599      mask = (Imrect *) stack_pop(&type);
600      t0 = gamma_fit_region(p, mask);
601      stack_push((void *)mask, IMRECT, im_free);
602   }
603 
604 /*
605   imptrs = seq_limits(&imptrlz, &imptruz, &imptrly, &imptruy, &imptrlx,
606                         &imptrux);
607 */
608   length = (p->n2 -  p->n1);
609   time = (float *)fvector_alloc(0, length);
610   for (i = 0; i < length; i++)
611     {
612       time[i] = i * single_time;
613     }
614 /*
615   length =  imptruz - imptrlz;
616 */
617   x = time;
618   if (p->r2 != NULL && p->r2_ther !=NULL)
619   {
620     y1 = &(p->r2[p->n1]);
621     y2 = &(p->r2_ther[p->n1]);
622 
623     tv_erase(tv_g);
624     plot(PL_INIT, PL_TV, tv_g,
625          PL_AXIS_COLOR, black,
626          PL_X_TEXT, true, 
627          PL_Y_TEXT, true,
628          PL_TITLE, "Gamma Fit",
629          PL_STYLE, PL_CROSS,
630          PL_COLOR, red,
631          PL_GRAPH_DATA, length, x, y1,
632          PL_STYLE, PL_CROSS,
633          PL_COLOR, blue,
634          PL_GRAPH_DATA, length, x, y2,
635          PL_STYLE, PL_LINE,
636          PL_GRAPH_DATA, length, x, y2,
637          PL_PLOT,
638          NULL);
639 
640   }
641   return(t0);
642 }
643 
644 Tv_mouse     nmr_gfit_mouse(void)
645 {
646     return (mouse_define(MOUSE_NAME, "gamma fit",
647                          LEFT_NAME, "pixel",
648                          LEFT_DOWN, pixel_gfit_plot,
649                          NULL));
650 }
651 
652 Tv_mouse     nmr_permfit_mouse(void)
653 {
654     return (mouse_define(MOUSE_NAME, "permeability fit",
655                          LEFT_NAME, "pixel",
656                          LEFT_DOWN, pixel_pfit_plot,
657                          NULL));
658 }
659 
660 Tv_mouse     nmr_flow_mouse()
661 {
662     return (mouse_define(MOUSE_NAME, "F/T",
663                          LEFT_NAME, "pixel",
664                          LEFT_DOWN, pixel_ft_plot,
665                          NULL));
666 }
667 
668 Tv_mouse      nmr_masksize_mouse(void)
669 {
670   return (mouse_define(MOUSE_NAME,  "mask size",
671                        LEFT_NAME,   "start",
672                        LEFT_DOWN,    mask_size_start_d,
673                        LEFT_UP,      mask_size_start_u,
674                        RIGHT_NAME,  "next",
675                        RIGHT_DOWN,   mask_size_point_d,
676                        RIGHT_UP,     mask_size_point_u,
677                        MIDDLE_NAME, "size",
678                        MIDDLE_DOWN,  mask_size_show,
679                        NULL));
680 
681 }
682 
683 Tv_mouse      nmr_regsize_mouse(void)
684 {
685   return (mouse_define(MOUSE_NAME,  "region size",
686                        LEFT_NAME,   "start",
687                        LEFT_DOWN,    mask_size_start_d,
688                        LEFT_UP,      mask_size_start_u,
689                        RIGHT_NAME,  "next",
690                        RIGHT_DOWN,   mask_size_point_d,
691                        RIGHT_UP,     mask_size_point_u,
692                        MIDDLE_NAME, "size",
693                        MIDDLE_DOWN,  region_size_show,
694                        NULL));
695 
696 }
697 
698 Tv_mouse      nmr_linelen_mouse(void)
699 {
700     return (mouse_define(MOUSE_NAME, "line length",
701                          LEFT_NAME, "line",
702                          LEFT_DOWN, set_start_down,
703                          LEFT_DRAG, draw_line_drag,
704                          LEFT_UP,   draw_line_up,
705                          NULL));
706 }
707 
708 

~ [ 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.