-
-
Save ajfigueroa/10920142 to your computer and use it in GitHub Desktop.
Just tweaking the read in part.
This file contains hidden or 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
clc; clear all; close all; | |
res = 512; % # of pixel lines in each dimension | |
mri_img = zeros(res, res, res); % initialize image 3D vector | |
file_names = dir; | |
file_idx = 1; | |
for i = 1:length(file_names) | |
name = file_names(i).name; | |
if findstr('slice', name) | |
filename = name; | |
f_id = fopen(filename, 'r'); | |
mri_img(:, :, file_idx) = fread(f_id, [res, res], 'uint16'); | |
file_idx = file_idx + 1; | |
fclose(f_id); | |
end | |
end | |
figure; | |
for i = 1:res | |
imagesc(mri_img(:, :, i)); colormap(gray); | |
pause; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment