%======================================================================================
%
% Generate samples of the anisotropic first-order multi-level logistic (MLL)  MRF model
%
% Aleksandra Pizurica TELIN/RUG 1998.
%=======================================================================================

Operation ='Create a sample of an anisotropic MRF model';
% An example of the parameter set:
Alpha=0;
Beta_H=-0.02;
Beta_V=-0.02;
Beta_D1=0;
Beta_D2=-2;
OtherParam=input('Default parameters are: \nAlpha=0\nBeta_H=-0.02\nBeta_V=-0.02\nBeta_D1=0\nBeta_D2=-2\nChoose other parameters (y/n) ','s');

if(OtherParam=='y')
  Alpha=input('Choose the label cost parameter Alpha\nAlpha=0 : equally probable labels -1 and 1; \nAlpha>0: preference for -1,  Alpha<0: preference for +1 (try ~ 0.05) ;\nAlpha=   ');
  Beta_H=input('Interaction parameter Beta_H= ');
  Beta_V=input('Interaction parameter Beta_V= ');
  Beta_D1=input('Interaction parameter Beta_D1= ');
  Beta_D2=input('Interaction parameter Beta_D2= ');
  M=100;
  N=100;
  %M=input('Nr. rows=');
  %N=input('Nr. cols.= ');
  ITERA=40;
  Temp=1;
end

GenerateOther='y'
while(GenerateOther=='y')
  X=Anisotropic(Alpha,Beta_H,Beta_V,Beta_D1,Beta_D2,Temp,M,N,ITERA);
  imagesc(X);
  colormap(gray);
  GenerateOther=input('Generate another sample (y/n) ','s');
end