From a4d8d04931650c77146173d3e4c37c9c6f093267 Mon Sep 17 00:00:00 2001 From: Florian Vollrath Date: Sun, 9 Oct 2016 22:43:19 +0200 Subject: [PATCH] fixed stuff --- functions/CellSortLoadTrials.m | 13 +++++++++++++ functions/CellSortLoadTrialsShiftCorrOnTrials.m | 2 +- main.m | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/functions/CellSortLoadTrials.m b/functions/CellSortLoadTrials.m index 12f32e1..31d731c 100644 --- a/functions/CellSortLoadTrials.m +++ b/functions/CellSortLoadTrials.m @@ -46,5 +46,18 @@ %do shift correction on complete video disp('Performing Shift Correction On All Frames..'); [data_g_array, data_r_array] = CellSortShiftCorrection(data_g_array,data_r_array,reference, 'iter'); + +%calculate quality plot +reference = mean(data_r_array, 3); +qualityPlot = zeros(1,size(data_r_array, 3)); +parfor i = 1:size(data_r_array,3) + qualityPlot(i) = squeeze(mean(mean(data_r_array(:,:,i) - reference,1),2)); +end +qualityPlot = qualityPlot.^2; +figure; +plot(qualityPlot); +for i=1:numberGreen + vline(numFrameList(i), 'black', greenFiles(i).name); +end disp('Finished Loading Trial Files!'); end \ No newline at end of file diff --git a/functions/CellSortLoadTrialsShiftCorrOnTrials.m b/functions/CellSortLoadTrialsShiftCorrOnTrials.m index 836fc87..b548146 100644 --- a/functions/CellSortLoadTrialsShiftCorrOnTrials.m +++ b/functions/CellSortLoadTrialsShiftCorrOnTrials.m @@ -50,7 +50,6 @@ data_g{i} = []; end -disp('Finished Loading Trial Files!'); %calculate quality plot reference = mean(data_r_array, 3); qualityPlot = zeros(1,size(data_r_array, 3)); @@ -63,4 +62,5 @@ for i=1:numberGreen vline(numFrameList(i), 'black', greenFiles(i).name); end +disp('Finished Loading Trial Files!'); end \ No newline at end of file diff --git a/main.m b/main.m index 1ace0e6..a29b2b5 100644 --- a/main.m +++ b/main.m @@ -12,7 +12,9 @@ %% load files %go to corr folder outFolder = 'F:\Arbeit\testData\PCAICA'; +%shifft correction on all frames %[data_g, data_r, frames, fn_green, fn_red, fileNamesGreen, fileNamesRed] = CellSortLoadTrials(outFolder); +%shift correction only on trials [data_g, data_r, frames, fn_green, fn_red, fileNamesGreen, fileNamesRed] = CellSortLoadTrialsShiftCorrOnTrials(outFolder); %If you want to load single files, use the functions below. % fn_green = 'data_g.tif';