function qwkGlomeruliViewer(volumes,flyIDs) %% This function will generate a basic view of glomeruli identified for each fly %First input (volumes) is the cell-array of volumes: controlVol_partI or %controlVol_partII.. %Second input (flyIDs) is the number of flies whose glomeruli will be %generated. Input as an array of numbers flyID = [1:10]; if nargin < 2 flyIDs = 1:length(volumes); end glomNames = [{'DA1'} {'DL3'} {'DL1'} {'DL5'} {'DM3'} {'DM6'} {'DA2'} {'DA4l'} {'D'} {'DM5'} {'DM2'} {'DM1'} {'DM4'} {'DP1m'} {'DL4'}]; %% colormp3 = colormap(jet(15)); trialIndex = {'OdorPanel 1','OdorPanel 2'}; for ID = flyIDs for odorPanel = 1:2 %% Figure lighting and orientation arrow fixedClusters = volumes{ID,2}{2,odorPanel}; s11 = size(fixedClusters{1,2}); figure tempTitle = strcat(volumes{ID,1},{' '},trialIndex{odorPanel}); title(tempTitle{1}); set(gcf,'Color','w'); a = annotation ( 'textarrow', [.15 .1], [0.7 0.75],'String','M'); a = annotation ( 'textarrow', [.15 .2], [0.7 0.75],'string','P'); a.Position = [0.1500 0.8000 0.0500 0.0500]; view(10,88); axis tight camlight lighting gouraud hold on rng('default') %% Produce volumes %colormp3 = brewermap(16,'Spectral'); a1 = [0 260 0 260 0 12]; cTime =1;outF = []; p2 = {};p3 = [];cnt34 = 1;cntY = 1; for i = 1:length(fixedClusters(:,1)) if sum(fixedClusters{i,2}(:)) == 0 continue end out = regionprops3(fixedClusters{i,2},'Centroid');outF(cntY,:) = out.Centroid; p2{cntY}=patch(isosurface(fixedClusters{i,2}),'FaceColor',colormp3(i,:),'EdgeColor','none','FaceAlpha',0.95,'EdgeColor',colormp3(i,:),'EdgeAlpha',0.95); %isonormals(reshape(fixedClusters{i,2},s11),p2{cntY}) tempSize = [0 s11(2) 0 s11(1) 0 s11(3)]; axis(tempSize); a = text(out.Centroid(1),out.Centroid(2),12,glomNames{i});a.FontSize = 30; %pause(2) drawnow end end end