function h = bmanalyzePlot( )
% BMANALYZEPLOT Plot BMANALYZE results.
% H = BMANALYZEPLOT() plots BMANALYZE results
%
% Example
% -------
% Plot results from granulometry analysis on coronal mouse brain Nissl section.
%
% bmanalyze('http://brainmaps.org/HBP2/mus.musculus/cor/002-nissl/m08a/', 'granulometry');
% bmanalyzePlot;
%
% See also BMANALYZE, BMANALYZEINFO, BMANALYZEGETPATHS.
%
% Copyright 2006 BrainMaps.org.
%Figure Positioning
bdwidth = 5;
topbdwidth = 30;
set(0,'Units','pixels')
scnsize = get(0,'ScreenSize');
pos1 = [bdwidth,... %left corner
2/3*scnsize(4) + bdwidth,...
scnsize(3)/2.95 - 2*bdwidth,... %width
scnsize(4)/3.4 - (topbdwidth + bdwidth)];
pos2 = [pos1(1) + scnsize(3)/3, pos1(2), pos1(3), pos1(4)];
pos3 = [pos1(1) + 2*scnsize(3)/3, pos1(2), pos1(3), pos1(4)];
pos4 = [pos1(1), pos1(2)-1/3*scnsize(4), pos1(3), pos1(4)];
pos5 = [pos1(1) + scnsize(3)/3, pos1(2)-1/3*scnsize(4), pos1(3), pos1(4)];
pos6 = [pos1(1) + 2*scnsize(3)/3, pos1(2)-1/3*scnsize(4), pos1(3), pos1(4)];
pos7 = [pos1(1), pos1(2)-2/3*scnsize(4), pos1(3), pos1(4)];
pos8 = [pos1(1) + scnsize(3)/3, pos1(2)-2/3*scnsize(4), pos1(3), pos1(4)];
pos9 = [pos1(1) + 2*scnsize(3)/3, pos1(2)-2/3*scnsize(4), pos1(3), pos1(4)];
load BMANALYZE
figure('Position',pos1),imagesc(a_pre),axis equal, axis off
out2=[];%repmat(zeros(floor(full_width/256),floor(full_height/256)), 5, 5 );
for cellrad=1:36
specount=0;
out=zeros(floor(full_width/256),floor(full_height/256));
for tileindex=1:x
if (tilehold(tileindex,2)==num_resolutions)
out( tilehold(tileindex,3)+1, tilehold(tileindex,4)+1 ) = spetotal(specount+1,cellrad);
specount=specount+1;
end
end
out2( rem(cellrad-1,6)*floor(full_width/256)+1:(rem(cellrad-1,6)+1)*floor(full_width/256)+1, (ceil(cellrad/6)-1)*floor(full_height/256)+1: (ceil(cellrad/6))*floor(full_height/256)+1 )=out;%-(cellrad+1)*10000000;
end
figure('Position',pos2),plot(mean(spetotal)), xlabel('radius of cell bodies (pixels)'), ylabel(''), title('Mean of Granulometry Spectra')
figure('Position',pos3),plot(var(spetotal)), xlabel('radius of cell bodies (pixels)'), ylabel(''), title('Variance of Granulometry Spectra')
figure('Position',pos4),imagesc(spetotal),colorbar, xlabel('radius of cell bodies (pixels)'), ylabel('tile index')
[x2 y2]=size(out2);
figure('Position',pos5),imagesc(out2'), colormap(gray),colorbar, axis equal, axis off, ylim([0 y2]),
title('Distribution of cell bodies classified by radius');