
function filt_neurons=add_uid(filt_neurons)
% generate uid for each neuron. 

%check if this is a filt_neurons (has .id field) or barcodes (no .id
%field);

if isfield(filt_neurons,'id')
    filt_neurons.uid=string(filt_neurons.batch_num)+"_"+string(filt_neurons.slice)+"_"+string(filt_neurons.id);
else
    % if it's a bc (i.e. , no .id field), then 
    filt_neurons.bcid=(1:numel(filt_neurons.slice))';
    filt_neurons.uid="bc"+string(filt_neurons.batch_num)+"_"+string(filt_neurons.slice)+"_"+string(filt_neurons.bcid);
end

end