Hi Eric,
On 14.12.2012 1:15 AM, Eric Barnhill wrote:
> I have some images I want to gradually blend from one to the next over,
> say, 50 frames in an AVI. I also have a stack of wave images that I want
> to gradually fade out into a single overlay image. Could anyone
> recommend a plugin for these kinds of animations so that I am not
> generating dozes of incrementally different overlays and stitching them
> together?
The attached python script uses the Image Expression Parser included in
Fiji (
http://fiji.sc/ ) to create a transition between the first two
slices of a stack.
This might help you to start doing what you want.
(Attaching the script leads to rejection of the mail by the ImageJ
mailing list, so I pasted the script below. Please mind the line breaks
introduced by the mailer.)
Hope that helps,
Jan
# This script creates a linear transition between the first two slices
of a stack
#
# Author: Jan Eglinger, Heinrich-Heine University Düsseldorf, Germany
import mpicbg.imglib.image.ImagePlusAdapter
import mpicbg.imglib.image.display.imagej.ImageJFunctions
import fiji.process.Image_Expression_Parser
imp = WindowManager.getCurrentImage()
imp.setSlice(1)
impA = ImagePlus('A', imp.getProcessor().duplicate())
imgA = mpicbg.imglib.image.ImagePlusAdapter.wrap(impA)
imp.setSlice(2)
impB = ImagePlus('B', imp.getProcessor().duplicate())
imgB = mpicbg.imglib.image.ImagePlusAdapter.wrap(impB)
map = {'A': imgA, 'B': imgB}
width = imp.getProcessor().getWidth()
height = imp.getProcessor().getHeight()
stack = ImageStack(width, height)
# Instantiate plugin
parser = fiji.process.Image_Expression_Parser()
# Configure & execute
parser.setImageMap(map)
frames = 21 # size of the transition stack
frames -= 1
for i in range(frames + 1):
expression = "(1 - %(i)1.1f / %(frames)1.1f ) * A + ( %(i)1.1f /
%(frames)1.1f ) * B" % { 'i': i, 'frames': frames}
parser.setExpression(expression)
parser.process()
result = parser.getResult()
result_imp =
mpicbg.imglib.image.display.imagej.ImageJFunctions.copyToImagePlus(result)
stack.addSlice("Transition", result_imp.getProcessor())
# Create and display final result ImagePlus from stack
final = ImagePlus("Transition stack", stack)
final.show()
final.resetDisplayRange()
final.updateAndDraw()
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html