I have been given a file from an older mathmatica version and my task is to get it working in mathmatica 13.3. While using the //Echo, I noticed that the code below is not computing the values for the variables, but just passing off a place holder and giving error messages. I am struggling to understand why that is and how to fix it. Any thoughts and suggestions would be apparated.
findDistances[ll_]:=Module[
{bandheap,len=Length[ll],wid=Length[ll[[1]]],hsize,hindex=0,distancetable,statetable,frozen=-1.,far=300.,band=0.,outofbounds=1000.,dist,maxpixval=255.,minpixval=0.,midpixval,heaptable,j1,j2,nbrs,pt,x,y,x1,y1,x2,y2,next,prev,done},
(*Initializations.*)
midpixval=(maxpixval-minpixval)//Echo;
distancetable =Map[If[#>midpixval,maxpixval,minpixval]&,ll,{2}];
statetable=Map[If[#1>1,far,frozen]&,distancetable,{2}]//Echo;
heaptable=Table[0,{len},{wid}];
hsize=len*wid;
bandheap=Table[{0.,0.,0.},{hsize}];
(*Initialize the band by placing all neighbors of frozen cells thereon.*)
Do[
If[statetable[[ii,jj]]=!=frozen,Continue[]];
nbrs={{ii,jj+1},{ii,jj-1},{ii-1,jj},{ii+1,jj}};