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

Linux Cross Reference
Tina5/tina-tools/tinatool/tlmedical/tlmedAnl_tool.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_tool.c,v $
 37  * Date    :  $Date: 2009/03/27 16:01:50 $
 38  * Version :  $Revision: 1.11 $
 39  * CVS Id  :  $Id: tlmedAnl_tool.c,v 1.11 2009/03/27 16:01:50 paul Exp $
 40  *
 41  * Notes :
 42  *
 43  *   Gio Buonaccorsi altered gfit_pixels_proc to include stack manipulation from
 44  *   gfit_measure_image.
 45  *   Done to improve lib / tool separation - 19 Feb 2003.
 46  *
 47  *********
 48 */
 49 
 50 #include "tlmedAnl_tool.h"
 51 
 52 #if HAVE_CONFIG_H
 53 #   include <config.h>
 54 #endif
 55 
 56 
 57 #include <stdio.h>
 58 #include <math.h>
 59 #include <float.h>
 60 #include <stdlib.h>
 61 #include <tina/sys/sysDef.h>
 62 #include <tina/sys/sysPro.h>
 63 #include <tina/math/mathDef.h>
 64 #include <tina/math/mathPro.h>
 65 #include <tina/image/imgDef.h>
 66 #include <tina/image/imgPro.h>
 67 #include <tina/medical/medDef.h>
 68 #include <tina/medical/medPro.h>
 69 #include <tinatool/draw/drawDef.h>
 70 #include <tinatool/draw/drawPro.h>
 71 #include <tinatool/wdgts/wdgtsPro.h>
 72 #include <tinatool/tlbase/tlbasePro.h>
 73 #include <tinatool/tlmedical/tlmedAnl_mouse.h>
 74 #include <tinatool/tlmedical/tlmedAnl_results.h>
 75 #include <tinatool/tlmedical/tlmedAnl_report.h>
 76 #include <tinatool/tlmedical/tlmedAnl_results.h>
 77 
 78 #define MAXPATHLEN 1024 /* why is this here?  this is defined by the system a.lacey 20.01.03 */
 79 #define TR_DATA   455
 80 #define FLIP_ANGLE_DATA   456
 81 
 82 
 83 static void *pt0 = NULL;
 84 static double a1=2, a2=10;
 85 static double *ptr, *pa1, *pa2, *pa3;
 86 static char filename[128]="lookup.4.199.2.10.35.asc";
 87 static char *pfn;
 88 static int lut1[1202];
 89 static float delta[1202], sig1[1202], sig2[1202], sig3[1202];
 90 static int        pmap;
 91 static int        gmap;
 92 static int        hwave = 3;
 93 static int        dtime = 0;
 94 static int        offset = 0;
 95 static int        corr_func_type = 0;
 96 static void      *pperiod = NULL;
 97 static double     iphase = -1.0;
 98 static void      *poffset = NULL;
 99 static void      *pdtime = NULL;
100 static char       patient[256];
101 static char       notes[256];
102 static char       repname[256];
103 
104 
105 /*
106 static Bool       stim_phase_on = false;
107 static void stim_phase_choice_proc(int val)
108 {
109    if (val > 0)
110       stim_phase_on = true;
111    else
112       stim_phase_on = false;   
113 }
114 */
115 
116 static void corr_func_choice_proc(int val)
117 {
118    corr_func_type = val;
119 }
120 
121 static void perm_con_proc(int val)
122 {
123    extern void perm_con();
124    set_perm_con(val);
125 }
126 
127 static void gmap_func_choice_proc(int val)
128 {
129    gmap = val;
130    stack_push((void *)gfit_get_image(gmap), IMRECT, im_free);
131 
132    if (imcalc_tv_get()!=NULL) tv_init(imcalc_tv_get());
133    if (imcal2_tv_get()!=NULL) tv_init(imcal2_tv_get());
134    image_choice_reset();
135 }
136 
137 static void pmap_func_choice_proc(int val)
138 {
139    pmap = val;
140    stack_push((void *)pfit_get_image(pmap), IMRECT, im_free);
141 
142    if (imcalc_tv_get()!=NULL) tv_init(imcalc_tv_get());
143    if (imcal2_tv_get()!=NULL) tv_init(imcal2_tv_get());
144    image_choice_reset();
145 }
146 
147 
148 static void stim_acquire_proc(int val)
149 {
150  Imrect *tmask = NULL;
151   int     type;
152 
153   switch (val)
154     {
155     case SCORR_SQR:
156       stim_sqrwave_acqu(&hwave, offset, dtime, (float)iphase);
157       break;
158     
159     case SCORR_SIN:
160       stim_sinwave_acqu(&hwave, offset, dtime, (float)iphase);
161       break;
162 
163     case SCORR_ROI:
164       stim_roi_acqu((Imrect *)NULL, &hwave);
165       break;
166 
167     case SCORR_PREV:
168       if (stack_check_types(IMRECT, NULL) == false)
169         {
170           error("stim_acquire: wrong type on stack", warning);
171           return;
172         }
173       tmask = (Imrect *) stack_pop(&type);
174       stim_roi_acqu(tmask, &hwave);
175       stack_push((void *)tmask, IMRECT, im_free);
176       break;
177     }
178     plot_stimfunc();
179 }
180 
181 static void stim_compare_proc(void)
182 {
183    stack_push((void *)stim_corr(offset, corr_func_type ), IMRECT, im_free);
184    
185    if (imcalc_tv_get()!=NULL) tv_init(imcalc_tv_get());
186    if (imcal2_tv_get()!=NULL) tv_init(imcal2_tv_get());
187    image_choice_reset();
188 }
189 
190 /*
191 static void     nearest_proc(void)
192 {
193    Imrect  *imf_knn_density(int neighbours, Imregion *test_roi);
194    Imrect         *im;
195    Imregion *roi = tv_get_im_roi(seq_tv_get());
196    int             type;
197 
198    im = imf_knn_density(10, roi);
199    stack_push(im, IMRECT, im_free);
200    if (imcalc_tv_get()!=NULL) tv_init(imcalc_tv_get());
201    if (imcal2_tv_get()!=NULL) tv_init(imcal2_tv_get());
202    image_choice_reset();
203 }
204 */
205 
206 static void  gen_art_proc()
207 {
208   Imrect  *im;
209   int      a, i, j;
210   int      b, c;
211   float    mu, mu1, mu2;
212 
213   mu1 = 100.0;
214   mu2 = 0.0;
215   b = 1;
216 
217   for (a = 0; a < 17; a++)
218     {
219       im = im_alloc(256, 256, NULL, float_v);
220       c = 0;
221       for (i = im->region->ly; i < im->region->uy; ++i)
222         {
223           if (c == 10) 
224             { b++; c = 0; }
225           else
226             c++;
227           /*
228           for (j = im->region->lx; j < im->region->ux; ++j)
229             {
230               if (j > (im->region->ux/2))
231                 {
232                   if ((b/hwave)%2)
233                     mu = mu1;
234                   else
235                     mu = mu2;
236                   IM_SHORT(im, i, j) = mu;
237                 }
238               else
239                 IM_SHORT(im, i, j) = 2.0;
240             }
241           
242           */
243           for (j = im->region->lx; j < im->region->ux; ++j)
244             {
245               if (j > (im->region->ux/2))
246                 {
247                   if ((b/hwave)%2)
248                     mu = mu1;
249                   else
250                     mu = mu2;
251                   IM_FLOAT(im, i, j) = rand_normal((double)mu, 10.0);
252                 }
253               else
254                 IM_FLOAT(im, i, j) = rand_normal(0.0, 1.0);
255             }
256           
257         }
258 
259       stack_push((void *)im, IMRECT, im_free);
260     }
261 }
262 
263 static void  mk_report()
264 {
265   flow_report(repname, patient, notes);
266 }
267 
268 
269 static void  gen_report_proc()
270 {
271   static void *dialog = NULL;
272 
273   if (dialog)
274     {
275       tw_show_dialog(dialog);
276       return;
277     }
278 
279   dialog = (void *)tw_dialog("Flow report generator");
280   tw_sglobal("Report file:", repname, 40);
281   tw_newrow();
282   tw_sglobal("Patient :", patient, 40);
283   tw_newrow();
284   tw_sglobal("Notes:", notes, 40);
285   tw_newrow();
286   tw_button("Go", mk_report, NULL);
287   tw_end_dialog();
288 }
289 
290 
291 /*
292 static void  plot_stimfunc_proc()
293 {
294   plot_stimfunc();
295 }
296 */
297 
298 
299 static void  plot_flow_proc()
300 {
301   plot_flow();
302   pl_measures();
303 }
304 
305 /*
306  *   Altered to improve lib / tool separation - GAB 19 Feb 2003
307  *   Stack manipulation from gfit_measure_image moved here.
308  */
309 static void  gfit_pixels_proc()
310 {
311    Imrect *mask = NULL;
312    int     type;
313   
314 /* old call a.lacey 22.01.02
315    gfit_measure_image();
316  */
317 /*
318  *   Stack manipulation from gfit_measure_image - GAB 19 Feb 2003
319  */
320    if (stack_check_types(IMRECT, NULL) != false)
321       mask = (Imrect *) stack_pop(&type);
322 
323    gfit_measure_image(0, mask);
324    stack_push((void *)gfit_get_image(gmap), IMRECT, im_free);
325 
326    if (imcalc_tv_get()!=NULL) tv_init(imcalc_tv_get());
327    if (imcal2_tv_get()!=NULL) tv_init(imcal2_tv_get());
328    image_choice_reset();
329 }
330 
331 static void gfit_region_proc()
332 {
333      Tv *tv = imcalc_tv_get();
334      Ipos pos;
335      *min_t0_get() = pixel_gfit_region(tv,pos) - 4.0;
336      tw_fglobal_reset(pt0);
337 }
338 
339 static void  pfit_pixels_proc()
340 {
341    Imrect *mask, *t1im;
342    int     type;
343   
344    if ((mask = (Imrect *) stack_inspect(&type)) == NULL)
345                 return;
346    if ((t1im = (Imrect *)mono_image_get()) == NULL) 
347                 return;
348                 
349    pfit_measure_image(0, mask, t1im);
350    stack_push((void *)pfit_get_image(pmap), IMRECT, im_free);
351 
352    if (imcalc_tv_get()!=NULL) tv_init(imcalc_tv_get());
353    if (imcal2_tv_get()!=NULL) tv_init(imcal2_tv_get());
354    image_choice_reset();
355 }
356 
357 
358 static void est_plasma_conc_proc()
359 {
360   Imrect *mask, *t1im;
361   int type;
362 
363   if ((mask = (Imrect *) stack_inspect(&type)) == NULL)
364     return;
365   if ((t1im = (Imrect *)mono_image_get()) == NULL) 
366     return;
367   
368   est_plasma_conc(mask, t1im); 
369 
370 }
371 
372 
373 void gen_lookup_table(void)
374 {
375   double flip_angle[3];
376   double flip_rad[3];
377   char command[100];
378   FILE *fp;
379   float step2 = 2;
380   int i,T1;
381   float delta,signal[3];
382   double Exp,Sin,Cos;
383 
384   flip_angle[0]=a1;
385   flip_angle[1]=a2;
386   flip_angle[2]=*alpha_get();
387   /* convert filp angles to radians */
388   for (i=0;i<3;i++) flip_rad[i] = flip_angle[i]*0.017453292;
389 
390   /*create output ascii file */
391   sprintf(filename ,"lookup.%5.3f.%d.%d.%d.asc",
392           *tr_get(),(int)flip_angle[0],(int)flip_angle[1],(int)flip_angle[2]);
393 
394   /* remove any previous copies */
395   sprintf(command,"rm %s\n",filename);
396   format(command);
397   system(command);
398 
399   if ((fp = fopen(filename, "w")) == NULL)
400     {
401       printf("\ncannot open output file\nExiting...\n");
402       return;
403     }
404 
405   delta = 1; /* RF offset */
406 
407   /* loop through T1 in steps of step2 */
408   for (T1=100; T1<=2500; T1+=step2)
409         {
410 
411         Exp = exp(-(double)(*tr_get())/(double)(T1));
412 
413         for (i=0;i<3;i++)
414                 {
415                 Sin = sin((double)(delta)*(double)(flip_rad[i]));
416                 Cos = cos((double)(delta)*(double)(flip_rad[i]));
417                 signal[i] = (Sin * (1-Exp)) / (1 - Cos * Exp);
418 
419                 }
420 
421         /* normalise to signal[0] */
422         for (i=2;i>=0;i--) signal[i]/=signal[0];
423         fprintf(fp, "%f %d %f %f %f\n",delta,T1,signal[0],signal[1],signal[2]);
424         }
425 
426   /* close file */
427   fclose(fp);
428 
429   return;
430 
431 }
432 
433 /*mjs 7/11/05 modified flip_proc to use sequence proplist rather than now 
434   defunct image proplists. */
435 static void flip_proc(void)
436 {
437   /*Imrect * im1,*im2,*im3;*/
438    Sequence *seq = seq_get_current();
439    float *TR_arr=NULL, *FA_arr=NULL;
440    /*List *lptr;*/
441 
442    if (seq == NULL)
443      {
444        format("Flip proc; sequence is NULL\n"); 
445        return; 
446      }
447    /*lptr = get_seq_start_el(seq);
448    im1 = (Imrect *)lptr->to;
449 
450    lptr = lptr->next;
451    im2 = (Imrect *)lptr->to;
452 
453    lptr = lptr->next;
454    im3 = (Imrect *)lptr->to;
455    */
456    /*if(prop_get(im1->props,TR_DATA) == NULL) return;
457    if(prop_get(im1->props,FLIP_ANGLE_DATA) == NULL) return;
458    if(prop_get(im2->props,FLIP_ANGLE_DATA) == NULL) return;
459    if(prop_get(im3->props,FLIP_ANGLE_DATA) == NULL) return;*/
460 
461    if(prop_get(seq->props,TR_DATA) == NULL) return;
462    if(prop_get(seq->props,FLIP_ANGLE_DATA) == NULL) return;
463 
464    /* taking the first TR in the TR data array as representative of all the TRs 
465       (ie, they should all be the same) */
466    /* also assumes that there are three elements in the FA data. faux pas.*/
467    TR_arr = (float*)prop_get(seq->props, TR_DATA);
468    FA_arr = (float*)prop_get(seq->props, FLIP_ANGLE_DATA);
469 
470    *tr_get() = TR_arr[seq->offset];
471    a1 = FA_arr[seq->offset];
472    a2 = FA_arr[seq->offset+seq->stride];
473    *alpha_get()=FA_arr[seq->offset+2*seq->stride];
474      
475    
476    /**tr_get() = *(float*)prop_get(im1->props, TR_DATA);
477    a1 = *(float*)prop_get(im1->props, FLIP_ANGLE_DATA);
478    a2 = *(float*)prop_get(im2->props, FLIP_ANGLE_DATA);
479    *alpha_get() = *(float*)prop_get(im3->props, FLIP_ANGLE_DATA);*/
480    tw_fglobal_reset(ptr);
481    tw_fglobal_reset(pa1);
482    tw_fglobal_reset(pa2);
483    tw_fglobal_reset(pa3);
484    format("flip_proc: working\n");
485 
486 }
487 
488 static void look_up_proc(void)
489 {
490 
491   FILE * fp;
492   int i;
493 
494  if ((fp = fopen(filename, "r")) == NULL)
495     {
496       printf("\ncannot open output file\nExiting...\n");
497       return;
498     }
499 
500   for(i=0; i<=1201; i++)
501     {
502       fscanf(fp, "%f %d %f %f %f", &delta[i], &lut1[i], &sig1[i], &sig2[i], &sig3[i]);
503     }
504 
505   fclose(fp);
506 
507   return;
508 }
509 
510 static void t1_calc_proc(void)
511 {
512    void ***imptrs;
513    float *signal;
514    int i,j,k,l;
515    int imptrlz, imptruz, imptrly, imptruy, imptrlx, imptrux;
516    double difference;
517    double T1_value;
518    double test;
519    Sequence *seq = seq_get_current();
520    int width, height;
521    float *row;
522    Imrect *im;
523    Imregion roi;
524    int barrier=0;
525 
526 
527    gen_lookup_table();
528    look_up_proc();
529 
530    barrier = seq_interp_choice(0);
531    seq_slice_init(seq);
532    imptrs = seq_limits(&imptrlz, &imptruz, &imptrly, &imptruy, &imptrlx,
533                          &imptrux);
534    seq_init_interp(imptrlx,imptrux,
535                imptrly,imptruy,
536                imptrlz,imptruz);
537    signal = fvector_alloc(imptrlz, imptruz);
538 
539 /*
540    roi.lx = imptrlx;
541    roi.ux = imptrux;
542    roi.ly = imptrly;
543    roi.uy = imptruy;
544 */
545    roi = *tv_get_im_roi(seq_tv_get());
546 
547    width = imptrux -imptrlx;
548    height = imptruy - imptrlx;
549 
550    im = im_alloc(height, width, &roi, float_v);
551 
552    row = fvector_alloc(roi.lx, roi.ux);
553 
554    for (i = roi.ly; i < roi.uy; i++)
555    {
556       for (j = roi.lx; j < roi.ux; j++)
557       {
558           for (k = imptrlz; k < imptruz; k++)
559           {
560             signal[k] = nearest_pixel(imptrs,
561                          vec3((double)j+0.5, (double)i+0.5,
562                          (double)k+0.5));
563             /*signal[k]=im_sub_pixf()*/
564           }
565           /*format("%f,%f,%f\n", signal[imptrlz], signal[imptrlz+1], signal[imptrlz+2]);*/
566           signal[imptrlz+1] /= signal[imptrlz];
567           signal[imptrlz+2] /= signal[imptrlz];
568 
569           difference = FLT_MAX;
570           T1_value = 0.0;
571           for (l = 0; l<=1201; l++)
572           {
573              test = fabs(sig2[l] - signal[imptrlz+1]) + fabs(sig3[l] - signal[imptrlz+2]);
574              if ( test < difference)
575              {
576                  T1_value = lut1[l];
577                  difference = test;
578              }
579            }
580 /*
581            row[j] = signal[imptrlz];
582 */
583            row[j] = (float)T1_value;
584       }
585       im_put_rowf(row, im, i, roi.lx, roi.ux);
586    }
587    stack_push((void *)im, IMRECT, im_free);
588    imcalc_draw(imcalc_tv_get());
589    fvector_free(row,roi.lx);
590    seq_interp_choice(barrier);
591 }
592 
593 
594 
595 static void     imcalc_mouse_proc(Tv_mouse(*func)())
596 {
597   tv_set_mouse(imcalc_tv(), (*func) ());
598   tv_set_activity(imcalc_tv(), MOUSE);
599 }
600 
601 /*
602 static void     seq_mouse_proc(Tv_mouse(*func)())
603 {
604   tv_set_mouse(seq_tv_get(), (*func) ());
605   tv_set_activity(seq_tv_get(), MOUSE);
606 }
607 */
608 
609 
610 
611 /*** Paramter dialog callbacks ***/
612 
613 static void     temp_param_dialog(void)
614 {
615    static void *dialog = NULL;
616 
617    if (dialog)
618    {
619       tw_show_dialog(dialog);
620       return;
621    }
622 
623    dialog = (void *)tw_dialog("Temporal Parameters");
624    tw_choice("Stimulus   ", stim_acquire_proc, 0,
625             "SQR", "SIN", "ROI", "Mask", NULL);
626 
627    tw_newrow();
628    pperiod = (void *)tw_iglobal("period/2: ", &hwave, 5);
629    poffset = (void *)tw_iglobal("  offset: ", &offset, 5);
630    tw_newrow();
631    tw_fglobal("  iphase: ", &iphase, 5);
632    pdtime = (void *)tw_iglobal(" deadtime: ", &dtime, 5);
633    tw_end_dialog();
634 }
635 
636 static void     gfit_param_dialog(void)
637 {
638     static void *dialog = NULL;
639 
640     if (dialog)
641     {
642         tw_show_dialog(dialog);
643         return;
644     }
645 
646     dialog = (void *)tw_dialog("Gamma Parameters");
647   
648     tw_fglobal(" average mtt: ", ave_mtt_get(), 8);
649     tw_newrow();
650     pt0 = (void *)tw_fglobal("  minimum t0: ", min_t0_get(), 8);
651     tw_button("region fit", gfit_region_proc, NULL);
652     tw_newrow();
653     tw_fglobal("  recirculation cut: ", recirc_cut_get(), 8);
654     tw_newrow();
655     tw_fglobal("  recirculation period: ", recirc_period_get(), 8);
656     tw_newrow();
657     tw_fglobal("  rcbv scale: ", scl_get(), 8);
658 
659     tw_end_dialog();
660 }
661 
662 static void     perm_param_dialog(void)
663 {
664     static void *dialog = NULL;
665 
666     if (dialog)
667     {
668         tw_show_dialog(dialog);
669         return;
670     }
671 
672     dialog = (void *)tw_dialog("Permeability Parameters");
673 
674     pfn = (void*) tw_sglobal("Filename: ", filename, 40);
675     tw_newrow();
676 
677     tw_choice("Constraints  ", perm_con_proc, 0,
678               "None", "VE", "VP", NULL);
679 
680     tw_newrow();
681     ptr = (void*) tw_fglobal("TR", tr_get(), 10);
682     tw_fglobal("Contrast R1", r1cont_get(), 10);
683     tw_fglobal("Prebolus", prebolus_get(), 10);
684     tw_newrow();
685     pa1 = (void*) tw_fglobal("Angle 1", &a1, 10);
686     pa2 = (void*) tw_fglobal("Angle 2", &a2, 10);
687     pa3 = (void*) tw_fglobal("Angle 3", alpha_get(), 10);
688     tw_end_dialog();
689 }
690 
691 
692 void    nmranalysis_tool(int x, int y)
693 {
694   static void *tool = NULL;
695 /*
696   void         nmr_reset_proc(void);
697 */
698  
699   if (tool)
700   {
701       tw_show_tool(tool);
702       return;
703   }
704 
705   tool = tw_tool("NMR Analysis Tool", x, y);
706 
707   tw_menubar("Imcalc Mouse:  ",
708              "Measure",
709              "null", imcalc_mouse_proc, null_mouse,
710              "line", imcalc_mouse_proc, nmr_linelen_mouse,
711              "region", imcalc_mouse_proc, nmr_regsize_mouse,
712              "mask", imcalc_mouse_proc, nmr_masksize_mouse,
713              NULL, 
714              "Plot",
715              "null", imcalc_mouse_proc, null_mouse,
716              "flow/T", imcalc_mouse_proc, nmr_flow_mouse,
717              "gamma fit", imcalc_mouse_proc, nmr_gfit_mouse,
718              "perm fit", imcalc_mouse_proc, nmr_permfit_mouse,
719              NULL, 
720                                                   NULL);
721   tw_help_button("nmr_analysis_tool");
722   tw_newrow();
723 
724   tw_button("stim params", temp_param_dialog, NULL);
725   tw_button("gamma params", gfit_param_dialog, NULL);
726   tw_button("perm params", perm_param_dialog, NULL);
727 
728   tw_newrow();
729    
730   tw_choice("Sequence  ", corr_func_choice_proc, 2,
731             "GBAM", "STIM", "FRIS", NULL);
732 
733   tw_button("compare", stim_compare_proc, NULL);
734   tw_newrow();
735  
736   tw_choice("Perfusion  ", gmap_func_choice_proc, 0,
737             "TTM", "CBV", "MTT", "ERR", "RCC", NULL);
738   tw_button("gamma fit", gfit_pixels_proc, NULL);
739   tw_newrow();
740   tw_choice("Permeability  ", pmap_func_choice_proc, 0,
741             "TTP", "VP", "VE", "K_trans", "ERR", NULL);
742   tw_button("perm fit", pfit_pixels_proc, NULL);
743 
744   tw_newrow();
745   tw_button("Flips ", flip_proc, NULL);
746   tw_button("T1 Calib.", t1_calc_proc, NULL);
747   tw_button("Est. Plasma conc.", est_plasma_conc_proc, NULL);
748 
749   tw_newrow();
750   tw_label("Test  ");
751   tw_button("flow/t",  plot_flow_proc, NULL);
752   tw_button("artificial", gen_art_proc, NULL);
753   tw_button("report", gen_report_proc, NULL);
754 /*
755   tw_button("nearest", nearest_proc, NULL);
756 */
757   tw_end_tool();
758 
759 }
760 

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