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.

fgetoutput
function fgetoutput
%Version 4/3/09 Brings up the get output window, and calls h_getoutput.
global m5f m5b fontpics h_getoutput h_getoutputfig darkgreen

x = .4; y = .4; w = .2; h = .2;
h_getoutputfig = figure('Color', darkgreen, 'units','normalized','name','Output File','ToolBar','none','NumberTitle','off','menubar','none','position',[ x y w h ] );
uicontrol( 'units', 'normalized', 'style', 'text', 'string', 'Name for  output directory', 'position', [ .1 .75 .8 .15], 'background','black','fore','white', 'fontsize', fontpics );
h_getoutput = uicontrol( h_getoutputfig, 'units', 'normalized',...
    'style', 'edit', 'string','', 'position', [ 1/4 1/2 1/2 1/6 ],'fore', m5f, 'back', m5b, 'fontsize', fontpics );
uicontrol( 'interruptible','off','style','pushbutton', 'units', 'normalized',  'string','Done',...
    'position',[ .35 1/12 .3 .15 ] , 'callback',@fgetoutput_callback, 'fontsize', fontpics);

function fgetoutput_callback( gcf, eventdata, handles )
global outputdirectory h_getoutput inputdirectory sourcedirectory homedirectory dirsep h_getoutputfig
global initialdone culldone inspectdone finaldone initials culls inspects finals
tmp = get( h_getoutput,'string');
if(isempty(tmp) == 1)
    outputdirectory = 'out1';
else
    outputdirectory = tmp;
end;
if exist(inputdirectory,'dir') == 0;
    fgetinput;
end;
if strcmp(inputdirectory, sourcedirectory) == 1
    fgetinput;
end;
if (strcmp(inputdirectory, homedirectory == 1))
    fgetinput;
end
outdirpath = strcat(inputdirectory,dirsep,outputdirectory);
initials = 0; culls = 0; inspects = 0; finals = 0;
if exist( outdirpath,'dir' ) ~= 0
    results = questdlg( 'Directory exists. Write to it? If yes, the previous search from initial.txt in this directory will be restored and the previous analysis could be overwritten. If no, a new output directory with a time stamp will automatically be generated.', 'Output files exist', 'Yes', 'No', 'No' );
    if( strcmp(results, 'No'));
        timevector = clock;
        t4 = num2str( timevector( 4 ), '%02d' ); % hour
        t5 = num2str( timevector( 5 ), '%02d' ); % minute
        outputdirectory = strcat(outputdirectory,t4,t5);
        mkdir(strcat(inputdirectory,dirsep,outputdirectory));
        initialdone = 0; culldone = 0; inspectdone = 0; finaldone = 0;
            initials = 0; culls = 0; inspects = 0; finals = 0;       
    else
        newsettings = sprintf( '%s%s%s%sinitial.txt', inputdirectory, dirsep, outputdirectory, dirsep );
        if exist(newsettings,'file') ~= 0
            fprintf( 1, 'Read in analysis from initial.txt in output directory, %s.\n', outputdirectory );
            initials = freaddata( 'initial.txt', 1 );
            culls = freaddata('culled.txt',2);
            initialdone = 0; culldone = 0; inspectdone = 1; finaldone = 1;
            %initials = 1; culls = 1; inspects = 1; finals = 1;
        end
    end;
else
mkdir(strcat(inputdirectory,dirsep,outputdirectory));    
end
close(h_getoutputfig);
fupdate


Contact us