-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdbl2tif.m
More file actions
21 lines (18 loc) · 757 Bytes
/
dbl2tif.m
File metadata and controls
21 lines (18 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function dbl2tif(rfilepath,wfilepath)
% DBL2TIF reads the .dbl raw data from the file defined by "rfilepath" input
% and transfer it to a .tif file defined by "wfilepath".
%
% originally copied from Edward Allgeyer
% updated by Xiang Hao on Sep 25, 2015. Normalize the figure to its own peak intensity for better visualization
% when preview the figure outside Matlab (e.g. Windows Photo Viewer).
data=uint16(squeeze(readDBL_Full(rfilepath)));
imsize=size(data);
MAX=double(max(max(max(data))));
data=uint16(double(data)*(2^16-1)/MAX);
try
for j=1:imsize(3)
imwrite(data(:,:,j),wfilepath,'tif','compression','none','WriteMode','append');
end
catch
imwrite(data(:,:,1),wfilepath,'tif','compression','none');
end