Posted by
Jacqueline Ross on
Sep 08, 2010; 10:09pm
URL: http://imagej.273.s1.nabble.com/ImageJ-is-saving-my-grayscale-AVI-files-as-RED-tp3686921p3686924.html
Hi Chris,
What program are you using for viewing the AVI? I've had this happen
when viewing a file using VLC Media Player. So, you could try a
different program and see if it is different.
Also, are you sure that the images are greyscale? If your camera is
colour, then you will have RGB images. In this case, you should convert
to greyscale in ImageJ first and then create the AVI. I'm really sorry
if this is an obvious comment but I have had people previously having
issues with printing apparently greyscale images that are actually still
in RGB format. They often print out green.
If you just want to change speed/size, you could try just using
VirtualDub. It's a freeware and I find it quite handy for compressing
large AVI files. You can find it here:
http://www.virtualdub.org/Kind regards,
Jacqui
Jacqueline Ross
Biomedical Imaging Microscopist
Biomedical Imaging Research Unit
School of Medical Sciences
Faculty of Medical & Health Sciences
The University of Auckland
Private Bag 92019
Auckland, NEW ZEALAND
Tel: 64 9 373 7599 Ext 87438
Fax: 64 9 373 7484
http://www.fmhs.auckland.ac.nz/sms/biru/-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of
Chris Richie
Sent: Thursday, 9 September 2010 8:18 a.m.
To:
[hidden email]
Subject: ImageJ is saving my grayscale AVI files as RED?
I have a Bio-formats macro that opens up my Nikon Elements AVI files
(which
has an incorrect FPS header) and then saves them as uncompressed AVI
with
15FPS.
the input and output files are the same size, however my input is a
grayscale image and the output is somehow being converted as a red image
(perhaps an 8-bit image with Red LUT?).
I have experimented with different kinds of image modes and hyperstacks,
but
this is as close as I have gotten.
I can supply a small sample (input and output) if that would be helpful.
This whole thing is because my Nikon Elements (AVI capture) always saves
the
files with 100FPS. The objective of this macro is to produce a file
with
the correct 15FPS in the header, a prerequisite for analyzing the movie
with
some other software. Is there a way to edit the header information
directly
without opening the file?
Thanks for your assistance
Chris
// start Macro
// batch process to re-header the .AVI files captured by April on the
Nikon
Elements
// hacked together from by crichie on 09-08-10.
// bfOpenAsHyperstack.txt Written by Wayne Rasband
// and another macro from a forum post by Dr K.R. Straatman
requires("1.41c");
///
///
dir1 = getDirectory("Choose Source Directory ");
list = getFileList(dir1);
dir2 = dir1+"analysed"+File.separator;
File.makeDirectory(dir2);
for (f=0; f<list.length; f++)
{
if (File.isDirectory(dir1+list[f])){}
else{
path = dir1+list[f];
if (endsWith(path, ".db")){}
else{
name = list[f];
run("Bio-Formats Macro Extensions");
Ext.setId(path);
Ext.getCurrentFile(file);
Ext.getSizeX(sizeX);
Ext.getSizeY(sizeY);
Ext.getSizeC(sizeC);
Ext.getSizeZ(sizeZ);
Ext.getSizeT(sizeT);
Ext.getImageCount(n);
setBatchMode(true);
for (i=0; i<n; i++) {
showProgress(i, n);
Ext.openImage("plane "+i, i);
if (i==0)
stack = getImageID;
else {
run("Copy");
close;
selectImage(stack);
run("Add Slice");
run("Paste");
}
}
rename(name);
if (nSlices>1) {
Stack.setDimensions(sizeC, sizeZ, sizeT);
if (sizeC>1) {
if (sizeC==3&&sizeC==nSlices) mode = "Composite";
else mode = "Color";
run("Make Composite", "display="+mode);
}
}
//run("AVI... ", "compression=Uncompressed frame=15
save="+path+"_15fps.avi");
newname = dir2 +"\\"+ name +"_15fps.avi";
print (newname);
run("AVI... ", "compression=Uncompressed frame=15 save="+ dir2 +"\\"+
name
+"_15fps.avi");
}
setBatchMode(false);
// Ext.close(); //remming this out to see if verbose error list goes
away.
close();
}
}
///
///
// end macro
--
View this message in context:
http://imagej.588099.n2.nabble.com/ImageJ-is-saving-my-grayscale-AVI-files-as-RED-tp5512203p5512203.html
Sent from the ImageJ mailing list archive at Nabble.com.