function pdf_values = compute_pdf(image_set, points_set, kernel, shape_weight)
% COMPUTE_PDF: 
%
%    GENERAL
%
%      pdf_values = compute_pdf(image_set, points_set, keep, label, norm_type, shape_weight)
%
%    INPUT/S
%
%      
%
%    OUTPUT/S
%
%      -pdf_values:
%
%    PENDING WORK
%
%      -
%
%    KNOWN BUG/S
%
%      -None.
%
%    COMMENT/S
%
%
%    RELATED FUNCTION/S
%
%      
%
%    ABOUT
%
%      -Created:     February 2004
%      -Last update: February 2004
%      -Revision:    0.0.1
%      -Author:      R. S. Schestowitz, University of Manchester
% ==============================================================

% [intensity_model.pcs,intensity_model.variances,intensity_model.params, intensity_model.mean, intensity_model.var_r, intensity_model.total_var, intensity_model.impdata] = st_pca(image_set', keep);
% [shape_model.pcs,shape_model.variances,shape_model.params, shape_model.mean, shape_model.var_r, shape_model.total_var, shape_model.impdata] = st_pca(points_set', keep);
%    % get shape and intensity model
% c_model.shape_weight = ones(1,size(shape_model.pcs,2));
%    % set weight to be a column vector of 1's? Would that mean equal weighing for shape and intensity?
% intensity_model.sd = std(intensity_model.params);
%   % get and record standard deviation
% shape_model.sd = std(shape_model.params);
% if(strcmp(norm_type,'variance'))		
% 	% combine params - initially normalise to variance described in model
% 	total_shape_variance = sum(shape_model.variances);
% 	total_intensity_variance = sum(intensity_model.variances);
% 	if(total_shape_variance ~= 0)
%         c_model.shape_weight(:) = sqrt(total_intensity_variance/total_shape_variance);
%     end
% %     disp(['Shapeweight: ',num2str(c_model.shape_weight(1))]);
for i = 1:size(image_set,2),
       current_intensity_sample = image_set(:,i);
       % paramater used to be 1 and passed in as a single parameter to pdf
       % function
       if (strcmp(kernel,'Normal')),
          parameter = mle(kernel,current_intensity_sample);
          pdf_values(i,:) = pdf(kernel, current_intensity_sample, parameter(1), parameter(2))';
       elseif (strcmp(kernel,'Exponential')),
           parameter = 1;
                  % this is an arbitrary useless value that needs to be
                  % tested
           pdf_values(i,:) = pdf(kernel, current_intensity_sample, parameter)';
       % EXTENSIONS NEED TO BE PLACED HERE UNDER <ELSEIF> STATEMENTS
       else
           parameter = 1;
                  % this is just a generic expression that makes sure all
                  % kernels work.
           pdf_values(i,:) = pdf(kernel, current_intensity_sample, parameter)';
       end
end      
%       c_model.shape_weight(:) = shape_weight;
% elseif(strcmp(norm_type,'edge'))
%       edges = abs(diff(image_set,1,2));
%       mean_edge_strength = sum(edges(:))/size(edges(:),1);
%       c_model.shape_weight(:) = mean_edge_strength;
% %     disp(['edge weight: ',num2str(mean_edge_strength)]);
% 
% [c_model.pcs, c_model.variances, c_model.params, c_model.mean, c_model.total_var, c_model.impdata] = make_combined_model(shape_model, intensity_model, c_model.shape_weight);
% c_model.sd = sqrt(c_model.variances);
% c_model.intensity_model = intensity_model;
% 
% % intensity_model
% % shape_model
% % figure;
% % plot(intensity_model);
%         % attempt to look at the models built from the data (RSS)
% 
% c_model.shape_model = shape_model;
% c_model.n_shape_modes = size(shape_model.sd,2);
% c_model.label = label;
%    % save some of the values to be returned by the function
