TomographicImaging / CIL

A versatile python framework for tomographic imaging
https://tomographicimaging.github.io/CIL/
Apache License 2.0
97 stars 45 forks source link

TotalVariation proximal in place #1650

Open MargaretDuff opened 10 months ago

MargaretDuff commented 10 months ago

TotalVariation proximal is not calculated in place correctly. This was spotted when trying to run SIRT with a TV constraint in https://github.com/TomographicImaging/CIL/issues/1514.

data = dataexample.SIMPLE_PHANTOM_2D.get(size=(128,128))
plt.figure()
plt.imshow(data.as_array())
plt.show()
out=data.geometry.allocate('random')
TotalVariation().proximal(data, tau=1, out=out)
plt.figure()
plt.imshow(out.as_array())
plt.show()

gives image image

data = dataexample.SIMPLE_PHANTOM_2D.get(size=(128,128))
plt.figure()
plt.imshow(data.as_array())
plt.show()
TotalVariation().proximal(data, tau=1, out=data)
plt.figure()
plt.imshow(data.as_array())
plt.show()

gives image image

MargaretDuff commented 1 month ago

Need to also test with strong convexity constant >0