Created
April 16, 2014 18:35
-
-
Save hiltontj/10918170 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all; | |
res = 512; % # of pixel lines in each dimension | |
img = zeros(res,res,res); % initialize image 3D vector | |
for i = 0:511 | |
clear str fid str_i; | |
str_i = num2str(i); | |
if (i < 10) | |
str_i = ['00' str_i]; | |
elseif ((i > 9) && (i < 100)) | |
str_i = ['0' str_i]; | |
end | |
str = ['slice.0' str_i]; | |
fid = fopen(str,'r'); | |
c(:,:,i+1) = fread(fid, [512,512], 'uint16'); | |
fclose(fid); | |
end | |
%% | |
figure(1) | |
for i = 1:res | |
imagesc(c(:,:,i)); colormap('gray'); | |
pause; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment