12345678910111213141516171819 |
- % Loads a prescription map into a sparse matrix
- function prescription = open_presc(batchname)
- fid = fopen(batchname,'rb');
- presc = [];
- presc.x_count = fread(fid,1,'int');
- presc.y_count = fread(fid,1,'int');
- presc.z_count = fread(fid,1,'int');
- Nind = fread(fid,1,'int'); % number of non-zero values
- .non_zero_indices = fread(fid,Nind,'int=>int');
- beamlets{k}.non_zero_values = fread(fid,Nind,'float=>float');
- % add unity to the indices to convert them from C to Matlab style
- % indexing:
- beamlets{k}.non_zero_indices = beamlets{k}.non_zero_indices + 1;
- end
- fclose(fid);
|