%Open the data file and load data
fid = fopen( 'example.vol', 'r' );
[data1D, count] = fread(fid, 'uint8');
%Find the boundaries of data pieces
delim = find(data1D == 32, 2);
data_offset = find( data1D == 10, 1 );
%Calculate the size of each dimension
size_x = 0;
for i=1:( delim(1)-1 )
      size_x = 10 * size_x + (data1D(i)-'0' );
end
size_y = 0;
for i=( delim(1) + 1 ):( delim(2)-1 )
      size_y = 10 * size_y + (data1D(i)-'0' );
end
size_z = 0;
for i=( delim(2) + 1 ):( data_offset-1 )
      size_z = 10 * size_z + (data1D(i)-'0' );
end
%OR just set them manually from the info files in the website.
%Reshape the data from 1D to 3D
data3D = reshape( data1D(data_offset+1:count), size_x, size_y, size_z );
fclose(fid);