Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
added an output of merged cell_signals and some information to select…
Browse files Browse the repository at this point in the history
… PCAs manually
  • Loading branch information
MPIBR-vollrathf committed Sep 7, 2016
1 parent cd52d25 commit 36ef7ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
9 changes: 7 additions & 2 deletions alternativePlot.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function alternativePlot(ica_segments, cluster, cell_sig, subPlotCols, sortedIdx, data_r)
function cell_sig_merged = alternativePlot(ica_segments, cluster, cell_sig, subPlotCols, sortedIdx, data_r)
cm = colormap(hsv);
tempImage = zeros(size(ica_segments, 2), size(ica_segments, 3), 3);

Expand All @@ -23,7 +23,7 @@ function alternativePlot(ica_segments, cluster, cell_sig, subPlotCols, sortedIdx
end
%set pixels 0 which are smaller than 0, seems to happen in rare cases..
for i = 1:3
tempImage(:,:,i) = (tempImage(:,:,i) > 0).*tempImage(:,:,i);
tempImage(:,:,i) = (tempImage(:,:,i) > 0).*tempImage(:,:,i);
end
%scale tempImage
% maximum = max(tempImage(:));
Expand Down Expand Up @@ -51,8 +51,13 @@ function alternativePlot(ica_segments, cluster, cell_sig, subPlotCols, sortedIdx
subplot(1,2,2);
hold on
cell_sigPlot = cell_sig(sortedIdx,:);



signal = zeros(size(cluster,2),size(cell_sig,2));
for i = 1:size(cluster, 2)
cell_sig_merged{i} = cell_sig(sortedIdx,:);
cell_sig_merged{i} = mean(cell_sig_merged{i}(cluster{i},:), 1);
for clusterIdx = cluster{i}
%subtract minimum value
minimum = min(cell_sigPlot(clusterIdx,:));
Expand Down
11 changes: 6 additions & 5 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
%choose PCAs, type f/b in command line to go back or forward. type two number
%to select the range "1 ENTER 25 ENTER" would select the PCAs from 1 to 25
[PCuse] = CellsortChoosePCs(fn_green, mixedfilters, data_g);

%OR specify the PCAs to use manually:
%PCuse = [2,3,6,13,16,17,18,19,21,22,23,25,29,30];
%% 2b. Plot PC spectrum
%optionally, you can display the PC spectrum..
CellsortPlotPCspectrum(fn_green, CovEvals, PCuse, data_g)
Expand Down Expand Up @@ -67,8 +68,8 @@
%plotting: 1 = yes or 0 = no.. shall a plot be shown or not?

smwidth = 1;
thresh = 2;
arealims = [250];
thresh = 1.5;
arealims = [200];
plotting = 1;

[ica_segments, segmentlabel, segcentroid] = CellsortSegmentation(ica_filters, smwidth, thresh, arealims, plotting);
Expand All @@ -94,7 +95,7 @@
%% show signal of cells (cell_sig)
%caluclate correlation matrix for cell_sig
[ica_segments, cluster, subPlotCols, subPlotWidth, sortedIdx] = calcCorrEff(cell_sig, ica_segments);
alternativePlot(ica_segments, cluster, cell_sig, subPlotCols, sortedIdx, data_r);
cell_sig_merged = alternativePlot(ica_segments, cluster, cell_sig, subPlotCols, sortedIdx, data_r);

%% let user deselect and merge rois
%merge -> change cluster ->recereate plots
Expand All @@ -117,4 +118,4 @@
subPlotCols = size(cluster_new, 2);

%redraw
alternativePlot(ica_segments, cluster_new, cell_sig, subPlotCols, sortedIdx, data_r);
cell_sig_merged = alternativePlot(ica_segments, cluster_new, cell_sig, subPlotCols, sortedIdx, data_r);

0 comments on commit 36ef7ea

Please sign in to comment.