Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts to generate figures, fig. 5 (top), supp. fig. (algofig)
- Loading branch information
Showing
11 changed files
with
89 additions
and
6 deletions.
There are no files selected for viewing
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function [Xn,nmz] = norms(X) | ||
|
||
% normalize the columns of X | ||
nmz = sqrt(sum(X.^2)); | ||
Xn = X./repmat(nmz,size(X,1),1); | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
% script_fig5 | ||
% creates top panel of Figure 5 | ||
|
||
load('finalresults-cell2vesseldist.mat') | ||
load('centroids_rfr1.mat') | ||
|
||
dist_vessel = nndist; clear nndist | ||
out = knnsearch(Centroids(:,1:3),Centroids(:,1:3),'K',2); | ||
nncell = out(:,2)'; | ||
dist_cell = sqrt(sum(((Centroids(:,1:3)-Centroids(nncell,1:3))').^2))'; | ||
|
||
% compute cell density (nn approach) | ||
k=5; % dvec = cell density estimates over volume | ||
[pout,pts,volvox,dvec,numvox] = knndensityest(Centroids(:,1:3),k); | ||
|
||
%% | ||
figure; | ||
subplot(131); | ||
hist(dvec,linspace(0,6e5)) | ||
axis tight | ||
title('Distribution of cell density over volume') | ||
xlabel('cell density (x 10^5 cells/cubic mm)') | ||
ylabel('counts') | ||
|
||
subplot(132); | ||
hist(dist_cell*0.65,linspace(0,140,100)) | ||
axis tight | ||
title('Distances from cell centers to closest cell center') | ||
xlabel('cubic microns') | ||
ylabel('neurons') | ||
|
||
|
||
subplot(133); | ||
hist(dist_vessel*0.65,linspace(0,140,100)) | ||
axis tight | ||
title('Distances from cell centers to closest vessel voxel') | ||
xlabel('cubic microns') | ||
ylabel('neurons') | ||
|
||
sample_stats.celldensity_mean = mean(dvec); | ||
sample_stats.celldensity_var = var(dvec); | ||
|
||
sample_stats.ccdist_mean = mean(dist_cell); | ||
sample_stats.ccdist_var = var(dist_cell); | ||
|
||
sample_stats.cvdist_mean = mean(dist_vessel); | ||
sample_stats.cvdist_var = var(dist_vessel); | ||
|
||
sample_stats.totstats = [mean(dvec),var(dvec),mean(dist_cell), var(dist_cell), mean(dist_vessel),var(dist_vessel)]; | ||
|
||
|
||
%% | ||
% visualize density | ||
figure; | ||
for i=1:size(pout,3); | ||
imagesc(log(pout(:,:,i)),[min(log(pout(:))),max(log(pout(:)))]), | ||
pause, | ||
end | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+18.1 KB
data/groundtruth/V1/samples_withincellandbackground_slices_25_50_75_10sampperslice.nii.gz
Binary file not shown.
Binary file added
BIN
+8.63 KB
data/groundtruth/V2/V2samples_withincellandbackground_slices_25_51_75_10sampperslice.nii.gz
Binary file not shown.
Binary file added
BIN
+18.1 KB
data/groundtruth/V3/V3_samples_30perslice_every25slices_cellwbg.nii.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.