General Questions:
Is there a way to swap the Z and T parameters of a .avi file in ImageJ. Alternatively, can I use FFmpeg to generate an .avi file that has the appropriate Z and T parameters I need? Background info I am using my iPhone to take images of Drosophila larval locomotion (no budget for a camera) and would like to analyze them using a tracking plugin in Fiji/ImageJ. The original files are .mov files, which give compression errors when I try to open them directly. Simple conversion to avi files (in several different software programs including FFmpeg) does not work, as I get a slightly different compression error from ImageJ with these. I figured out that I need to change the codec of the file, so I've installed FFmpeg and borrowed some code off of this forum to generate a decompressed .avi file with a nv12 codec. The code I'm using is as follows (original file is named "test.mov): ffmpeg –i test.mov –pix_fmt nv12 –f avi –vcodec rawvideo test2.avi This produces an avi file that opens just fine in ImageJ through the File->Import function. the Bio-formats plugin produces unintelligible (to me) errors with these files. When I try to use these nv12 avi files with various tracking plugins (MTrack2, MTrackJ, wrMTrck) they fail to work properly. One of them (TrackMate) generates a message titled Z/T Swap? that says "It appears that you have 1 timepoint but 921 slices. Do you want to sway Z and T?". When I check the size of my image, it does indicate that I have 921 slices, which would be consistent with the problems I encounter in the tracking plugins. Is there a way in either ImageJ or FFmpeg to switch the "Z" component of my file so that it is ready as time by these plugins? (i want 1 slice, and 921 point in time)? I just installed and updated Fiji today (64 bit on Windows 10), so I should have the most up to date versions of everything. Any help would be greatly appreciated!! |
Dear Ashlyn,
If I understand correctly you should be able to use Image > Hyperstack > Reorder Hyperstack... to turn your Z into T. Good luck! Jitte On Thu, 8 Sep 2016 at 21:35 ashlyns <[hidden email]> wrote: > General Questions: > > Is there a way to swap the Z and T parameters of a .avi file in ImageJ. > Alternatively, can I use FFmpeg to generate an .avi file that has the > appropriate Z and T parameters I need? > > Background info > > I am using my iPhone to take images of Drosophila larval locomotion (no > budget for a camera) and would like to analyze them using a tracking plugin > in Fiji/ImageJ. The original files are .mov files, which give compression > errors when I try to open them directly. Simple conversion to avi files (in > several different software programs including FFmpeg) does not work, as I > get a slightly different compression error from ImageJ with these. I > figured > out that I need to change the codec of the file, so I've installed FFmpeg > and borrowed some code off of this forum to generate a decompressed .avi > file with a nv12 codec. The code I'm using is as follows (original file is > named "test.mov): > > ffmpeg –i test.mov –pix_fmt nv12 –f avi –vcodec rawvideo test2.avi > > This produces an avi file that opens just fine in ImageJ through the > File->Import function. the Bio-formats plugin produces unintelligible (to > me) errors with these files. When I try to use these nv12 avi files with > various tracking plugins (MTrack2, MTrackJ, wrMTrck) they fail to work > properly. One of them (TrackMate) generates a message titled Z/T Swap? that > says "It appears that you have 1 timepoint but 921 slices. Do you want to > sway Z and T?". When I check the size of my image, it does indicate that I > have 921 slices, which would be consistent with the problems I encounter in > the tracking plugins. > > Is there a way in either ImageJ or FFmpeg to switch the "Z" component of my > file so that it is ready as time by these plugins? (i want 1 slice, and 921 > point in time)? > > I just installed and updated Fiji today (64 bit on Windows 10), so I should > have the most up to date versions of everything. > > Any help would be greatly appreciated!! > > > > > > -- > View this message in context: > http://imagej.1557.x6.nabble.com/Problem-reading-avi-files-Z-and-T-variable-switched-tp5017164.html > Sent from the ImageJ mailing list archive at Nabble.com. > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by ashlyns
That worked great! I'm thought there might be a simple solution in ImageJ, but I didn't know where to find it. Thank you!
|
Hi ashlyns,
You can use either 1. Image>Hyperstacks>Stack to Hyperstacks, change number for slices(c) and frames(t) or 2. Image>Properties, you can change slices(c), frames(t) and give the frame interval chin |
Free forum by Nabble | Edit this page |