From a6a9e2a1572fac79dbe43bf7e480122de87aae20 Mon Sep 17 00:00:00 2001 From: asterakin Date: Tue, 14 Feb 2017 13:17:14 -0800 Subject: [PATCH] removing filtred when counting fluorescence channels. Needed when running for the second time foci finding steps onwards. --- cell/trackOptiMakeCell.m | 4 +++- fluorescence/trackOptiFluor.m | 18 ++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cell/trackOptiMakeCell.m b/cell/trackOptiMakeCell.m index 3e72fa6..bb0e3fb 100644 --- a/cell/trackOptiMakeCell.m +++ b/cell/trackOptiMakeCell.m @@ -139,7 +139,9 @@ function trackOptiMakeCell(dirname,CONST,header) tmp_fn = fieldnames( data_c ); nf = numel( tmp_fn ); for j = 1:nf; - if numel(strfind(tmp_fn{j},'fluor')==1)&& ~numel((strfind(tmp_fn{j},'fluor0'))) + if numel(strfind(tmp_fn{j},'fluor')==1) && ... + ~numel((strfind(tmp_fn{j},'fluor0'))) && ... + ~numel((strfind(tmp_fn{j},'filtered'))) nc = nc+1; end end diff --git a/fluorescence/trackOptiFluor.m b/fluorescence/trackOptiFluor.m index 88e4c7b..8b77207 100644 --- a/fluorescence/trackOptiFluor.m +++ b/fluorescence/trackOptiFluor.m @@ -1,12 +1,12 @@ function trackOptiFluor(dirname,CONST,header) % trackOptiFluor calculates the mean background fluorescence for each frame. -% This is the fluroscence outside the background mask. It does not do any focus -% fitting at this stage. It saves the information in the err/seg -% files under data_c.fl1bg for channel 1 and data_c.fl2bg for channel 2. +% This is the mean fluorescence of the non cell regions. No focus fitting is +% done at this stage. It saves the information in the err/seg +% files under data_c.fl1bg for channel 1, data_c.fl2bg for channel 2, etc. % % INPUT : % dirname: seg folder eg. maindirectory/xy1/seg -% CONST: are the segmentation constants. +% CONST: segmentation constants. % header : string displayed with information % % Copyright (C) 2016 Wiggins Lab @@ -32,10 +32,8 @@ function trackOptiFluor(dirname,CONST,header) header = []; end - SE = strel( 'disk', 5 ); - if(nargin<1 || isempty(dirname)) dirname = '.'; end @@ -53,26 +51,26 @@ function trackOptiFluor(dirname,CONST,header) end nc = 0; - if numel(contents) > 0 data_c = loaderInternal([dirname,contents(1).name]); datacFields = fieldnames(data_c); nf = numel(datacFields); % goes through the fields in data_c and calculates the number of fluorescence channels for j = 1:nf; - if numel(strfind(datacFields{j},'fluor')==1) && ~numel((strfind(datacFields{j},'fluor0'))) + if numel(strfind(datacFields{j},'fluor')==1) && ... + ~numel(strfind(datacFields{j},'filtered')) && ... + ~numel((strfind(datacFields{j},'fluor0'))) nc = nc+1; end end end - % loop through all the cells. if nc > 0 for i = 1:num_im data_c = loaderInternal([dirname,contents(i).name]); - % Compute the background fluorescence level in both channel + % Compute the background fluorescence level in every channel ss = size( data_c.mask_cell ); for j = 1 : nc