function [summit, nonsummit, si, nsi] = getHemoTraces (survival, expmt, var, irange, firstMoves, drop_NS_XI)

    [si, nsi] = deal(1);
    [summit, nonsummit] = deal(NaN(ceil(length(irange)/2),length(expmt.(var).data)));
    [sumROIs,nonsumROIs] = deal([]);

    for i=irange
        if ~strcmp(survival{i,'Auto_notes'},'drop')
            % Require that summiting donors MUST have died from infection
            % on expermient day to be counted
            if strcmp(survival{i,'Donor'},"S") && strcmp(survival{i,'donor_survival'},'XI')
                sumROIs = [sumROIs, i];
                if strcmp(var,"Centroid")
                    summit(si,1:length(expmt.(var).data)-firstMoves(i)+1) = ...
                        transpose(squeeze(scaleHt(expmt.(var).data(firstMoves(i):end,2,i))));
                else
                    summit(si,1:length(expmt.(var).data)-firstMoves(i)+1) = ...
                        transpose(expmt.(var).data(firstMoves(i):end,i));
                end
                si = si +1;
            elseif strcmp(survival{i,'Donor'},"NS")
                if drop_NS_XI % drop all non-summiting flies that died of infection on experiment day
                    if ~strcmp(survival{i,'donor_survival'},'XI')
                        if strcmp(var,"Centroid")
                            nonsummit(nsi,1:length(expmt.(var).data)-firstMoves(i)+1) = ...
                                transpose(squeeze(scaleHt(expmt.(var).data(firstMoves(i):end,2,i))));

                        else
                            nonsummit(nsi,1:length(expmt.(var).data)-firstMoves(i)+1) = ...
                                transpose(expmt.(var).data(firstMoves(i):end,i));
                        end
                        nsi = nsi + 1;
                        nonsumROIs = [nonsumROIs, i];
                    end
                elseif ~strcmp(survival{i,'Caught_before_summiting'},'N') % exclude flies likely had already summitted before collection
                    if strcmp(var,"Centroid")
                        nonsummit(nsi,1:length(expmt.(var).data)-firstMoves(i)+1) = ...
                            transpose(squeeze(scaleHt(expmt.(var).data(firstMoves(i):end,2,i))));
                    else
                        nonsummit(nsi,1:length(expmt.(var).data)-firstMoves(i)+1) = ...
                            transpose(expmt.(var).data(firstMoves(i):end,i));
                    end
                    nsi = nsi + 1;
                    nonsumROIs = [nonsumROIs, i];
                end
            end
        end
    end
    
    si = si -1;
    nsi = nsi -1;
    
    summit = summit(1:si,:);
    nonsummit = nonsummit(1:nsi,:);
    
    disp("Summiting ROIS:");
    disp(sumROIs);
    disp("Nonsummiting ROIS:");
    disp(nonsumROIs);

end