Hi Matthias,<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>Now I encountered another problem. With normal sized images everything works fine. But since I pretty much only have images that are larger than 2GB, the Java machine has not enough memory to "load" the whole image plane. However this is not really what I want to do anyway. It seems that itk has a way to manage large files by opening them using streams. An image is split into pieces on read so that large images can be processes sequentially. I'm not sure but this functionality seems not to be implemented down to the wrapping bioformat reader for itk.</blockquote>
<div><br></div><div>As you observed, Bio-Formats has the capability to read in only a subset of image data, including a cropped region of each XY plane. The BF-ITK plugin is supposed to provide this capability as well, using the "IORegion" feature of ITK ImageIO. That said, we have not really tested this feature, and there may be a problem with it. I am actually not even sure how the calling code should go about specifying the IORegion. But I suggest you give it a try (ask on ITK-users if you need assistance) and then report back if you find any problems with it.</div>
<div><br></div><div>HTH,</div><div>Curtis</div><div><br><br><div class="gmail_quote">On Wed, Jul 11, 2012 at 3:54 AM, Matthias Noll <span dir="ltr"><<a href="mailto:matthias.noll@igd.fraunhofer.de" target="_blank">matthias.noll@igd.fraunhofer.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Churtis,<br>
<br>
I managed to apply the reader after deregistration of other readers that were interfering in the reader selection.<br>
<br>
Now I encountered another problem. With normal sized images everything works fine. But since I pretty much only have images that are larger than 2GB, the Java machine has not enough memory to "load" the whole image plane. However this is not really what I want to do anyway. It seems that itk has a way to manage large files by opening them using streams. An image is split into pieces on read so that large images can be processes sequentially. I'm not sure but this functionality seems not to be implemented down to the wrapping bioformat reader for itk.<br>
<br>
itk::ERROR: BioFormatsImageIO(<u></u>0000000003815B60): BioFormatsImageIO: 'ITKBridgePipe read' exited abnormally. Exception in thread "main" loci.formats.FormatException: Image plane too large. Only 2GB of data can be extracted at one time.<br>
<br>
Looking at the error message, the Java wrapped code obviously wants to read in the whole image. The cropping seems to be done after the complete image is read.<br>
<br>
I also found this page using the error output.<br>
<a href="http://www.openmicroscopy.org/site/support/faq/bio-formats/i-see-an-outofmemory-or-negativearraysize-error-message-when-attempting-to-open-an-svs-or-jpeg-2000-file.-what-does-this-mean" target="_blank">http://www.openmicroscopy.org/<u></u>site/support/faq/bio-formats/<u></u>i-see-an-outofmemory-or-<u></u>negativearraysize-error-<u></u>message-when-attempting-to-<u></u>open-an-svs-or-jpeg-2000-file.<u></u>-what-does-this-mean</a><br>
<br>
I could use the option to increase the JVM memory space but this would only help me so far. With really large images that exceed my memory I would still have a problem. Is there a way to get around the complete read-in of the input with the itk reader that I've misses so far?<br>
<br>
Best Regards,<br>
Matthias<br>
<br>
Am 7/2/2012 7:25 PM, schrieb Curtis Rueden:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>
Hi Matthias,<br>
<br>
I want to use the cpp wrapped bioformat reader with itk to read<br>
ome.tif files. The interfacing with itk however is kind of not<br>
working properly. First I have to unregister the base readers (jpg,<br></div>
png etc. )using the command itk::ObjectFactoryBase::__<u></u>ReHash(); If I<div><br>
don't do this, one of base readers will try to load the tiff image.<br>
Namely the TiffImageIO. Since the image in question is tiled, this<br>
read operation will fail. And therfore the bioformat reader will<br>
never be activated. If I use the ReHash() function, the bioformat<br>
reading works, but all other reader/writers are unregistered in the<br>
ObjectFactoryBase. In registering them manually for e.g. png saving<br>
a output region of the read ome.tiff image. The bioformat reader<br>
will always tell itk that he can write the input image. But he sould<br>
not, since I choose .png as the output format. I'm not quite shure<br>
what I'm doing wrong concerning the reader. I thought the plugin<br>
should behave as a normal itk reader/writer.<br>
<br>
<br>
I am CCing the ITK-users list, since I think your question is a more<br>
general one about the ITK ImageIO plugin mechanism. It seems to me that<br>
all you really need is a simple way to reshuffle the order of the<br>
available ImageIO plugins—in this case, to give the Bio-Formats ITK<br>
plugin a higher priority than the built-in TIFF ImageIO plugin. Does<br>
anyone know a good way to do this?<br>
<br>
Thanks,<br>
Curtis<br>
<br>
P.S. The ImageIO plugin Matthias is talking about is here:<br>
<a href="http://loci.wisc.edu/bio-formats/itk" target="_blank">http://loci.wisc.edu/bio-<u></u>formats/itk</a><br>
<br>
<br>
On Mon, Jul 2, 2012 at 11:09 AM, <<a href="mailto:matthias.noll@igd.fraunhofer.de" target="_blank">matthias.noll@igd.fraunhofer.<u></u>de</a><br></div><div>
<mailto:<a href="mailto:matthias.noll@igd.fraunhofer.de" target="_blank">matthias.noll@igd.<u></u>fraunhofer.de</a>>> wrote:<br>
<br>
Matthias Noll sent a message using the contact form at<br>
<a href="http://loci.wisc.edu/contact" target="_blank">http://loci.wisc.edu/contact</a>.<br>
<br>
Hello,<br>
I want to use the cpp wrapped bioformat reader with itk to read<br>
ome.tif files. The interfacing with itk however is kind of not<br>
working properly. First I have to unregister the base readers (jpg,<br></div>
png etc. )using the command itk::ObjectFactoryBase::__<u></u>ReHash(); If I<div><br>
don't do this, one of base readers will try to load the tiff image.<br>
Namely the TiffImageIO. Since the image in question is tiled, this<br>
read operation will fail. And therfore the bioformat reader will<br>
never be activated. If I use the ReHash() function, the bioformat<br>
reading works, but all other reader/writers are unregistered in the<br>
ObjectFactoryBase. In registering them manually for e.g. png saving<br>
a output region of the read ome.tiff image. The bioformat reader<br>
will always tell itk that he can write the input image. But he sould<br>
not, since I choose .png as the output format. I'm not quite shure<br>
what I'm doing wrong concerning the reader. I thought the plugin<br>
should behave as a normal itk reader/writer.<br>
I'm greatful for any kind of help.<br>
Thanks Matthias<br>
<br>
<br>
</div></blockquote>
</blockquote></div><br></div>