<div dir="ltr"><div><div><div><div>Hi Michael,<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">So far I've used "File > Open". Sorry.<br>

</blockquote><br></div>No need to apologize! This is a common misunderstanding. When you use "File > Open", your .ome.tiff gets picked up by the ImageJ TIFF reader instead of Bio-Formats. So that's why metadata is missing. This is actually something we're improving with the ImageJ2 release this week: "File > Open" will be able to work with Bio-Formats automatically.<br>

<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">I just tried "File > Import > Bio-Formats" and it works as well.<br></blockquote>

<br></div>This made me suspect that there was something going wrong on my end. I should have asked which version of Bio-Formats you were using bfconvert from.. I was using it from v5.0.1. I updated to v5.0.2 this morning and tried bfconvert, and now my output .ome.tiffs open just fine in Fiji's Bio-Formats Importer. So I'm sorry for any misguidance there.<br>

<br></div>Anyway, as for the itkSCIFIOImageIO use, I was still getting OutOfMemoryErrors. So you'll want to increase the amount of memory Java can use. By default, the ImageIO creates a JVM with 256m. You can override this by setting a "JAVA_FLAGS" environment variable. Once I went over 3g, I was actually able to convert your data appropriately, finally! To increase available memory, I used the command:<br>

<br><div style="margin-left:40px">export JAVA_FLAGS=-Xmx3400m<br></div><br></div>Also! I forgot there were some important considerations with other flags to use with the itkSCIFIOImageIO:<br><ul><li>use "-d 5". I know your data is 3D + channels, but as an .ome.tiff it will be considered 5D by the imageio and the wrong dimensions could get truncated if you set -d less than 5.</li>

<li>If necessary, set pixel type with "-t". The default is unsigned short (an ITK pixel type, which is equivalent to Bio-Formats's uint16). Your data is uint16 so there's no need to use this flag, just wanted you to be aware of it.</li>

</ul><p>So, the command that worked for me was:</p><p style="margin-left:40px">/SCIFIOTestDriver itkSCIFIOImageIOTest bfconvert_output/output_series_0.ome.tiff test.ome.tiff -w -d 5</p><p>Let me know if you have any more problems,</p>

<p>Mark<br></p></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 1, 2014 at 1:19 AM, 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>
I just tried "File > Import > Bio-Formats" and it works as well.<br>
If I select one of the files produced with ...%s.ome.tiff in the first<br>
open dialog box and then Hyperstack in the "Bio-Formats Import<br>
Options", I can open any of the series files.<br>
If I separate on of these files into another directory and try to open<br>
it the same way, Fiji crashes.<br>
I can also open the file containing all the series, but made some<br>
coffee in between.<br>
So far I've used "File > Open". Sorry. "File > Open" also works for<br>
the separated file, in case this matters, but shows them in gray and<br>
plane by plane (no channell selection).<br>
<br>
Thanks,<br>
Michael<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On 1 June 2014 03:08, Mark Hiner <<a href="mailto:hiner@wisc.edu">hiner@wisc.edu</a>> wrote:<br>
> Hi Michael,<br>
><br>
><br>
>> I can import the bfconvert output into Fiji with no problem.<br>
><br>
><br>
> I just wanted to confirm, you're using "File > Import > Bio-Formats" or the<br>
> Bio-Formats importer in Fiji, correct? It definitely didn't work for me when<br>
> I tried yesterday. I can check next week to see if I was using an outdated<br>
> Bio-Formats or something..<br>
><br>
> Thanks,<br>
> Mark<br>
><br>
><br>
> On Sat, May 31, 2014 at 7:52 AM, Michael Meuli <<a href="mailto:michael.meuli@gmail.com">michael.meuli@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Hi Mark<br>
>><br>
>> I can import the bfconvert output into Fiji with no problem.<br>
>> (If I do "./bfconvert /path/to/wt-dead-A.lif /path/to/output.ome.tiff" or<br>
>> "./bfconvert /path/to/wt-dead-A.lif /path/to/output_series_%s.ome.tiff"<br>
>> I can open the file(s) with Fiji.)<br>
>> If I open the .lif file with Fiji and export one series to ome.tiff I<br>
>> can read the output with ./SCIFIOTestDriver itkSCIFIOImageIOTest ...<br>
>> whereas I'm not able to read the output of bfconvert.<br>
>><br>
>> Thanks a lot and best regards<br>
>> Michael<br>
>><br>
>><br>
>><br>
>> On 30 May 2014 16:18, Mark Hiner <<a href="mailto:hinerm@gmail.com">hinerm@gmail.com</a>> wrote:<br>
>> > Hi Michael,<br>
>> ><br>
>> >> "./SCIFIOTestDriver<br>
>> >> itkSCIFIOImageIOTest/path/to/output_series_0.ome.tiff<br>
>> >> /path/to/scifio-test.ome.tiff"<br>
>> ><br>
>> > Just a reminder, since you're writing ome.tiff you should have a "-w"<br>
>> > flag<br>
>> > at the end of this command. It sounds like you were using -w, just<br>
>> > wanted to<br>
>> > clarify for anyone else reading this thread.<br>
>> ><br>
>> >> Exception in thread "main" java.lang.OutOfMemoryError: Java heap space<br>
>> ><br>
>> >  There are two problems here. First, it seems that in SCIFIOImageIO the<br>
>> > use<br>
>> > of Bio-Formats is overly aggressive in pulling in all the series, thus<br>
>> > the<br>
>> > OutOfMemoryError. If you physically isolate a single series (e.g. delete<br>
>> > or<br>
>> > move to another directory series 1-19) the application will run, but we<br>
>> > get<br>
>> > another exception (at least on my end):<br>
>> ><br>
>> > ./SCIFIOTestDriver itkSCIFIOImageIOTest output_series_0.ome.tiff<br>
>> > scifio-test.ome.tiff -w<br>
>> ><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:<br>
>> ><br>
>> > /Users/mhiner/loci/ITK/build/Modules/Remote/SCIFIO/src/itkSCIFIOImageIO.cxx<br>
>> > Line: 180<br>
>> > Description: itk::ERROR: SCIFIOImageIO(0x7ff8838b4f00): SCIFIOImageIO<br>
>> > exited<br>
>> > abnormally. Creating new reader for output_series_0.ome.tiff<br>
>> ><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> for<br>
>> > more info.<br>
>> > Exception in thread "main" loci.formats.FormatException: Unmatched UUID:<br>
>> > urn:uuid:b72fe97b-02c9-4029-a876-ca2bae46cbac<br>
>> >     at loci.formats.in.OMETiffReader.initFile(OMETiffReader.java:456)<br>
>> ><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<br>
>> > loci.scifio.itk.SCIFIOITKBridge.createReader(SCIFIOITKBridge.java:617)<br>
>> >     at<br>
>> > loci.scifio.itk.SCIFIOITKBridge.readImageInfo(SCIFIOITKBridge.java:268)<br>
>> >     at<br>
>> > loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:133)<br>
>> ><br>
>> >     at<br>
>> > loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:108)<br>
>> >     at<br>
>> > loci.scifio.itk.SCIFIOITKBridge.waitForInput(SCIFIOITKBridge.java:83)<br>
>> >     at<br>
>> > loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:163)<br>
>> >     at loci.scifio.itk.SCIFIOITKBridge.main(SCIFIOITKBridge.java:688)<br>
>> ><br>
>> > I also get this exception when importing with Bio-Formats into Fiji.<br>
>> ><br>
>> > As a side note, there are flags for itkSCIFIOImageIOTest that, in<br>
>> > theory,<br>
>> > 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<br>
>> > risk of OutOfMemoryErrors.<br>
>> ><br>
>> > But neither of these will help the UUID exception. Also, I still got<br>
>> > OutOfMemoryErrors with these, so it was still trying to initialize using<br>
>> > all<br>
>> > the series. So I created a new issue in the SCIFIO-ImageIO tracker.<br>
>> ><br>
>> > Anyway, try importing the bfconvert output into Fiji with Bio-Formats<br>
>> > and<br>
>> > let me know if you don't get the UUID exception. If you do, then I think<br>
>> > the<br>
>> > bfconvert output is just invalid..<br>
>> ><br>
>> > Regards,<br>
>> > Mark<br>
>> ><br>
>> ><br>
>> > On Thu, May 29, 2014 at 12:17 PM, Michael Meuli<br>
>> > <<a href="mailto:michael.meuli@gmail.com">michael.meuli@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> 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:<br>
>> >><br>
>> >> /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>
>> >><br>
>> >><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<br>
>> >><br>
>> >> loci.common.NIOByteBufferProvider.allocateDirect(NIOByteBufferProvider.java:132)<br>
>> >> at<br>
>> >><br>
>> >> 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<br>
>> >><br>
>> >> 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<br>
>> >> 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<br>
>> >> loci.scifio.itk.SCIFIOITKBridge.createReader(SCIFIOITKBridge.java:622)<br>
>> >> at<br>
>> >> loci.scifio.itk.SCIFIOITKBridge.readImageInfo(SCIFIOITKBridge.java:266)<br>
>> >> at<br>
>> >><br>
>> >> loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:131)<br>
>> >> at<br>
>> >><br>
>> >> loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:108)<br>
>> >> at<br>
>> >> loci.scifio.itk.SCIFIOITKBridge.waitForInput(SCIFIOITKBridge.java:83)<br>
>> >> at<br>
>> >><br>
>> >> loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:161)<br>
>> >> at loci.scifio.itk.SCIFIOITKBridge.main(SCIFIOITKBridge.java:693)<br>
>> >><br>
>> >> Best regards<br>
>> >> Michael Meuli<br>
>> >><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<br>
>> >> > clear, if<br>
>> >> > your goal was to produce an OME-TIFF:<br>
>> >> ><br>
>> >> >> /SCIFIOTestDriver itkSCIFIOImageIOTest<br>
>> >> >> /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<br>
>> >> > outputs of<br>
>> >> > the itkSCIFIOImageIOTest conversion would be a good way to check for<br>
>> >> > errors<br>
>> >> > in the conversion process)<br>
>> >> ><br>
>> >> > That said, I believe your conversion failed because the output was<br>
>> >> > 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<br>
>> >> > to<br>
>> >> > tell<br>
>> >> > it exactly how to run, and because the SCIFIOImageIO is an external<br>
>> >> > module<br>
>> >> > it is not prioritized by the ITK format detection framework over<br>
>> >> > internal<br>
>> >> > modules (I'm not sure it's part of the automatic detection framework<br>
>> >> > at<br>
>> >> > all,<br>
>> >> > actually). So you need to force the use of the SCIFIOImageIO for<br>
>> >> > writing.<br>
>> >> ><br>
>> >> > If you run:<br>
>> >> ><br>
>> >> >  /SCIFIOTestDriver itkSCIFIOImageIOTest<br>
>> >> ><br>
>> >> > with no arguments from the command line, it will print the usage +<br>
>> >> > available<br>
>> >> > flags. The flag you wanted here is "-w"  to write with the<br>
>> >> > SCIFIOImageIO<br>
>> >> > (which will use Bio-Formats, and thus the OME-TIFF writer).<br>
>> >> ><br>
>> >> > So the final syntax is:<br>
>> >> ><br>
>> >> > /SCIFIOTestDriver itkSCIFIOImageIOTest<br>
>> >> > /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<br>
>> >> > <<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>
>> ><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>