open_presc.m 484 B

1234567891011121314
  1. % Loads a prescription map into a sparse matrix
  2. function prescTumor = open_presc(batchname)
  3. fid = fopen(batchname,'rb');
  4. prescTumor = [];
  5. prescTumor.x_count = fread(fid,1,'int');
  6. prescTumor.y_count = fread(fid,1,'int');
  7. prescTumor.z_count = fread(fid,1,'int');
  8. prescTumor.Nind = fread(fid,1,'int'); % number of non-zero values
  9. prescTumor.non_zero_indices = fread(fid,prescTumor.Nind,'int=>int');
  10. prescTumor.non_zero_values = fread(fid,prescTumor.Nind,'float=>float');
  11. fclose(fid);