Texo Data Processing Prior to 6.0.x

Data representation
The data in the CINE-Buffer and respectively in the output files of the console example program is stored in the following manner:



Each block represents on byte. The number of samples in one line can be derived by:

MATLAB method to read data-file
To display the results of Texo data capture, the MATLAB code below provides a simple example. It is a function that will take in raw RF values outputted from Texo, and create a large matrix that will hold all RF lines organized into frames.


 * filename: Name of the raw RF data file, including all the directory information.
 * eg. \\D:\Data\Texo\RF\output.raw
 * w: Number of scanlines per frame. This information is determined by counting the times the function texo::addLine was called for the sequence
 * h: Size of each line in bytes. This value can be calculated by dividing the frame size in bytes by the number of scanlines per frame (w). However, the header of each file takes up 4 bytes, so it is necessary to get rid of first 4 bytes header which is used as a time-stamp for each frame collected from the cine buffer. The value of frame size is obtained by the function texo::getFrameSize.
 * frame_no: Number of frames acquired. This information is obtained by calling texo::getCollectedFrameCount.

A known error on the Sonix hardware is the fact that the first RF line on the first frame captured will be distorted. The easiest way to deal with this problem is to ignore the very first frame. Therefore it is advised to acquire one extra frame than actually necessary and discard the first frame.

fid = fopen(filename,'r'); frame_no*(w*h/2+2); [v,count] = fread(fid,inf,'short'); count; images = []; BigMatrix=[]; for frame_count = 1:frame_no, BigMatrix(frame_count,:) = v(((frame_count-1)*(h/2*w+2)+3) : ((frame_count)*(h/2*w+2)))'; end; for i=1:frame_no, A = reshape(BigMatrix(i,:),h/2,w); images(:,:,i) = A;   plot(A);%,axis([0 xmax ymin ymax  ]);%imagesc(A);colormap gray; end; fclose(fid);