image thumbnail

Image Section Generator

by

 

21 May 2009 (Updated )

Image Section Generator grabs cursor-designated linescans from microscope images

CheckForExistingFile( OutFileName )
%--------------------------------------------------------------------%
%	    Alison Chaiken, sole author and maintainer     			     %
%        ------------------------------------------------------      %
%	    GUI-based Matlab and FEMLAB data analysis, instrument	     %
%	    control, statistical analysis, finite-element modelling,     %
%	    image acquisition and analysis          				     %
%       -------------------------------------------------------      %
%	    alchaiken@gmail.com			                    		     %
%	    http://www.exerciseforthereader.org/         			     %
%	    (001)650-279-5600					                         %
%--------------------------------------------------------------------%

function [ exists ] = CheckForExistingFile( OutFileName )
% Check to see if a file of the user-indicated name already exists.   If
% so, ask user if she/he wants to overwrite

exists = 0;
dir_struct = dir(pwd);
[sorted_names,sorted_index] = sortrows({dir_struct.name}');

numfiles=max(sorted_index);
matches=strfind(sorted_names, OutFileName);
for i=1:numfiles
    if ~isempty(matches{i})
        exists = 1;
    end
end

Contact us