Doxygen Source Code Documentation
Xphace.c File Reference
#include <Xm/XmAll.h>
#include "mrilib.h"
#include "imseq.h"
Go to the source code of this file.
Data Structures | |
struct | PLUGIN_impopper |
Defines | |
#define | FIX_SCALE_SIZE_PROBLEM |
#define | FIX_SCALE_SIZE |
#define | PLUTO_popup_open(hh) ( (hh) != NULL && ISQ_REALZ(((PLUGIN_impopper *)(hh))->seq) ) |
#define | CONST 1 |
#define | NOISE 2 |
#define | Mfree(im) do{mri_free(im);im=NULL;}while(0) |
Functions | |
MRI_IMAGE * | mri_fft2D (MRI_IMAGE *im, int mode) |
MRI_IMAGE * | cx_scramble (MRI_IMAGE *ima, MRI_IMAGE *imb, float alpha, float beta) |
MRI_IMAGE * | mri_scramble (MRI_IMAGE *ima, MRI_IMAGE *imb, float alpha, float beta) |
void | PLUGIN_seq_send_CB (MCW_imseq *seq, XtPointer handle, ISQ_cbs *cbs) |
XtPointer | PLUGIN_imseq_getim (int n, int type, XtPointer handle) |
void * | PH_popup_image (void *handle, MRI_IMAGE *im) |
void | PH_scale_CB (Widget, XtPointer, XtPointer) |
void | PH_redraw (void) |
int | PH_loadim (char *) |
void | PH_startup_timeout_CB (XtPointer client_data, XtIntervalId *id) |
int | main (int argc, char *argv[]) |
MRI_IMAGE * | PH_fakeim (int, int, int, float) |
Variables | |
XtAppContext | MAIN_app |
MCW_DC * | MAIN_dc |
Widget | MAIN_shell = NULL |
Widget | MAIN_rc |
Widget | MAGN_scale |
Widget | PHASE_scale |
int | P_swide = 512 |
void * | P_handle = NULL |
char * | FALLback [] |
MRI_IMAGE * | P_ima = NULL |
MRI_IMAGE * | P_imb = NULL |
float | P_alpha = 0.0 |
float | P_beta = 0.0 |
int | P_ima_null = CONST |
int | P_imb_null = CONST |
float | P_ima_val = 0.0 |
float | P_imb_val = 0.0 |
int | P_nx = 256 |
int | P_ny = 256 |
int | doA = 1 |
Define Documentation
|
Definition at line 440 of file Xphace.c. Referenced by PH_fakeim(), and PH_loadim(). |
|
Value: do{ XtVaSetValues(MAGN_scale ,XmNwidth,P_swide,NULL) ; \ XtVaSetValues(PHASE_scale,XmNwidth,P_swide,NULL) ; } while(0) Definition at line 16 of file Xphace.c. Referenced by PH_scale_CB(). |
|
|
|
Definition at line 448 of file Xphace.c. Referenced by PH_loadim(). |
|
Definition at line 441 of file Xphace.c. Referenced by PH_fakeim(), and PH_loadim(). |
|
Definition at line 160 of file Xphace.c. Referenced by AFNI_splashup(). |
Function Documentation
|
Definition at line 86 of file Xphace.c. References CABS, CARG, complex::i, MRI_IMAGE::kind, MRI_COMPLEX_PTR, mri_new_conforming, MRI_IMAGE::nvox, MRI_IMAGE::nx, MRI_IMAGE::ny, complex::r, and tt. Referenced by mri_scramble().
00088 { 00089 int ii , npix ; 00090 double r1,r2 , t1,t2 , rr,tt ; 00091 complex * ar , * br , * cr ; 00092 double aa,aa1 , bb,bb1 ; 00093 MRI_IMAGE * imc ; 00094 00095 if( ima == NULL || ima->kind != MRI_complex || 00096 imb == NULL || imb->kind != MRI_complex || 00097 ima->nx != imb->nx || ima->ny != imb->ny || 00098 alpha < 0.0 || alpha > 1.0 || 00099 beta < 0.0 || beta > 1.0 ) return NULL ; 00100 00101 npix = ima->nvox ; 00102 ar = MRI_COMPLEX_PTR(ima) ; 00103 br = MRI_COMPLEX_PTR(imb) ; 00104 imc = mri_new_conforming( ima , MRI_complex ) ; 00105 cr = MRI_COMPLEX_PTR(imc) ; 00106 00107 aa = alpha ; aa1 = 1.0 - aa ; 00108 bb = beta ; bb1 = 1.0 - bb ; 00109 00110 for( ii=0 ; ii < npix ; ii++ ){ 00111 r1 = CABS(ar[ii]) ; r2 = CABS(br[ii]) ; rr = pow(r1,aa)*pow(r2,aa1) ; 00112 t1 = CARG(ar[ii]) ; t2 = CARG(br[ii]) ; tt = t1-t2 ; 00113 if( tt < -PI ) t2 -= 2.0*PI ; 00114 else if( tt > PI ) t2 += 2.0*PI ; 00115 tt = bb*t1 + bb1*t2 ; 00116 cr[ii].r = rr * cos(tt) ; cr[ii].i = rr * sin(tt) ; 00117 } 00118 00119 return imc ; 00120 } |
|
Definition at line 308 of file Xphace.c. References argc, FALLback, LABEL_ARG, machdep(), MAGN_scale, MAIN_app, MAIN_rc, MAIN_shell, mainENTRY, MCW_new_DC(), P_swide, PH_loadim(), PH_scale_CB(), PH_startup_timeout_CB(), and PHASE_scale.
00309 { 00310 Widget rc , lab ; 00311 int ww , uu ; 00312 00313 if( argc < 2 || strcmp(argv[1],"-help") == 0 ){ 00314 printf("Usage: Xphace im1 [im2]\n" 00315 "Image mergerizing.\n" 00316 "Image files are in PGM format.\n") ; exit(0) ; 00317 } 00318 00319 mainENTRY("Xphace main") ; machdep() ; 00320 00321 ww = PH_loadim( argv[1] ) ; 00322 if( ww < 0 ) exit(1) ; 00323 if( argc > 2 ){ 00324 ww = PH_loadim( argv[2] ) ; 00325 if( ww < 0 ) exit(1) ; 00326 } else { 00327 PH_loadim( "noise=1" ) ; 00328 } 00329 00330 MAIN_shell = XtVaAppInitialize( &MAIN_app , "AFNI" , NULL , 0 , 00331 &argc , argv , FALLback , NULL ) ; 00332 00333 if( MAIN_shell == NULL ){ 00334 fprintf(stderr,"\n*** Cannot initialize X11 ***\n") ; exit(1) ; 00335 } 00336 00337 MAIN_dc = MCW_new_DC( MAIN_shell , 32 , 0 , NULL,NULL , 1.0 , 0 ) ; 00338 00339 XtVaSetValues( XmGetXmDisplay(XtDisplay(MAIN_shell)) , 00340 XmNdragInitiatorProtocolStyle , XmDRAG_NONE , 00341 XmNdragReceiverProtocolStyle , XmDRAG_NONE , 00342 NULL ) ; 00343 00344 MAIN_rc = XtVaCreateWidget( "AFNI" , xmRowColumnWidgetClass , MAIN_shell , 00345 XmNpacking , XmPACK_TIGHT , 00346 XmNorientation , XmVERTICAL , 00347 XmNtraversalOn , False , 00348 NULL ) ; 00349 00350 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 00351 00352 rc = XtVaCreateWidget( "AFNI" , xmRowColumnWidgetClass , MAIN_rc , 00353 XmNpacking , XmPACK_TIGHT , 00354 XmNorientation , XmHORIZONTAL , 00355 XmNtraversalOn , False , 00356 NULL ) ; 00357 00358 lab = XtVaCreateManagedWidget( "AFNI" , xmLabelWidgetClass , rc , 00359 LABEL_ARG( "Magn. " ) , 00360 XmNmarginHeight, 0 , 00361 XmNmarginWidth , 0 , 00362 NULL ) ; 00363 00364 MAGN_scale = XtVaCreateManagedWidget( "AFNI" , xmScaleWidgetClass , rc , 00365 XmNminimum , 0 , 00366 XmNmaximum , 100 , 00367 XmNvalue , 0 , 00368 XmNwidth , P_swide , 00369 XmNshowValue , True , 00370 XmNscaleMultiple , 10 , 00371 XmNorientation , XmHORIZONTAL , 00372 XmNtraversalOn , False , 00373 NULL ) ; 00374 00375 XtAddCallback( MAGN_scale , XmNvalueChangedCallback , PH_scale_CB , NULL ) ; 00376 XtManageChild( rc ) ; 00377 00378 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 00379 00380 rc = XtVaCreateWidget( "AFNI" , xmRowColumnWidgetClass , MAIN_rc , 00381 XmNpacking , XmPACK_TIGHT , 00382 XmNorientation , XmHORIZONTAL , 00383 XmNtraversalOn , False , 00384 NULL ) ; 00385 00386 lab = XtVaCreateManagedWidget( "AFNI" , xmLabelWidgetClass , rc , 00387 LABEL_ARG( "Phase " ) , 00388 XmNmarginHeight, 0 , 00389 XmNmarginWidth , 0 , 00390 NULL ) ; 00391 00392 PHASE_scale = XtVaCreateManagedWidget( "AFNI" , xmScaleWidgetClass , rc , 00393 XmNminimum , 0 , 00394 XmNmaximum , 100 , 00395 XmNvalue , 0 , 00396 XmNwidth , P_swide , 00397 XmNshowValue , True , 00398 XmNscaleMultiple , 10 , 00399 XmNorientation , XmHORIZONTAL , 00400 XmNtraversalOn , False , 00401 NULL ) ; 00402 00403 XtAddCallback( PHASE_scale , XmNvalueChangedCallback , PH_scale_CB , NULL ) ; 00404 XtManageChild( rc ) ; 00405 00406 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 00407 00408 XtManageChild( MAIN_rc ) ; 00409 XtRealizeWidget( MAIN_shell ) ; 00410 00411 #if 0 00412 XtVaSetValues( MAIN_rc , XmNwidth , P_swide , NULL ) ; 00413 XtVaSetValues( MAGN_scale , XmNwidth , P_swide , NULL ) ; 00414 XtVaSetValues( PHASE_scale , XmNwidth , P_swide , NULL ) ; 00415 #endif 00416 00417 XtVaSetValues( MAIN_shell , 00418 XmNmwmDecorations , MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MENU , 00419 XmNmwmFunctions , MWM_FUNC_MOVE | MWM_FUNC_CLOSE , 00420 XmNtitle , "Xphace Controls" , 00421 NULL ) ; 00422 00423 (void) XtAppAddTimeOut( MAIN_app , 1234 , PH_startup_timeout_CB , NULL ) ; 00424 XtAppMainLoop( MAIN_app ) ; 00425 exit(0) ; 00426 } |
|
Definition at line 25 of file Xphace.c. References csfft_cox(), csfft_nextup_one35(), free, complex::i, malloc, MRI_COMPLEX_PTR, mri_free(), mri_new(), mri_to_complex(), MRI_IMAGE::nx, MRI_IMAGE::ny, and complex::r. Referenced by mri_scramble().
00026 { 00027 MRI_IMAGE * cxim , * outim ; 00028 int nx,ny , nxup,nyup , ii,jj ; 00029 complex * cxar , * outar , * cpt , * opt ; 00030 float fac ; 00031 00032 if( im == NULL ) return NULL ; 00033 00034 /* convert input to complex */ 00035 00036 cxim = mri_to_complex(im) ; 00037 cxar = MRI_COMPLEX_PTR(cxim) ; 00038 00039 /* compute size of output */ 00040 00041 nx = cxim->nx ; nxup = csfft_nextup_one35(nx) ; 00042 ny = cxim->ny ; nyup = csfft_nextup_one35(ny) ; 00043 00044 /* create output array */ 00045 00046 outim = mri_new( nxup , nyup , MRI_complex ) ; 00047 outar = MRI_COMPLEX_PTR(outim) ; 00048 00049 /* copy input to output, zero padding along the way */ 00050 00051 opt = outar ; 00052 cpt = cxar ; 00053 for( jj=0 ; jj < ny ; jj++ ){ 00054 for( ii=0 ; ii < nx ; ii++ ){opt->r=cpt->r; opt->i=cpt->i; opt++; cpt++;} 00055 for( ; ii < nxup ; ii++ ){opt->r=opt->i=0.0; opt++;} 00056 } 00057 for( ; jj < nyup ; jj++ ){opt->r=opt->i=0.0; opt++;} 00058 00059 mri_free(cxim) ; 00060 00061 /* row FFTs */ 00062 00063 for( jj=0 ; jj < ny ; jj++ ) 00064 csfft_cox( mode , nxup , outar+jj*nxup ) ; 00065 00066 /* column FFTs */ 00067 00068 cxar = (complex *) malloc(sizeof(complex)*nyup) ; 00069 00070 for( ii=0 ; ii < nxup ; ii++ ){ 00071 for( jj=0 ; jj < nyup ; jj++ ) cxar[jj] = outar[ii+jj*nxup] ; 00072 csfft_cox( mode , nyup , cxar ) ; 00073 for( jj=0 ; jj < nyup ; jj++ ) outar[ii+jj*nxup] = cxar[jj] ; 00074 } 00075 00076 fac = sqrt(1.0/(nxup*nyup)) ; 00077 for( ii=0 ; ii < nxup*nyup ; ii++ ){ 00078 outar[ii].r *= fac ; outar[ii].i *= fac ; 00079 } 00080 00081 free(cxar) ; return outim ; 00082 } |
|
Definition at line 124 of file Xphace.c. References cx_scramble(), MRI_IMAGE::kind, mri_cut_2D(), mri_fft2D(), mri_free(), mri_to_mri(), MRI_IMAGE::nx, and MRI_IMAGE::ny. Referenced by main(), and PH_redraw().
00126 { 00127 MRI_IMAGE * cxa, * cxb, * cxc ; 00128 int nx,ny , nxup,nyup ; 00129 00130 if( ima == NULL || imb == NULL || 00131 ima->nx != imb->nx || ima->ny != imb->ny || 00132 alpha < 0.0 || alpha > 1.0 || 00133 beta < 0.0 || beta > 1.0 ) return NULL ; 00134 00135 cxa = mri_fft2D( ima , -1 ) ; 00136 cxb = mri_fft2D( imb , -1 ) ; 00137 cxc = cx_scramble( cxa,cxb,alpha,beta ) ; 00138 mri_free(cxa) ; mri_free(cxb) ; 00139 cxa = mri_fft2D( cxc , 1 ) ; 00140 mri_free(cxc) ; 00141 cxb = mri_to_mri( ima->kind , cxa ) ; 00142 mri_free(cxa) ; 00143 00144 if( cxb->nx > ima->nx || cxb->ny > ima->ny ){ 00145 cxc = mri_cut_2D( cxb , 0,ima->nx-1,0,ima->ny-1 ) ; 00146 mri_free(cxb) ; cxb = cxc ; 00147 } 00148 00149 return cxb ; 00150 } |
|
Definition at line 506 of file Xphace.c. References CONST, far, MRI_FLOAT_PTR, mri_new(), NOISE, and MRI_IMAGE::nvox. Referenced by PH_loadim().
00507 { 00508 MRI_IMAGE * im ; 00509 float * far ; 00510 int ii , nvox ; 00511 00512 im = mri_new( nx , ny , MRI_float ) ; 00513 far = MRI_FLOAT_PTR(im) ; 00514 nvox = im->nvox ; 00515 00516 #if 0 00517 fprintf(stderr,"PH_fakeim: code=%d val=%f\n",code,val) ; 00518 #endif 00519 00520 switch( code ){ 00521 00522 default: 00523 case CONST: 00524 for( ii=0 ; ii < nvox ; ii++ ) far[ii] = val ; 00525 break ; 00526 00527 case NOISE: 00528 for( ii=0 ; ii < nvox ; ii++ ) far[ii] = val * drand48() ; 00529 break ; 00530 } 00531 00532 return im ; 00533 } |
|
Definition at line 454 of file Xphace.c. References CONST, doA, MAX, Mfree, mri_maxabs(), mri_read(), mri_resize(), mri_scale_to_float(), NOISE, MRI_IMAGE::nx, MRI_IMAGE::ny, P_ima_null, P_ima_val, P_imb_null, P_imb_val, P_nx, P_ny, PH_fakeim(), and top. Referenced by main().
00455 { 00456 MRI_IMAGE * im=NULL ; 00457 int nxa,nxb , nya,nyb ; 00458 00459 if( str[0] == '\0' || strncmp(str,"black",5) == 0 ){ 00460 if( doA ){ P_ima_null = CONST ; P_ima_val = 0.0 ; Mfree(P_ima) ; } 00461 else { P_imb_null = CONST ; P_imb_val = 0.0 ; Mfree(P_imb) ; } 00462 } else if( strncmp(str,"const=",6) == 0 ){ 00463 float val=0.0 ; 00464 sscanf(str+6,"%f",&val) ; 00465 if( doA ){ P_ima_null = CONST ; P_ima_val = val ; Mfree(P_ima) ; } 00466 else { P_imb_null = CONST ; P_imb_val = val ; Mfree(P_imb) ; } 00467 } else if( strncmp(str,"noise=",6) == 0 ){ 00468 float val=0.0 ; 00469 sscanf(str+6,"%f",&val) ; 00470 if( doA ){ P_ima_null = NOISE ; P_ima_val = val ; Mfree(P_ima) ; } 00471 else { P_imb_null = NOISE ; P_imb_val = val ; Mfree(P_imb) ; } 00472 } else { 00473 float top ; MRI_IMAGE * qim ; 00474 im = mri_read( str ) ; 00475 if( im == NULL ) return -1; 00476 top = mri_maxabs(im) ; 00477 if( top > 0.0 ) top = 1.0 / top ; 00478 qim = mri_scale_to_float( top , im ) ; 00479 Mfree(im) ; im = qim ; 00480 if( doA ){ Mfree(P_ima) ; P_ima = im ; } 00481 else { Mfree(P_imb) ; P_imb = im ; } 00482 } 00483 00484 nxa = (P_ima != NULL) ? P_ima->nx : 0 ; 00485 nxb = (P_imb != NULL) ? P_imb->nx : 0 ; 00486 nya = (P_ima != NULL) ? P_ima->ny : 0 ; 00487 nyb = (P_imb != NULL) ? P_imb->ny : 0 ; 00488 00489 P_nx = MAX(nxa,nxb) ; if( P_nx == 0 ) P_nx = 256 ; 00490 P_ny = MAX(nya,nyb) ; if( P_ny == 0 ) P_ny = 256 ; 00491 00492 if( nxa > 0 && (nxa != P_nx || nya != P_ny) ){ 00493 im = mri_resize(P_ima,P_nx,P_ny) ; Mfree(P_ima) ; P_ima = im ; 00494 } 00495 00496 if( nxb > 0 && (nxb != P_nx || nyb != P_ny) ){ 00497 im = mri_resize(P_imb,P_nx,P_ny) ; Mfree(P_imb) ; P_imb = im ; 00498 } 00499 00500 if( P_ima == NULL ) P_ima = PH_fakeim( P_nx,P_ny , P_ima_null,P_ima_val ) ; 00501 if( P_imb == NULL ) P_imb = PH_fakeim( P_nx,P_ny , P_imb_null,P_imb_val ) ; 00502 00503 doA = 0 ; return 0 ; 00504 } |
|
Definition at line 235 of file Xphace.c. References drive_MCW_imseq(), PLUGIN_impopper::im, isqDR_clearstat, isqDR_destroy, isqDR_offwid, isqDR_onoffwid, isqDR_realize, isqDR_reimage, MRI_IMAGE::kind, mri_free(), mri_to_mri(), open_MCW_imseq(), PLUGIN_imseq_getim(), PLUGIN_impopper::seq, and MCW_imseq::wtop. Referenced by PH_redraw().
00236 { 00237 PLUGIN_impopper * imp = (PLUGIN_impopper *) handle ; 00238 00239 /*-- input image is NULL ==> popdown, if applicable --*/ 00240 00241 if( im == NULL ){ 00242 if( imp != NULL ) 00243 drive_MCW_imseq( imp->seq , isqDR_destroy , NULL ) ; 00244 00245 return ((void *) imp) ; 00246 } 00247 00248 /*-- input = no popper handle ==> create one --*/ 00249 00250 if( imp == NULL ){ 00251 imp = XtNew(PLUGIN_impopper) ; 00252 imp->seq = NULL ; imp->im = NULL ; 00253 } 00254 00255 /*-- input = non-null image ==> replace image --*/ 00256 00257 mri_free( imp->im ) ; /* toss old copy */ 00258 imp->im = mri_to_mri( im->kind , im ) ; /* make new copy */ 00259 00260 /*-- input = inactive popper handle ==> activate it --*/ 00261 00262 if( imp->seq == NULL ){ 00263 imp->seq = open_MCW_imseq( MAIN_dc , 00264 PLUGIN_imseq_getim , (XtPointer) imp ) ; 00265 00266 drive_MCW_imseq( imp->seq , isqDR_realize, NULL ) ; 00267 drive_MCW_imseq( imp->seq , isqDR_onoffwid , (XtPointer) isqDR_offwid ) ; 00268 00269 XtVaSetValues( imp->seq->wtop , 00270 XmNmwmDecorations , MWM_DECOR_BORDER | MWM_DECOR_TITLE | MWM_DECOR_MENU , 00271 XmNmwmFunctions , MWM_FUNC_MOVE | MWM_FUNC_CLOSE , 00272 XmNtitle , "Xphace Images" , 00273 NULL ) ; 00274 00275 } 00276 00277 drive_MCW_imseq( imp->seq , isqDR_clearstat , NULL ) ; 00278 drive_MCW_imseq( imp->seq , isqDR_reimage , (XtPointer) 0 ) ; 00279 00280 return ((void *) imp) ; 00281 } |
|
Definition at line 557 of file Xphace.c. References ADDTO_IMARR, FREE_IMARR, INIT_IMARR, mri_cat2D(), mri_free(), mri_scramble(), MRI_IMAGE::nx, MRI_IMAGE::ny, P_alpha, P_beta, P_handle, and PH_popup_image(). Referenced by PH_scale_CB(), and PH_startup_timeout_CB().
00558 { 00559 MRI_IMAGE * imc , * im3 ; 00560 MRI_IMARR * imar ; 00561 float fgap = 0.0 ; 00562 00563 if( P_ima == NULL || P_imb == NULL ) return ; 00564 00565 #if 0 00566 fprintf(stderr,"PH_redraw: A:nx=%d ny=%d B:nx=%d ny=%d\n", 00567 P_ima->nx,P_ima->ny , P_imb->nx,P_imb->ny ) ; 00568 fprintf(stderr,"PH_redraw: calling mri_scramble\n") ; 00569 #endif 00570 00571 imc = mri_scramble( P_ima,P_imb , 1.0-P_alpha,1.0-P_beta ) ; 00572 00573 #if 0 00574 if(imc==NULL)fprintf(stderr," - returned NULL!\n") ; 00575 #endif 00576 00577 INIT_IMARR(imar) ; 00578 ADDTO_IMARR(imar,P_ima); ADDTO_IMARR(imar,imc); ADDTO_IMARR(imar,P_imb); 00579 00580 #if 0 00581 fprintf(stderr,"PH_redraw: calling mri_cat2D\n") ; 00582 if(imc!=NULL)fprintf(stderr," C:nx=%d ny=%d\n", imc->nx,imc->ny ) ; 00583 #endif 00584 00585 im3 = mri_cat2D( 3,1 , 3 , &fgap , imar ) ; 00586 FREE_IMARR(imar) ; mri_free(imc) ; 00587 00588 #if 0 00589 if(im3==NULL)fprintf(stderr," - returned NULL!\n") ; 00590 fprintf(stderr,"PH_redraw: calling PH_popup_image\n") ; 00591 #endif 00592 00593 P_handle = PH_popup_image( P_handle , im3 ) ; 00594 00595 mri_free(im3) ; return ; 00596 } |
|
Definition at line 535 of file Xphace.c. References FIX_SCALE_SIZE, getenv(), ISQ_snapshot(), MAGN_scale, P_alpha, P_beta, P_handle, PH_redraw(), PHASE_scale, PLUGIN_impopper::seq, and MCW_imseq::wimage. Referenced by main().
00536 { 00537 XmScaleCallbackStruct * cbs = (XmScaleCallbackStruct *) cb ; 00538 float val = 0.01 * cbs->value ; 00539 00540 FIX_SCALE_SIZE ; 00541 00542 if( w == MAGN_scale ) P_alpha = val ; 00543 else if( w == PHASE_scale ) P_beta = val ; 00544 00545 PH_redraw() ; 00546 00547 { char *eee = getenv("XPHACE_SNAP") ; 00548 if( eee != NULL && toupper(*eee) == 'Y' ){ 00549 PLUGIN_impopper *imp = (PLUGIN_impopper *) P_handle ; 00550 #if 0 00551 fprintf(stderr,"XID = %x\n",(unsigned int)XtWindow(imp->seq->wimage)) ; 00552 #endif 00553 ISQ_snapshot( imp->seq->wimage ) ; 00554 }} 00555 } |
|
Definition at line 430 of file Xphace.c. References client_data, and PH_redraw(). Referenced by main().
00431 { 00432 PH_redraw() ; return ; 00433 } |
|
Definition at line 192 of file Xphace.c. References MCW_imseq_status::aux, PLUGIN_impopper::im, isqCR_getimage, isqCR_getoverlay, isqCR_getqimage, isqCR_getstatus, MRI_IMAGE::kind, mri_to_mri(), MCW_imseq_status::num_series, MCW_imseq_status::num_total, MCW_imseq_status::parent, PLUGIN_seq_send_CB(), MCW_imseq_status::send_CB, MCW_imseq_status::slice_proj, MCW_imseq_status::transforms0D, and MCW_imseq_status::transforms2D. Referenced by PH_popup_image().
00193 { 00194 PLUGIN_impopper * imp = (PLUGIN_impopper *) handle ; 00195 00196 if( imp == NULL ) return(NULL) ; 00197 00198 /*--- control info ---*/ 00199 00200 if( type == isqCR_getstatus ){ 00201 MCW_imseq_status * stat = XtNew( MCW_imseq_status ) ; 00202 stat->num_total = 1 ; 00203 stat->num_series = 1 ; 00204 stat->send_CB = PLUGIN_seq_send_CB ; 00205 stat->parent = (XtPointer) imp ; 00206 stat->aux = NULL ; 00207 00208 stat->transforms0D = NULL ; 00209 stat->transforms2D = NULL ; 00210 stat->slice_proj = NULL ; 00211 00212 return((XtPointer) stat) ; 00213 } 00214 00215 /*--- no overlay ---*/ 00216 00217 if( type == isqCR_getoverlay ) return(NULL) ; 00218 00219 /*--- return a copy of the image 00220 (since the imseq will delete it when it is done) ---*/ 00221 00222 if( type == isqCR_getimage || type == isqCR_getqimage ){ 00223 MRI_IMAGE * im = NULL ; 00224 if( imp->im != NULL ) im = mri_to_mri( imp->im->kind , imp->im ) ; 00225 return((XtPointer) im) ; 00226 } 00227 00228 return(NULL) ; /* should not occur, but who knows? */ 00229 } |
|
Definition at line 169 of file Xphace.c. References PLUGIN_impopper::im, isqCR_destroy, mri_free(), ISQ_cbs::reason, PLUGIN_impopper::seq, MCW_imseq::status, and XtFree. Referenced by PLUGIN_imseq_getim().
00170 { 00171 PLUGIN_impopper * imp = (PLUGIN_impopper *) handle ; 00172 00173 if( imp == NULL ) return ; 00174 00175 switch( cbs->reason ){ 00176 00177 case isqCR_destroy:{ 00178 XtFree((char*)imp->seq->status) ; 00179 XtFree((char*)imp->seq) ; imp->seq = NULL ; 00180 mri_free( imp->im ) ; imp->im = NULL ; 00181 } 00182 break ; 00183 } 00184 return ; 00185 } |
Variable Documentation
|
Definition at line 452 of file Xphace.c. Referenced by PH_loadim(). |
|
Initial value: { "AFNI*fontList: 9x15bold=charset1" , "AFNI*background: gray40" , "AFNI*menu*background: gray40" , "AFNI*borderColor: gray40" , "AFNI*foreground: yellow" , "AFNI*borderWidth: 0" , "AFNI*troughColor: green" , "AFNI*XmLabel.translations: #override<Btn2Down>:" , NULL } Definition at line 285 of file Xphace.c. Referenced by main(). |
|
Definition at line 10 of file Xphace.c. Referenced by main(), and PH_scale_CB(). |
|
Definition at line 6 of file Xphace.c. Referenced by main(). |
|
|
|
Definition at line 9 of file Xphace.c. Referenced by main(). |
|
Definition at line 8 of file Xphace.c. Referenced by main(). |
|
Definition at line 438 of file Xphace.c. Referenced by PH_redraw(), and PH_scale_CB(). |
|
Definition at line 438 of file Xphace.c. Referenced by PH_redraw(), and PH_scale_CB(). |
|
Definition at line 158 of file Xphace.c. Referenced by PH_redraw(), and PH_scale_CB(). |
|
|
|
Definition at line 443 of file Xphace.c. Referenced by PH_loadim(). |
|
Definition at line 444 of file Xphace.c. Referenced by PH_loadim(). |
|
|
|
Definition at line 443 of file Xphace.c. Referenced by PH_loadim(). |
|
Definition at line 444 of file Xphace.c. Referenced by PH_loadim(). |
|
Definition at line 446 of file Xphace.c. Referenced by PH_loadim(). |
|
Definition at line 446 of file Xphace.c. Referenced by PH_loadim(). |
|
Definition at line 14 of file Xphace.c. Referenced by main(). |
|
Definition at line 10 of file Xphace.c. Referenced by main(), and PH_scale_CB(). |