This commit is contained in:
2018-04-17 12:05:48 +02:00
parent 14edc0e745
commit 58a1260003
428 changed files with 41350 additions and 477 deletions

30
script/image/image2.py Executable file
View File

@@ -0,0 +1,30 @@
###################################################################################################
# Demonstrate creation of an image filters and new source based on filter.
# Also demonstrate creation of image histogram and use of overlays.
###################################################################################################
import ch.psi.pshell.imaging.Filter as Filter
from ch.psi.pshell.imaging.Utils import *
from ch.psi.pshell.imaging.Overlays import *
import ch.psi.pshell.imaging.Pen as Pen
import net.imglib2.script.bufferedimage.BufferedImageImg as BufferedImageImg
class MyFilter(Filter):
def process(self, image, data):
im = BufferedImageImg(image)
global last
image = grayscale(image)
i=None
if last is not None:
i = sub(image,last, False)
i = rescale(i,100.0, 0, True)
i = add(i, last, True)
i = rescale(i,10.0, 0, True)
last = image
return i
#Setting the filter to a source
img.setFilter(MyFilter())