function FRET=stimporter(fileindex)
%IMPORTFILE(FILETOREAD1)
%  Imports data from the specified file and writes to structure
Filenumber=size(fileindex,1);
for i=1:Filenumber
% Import the file
    FRET(1,i).DAChannel = importdata(fileindex{i});

    % Naming the the timeseries.
[unused,name] = fileparts(fileindex{i}); 
FRET(1,i).Name = name
end;

%MinMax and noise Values
for i=1:Filenumber
    FRET(1,i).MaxMinNull = [max(FRET(1,i).DAChannel),min(FRET(1,i).DAChannel),min(abs(FRET(1,i).DAChannel))];
end;
%ADratio
for i=1:Filenumber
    FRET(1,i).ADratio=sum(FRET(1,i).DAChannel(find(FRET(1,i).DAChannel(:,2)>0)))/sum(FRET(1,i).DAChannel(find(FRET(1,i).DAChannel(:,1)>0)));
end;
%single A and D Photons
for i=1:Filenumber
   FRET(1,i).singles=[sum(FRET(1,i).DAChannel(:,1)==FRET(1,i).DAChannel(find(FRET(1,i).DAChannel(:,1)>0,1),1),1),sum(FRET(1,i).DAChannel(:,2)==FRET(1,i).DAChannel(find(FRET(1,i).DAChannel(:,2)>0,1),2),1)]
end;
%multiple Photon Counts
for i=1:Filenumber
FRET(1,i).multiples=[sum(FRET(1,i).DAChannel(:,1)>FRET(1,i).DAChannel(find(FRET(1,i).DAChannel(:,1)>0,1),1),1),sum(FRET(1,i).DAChannel(:,2)>FRET(1,i).DAChannel(find(FRET(1,i).DAChannel(:,2)>0,1),2),1)];
end;