-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
provide option to make a 'presentation' video #66
Milestone
Comments
new options:
|
sample python script for generating avi files: import os
from ij import IJ, ImagePlus, ImageStack
from ij.io import Opener
from ij.plugin.filter import AVI_Writer
from ij.measure import Calibration
def is_tif_file(f):
return f.split('.')[1] == 'tiff'
def tif_sort_key(f):
return int(f.split('.')[0])
DIR = '/Users/dylan/data/full_tiff_stacks/jun/temp16/'
file_list = [ f for f in os.listdir(DIR) if is_tif_file(f)]
file_list.sort(key=tif_sort_key)
s = ImageStack()
o = Opener()
for f in file_list:
imp = o.openTiff(DIR, f)
s.addSlice(imp.getProcessor())
imp_to_avi = ImagePlus("avi", s)
ip = imp_to_avi.getProcessor()
#c = imp_to_avi.getCalibration()
#c.fps = 10.0
#imp_to_avi.setCalibration(c)
writer = AVI_Writer()
writer.writeImage(imp_to_avi, DIR + 'test.avi', 0, 0)
#f = FolderOpener()
#i = f.open('/Users/dylan/data/full_tiff_stacks/jun/temp16')
#print f.trimFileList([".csv"])
#print(i) |
IJ.run("Open...", "");
IJ.run(imp, "Image Sequence...", "open=/Users/dylan/data/full_tiff_stacks/jun/temp16-raw sort use");
IJ.run(imp, "AVI... ", "compression=JPEG frame=10 save=/Users/dylan/data/full_tiff_stacks/jun/temp16-raw/temp16-raw.avi"); |
this works imp = FolderOpener.open("/Users/dylan/data/full_tiff_stacks/jun/temp16-raw/", "virtual");
IJ.run(i, "AVI... ", "compression=JPEG frame=10 save=/Users/dylan/data/full_tiff_stacks/jun/temp16-raw.avi"); |
from ij import IJ, ImagePlus
from ij.plugin import FolderOpener
imp = FolderOpener.open("/Users/dylan/data/full_tiff_stacks/jun/temp16-raw/", "virtual");
IJ.run(imp, "AVI... ", "compression=None frame=10 save=/Users/dylan/data/full_tiff_stacks/jun/temp16-raw.avi"); |
add text to from ij import IJ, ImagePlus
from ij.plugin import FolderOpener
from ij.gui import TextRoi
i = IJ.getImage()
ip = i.getProcessor()
ip.drawString("Stimulator On", 0, 200)
i.setProcessor(ip)
i.show() from ij import IJ, ImagePlus;
from ij.gui import TextRoi
from java.awt import Font;
#import ij.gui.TextRoi;
i = IJ.getImage()
ip = i.getProcessor()
f = Font("Arial", 0, 20)
ip.setFont(f)
ip.setColor(1048575) # white
ip.drawString("Stimulator On")
i.setProcessor(ip)
i.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: