I am new to programming and I am trying to use ImageJ and Jython to extract a single line from a video and combine the lines into a time progression. I am trying to create a videokymogram (i.e. http://www.kymography.com/supp_demo.html)!
My attempt goes like this:
from ij import ImagePlus, IJ
from ij.process import FloatProcessor
img = IJ.getImage()
roi = img.getRoi()
StackSize = 100 #img.getImageStackSize()
pixels = roi.getPixels()
Length = len(pixels)
Width = 1
total_pixels = [[0] *len(pixels)] * StackSize
t_pixels = []
for j in range (1, StackSize):
img.setSlice (j)
roi = img.getRoi()
pixels = roi.getPixels()
for i in xrange (len(pixels)):
pixels [i] = pixels [i]
total_pixels[j-1] = pixels
fp = FloatProcessor (Length, StackSize,total_pixels)
imp = ImagePlus ("White Noise", fp)
imp.show()
However it returns: TypeError: ij.process.FloatProcessor(): 3rd arg can't be coerced to double[], int[], float[]
Any tips on how to fix that. I could maybe iterate a text file appending the pixels variable but I don't know how to do it. Any help is welcomed. BTW, if you want to try it, you can use Fiji's Fly Brain sample.
Thank you very much