<div dir="ltr"><div>Hi Michael,<br><br>> "./SCIFIOTestDriver itkSCIFIOImageIOTest/path/to/output_series_0.ome.tiff /path/to/scifio-test.ome.tiff"<br><br></div><div>Just a reminder, since you're writing ome.tiff you should have a "-w" flag at the end of this command. It sounds like you were using -w, just wanted to clarify for anyone else reading this thread.<br>
</div><div><br>> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space<br><br></div><div> There are two problems here. First, it seems that in SCIFIOImageIO the use of Bio-Formats is overly aggressive in pulling in all the series, thus the OutOfMemoryError. If you physically isolate a single series (e.g. delete or move to another directory series 1-19) the application will run, but we get another exception (at least on my end):<br>
<br><div style="margin-left:40px">./SCIFIOTestDriver itkSCIFIOImageIOTest output_series_0.ome.tiff scifio-test.ome.tiff -w<br>reader->GetUseStreaming(): 1<br>done checking streaming usage<br>ITK test driver caught an ITK exception:<br>
<br>itk::ExceptionObject (0x7ff8838b6ae8)<br>Location: "unknown"<br>File: /Users/mhiner/loci/ITK/build/Modules/Remote/SCIFIO/src/itkSCIFIOImageIO.cxx<br>Line: 180<br>Description: itk::ERROR: SCIFIOImageIO(0x7ff8838b4f00): SCIFIOImageIO exited abnormally. Creating new reader for output_series_0.ome.tiff<br>
log4j:WARN No appenders could be found for logger (loci.common.services.ServiceFactory).<br>log4j:WARN Please initialize the log4j system properly.<br>log4j:WARN See <a href="http://logging.apache.org/log4j/1.2/faq.html#noconfig">http://logging.apache.org/log4j/1.2/faq.html#noconfig</a> for more info.<br>
Exception in thread "main" loci.formats.FormatException: Unmatched UUID: urn:uuid:b72fe97b-02c9-4029-a876-ca2bae46cbac<br> at loci.formats.in.OMETiffReader.initFile(OMETiffReader.java:456)<br> at loci.formats.FormatReader.setId(FormatReader.java:1244)<br>
at loci.formats.ImageReader.setId(ImageReader.java:727)<br> at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:529)<br> at loci.formats.ChannelFiller.setId(ChannelFiller.java:263)<br> at loci.scifio.itk.SCIFIOITKBridge.createReader(SCIFIOITKBridge.java:617)<br>
at loci.scifio.itk.SCIFIOITKBridge.readImageInfo(SCIFIOITKBridge.java:268)<br> at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:133)<br> at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:108)<br>
at loci.scifio.itk.SCIFIOITKBridge.waitForInput(SCIFIOITKBridge.java:83)<br> at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:163)<br> at loci.scifio.itk.SCIFIOITKBridge.main(SCIFIOITKBridge.java:688)<br>
</div><br></div><div>I also get this exception when importing with Bio-Formats into Fiji.<br><br></div><div>As a side note, there are flags for itkSCIFIOImageIOTest that, in theory, should help the out of memory side:<br>
<br>"-s <n1, n2>" should limit the series read.<br>"-v <n>" should divide the data into divisions, which might mitigate the risk of OutOfMemoryErrors.<br><br></div><div>But neither of these will help the UUID exception. Also, I still got OutOfMemoryErrors with these, so it was still trying to initialize using all the series. So I created a <a href="https://github.com/scifio/scifio-imageio/issues/16">new issue</a> in the SCIFIO-ImageIO tracker.<br>
<br></div><div>Anyway, try importing the bfconvert output into Fiji with Bio-Formats and let me know if you <i>don't</i> get the UUID exception. If you do, then I think the bfconvert output is just invalid..<br><br></div>
<div>Regards,<br>Mark<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 29, 2014 at 12:17 PM, Michael Meuli <span dir="ltr"><<a href="mailto:michael.meuli@gmail.com" target="_blank">michael.meuli@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Mark,<br>
<br>
Thanks for the quick response. I can see I was using<br>
itkSCIFIOImageIOTest the wrong way and it doesn't make sense to use it<br>
like this.<br>
If I use the -w flag I get an error in all cases but at the moment I<br>
don't care as my aim now is to read ome.tiff files with itk.<br>
I've written a small program (mainly by copy paste from examples /<br>
<a href="https://github.com/michaelmeuli/bactelize" target="_blank">https://github.com/michaelmeuli/bactelize</a>) which so far reads the<br>
multi-channel-z-series.ome.tif file, does a maximum intensity<br>
projection of one channel and writes a 2D image and it seems to work<br>
with the multi-channel-z-series.ome.tif but not with the files<br>
converted with bfconvert.<br>
<br>
Expressed with itkSCIFIOImageIOTest:<br>
"./SCIFIOTestDriver itkSCIFIOImageIOTest<br>
/path/to/multi-channel-z-series.ome.tif /path/to/scifio-test.ome.tiff"<br>
doesn't give an error and seems to produce a tiff file of the first<br>
z-plane, but<br>
"./SCIFIOTestDriver itkSCIFIOImageIOTest<br>
/path/to/output_series_0.ome.tiff /path/to/scifio-test.ome.tiff" gives<br>
an error:<br>
<br>
reader->GetUseStreaming(): 1<br>
done checking streaming usage<br>
ITK test driver caught an ITK exception:<br>
<br>
itk::ExceptionObject (0x2f87680)<br>
Location: "unknown"<br>
File: /home/michael/Colocalization/ITK-Release-build/Modules/Remote/SCIFIO/src/itkSCIFIOImageIO.cxx<br>
Line: 180<br>
Description: itk::ERROR: SCIFIOImageIO(0x2f78970): SCIFIOImageIO<br>
exited abnormally. Creating new reader for<br>
/home/michael/bioimage/ome/data/wt-dead-A-ome-tiff/output_series_0.ome.tiff<br>
log4j:WARN No appenders could be found for logger<br>
(loci.common.services.ServiceFactory).<br>
log4j:WARN Please initialize the log4j system properly.<br>
log4j:WARN See <a href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" target="_blank">http://logging.apache.org/log4j/1.2/faq.html#noconfig</a><br>
for more info.<br>
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space<br>
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)<br>
at java.nio.ByteBuffer.allocate(ByteBuffer.java:312)<br>
at loci.common.NIOByteBufferProvider.allocateDirect(NIOByteBufferProvider.java:132)<br>
at loci.common.NIOByteBufferProvider.allocate(NIOByteBufferProvider.java:118)<br>
at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:532)<br>
at loci.common.NIOFileHandle.seek(NIOFileHandle.java:254)<br>
at loci.common.RandomAccessInputStream.seek(RandomAccessInputStream.java:140)<br>
at loci.formats.tiff.TiffParser.getIFDOffsets(TiffParser.java:308)<br>
at loci.formats.tiff.TiffParser.getIFDs(TiffParser.java:226)<br>
at loci.formats.in.MinimalTiffReader.initFile(MinimalTiffReader.java:426)<br>
at loci.formats.FormatReader.setId(FormatReader.java:1244)<br>
at loci.formats.in.OMETiffReader.initFile(OMETiffReader.java:704)<br>
at loci.formats.FormatReader.setId(FormatReader.java:1244)<br>
at loci.formats.ImageReader.setId(ImageReader.java:727)<br>
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:529)<br>
at loci.formats.ChannelFiller.setId(ChannelFiller.java:263)<br>
at loci.scifio.itk.SCIFIOITKBridge.createReader(SCIFIOITKBridge.java:622)<br>
at loci.scifio.itk.SCIFIOITKBridge.readImageInfo(SCIFIOITKBridge.java:266)<br>
at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:131)<br>
at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:108)<br>
at loci.scifio.itk.SCIFIOITKBridge.waitForInput(SCIFIOITKBridge.java:83)<br>
at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:161)<br>
at loci.scifio.itk.SCIFIOITKBridge.main(SCIFIOITKBridge.java:693)<br>
<br>
Best regards<br>
<span class="HOEnZb"><font color="#888888">Michael Meuli<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On 29 May 2014 17:41, Mark Hiner <<a href="mailto:hiner@wisc.edu">hiner@wisc.edu</a>> wrote:<br>
> Hi Michael,<br>
><br>
><br>
>> The problem is that ./SCIFIOTestDriver itkSCIFIOImageIOTest<br>
>> /path/to/output_series_0.ome.tiff /path/to/scifiotest.ome.tiff<br>
>> (and my little program) throws an exception.<br>
> ...<br>
><br>
>> How do I use bfconvert the correct way for my case?<br>
><br>
> You used bfconvert correctly to convert your dataset. Just so it's clear, if<br>
> your goal was to produce an OME-TIFF:<br>
><br>
>> /SCIFIOTestDriver itkSCIFIOImageIOTest /path/to/output_series_0.ome.tiff<br>
>> /path/to/scifiotest.ome.tiff<br>
><br>
> would be unnecessary, as you already have the OME-TIFF output from<br>
> bfconvert. The itkSCIFIOImageIOTest is an analogous tool to bfconvert<br>
> written in the Bio-Formats C++ framework. (although comparing the outputs of<br>
> the itkSCIFIOImageIOTest conversion would be a good way to check for errors<br>
> in the conversion process)<br>
><br>
> That said, I believe your conversion failed because the output was picked up<br>
> by the ITK TIFF ImageIO, which I believe only supports 3D data. The<br>
> itkSCIFIOImageIOTest utility does basically no automation - you have to tell<br>
> it exactly how to run, and because the SCIFIOImageIO is an external module<br>
> it is not prioritized by the ITK format detection framework over internal<br>
> modules (I'm not sure it's part of the automatic detection framework at all,<br>
> actually). So you need to force the use of the SCIFIOImageIO for writing.<br>
><br>
> If you run:<br>
><br>
> /SCIFIOTestDriver itkSCIFIOImageIOTest<br>
><br>
> with no arguments from the command line, it will print the usage + available<br>
> flags. The flag you wanted here is "-w" to write with the SCIFIOImageIO<br>
> (which will use Bio-Formats, and thus the OME-TIFF writer).<br>
><br>
> So the final syntax is:<br>
><br>
> /SCIFIOTestDriver itkSCIFIOImageIOTest /path/to/output_series_0.ome.tiff<br>
> /path/to/scifiotest.ome.tiff -w<br>
><br>
> which worked for me locally.<br>
><br>
> Let me know if you have any other questions or issues!<br>
><br>
> Regards,<br>
> Mark<br>
><br>
> On Thu, May 29, 2014 at 4:40 AM, Michael Meuli <<a href="mailto:michael.meuli@gmail.com">michael.meuli@gmail.com</a>><br>
> wrote:<br>
>><br>
>> ./SCIFIOTestDriver itkSCIFIOImageIOTest<br>
>> /path/to/output_series_0.ome.tiff /path/to/scifiotest.ome.tiff<br>
><br>
><br>
><br>
</div></div></blockquote></div><br></div>