Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed bug in uint8-data read which affects large images. Some uint16s…

… are used for compression not as an image data format.
  • Loading branch information...
commit e7eaaa0c0ed9e8cdbdf874daf9ff7946f3ff2bde 1 parent 514b001
Alistair Boettiger authored
View
6 CheckDotUpDown.m
@@ -47,7 +47,7 @@
NDots = length(dotC); % total number of dots;
-maxdots = eval([intype,'(max(dotsinlayer) +100)']);
+maxdots = cast(max(dotsinlayer) +100, 'uint16');
disp(['Max dots per layer = ',num2str(maxdots)]);
disp(['Total dots = ',num2str(NDots)]);
@@ -94,7 +94,7 @@
% pre-calc
Rs = cell(Zs,1);
for z=1:Zs
- Rz = zeros(hs,ws,intype);
+ Rz = zeros(hs,ws,'uint16'); % this is uint16 just for data size maintance.
Rz(Inds{z}) = DotLabels{z}; % convert indices to raster map
Rs{z} = imdilate(Rz,strel('disk',ovlap));
end
@@ -103,7 +103,7 @@
for Z = 1:Zs % The primary layer Z = 16
inds1 = Inds{Z};
- R1 = zeros(hs,ws,intype);
+ R1 = zeros(hs,ws,'uint16');
R1(inds1) = maxdots; % convert indices to raster map
% figure(3); clf; imagesc(R1); colorbar; colormap jet;
View
20 CheckDotUpDown.m~
@@ -47,7 +47,7 @@ clear DotData;
NDots = length(dotC); % total number of dots;
-maxdots = eval([intype,'(max(dotsinlayer) +100)']);
+maxdots = max(dotsinlayer) +100, 'uint16');
disp(['Max dots per layer = ',num2str(maxdots)]);
disp(['Total dots = ',num2str(NDots)]);
@@ -94,7 +94,7 @@ LayerJoin = false(2*NDots,Zs);
% pre-calc
Rs = cell(Zs,1);
for z=1:Zs
- Rz = zeros(hs,ws,intype);
+ Rz = zeros(hs,ws,'uint16'); % this is uint16 just for data size maintance.
Rz(Inds{z}) = DotLabels{z}; % convert indices to raster map
Rs{z} = imdilate(Rz,strel('disk',ovlap));
end
@@ -103,7 +103,7 @@ end
for Z = 1:Zs % The primary layer Z = 16
inds1 = Inds{Z};
- R1 = zeros(hs,ws,intype);
+ R1 = zeros(hs,ws,'uint16');
R1(inds1) = maxdots; % convert indices to raster map
% figure(3); clf; imagesc(R1); colorbar; colormap jet;
@@ -332,9 +332,10 @@ for i = 1:2:2*NDots-1 % i =5
if stacked_dots == 0 && getpreciseZ == 1
ii = find(cent(:,2)==i,1);
dotC((i+1)/2,3) = cent(ii(1),1);
- ii = (cent(ii(1),2)+1)/2;
- dotC(masked_inds(i,j(1)),1) = dotC(ii,1);
- dotC(counted,2) = dotC(ii,2);
+ i_self = masked_inds(i,j(1));
+ i_max = (cent(ii(1),2)+1)/2;
+ dotC(i_self,1) = dotC(i_max,1);
+ dotC(i_self,2) = dotC(i_max,2);
end
else
remove_dot((i+1)/2) = 1;
@@ -352,9 +353,10 @@ for i = 1:2:2*NDots-1 % i =5
ii = find(cent(:,2)==i);
ii = ii( min(bi,length(ii)) );
dotC((i+1)/2,3) = cent(ii,1);
- ii = (cent(ii,2)+1)/2;
- dotC(counted,1) = dotC(ii,1);
- dotC(counted,2) = dotC(ii,2);
+ i_self = masked_inds(i,j(1));
+ i_max = (cent(ii,2)+1)/2;
+ dotC(i_self,1) = dotC(i_max,1);
+ dotC(i_self,2) = dotC(i_max,2);
end
stacked_dots =0;
end
View
20 optimizing_dotfinding.m
@@ -19,9 +19,6 @@
-
-
-
tic;
disp('loading data...');
@@ -92,6 +89,7 @@
Imax_dots = Imax(xp1:xp2,yp1:yp2,1:3);
figure(1); clf; imagesc(Imax(:,:,1:3));
figure(2); clf; imagesc(Imax_dots);
+
disp(['Coordinates: ', num2str(xp1), ' : ', num2str(xp2), ', ' num2str(yp1), ' : ', num2str(yp2) ] );
@@ -228,9 +226,8 @@
D2 = cell2mat(DotData2');
- if show_projected == 1
- Imax = imread([rawfolder,stackfolder,'max_',fname,'_',emb,'.tif']);
- Imax_dots = 3*Imax(xp1:xp2,yp1:yp2,1:3);
+ Imax = imread([rawfolder,stackfolder,'max_',fname,'_',emb,'.tif']);
+ Imax_dots = 1.5*Imax(xp1:xp2,yp1:yp2,1:3);
Imax_dots(:,:,3) = .1*Imax_dots(:,:,3);
figure(2); clf; imagesc(Imax_dots);
colordef black; set(gcf,'color','k');
@@ -258,8 +255,7 @@
imagesc(Imax_g); hold on;
plot( NewDotC2(:,1),NewDotC2(:,2),'go','MarkerSize',5 );
- end
-
+
% figure(2);
% for z=1:Zs
% text(DotData2{z}(:,1),DotData2{z}(:,2),[num2str(z)],'color','w','FontSize',8);
@@ -268,6 +264,14 @@
%
+
+ figure(2); clf; set(gcf,'color','k');
+ Imax_r = Imax_dots; Imax_r(:,:,2) = 0*Imax_r(:,:,2);
+ imagesc(Imax_r);
+
+ Imax_g = Imax_dots; Imax_g(:,:,1) = 0*Imax_g(:,:,1);
+ imagesc(Imax_g); hold on;
+
minS = 8;
d2 = 10*zeros(1,length(NewDotC2));
View
21 optimizing_dotfinding.m~
@@ -92,6 +92,7 @@ xp2 = xp1+200;
Imax_dots = Imax(xp1:xp2,yp1:yp2,1:3);
figure(1); clf; imagesc(Imax(:,:,1:3));
figure(2); clf; imagesc(Imax_dots);
+
disp(['Coordinates: ', num2str(xp1), ' : ', num2str(xp2), ', ' num2str(yp1), ' : ', num2str(yp2) ] );
@@ -228,9 +229,8 @@ ck_dots = tic;
D2 = cell2mat(DotData2');
- if show_projected == 1
- Imax = imread([rawfolder,stackfolder,'max_',fname,'_',emb,'.tif']);
- Imax_dots = 3*Imax(xp1:xp2,yp1:yp2,1:3);
+ Imax = imread([rawfolder,stackfolder,'max_',fname,'_',emb,'.tif']);
+ Imax_dots = 1.5*Imax(xp1:xp2,yp1:yp2,1:3);
Imax_dots(:,:,3) = .1*Imax_dots(:,:,3);
figure(2); clf; imagesc(Imax_dots);
colordef black; set(gcf,'color','k');
@@ -258,8 +258,7 @@ ck_dots = tic;
imagesc(Imax_g); hold on;
plot( NewDotC2(:,1),NewDotC2(:,2),'go','MarkerSize',5 );
- end
-
+
% figure(2);
% for z=1:Zs
% text(DotData2{z}(:,1),DotData2{z}(:,2),[num2str(z)],'color','w','FontSize',8);
@@ -267,10 +266,16 @@ ck_dots = tic;
% end
%
-
- % plot( NewDotC2(:,1),NewDotC2(:,2),'co','MarkerSize',14 );
- minS = 10;
+
+ figure(2); clf; set(gcf,'color','k');
+ Imax_r = Imax_dots; Imax_r(:,:,2) = 0*Imax_r(:,:,2);
+ imagesc(Imax_r);
+
+ Imax_g = Imax_dots; Imax_g(:,:,1) = 0*Imax_g(:,:,1);
+ imagesc(Imax_g); hold on;
+
+ minS = 8;
d2 = 10*zeros(1,length(NewDotC2));
jn = zeros(1,length(NewDotC2));
Please sign in to comment.
Something went wrong with that request. Please try again.