<div dir="ltr"><div><div dir="ltr"><div><font color="#000000">Hello,</font></div><div><font color="#000000"><br></font></div><div><span style="color:rgb(0,0,0)">I am relatively new to ITK. </span><font color="#000000">I am trying to read a very large TIFF image using the IO streaming functionality in ITK. I am reading a very small portion of the image and I still end up getting memory allocation error. I get the feeling, the code is trying to read the entire image at once, even after specifying the region to read. Can someone please tell what is wrong the following code snippet ?</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><div>typedef itk::RGBPixel< unsigned char > RGBPixelType;</div><div>typedef itk::Image< RGBPixelType, 2 > RGB2DImageType;</div><div>typedef itk::ImageFileReader<RGB2DImageType> RGBReaderType;</div><div><br></div><div>itk::TIFFImageIO::Pointer tiffIO = itk::TIFFImageIO::New();</div><div>tiffIO->SetPixelType(itk::ImageIOBase::RGBA);</div><div><br></div><div>RGB2DImageType::SizeType sz;</div><div>RGB2DImageType::IndexType idx;</div><div>sz[0]=128; sz[1]=128;</div><div>idx[0]=0; idx[1]=0;</div><div><br></div><div>itk::ImageIORegion region(2);</div><div>region.SetSize(0,sz[0]);</div><div>region.SetSize(1,sz[1]);</div><div>region.SetIndex(0,idx[0]);</div><div>region.SetIndex(1,idx[1]);</div><div>tiffIO->SetIORegion(region);</div><div><br></div><div>RGBReaderType::Pointer reader = RGBReaderType::New();</div><div>reader->SetFileName("V:\\TiFF_Image.tiff");</div><div>reader->SetImageIO(tiffIO);</div><div>reader->SetUseStreaming(1);<br></div><div>reader->Update();</div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Regards,</div><div>Vikram</div></font></div>
<div></div></div></div>
</div>