function output=ti_data_read(input)

%This function reads in a memory dump from 
%Code Composer studio and attempts to convert it
%to an image file for use in the MATLAB environment.

output=zeros(480,640);
fid = fopen(input,'rt');
tline= fgetl(fid);  %ignore header line

for row=1:1:480
  for column=1:4:640  
    tline= fgetl(fid);
    output(row,column+3)=hex2dec(tline(3:4));
    output(row,column+2)=hex2dec(tline(5:6));
    output(row,column+1)=hex2dec(tline(7:8));
    output(row,column)=hex2dec(tline(9:10));
  end;
end;
output=uint8(output);
