View full-text article in PMC Entropy (Basel). 2024 Feb 10;26(2):155. doi: 10.3390/e26020155 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 1 Two-dimensional sample entropy Require: Sequence U:={ui,j:1≤i≤w,1≤j≤h}, s⊂Zw,h template length m and threshold r. 1:procedure SampEn2D(U,s,m,r) 2: Set count=0, 3: Set N0=#s, 4: for i=1 to N0 do 5: for j=i to N0 do 6: (k,l)=si; (a,b)=sj, 7: Xi,jm=U[i:i+m−1][j:j+m−1], 8: Xa,bm=U[a:a+m−1][b:b+m−1], 9: if d(Xi,jm,Xa,bm)≤r then 10: count=count+1, 11: return count