|  | @@ -51,9 +51,9 @@ switch pre_beamWeights
 | 
	
		
			
				|  |  |          w_beamlets = NLP_result.weights;
 | 
	
		
			
				|  |  |          
 | 
	
		
			
				|  |  |          load([Pat_path, '\all_beams.mat'])
 | 
	
		
			
				|  |  | -        if numel(all_beams) ~= numel(w_beamlets)
 | 
	
		
			
				|  |  | -            error('Provided weight number does not match beamlet number!')
 | 
	
		
			
				|  |  | -        end
 | 
	
		
			
				|  |  | +%         if numel(all_beams) ~= numel(w_beamlets)
 | 
	
		
			
				|  |  | +%             error('Provided weight number does not match beamlet number!')
 | 
	
		
			
				|  |  | +%         end
 | 
	
		
			
				|  |  |      case 'n'
 | 
	
		
			
				|  |  |          disp('Initial beam weights will be calculated.')
 | 
	
		
			
				|  |  |  end
 | 
	
	
		
			
				|  | @@ -73,10 +73,17 @@ load(path2goal)
 | 
	
		
			
				|  |  |  % -- make the optimization optGoal structure --
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  for i_goal = 1:size(OptGoals.goals,1)
 | 
	
		
			
				|  |  | -    answer = inputdlg(['# of supervoxels for "' OptGoals.data{i_goal}.name '" with ' num2str(numel(OptGoals.data{i_goal}.ROI_idx)) ' vox: ("0" to skip)'])
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  | -    switch answer{1}
 | 
	
		
			
				|  |  | -        case '0'
 | 
	
		
			
				|  |  | +    if isfield(OptGoals.data{i_goal}, 'SupVox_num')
 | 
	
		
			
				|  |  | +        SupVox_num = OptGoals.data{i_goal}.SupVox_num;
 | 
	
		
			
				|  |  | +    else
 | 
	
		
			
				|  |  | +        answer = inputdlg(['# of supervoxels for "' OptGoals.data{i_goal}.name '" with ' num2str(numel(OptGoals.data{i_goal}.ROI_idx)) ' vox: ("0" to skip)'])
 | 
	
		
			
				|  |  | +        SupVox_num = str2double(answer{1})
 | 
	
		
			
				|  |  | +    end
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    switch SupVox_num
 | 
	
		
			
				|  |  | +        case 0
 | 
	
		
			
				|  |  |          % if not supervoxel, just select provided ROI_idx
 | 
	
		
			
				|  |  |          optGoal{i_goal} = OptGoals.data{i_goal};
 | 
	
		
			
				|  |  |          optGoal{i_goal}.beamlets_pruned = sparse(beamlets(optGoal{i_goal}.ROI_idx, :));
 | 
	
	
		
			
				|  | @@ -86,11 +93,10 @@ for i_goal = 1:size(OptGoals.goals,1)
 | 
	
		
			
				|  |  |          otherwise
 | 
	
		
			
				|  |  |          % -- if supervoxel, merge given columns
 | 
	
		
			
				|  |  |          % - make supervoxel map
 | 
	
		
			
				|  |  | +        
 | 
	
		
			
				|  |  |          mask = zeros(OptGoals.data{i_goal}.imgDim);
 | 
	
		
			
				|  |  |          mask(OptGoals.data{i_goal}.ROI_idx) = 1;
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | -        superMask = superpix_group(mask, str2double(answer{1})); 
 | 
	
		
			
				|  |  | -        
 | 
	
		
			
				|  |  | +        superMask = superpix_group(mask, SupVox_num); 
 | 
	
		
			
				|  |  |          superVoxList = unique(superMask);
 | 
	
		
			
				|  |  |          superVoxList = superVoxList(superVoxList>0);
 | 
	
		
			
				|  |  |          
 | 
	
	
		
			
				|  | @@ -205,7 +211,7 @@ save([Pat_path, '\matlab_files\NLP_result.mat'], 'NLP_result');
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  plot_DVH(Geometry, D_full)
 | 
	
		
			
				|  |  | -colorwash(Geometry.data, D_full, [-500, 500], [0, 35]);
 | 
	
		
			
				|  |  | +colorwash(Geometry.data, D_full, [500, 1500], [0, 66]);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  end
 | 
	
	
		
			
				|  | @@ -283,7 +289,6 @@ function penalty = eval_f(x, optGoal, nrs_i, sss_i, rgs_i)
 | 
	
		
			
				|  |  |      end
 | 
	
		
			
				|  |  |  end
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  % ---- MAKE ROI ROBUST ----
 | 
	
		
			
				|  |  |  function optGoal = make_robust_optGoal(optGoal, RO_params, beamlets);
 | 
	
		
			
				|  |  |      % take regular optimal goal and translate it into several robust cases
 | 
	
	
		
			
				|  | @@ -297,7 +302,7 @@ function optGoal = make_robust_optGoal(optGoal, RO_params, beamlets);
 | 
	
		
			
				|  |  |      % Y - Y>0 moves image down
 | 
	
		
			
				|  |  |      % Z - in/out.
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  | -    shift_mag = 1; % vox of shift
 | 
	
		
			
				|  |  | +    shift_mag = 3; % vox of shift
 | 
	
		
			
				|  |  |      nrs_scene_list={[0,0,0]};
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      
 |