Login  Register

Open a big tiff file.

Posted by cri on Jan 08, 2015; 8:14pm
URL: http://imagej.273.s1.nabble.com/Open-a-big-tiff-file-tp5011136.html

Hi all,

I tried to use the BioFormats plugin for opening a big tiff file. An ImageStack is opened with the correct dimensions but all slices are completely dark. (All pixels are 0). Opening the image with File -> Open works. It is also possible to open the image by using Dataset.open() (the ImageJ2 style) but because I'm not very familiar with the new data structures, I'd prefer with staying with the ImageJ1 API for the moment.
The image contains 500 slices (16 bits per pixel) with 2048x2048 pixels each.

Could you please tell me, how to open such a file or how to convert an ImageJ2-Dataset to an ImagePlus?

Many thanks,
cri

The following code compiles without errors and opens a stack with dark slices only:

public class BFTest implements PlugIn {
        static ImageJ ij;
       
        @Override
        public void run(final String arg) {
                String path="[1]Thu Nov 6 18-03-58 2014.tif";
               
                try {
                        System.out.println("opening ...");
                       
                        //  this shows an image stack with correct dimensions but
                        //  all pixels in each slice are 0
                        ImagePlus[] imp=BF.openImagePlus(path);
                        imp[0].show();
                       
                        System.out.println("done.");
                } catch (FormatException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IOException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
        }


        public static void main(final String... args) {
                ij=new ImageJ();
                ij.ui().showUI();
               
                IJ.runPlugIn(BFTest.class.getName(), "");
        }

}