Login  Register

Re: Open a big tiff file.

Posted by ctrueden on Jan 09, 2015; 4:32pm
URL: http://imagej.273.s1.nabble.com/Open-a-big-tiff-file-tp5011136p5011156.html

Hi Christian,

> 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).

Just to be absolutely sure: when you mouse over the image, the pixel probe
output (shown in the ImageJ main window status bar area) says 0 for
everything, right?

If not, then see:
http://imagej.net/FAQ#The_image_I_loaded_is_displayed_all_black.21_But_it_is_not_black.21

If the data is indeed being read as all zeroes, but you know it isn't all
zeroes (i.e., another image program reads the values correctly), then could
you please upload a sample file illustrating the problem? You can use the
Help > Upload Sample Image command. Then reply back and let us know the
name of the image you uploaded. The image will be used for internal
debugging purposes only.

Since the image is large, you could extract a single frame and upload just
that one. E.g. using libtiff from the CLI:
    tiffcp input.tif,1 output.tif

> I'm not very familiar with the new data structures, I'd prefer
> with staying with the ImageJ1 API for the moment.

That's what I would recommend, since the ImageJ2 data model is still
evolving.

Regards,
Curtis

On Thu, Jan 8, 2015 at 2:14 PM, cri <[hidden email]> wrote:

> 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(), "");
>         }
>
> }
>
>
>
>
> --
> View this message in context:
> http://imagej.1557.x6.nabble.com/Open-a-big-tiff-file-tp5011136.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