

patient_dir = 'C:\010-work\003_localGit\WiscPlan_v2\WiscPlanPhotonkV125\PatientData\';
target_filename = fullfile(patient_dir, 'beamlet_batch_files', 'beamletbatch0.bin');
% Nbeamlets = read_ryan_beamlets(target_filename, 'info');
beamlet_batch_filename = [patient_dir '\beamlet_batch_files\' 'beamletbatch0.bin'];

beamlet_cell_array = read_ryan_beamlets(beamlet_batch_filename, 'ryan');



% close all

N=2002;
data=beamlet_cell_array{N};
tabula=zeros(data.x_count, data.y_count, data.z_count);
tabula(data.non_zero_indices)=data.non_zero_values;
valMax=max(data.non_zero_values(:));
orthoslice(tabula, [0, valMax/3])