Code covered by the BSD License  

Highlights from
FRETSCAL

image thumbnail

FRETSCAL

by

Eric Muller

 

For the FRET analysis of images of yeast cells labeled with YFP and CFP.

fgettype
function fgettype
%Version 4/3/09 This opens the splash screen with the radio buttons that
%describe the type of experiment, FRET, CFP spillover or YFP spillover. It
%also assigns the wavelength that will be used to find the initial peaks of
%intensity of the AOI.

global frettype cfptype yfptype primary fontpics darkgreen 

x = .3; y = .3; w = .4; h = .4;
h_gettypefig = figure('Color', darkgreen, 'units','normalized','name','Experiment','ToolBar','none','NumberTitle','off','menubar','none','position',[ x y w h ] );
uicontrol( 'units', 'normalized', 'style', 'text', ...
          'string', 'Experiment type and primary search channel', 'position', [ .15 11/12 .7 1/15 ], 'background','black','fore','white','fontsize', fontpics ); 
h_gettype.u0 = uicontrol( 'units', 'normalized', 'style', 'radiobutton', 'string', 'FRETR measurement, primary YFP', ...
           'position', [ 1/10 9/12 8/10 1/12 ], 'fontsize', fontpics ); 
h_gettype.u1 = uicontrol( 'units', 'normalized', 'style', 'radiobutton', 'string', 'FRETR measurement, primary FRET', ...
           'position', [ 1/10 8/12 8/10 1/12 ], 'fontsize', fontpics ); 
h_gettype.u2 = uicontrol( 'units', 'normalized', 'style', 'radiobutton', 'string', 'FRETR measurement, primary CFP', ...
           'position', [ 1/10 7/12 8/10 1/12 ], 'fontsize', fontpics ); 
h_gettype.u3 = uicontrol( 'units', 'normalized', 'style', 'radiobutton', 'string', 'YFP spillover measurement, primary YFP', ...
           'position', [ 1/10 6/12 8/10 1/12 ], 'fontsize', fontpics ); 
h_gettype.u4 = uicontrol( 'units', 'normalized', 'style', 'radiobutton', 'string', 'YFP spillover measurement, primary FRET', ...
           'position', [ 1/10 5/12 8/10 1/12 ], 'fontsize', fontpics ); 
h_gettype.u5 = uicontrol( 'units', 'normalized', 'style', 'radiobutton', 'string', 'CFP spillover measurement, primary CFP', ...
           'position', [ 1/10 4/12 8/10 1/12 ], 'fontsize', fontpics ); 
h_gettype.u6 = uicontrol( 'units', 'normalized', 'style', 'radiobutton', 'string', 'CFP spillover measurement, primary FRET', ...
           'position', [ 1/10 3/12 8/10 1/12 ], 'fontsize', fontpics ); 
set(  h_gettype.u0, 'callback', {@fgettype_callback, h_gettype, 1 } );
set(  h_gettype.u1, 'callback', {@fgettype_callback, h_gettype, 2 } );
set(  h_gettype.u2, 'callback', {@fgettype_callback, h_gettype, 3 } );
set(  h_gettype.u3, 'callback', {@fgettype_callback, h_gettype, 4 } );
set(  h_gettype.u4, 'callback', {@fgettype_callback, h_gettype, 5 } );
set(  h_gettype.u5, 'callback', {@fgettype_callback, h_gettype, 6 } );
set(  h_gettype.u6, 'callback', {@fgettype_callback, h_gettype, 7 } );

if( frettype == 1 )
  if( primary == 1 )
    set( h_gettype.u0, 'value', 1 );
    set( h_gettype.u1, 'value', 0 );
    set( h_gettype.u2, 'value', 0 );
    set( h_gettype.u3, 'value', 0 );
    set( h_gettype.u4, 'value', 0 );
    set( h_gettype.u5, 'value', 0 );
    set( h_gettype.u6, 'value', 0 );
  elseif( primary == 2 )
    set( h_gettype.u0, 'value', 0 );
    set( h_gettype.u1, 'value', 1 );
    set( h_gettype.u2, 'value', 0 );
    set( h_gettype.u3, 'value', 0 );
    set( h_gettype.u4, 'value', 0 );
    set( h_gettype.u5, 'value', 0 );
    set( h_gettype.u6, 'value', 0 );
  else
    set( h_gettype.u0, 'value', 0 );
    set( h_gettype.u1, 'value', 0 );
    set( h_gettype.u2, 'value', 1 );
    set( h_gettype.u3, 'value', 0 );
    set( h_gettype.u4, 'value', 0 );
    set( h_gettype.u5, 'value', 0 );
    set( h_gettype.u6, 'value', 0 );
  end;
