hello,
i am using LOCI to open an image as a Standard ImageJ: IJ.run("Bio-Formats Importer", "open="+path+" color_mode=Default view=[Standard ImageJ] stack_order=Default"); however i anyway would like to get the information on how many channels and z-slices and time-points the Bio-Formats importer thinks the image has. in fact this information is displayed in the Image Sub-Title after opening it, so it must be there :-) my problem is that i do not know how to get programmatic access to these numbers in Java/JavaScript/Jython (not using MacroExtensions!). would be great if someone could help! Cheers, Tischi -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
2012/7/20 Christian Tischer <[hidden email]>:
> hello, > > i am using LOCI to open an image as a Standard ImageJ: > > IJ.run("Bio-Formats Importer", "open="+path+" color_mode=Default > view=[Standard ImageJ] stack_order=Default"); > > however i anyway would like to get the information on how many channels and > z-slices and time-points the Bio-Formats importer thinks the image has. > in fact this information is displayed in the Image Sub-Title after opening > it, so it must be there :-) > > my problem is that i do not know how to get programmatic access to these > numbers in Java/JavaScript/Jython (not using MacroExtensions!). Ask the ImagePlus: http://www.ini.uzh.ch/~acardona/fiji-tutorial/#imageplus Relevant snippet in Jython: # Grab the last activated image imp = IJ.getImage() # Print image details print "title:", imp.title print "width:", imp.width print "height:", imp.height print "number of pixels:", imp.width * imp.height print "number of slices:", imp.getNSlices() print "number of channels:", imp.getNChannels() print "number of time frames:", imp.getNFrames() Albert -- http://albert.rierol.net http://www.ini.uzh.ch/~acardona/ -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
oops. that works in fact. somehow i did not expect ImagePlus to know this
information without actually being a hyperstack. sorry for the stupid question :-) thanks Albert!! On Fri, Jul 20, 2012 at 12:07 PM, Albert Cardona <[hidden email]> wrote: > 2012/7/20 Christian Tischer <[hidden email]>: > > hello, > > > > i am using LOCI to open an image as a Standard ImageJ: > > > > IJ.run("Bio-Formats Importer", "open="+path+" color_mode=Default > > view=[Standard ImageJ] stack_order=Default"); > > > > however i anyway would like to get the information on how many channels > and > > z-slices and time-points the Bio-Formats importer thinks the image has. > > in fact this information is displayed in the Image Sub-Title after > opening > > it, so it must be there :-) > > > > my problem is that i do not know how to get programmatic access to these > > numbers in Java/JavaScript/Jython (not using MacroExtensions!). > > > Ask the ImagePlus: > > http://www.ini.uzh.ch/~acardona/fiji-tutorial/#imageplus > > Relevant snippet in Jython: > > # Grab the last activated image > imp = IJ.getImage() > > # Print image details > print "title:", imp.title > print "width:", imp.width > print "height:", imp.height > print "number of pixels:", imp.width * imp.height > print "number of slices:", imp.getNSlices() > print "number of channels:", imp.getNChannels() > print "number of time frames:", imp.getNFrames() > > Albert > > > -- > http://albert.rierol.net > http://www.ini.uzh.ch/~acardona/ > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |