[ITK-users] [ITK] Getting info from a very big image file

Gib Bogle g.bogle at auckland.ac.nz
Tue Dec 12 18:36:42 EST 2017


Thanks Brad.  The situation is complicated by the fact that there are 3 channels (three colours).  Tiffsplit is able to split the file into 396 127 MB TIFFs and 396 thumbnail TIFFs.  Irfanview can open one of the TIFFs, and it tells me that it is 4656x4656 and 48 bitsperpixel.  That is, it contains 3 16-bit images of that size.  Nothing is displayed in Irfanview - I'm rather surprised that it could open it at all.
 I'll try using that example, but the double complication of the included thumbnails and the 3 colours might stymie it.

Cheers, Gib
________________________________________
From: Lowekamp, Bradley (NIH/NLM/LHC) [C] <blowekamp at mail.nih.gov>
Sent: Wednesday, 13 December 2017 3:51 a.m.
To: Matt McCormick; Gib Bogle
Cc: insight-users at itk.org
Subject: Re: [ITK] [ITK-users] Getting info from a very big image file

Gib,

I have not tested this, but the LSMImageIO is derived from the TIFFImageIO,  and LSMImageIO::Read does just call TIFFImageIO. So the chances are very good that it supports streamed reading.

I updated the TIFFImageIO to support stream reading of the individual pages in the TIFF stack some time ago.

You may find the following example useful to determining if the functionality is there:
https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/IO/ImageReadExtractWrite.cxx


You can see the usage of “UpdateOutputInformation” followed by the ExtractImageFilter, this can be a very powerful and efficient pattern for working with large images. The ExtractImageFilter can be used to create a 3D to 2D image from it’s input volume.

Brad


On 12/11/17, 10:56 PM, "Matt McCormick" <matt.mccormick at kitware.com> wrote:

    Hi Gib,

    Call

     reader->UpdateOutputInformation();

    instead of

      reader->Update();

    to get the LargestPossibleRegion populated without loading the pixel buffer.


    The image IO has to support streaming to read in only a
    RequestedRegion -- unfortunately, I do not think the LSMImageIO
    supports this at this time.

    HTH,
    Matt

    On Mon, Dec 11, 2017 at 10:44 PM, Gib Bogle <g.bogle at auckland.ac.nz> wrote:
    > Hello,
    >
    >
    > I am wanting to work with a 50 GB LSM file (3D).  The first step is to be
    > able to get the image info: width, height and depth.  I have code that works
    > on a small LSM file
    >
    >
    >     im_u16 = reader->GetOutput();
    >     width = im_u16->GetLargestPossibleRegion().GetSize()[0];
    >     height = im_u16->GetLargestPossibleRegion().GetSize()[1];
    >     depth = im_u16->GetLargestPossibleRegion().GetSize()[2];
    >
    >
    > but I see that to do this the whole image must be loaded into memory.  When
    > I start the program running with the big file I can see that it is going to
    > exceed the host machine's 32 GB.  Is there a way to get the image dimensions
    > without loading the whole image?  What I am hoping to do is split the file
    > into 2D TIFF files - is there any way to extract a 2D slice without reading
    > the whole image?  Or will I be forced to run on a  machine with more than 50
    > GB of RAM?
    >
    >
    > Thanks in advance for any suggestions.
    >
    >
    > Best regards
    >
    > Gib
    >
    >
    > The ITK community is transitioning from this mailing list to
    > discourse.itk.org. Please join us there!
    > ________________________________
    > Powered by www.kitware.com
    >
    > Visit other Kitware open-source projects at
    > http://www.kitware.com/opensource/opensource.html
    >
    > Kitware offers ITK Training Courses, for more information visit:
    > http://www.kitware.com/products/protraining.php
    >
    > Please keep messages on-topic and check the ITK FAQ at:
    > http://www.itk.org/Wiki/ITK_FAQ
    >
    > Follow this link to subscribe/unsubscribe:
    > http://public.kitware.com/mailman/listinfo/insight-users
    >
    The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
    ________________________________
    Powered by www.kitware.com

    Visit other Kitware open-source projects at
    http://www.kitware.com/opensource/opensource.html

    Kitware offers ITK Training Courses, for more information visit:
    http://www.kitware.com/products/protraining.php

    Please keep messages on-topic and check the ITK FAQ at:
    http://www.itk.org/Wiki/ITK_FAQ

    Follow this link to subscribe/unsubscribe:
    http://public.kitware.com/mailman/listinfo/insight-users
    The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
    ________________________________________
    Community mailing list
    Community at itk.org
    http://public.kitware.com/mailman/listinfo/community




More information about the Insight-users mailing list