function disppsd(MATRIX,FINAL)

% Displays the cellular pattern and the PSD.
%
% EXAMPLES:
%
% >> disppsd('cell.jpg')
%    where cell.jpg is the cellular pattern image.
% OR
% >> disppsd(MATRIX)
%    where MATRIX is the double-type matrix of
%    the cellular pattern image, i.e. MATRIX=double(imread('cell.jpg'));
% OR
% >> disppsd(MATRIX,FINAL)
%    where MATRIX is the same as above and FINAL is the result of
%    the PSD computation, i.e. FINAL=grayscale(calcpsd(MATRIX));


if isstr(MATRIX)
   MATRIX=double(imread(MATRIX)); % Turns the image into a matrix
end
% The previous loop allows us to input the image either as a function argument
% (then CELLIMAGE is a string, for instance cell.jpg),
% or the image matrix (then CELLIMAGE is a matrix).

if nargin==1
   FINAL=grayscale(calcpsd(MATRIX));
end

figure;colormap(gray);imshow(grayscale(MATRIX));image(grayscale(MATRIX));title('Disppsd -- Cellular Pattern');axis on;zoom on; % Imshow>>Image gives better results than Image alone. I don't know why...
figure;colormap(gray);imshow(FINAL);image(FINAL);title('Disppsd -- Power Spectral Density');axis on;zoom on;