Permalink
Browse files

Modified v 1 and 3 to allow for variable number layers per stack in m…

…ultiposition data-set.
  • Loading branch information...
1 parent 67f98ae commit 1d439314d6a5e0000ba5ffe4dbecbc06c06a57e1 Alistair Boettiger committed Jun 27, 2011
Showing with 59 additions and 31 deletions.
  1. +26 −12 Unsupervised_DotFinding.m
  2. +4 −4 Unsupervised_DotFinding2.m
  3. +29 −15 Unsupervised_DotFinding3.m
View
@@ -8,15 +8,15 @@
tot_time = tic;
% Input options
-old_lab = 0;
+old_lab = 0; Es = 0;
folder = '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/mRNA_counting/Data/2011-05-22/'; % '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/Enhancer_Modeling/Data/';
rawfolder = '/Volumes/Data/Lab Data/Raw_Data/2011-05-22/'; % '/Volumes/Data/Lab Data/Raw_Data/02-17-11/'; %% %
-stackfolder = 's01_MP09/';%'s07_MP08/';% 's03_MP02/';% 's02_MP01/';% 's10_bcd1x/';% 's11_bcd6x/'; %'s14_comp_cntrl/'; % 's12_cntrl_2label/'; %'MP02_22C/'; %'MP01_22C/'; % 'MGa1x/'; % 'MP10_22C/'; %'MP05_22C/'; %'YW_ths_sog/'; % 'MP10_22C/'; % % 'MP09_22C/'; % 'MGa2x/'; % 'MGa1x/'; % 'MGa2x/'; % 'MP10_22C_sna_y_c/'; %
-fname = 's01_MP09_Hz_22C_c';% 's07_MP08Hz_snaD_22C'; %'s03_MP02_Hz_22C_b';% 's01_MP09_Hz_22C_b';% 's02_MP01_Hz_22C'; % 's10_bcd1x';% 's11_bcd6x'; % 's14_comp_cntrl'; Es =1; % 's12_cntrl_2label'; Es = 1; % 'MP09_22C_hb_y_f'; Es = 7; % 'MP02_22C_hb_y'; Es = 9; % 'MP02_22C_hb_y_b'; Es = 10; % % 'MP01_22C_hb_y_f'; Es = 12; % 'MP01_22C_hb_y_c'; Es = 10; % 'MP01_22C_hb_y'; Es = 13; % 'MGa1x_LacZ_b'; Es = 12; % 'MP10_22C_sna_y_e'; Es = 12; % 'MP05_22C_sna_y_c'; Es =7; % 'MP10_22C_sna_y_d3'; Es = 1; %'YW_ths_sog'; Es = 12; % % 'MP09_22C_hb_y_e'; Es = 10; % 'MP09_22C_hb_y_d'; Es=11; % 'MGa2x_LacZ_sna_b'; Es = 10; % 'MP10_22C_sna_y_d'; % 'MGa_LacZ'; %'MGa2x_LacZ_sna'; %'MP10_22C_sna_y_c'; old_lab = 1; % 'MP05_22C_sna_y'; old_lab = 1; %
-mRNA_channels = 2; % 3; % 1; % total mRNA channels
+stackfolder = 's21_MP07/';% 's04_MP10/';% 's01_MP09/';%'s07_MP08/';% 's03_MP02/';% 's02_MP01/';% 's10_bcd1x/';% 's11_bcd6x/'; %'s14_comp_cntrl/'; % 's12_cntrl_2label/'; %'MP02_22C/'; %'MP01_22C/'; % 'MGa1x/'; % 'MP10_22C/'; %'MP05_22C/'; %'YW_ths_sog/'; % 'MP10_22C/'; % % 'MP09_22C/'; % 'MGa2x/'; % 'MGa1x/'; % 'MGa2x/'; % 'MP10_22C_sna_y_c/'; %
+fname = 'MP07het_snaD_22C'; % 's04_MP10Hz'; % 's01_MP09_Hz_22C_c';% 's07_MP08Hz_snaD_22C'; %'s03_MP02_Hz_22C_b';% 's01_MP09_Hz_22C_b';% 's02_MP01_Hz_22C'; % 's10_bcd1x';% 's11_bcd6x'; % 's14_comp_cntrl'; Es =1; % 's12_cntrl_2label'; Es = 1; % 'MP09_22C_hb_y_f'; Es = 7; % 'MP02_22C_hb_y'; Es = 9; % 'MP02_22C_hb_y_b'; Es = 10; % % 'MP01_22C_hb_y_f'; Es = 12; % 'MP01_22C_hb_y_c'; Es = 10; % 'MP01_22C_hb_y'; Es = 13; % 'MGa1x_LacZ_b'; Es = 12; % 'MP10_22C_sna_y_e'; Es = 12; % 'MP05_22C_sna_y_c'; Es =7; % 'MP10_22C_sna_y_d3'; Es = 1; %'YW_ths_sog'; Es = 12; % % 'MP09_22C_hb_y_e'; Es = 10; % 'MP09_22C_hb_y_d'; Es=11; % 'MGa2x_LacZ_sna_b'; Es = 10; % 'MP10_22C_sna_y_d'; % 'MGa_LacZ'; %'MGa2x_LacZ_sna'; %'MP10_22C_sna_y_c'; old_lab = 1; % 'MP05_22C_sna_y'; old_lab = 1; %
+mRNA_channels = 1; % 3; % 1; % total mRNA channels
-sname = fname; % 's03_MP02_Hz_22C_b';%
+sname = 'MP07het_snaD_22C_1'; Es=4; Zs = 50; % MP07fname; % 's03_MP02_Hz_22C_b';%
ver = '';% '_v2';
% MP10_22C_sna_y_c and MP05_22C all done at 3.5, 4, 0.03, 30, 30
@@ -25,11 +25,13 @@
filename = [rawfolder,'/',fname];
load([rawfolder,'/',sname,'.mat'])
-Zs = Datas.LSM_info.DimensionZ;
+
w = Datas.Stack1.Image1.IMG.width;
h = Datas.Stack1.Image1.IMG.height;
-Es = length(fields(Datas)) - 3; % Number of Stacks
-
+if Es==0
+ Zs = Datas.LSM_info.DimensionZ;
+ Es = length(fields(Datas)) - 3; % Number of Stacks
+end
% ------- Option: Focus on subset of image: ------------------- %
% m = 1/2048; % .9;% .7; % .5; .7; % 1/2048; %
% xp1= floor(h/2*m)+1; xp2 = floor(h/2*(2-m))+1; yp1 = floor(w/2*m)+1; yp2 = floor(w/2*(2-m))+1;
@@ -74,7 +76,7 @@
Ix = fspecial('gaussian',FiltSize,sigmaI); % inhibitory gaussian
%%
-for e= 1:Es
+for e= 2:Es
%%
tic
disp('loading data...');
@@ -113,7 +115,7 @@
if mRNAchn == 1;
min_int = 0.05; % just for speed
else
- min_int = 0.02; %
+ min_int = 0.01; %
end
DotLabels= cell(1,Zs);
@@ -125,12 +127,24 @@
tic; disp('finding dots...');
for z = 1:Zs % z = 11
im_folder{z} = [rawfolder,stackfolder,fname,'_',emb,'_z',num2str(z),'.tif'];
+ try
Iin_z = imreadfast(im_folder{z});
[DotLabels{z},DotData{z},Inds{z},Ints{z}] = dotfinder(Iin_z(xp1:xp2,yp1:yp2,mRNAchn),Ex,Ix,min_int,min_size);
- end
+ catch err
+ disp(err.message);
+ Zs = z-1;
+ break
+ end
+ end
toc;
-
+ % resize;
+ DotLabels= DotLabels(1:Zs);
+ DotData = DotData(1:Zs);
+ Inds = Inds(1:Zs);
+ Ints = Ints(1:Zs);
+
+
%%
intype = class(Iin_z);
@@ -12,12 +12,12 @@
folder = '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/mRNA_counting/Data/2011-05-22/'; % '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/Enhancer_Modeling/Data/';
rawfolder = '/Volumes/Data/Lab Data/Raw_Data/2011-05-22/'; % '/Volumes/Data/Lab Data/Raw_Data/02-17-11/'; %% %
-stackfolder = 's01_MP09/';% 's02_MP01/';% 's06_MP10_sna18/'; % %'s10_bcd1x/';% 's11_bcd6x/'; %'s14_comp_cntrl/'; % 's12_cntrl_2label/'; %'MP02_22C/'; %'MP01_22C/'; % 'MGa1x/'; % 'MP10_22C/'; %'MP05_22C/'; %'YW_ths_sog/'; % 'MP10_22C/'; % % 'MP09_22C/'; % 'MGa2x/'; % 'MGa1x/'; % 'MGa2x/'; % 'MP10_22C_sna_y_c/'; %
-fname ='s01_MP09_Hz_22C_c'; % 's02_MP01_Hz_22C_b'; % 's06_MP10_sna18'; %'s10_bcd1x';% 's11_bcd6x'; % 's14_comp_cntrl'; Es =1; % 's12_cntrl_2label'; Es = 1; % 'MP09_22C_hb_y_f'; Es = 7; % 'MP02_22C_hb_y'; Es = 9; % 'MP02_22C_hb_y_b'; Es = 10; % % 'MP01_22C_hb_y_f'; Es = 12; % 'MP01_22C_hb_y_c'; Es = 10; % 'MP01_22C_hb_y'; Es = 13; % 'MGa1x_LacZ_b'; Es = 12; % 'MP10_22C_sna_y_e'; Es = 12; % 'MP05_22C_sna_y_c'; Es =7; % 'MP10_22C_sna_y_d3'; Es = 1; %'YW_ths_sog'; Es = 12; % % 'MP09_22C_hb_y_e'; Es = 10; % 'MP09_22C_hb_y_d'; Es=11; % 'MGa2x_LacZ_sna_b'; Es = 10; % 'MP10_22C_sna_y_d'; % 'MGa_LacZ'; %'MGa2x_LacZ_sna'; %'MP10_22C_sna_y_c'; old_lab = 1; % 'MP05_22C_sna_y'; old_lab = 1; %
+stackfolder = 's05_MP06/';% 's01_MP09/';% 's02_MP01/';% 's06_MP10_sna18/'; % %'s10_bcd1x/';% 's11_bcd6x/'; %'s14_comp_cntrl/'; % 's12_cntrl_2label/'; %'MP02_22C/'; %'MP01_22C/'; % 'MGa1x/'; % 'MP10_22C/'; %'MP05_22C/'; %'YW_ths_sog/'; % 'MP10_22C/'; % % 'MP09_22C/'; % 'MGa2x/'; % 'MGa1x/'; % 'MGa2x/'; % 'MP10_22C_sna_y_c/'; %
+fname ='s05_MP06Hz'; % 's01_MP09_Hz_22C_c'; % 's02_MP01_Hz_22C_b'; % 's06_MP10_sna18'; %'s10_bcd1x';% 's11_bcd6x'; % 's14_comp_cntrl'; Es =1; % 's12_cntrl_2label'; Es = 1; % 'MP09_22C_hb_y_f'; Es = 7; % 'MP02_22C_hb_y'; Es = 9; % 'MP02_22C_hb_y_b'; Es = 10; % % 'MP01_22C_hb_y_f'; Es = 12; % 'MP01_22C_hb_y_c'; Es = 10; % 'MP01_22C_hb_y'; Es = 13; % 'MGa1x_LacZ_b'; Es = 12; % 'MP10_22C_sna_y_e'; Es = 12; % 'MP05_22C_sna_y_c'; Es =7; % 'MP10_22C_sna_y_d3'; Es = 1; %'YW_ths_sog'; Es = 12; % % 'MP09_22C_hb_y_e'; Es = 10; % 'MP09_22C_hb_y_d'; Es=11; % 'MGa2x_LacZ_sna_b'; Es = 10; % 'MP10_22C_sna_y_d'; % 'MGa_LacZ'; %'MGa2x_LacZ_sna'; %'MP10_22C_sna_y_c'; old_lab = 1; % 'MP05_22C_sna_y'; old_lab = 1; %
mRNA_channels = 2; % 3; % 1; % total mRNA channels
sver = '';% '_1'; % additional label on slide.
-ver = '_v2';% '_v2';
+ver = '';% '_v2';
% MP10_22C_sna_y_c and MP05_22C all done at 3.5, 4, 0.03, 30, 30
% MGa2x and MGa1x all done at 2.5, 3, 0.03, 30, 30
@@ -113,7 +113,7 @@
if mRNAchn == 1;
min_int = 0.05; % .05 just for speed
else
- min_int = 0.05; %
+ min_int = 0.01; %
end
DotLabels= cell(1,Zs);
View
@@ -8,28 +8,30 @@
tot_time = tic;
% Input options
-old_lab = 0;
-folder = '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/mRNA_counting/Data/'; % '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/Enhancer_Modeling/Data/';
+old_lab = 0; Es = 0;
+folder = '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/mRNA_counting/Data/2011-05-22/'; % '/Users/alistair/Documents/Berkeley/Levine_Lab/Projects/Enhancer_Modeling/Data/';
rawfolder = '/Volumes/Data/Lab Data/Raw_Data/2011-05-22/'; % '/Volumes/Data/Lab Data/Raw_Data/02-17-11/'; %% %
-stackfolder = 's03_MP02/';% 's10_bcd1x/';% 's11_bcd6x/'; %'s14_comp_cntrl/'; % 's12_cntrl_2label/'; %'MP02_22C/'; %'MP01_22C/'; % 'MGa1x/'; % 'MP10_22C/'; %'MP05_22C/'; %'YW_ths_sog/'; % 'MP10_22C/'; % % 'MP09_22C/'; % 'MGa2x/'; % 'MGa1x/'; % 'MGa2x/'; % 'MP10_22C_sna_y_c/'; %
-fname = 's03_MP02_Hz_22C'; % 's10_bcd1x';% 's11_bcd6x'; % 's14_comp_cntrl'; Es =1; % 's12_cntrl_2label'; Es = 1; % 'MP09_22C_hb_y_f'; Es = 7; % 'MP02_22C_hb_y'; Es = 9; % 'MP02_22C_hb_y_b'; Es = 10; % % 'MP01_22C_hb_y_f'; Es = 12; % 'MP01_22C_hb_y_c'; Es = 10; % 'MP01_22C_hb_y'; Es = 13; % 'MGa1x_LacZ_b'; Es = 12; % 'MP10_22C_sna_y_e'; Es = 12; % 'MP05_22C_sna_y_c'; Es =7; % 'MP10_22C_sna_y_d3'; Es = 1; %'YW_ths_sog'; Es = 12; % % 'MP09_22C_hb_y_e'; Es = 10; % 'MP09_22C_hb_y_d'; Es=11; % 'MGa2x_LacZ_sna_b'; Es = 10; % 'MP10_22C_sna_y_d'; % 'MGa_LacZ'; %'MGa2x_LacZ_sna'; %'MP10_22C_sna_y_c'; old_lab = 1; % 'MP05_22C_sna_y'; old_lab = 1; %
+stackfolder = 's08_EsplN_vndN/';% 's03_MP02/';% 's10_bcd1x/';% 's11_bcd6x/'; %'s14_comp_cntrl/'; % 's12_cntrl_2label/'; %'MP02_22C/'; %'MP01_22C/'; % 'MGa1x/'; % 'MP10_22C/'; %'MP05_22C/'; %'YW_ths_sog/'; % 'MP10_22C/'; % % 'MP09_22C/'; % 'MGa2x/'; % 'MGa1x/'; % 'MGa2x/'; % 'MP10_22C_sna_y_c/'; %
+fname = 's08_EsplN_vndN'; % 's03_MP02_Hz_22C'; % 's10_bcd1x';% 's11_bcd6x'; % 's14_comp_cntrl'; Es =1; % 's12_cntrl_2label'; Es = 1; % 'MP09_22C_hb_y_f'; Es = 7; % 'MP02_22C_hb_y'; Es = 9; % 'MP02_22C_hb_y_b'; Es = 10; % % 'MP01_22C_hb_y_f'; Es = 12; % 'MP01_22C_hb_y_c'; Es = 10; % 'MP01_22C_hb_y'; Es = 13; % 'MGa1x_LacZ_b'; Es = 12; % 'MP10_22C_sna_y_e'; Es = 12; % 'MP05_22C_sna_y_c'; Es =7; % 'MP10_22C_sna_y_d3'; Es = 1; %'YW_ths_sog'; Es = 12; % % 'MP09_22C_hb_y_e'; Es = 10; % 'MP09_22C_hb_y_d'; Es=11; % 'MGa2x_LacZ_sna_b'; Es = 10; % 'MP10_22C_sna_y_d'; % 'MGa_LacZ'; %'MGa2x_LacZ_sna'; %'MP10_22C_sna_y_c'; old_lab = 1; % 'MP05_22C_sna_y'; old_lab = 1; %
mRNA_channels = 2; % 3; % 1; % total mRNA channels
-
+sname = 's08_EsplN_vndN_01'; Es=4; Zs = 50; % fname;
ver = '';% '_v2';
% MP10_22C_sna_y_c and MP05_22C all done at 3.5, 4, 0.03, 30, 30
% MGa2x and MGa1x all done at 2.5, 3, 0.03, 30, 30
filename = [rawfolder,'/',fname];
-load([filename,ver,'.mat'])
-Zs = Datas.LSM_info.DimensionZ;
+load([rawfolder,'/',sname,'.mat'])
+
w = Datas.Stack1.Image1.IMG.width;
h = Datas.Stack1.Image1.IMG.height;
-Es = length(fields(Datas)) - 3; % Number of Stacks
-
+if Es==0
+ Zs = Datas.LSM_info.DimensionZ;
+ Es = length(fields(Datas)) - 3; % Number of Stacks
+end
% ------- Option: Focus on subset of image: ------------------- %
% m = 1/2048; % .9;% .7; % .5; .7; % 1/2048; %
% xp1= floor(h/2*m)+1; xp2 = floor(h/2*(2-m))+1; yp1 = floor(w/2*m)+1; yp2 = floor(w/2*(2-m))+1;
@@ -63,7 +65,7 @@
% sphere finding parameters
getpreciseZ = 0;
- consec_layers = 2;
+ consec_layers = 3;
ovlap = 4;
%---------------------------------%
@@ -74,7 +76,7 @@
Ix = fspecial('gaussian',FiltSize,sigmaI); % inhibitory gaussian
%%
-for e= 1:Es
+for e= 3:Es
%%
tic
disp('loading data...');
@@ -111,9 +113,9 @@
for mRNAchn = 1:mRNA_channels % mRNAchn =2
if mRNAchn == 1;
- min_int = 0.05; % just for speed
+ min_int = 0.05; % just for speed
else
- min_int = 0.02; %
+ min_int = 0.01; %
end
DotLabels= cell(1,Zs);
@@ -125,12 +127,24 @@
tic; disp('finding dots...');
for z = 1:Zs % z = 11
im_folder{z} = [rawfolder,stackfolder,fname,'_',emb,'_z',num2str(z),'.tif'];
+ try
Iin_z = imreadfast(im_folder{z});
[DotLabels{z},DotData{z},Inds{z},Ints{z}] = dotfinder(Iin_z(xp1:xp2,yp1:yp2,mRNAchn),Ex,Ix,min_int,min_size);
- end
+ catch err
+ disp(err.message);
+ Zs = z-1;
+ break
+ end
+ end
toc;
-
+ % resize;
+ DotLabels= DotLabels(1:Zs);
+ DotData = DotData(1:Zs);
+ Inds = Inds(1:Zs);
+ Ints = Ints(1:Zs);
+
+
%%
intype = class(Iin_z);

0 comments on commit 1d43931

Please sign in to comment.