diff options
Diffstat (limited to 'python/astra/extrautils.pyx')
-rw-r--r-- | python/astra/extrautils.pyx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/python/astra/extrautils.pyx b/python/astra/extrautils.pyx index 2c7771e..248c6ee 100644 --- a/python/astra/extrautils.pyx +++ b/python/astra/extrautils.pyx @@ -3,7 +3,7 @@ # 2013-2016, CWI, Amsterdam # # Contact: astra@uantwerpen.be -# Website: http://sf.net/projects/astra-toolbox +# Website: http://www.astra-toolbox.com/ # # This file is part of the ASTRA Toolbox. # @@ -26,19 +26,19 @@ def clipCircle(img): - cdef int i,j - cdef double x2,y2,mid,bnd - cdef long sz,sz2 - sz = img.shape[0] - sz2 = sz*sz - bnd = sz2/4. - mid = (sz-1.)/2. - nDel=0 - for i in range(sz): - for j in range(sz): - x2 = (i-mid)*(i-mid) - y2 = (j-mid)*(j-mid) - if x2+y2>bnd: - img[i,j]=0 - nDel=nDel+1 - return nDel + cdef int i,j + cdef double x2,y2,mid,bnd + cdef long sz,sz2 + sz = img.shape[0] + sz2 = sz*sz + bnd = sz2/4. + mid = (sz-1.)/2. + nDel=0 + for i in range(sz): + for j in range(sz): + x2 = (i-mid)*(i-mid) + y2 = (j-mid)*(j-mid) + if x2+y2>bnd: + img[i,j]=0 + nDel=nDel+1 + return nDel |