elseif( yfptype == 1 )
  if( primary == 1 )
    set( h_gettype.u0, 'value', 0 );
    set( h_gettype.u1, 'value', 0 );
    set( h_gettype.u2, 'value', 0 );
    set( h_gettype.u3, 'value', 1 );
    set( h_gettype.u4, 'value', 0 );
    set( h_gettype.u5, 'value', 0 );
    set( h_gettype.u6, 'value', 0 );
  else
    set( h_gettype.u0, 'value', 0 );
    set( h_gettype.u1, 'value', 0 );
    set( h_gettype.u2, 'value', 0 );
    set( h_gettype.u3, 'value', 0 );
    set( h_gettype.u4, 'value', 1 );
    set( h_gettype.u5, 'value', 0 );
    set( h_gettype.u6, 'value', 0 );
  end;
elseif( cfptype == 1 )
  if( primary == 3 )
    set( h_gettype.u0, 'value', 0 );
    set( h_gettype.u1, 'value', 0 );
    set( h_gettype.u2, 'value', 0 );
    set( h_gettype.u3, 'value', 0 );
    set( h_gettype.u4, 'value', 0 );
    set( h_gettype.u5, 'value', 1 );
    set( h_gettype.u6, 'value', 0 );
  else
    set( h_gettype.u0, 'value', 0 );
    set( h_gettype.u1, 'value', 0 );
    set( h_gettype.u2, 'value', 0 );
    set( h_gettype.u3, 'value', 0 );
    set( h_gettype.u4, 'value', 0 );
    set( h_gettype.u5, 'value', 0 );
    set( h_gettype.u6, 'value', 1 );
  end;
else
  fprintf( 1, 'unknown type\n' );
end;
uicontrol( h_gettypefig, 'style','pushbutton', 'units', 'normalized', 'string','Done',...
           'position',[ .4 1/12 .2 1/12 ], 'callback','fupdate;close(gcf)', 'fontsize', fontpics);

function fgettype_callback( gcf, eventdata, handles, radio_value )
global frettype cfptype yfptype primary YFPspill  progbarcol

progbarcol = 'red';
  switch radio_value
   case 1
     frettype = 1; yfptype = 0; cfptype = 0; primary = 1;
     set( handles.u0, 'value', 1 ); set( handles.u1, 'value', 0 ); set( handles.u2, 'value', 0 ); 
     set( handles.u3, 'value', 0 ); set( handles.u4, 'value', 0 ); set( handles.u5, 'value', 0 ); 
     set( handles.u6, 'value', 0 ); 
   case 2
     frettype = 1; yfptype = 0; cfptype = 0; primary = 2;
     set( handles.u0, 'value', 0 ); set( handles.u1, 'value', 1 ); set( handles.u2, 'value', 0 ); 
     set( handles.u3, 'value', 0 ); set( handles.u4, 'value', 0 ); set( handles.u5, 'value', 0 ); 
     set( handles.u6, 'value', 0 ); 
   case 3
     frettype = 1; yfptype = 0; cfptype = 0; primary = 3;
     set( handles.u0, 'value', 0 ); set( handles.u1, 'value', 0 ); set( handles.u2, 'value', 1 ); 
     set( handles.u3, 'value', 0 ); set( handles.u4, 'value', 0 ); set( handles.u5, 'value', 0 ); 
     set( handles.u6, 'value', 0 ); 
   case 4
     frettype = 0; yfptype = 1; cfptype = 0; primary = 1; YFPspill = 1; CFPspill = 0;
     set( handles.u0, 'value', 0 ); set( handles.u1, 'value', 0 ); set( handles.u2, 'value', 0 ); 
     set( handles.u3, 'value', 1 ); set( handles.u4, 'value', 0 ); set( handles.u5, 'value', 0 ); 
     set( handles.u6, 'value', 0 ); 
   case 5
     frettype = 0; yfptype = 1; cfptype = 0; primary = 2; YFPspill = 1; CFPspill = 0;
     set( handles.u0, 'value', 0 ); set( handles.u1, 'value', 0 ); set( handles.u2, 'value', 0 ); 
     set( handles.u3, 'value', 0 ); set( handles.u4, 'value', 1 ); set( handles.u5, 'value', 0 ); 
     set( handles.u6, 'value', 0 ); 
   case 6
     frettype = 0; yfptype = 0; cfptype = 1; primary = 3; YFPspill = 0; CFPspill = 1;
     set( handles.u0, 'value', 0 ); set( handles.u1, 'value', 0 ); set( handles.u2, 'value', 0 ); 
     set( handles.u3, 'value', 0 ); set( handles.u4, 'value', 0 ); set( handles.u5, 'value', 1 ); 
     set( handles.u6, 'value', 0 ); 
   case 7
     frettype = 0; yfptype = 0; cfptype = 1; primary = 2; YFPspill = 0; CFPspill = 1;
     set( handles.u0, 'value', 0 ); set( handles.u1, 'value', 0 ); set( handles.u2, 'value', 0 ); 
     set( handles.u3, 'value', 0 ); set( handles.u4, 'value', 0 ); set( handles.u5, 'value', 0 ); 
     set( handles.u6, 'value', 1 );

  end;

Contact us