[ome-users] convert .lif file with bfconvert
Michael Meuli
michael.meuli at gmail.com
Thu May 29 18:17:06 BST 2014
Hi Mark,
Thanks for the quick response. I can see I was using
itkSCIFIOImageIOTest the wrong way and it doesn't make sense to use it
like this.
If I use the -w flag I get an error in all cases but at the moment I
don't care as my aim now is to read ome.tiff files with itk.
I've written a small program (mainly by copy paste from examples /
https://github.com/michaelmeuli/bactelize) which so far reads the
multi-channel-z-series.ome.tif file, does a maximum intensity
projection of one channel and writes a 2D image and it seems to work
with the multi-channel-z-series.ome.tif but not with the files
converted with bfconvert.
Expressed with itkSCIFIOImageIOTest:
"./SCIFIOTestDriver itkSCIFIOImageIOTest
/path/to/multi-channel-z-series.ome.tif /path/to/scifio-test.ome.tiff"
doesn't give an error and seems to produce a tiff file of the first
z-plane, but
"./SCIFIOTestDriver itkSCIFIOImageIOTest
/path/to/output_series_0.ome.tiff /path/to/scifio-test.ome.tiff" gives
an error:
reader->GetUseStreaming(): 1
done checking streaming usage
ITK test driver caught an ITK exception:
itk::ExceptionObject (0x2f87680)
Location: "unknown"
File: /home/michael/Colocalization/ITK-Release-build/Modules/Remote/SCIFIO/src/itkSCIFIOImageIO.cxx
Line: 180
Description: itk::ERROR: SCIFIOImageIO(0x2f78970): SCIFIOImageIO
exited abnormally. Creating new reader for
/home/michael/bioimage/ome/data/wt-dead-A-ome-tiff/output_series_0.ome.tiff
log4j:WARN No appenders could be found for logger
(loci.common.services.ServiceFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)
at java.nio.ByteBuffer.allocate(ByteBuffer.java:312)
at loci.common.NIOByteBufferProvider.allocateDirect(NIOByteBufferProvider.java:132)
at loci.common.NIOByteBufferProvider.allocate(NIOByteBufferProvider.java:118)
at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:532)
at loci.common.NIOFileHandle.seek(NIOFileHandle.java:254)
at loci.common.RandomAccessInputStream.seek(RandomAccessInputStream.java:140)
at loci.formats.tiff.TiffParser.getIFDOffsets(TiffParser.java:308)
at loci.formats.tiff.TiffParser.getIFDs(TiffParser.java:226)
at loci.formats.in.MinimalTiffReader.initFile(MinimalTiffReader.java:426)
at loci.formats.FormatReader.setId(FormatReader.java:1244)
at loci.formats.in.OMETiffReader.initFile(OMETiffReader.java:704)
at loci.formats.FormatReader.setId(FormatReader.java:1244)
at loci.formats.ImageReader.setId(ImageReader.java:727)
at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:529)
at loci.formats.ChannelFiller.setId(ChannelFiller.java:263)
at loci.scifio.itk.SCIFIOITKBridge.createReader(SCIFIOITKBridge.java:622)
at loci.scifio.itk.SCIFIOITKBridge.readImageInfo(SCIFIOITKBridge.java:266)
at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:131)
at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:108)
at loci.scifio.itk.SCIFIOITKBridge.waitForInput(SCIFIOITKBridge.java:83)
at loci.scifio.itk.SCIFIOITKBridge.executeCommand(SCIFIOITKBridge.java:161)
at loci.scifio.itk.SCIFIOITKBridge.main(SCIFIOITKBridge.java:693)
Best regards
Michael Meuli
On 29 May 2014 17:41, Mark Hiner <hiner at wisc.edu> wrote:
> Hi Michael,
>
>
>> The problem is that ./SCIFIOTestDriver itkSCIFIOImageIOTest
>> /path/to/output_series_0.ome.tiff /path/to/scifiotest.ome.tiff
>> (and my little program) throws an exception.
> ...
>
>> How do I use bfconvert the correct way for my case?
>
> You used bfconvert correctly to convert your dataset. Just so it's clear, if
> your goal was to produce an OME-TIFF:
>
>> /SCIFIOTestDriver itkSCIFIOImageIOTest /path/to/output_series_0.ome.tiff
>> /path/to/scifiotest.ome.tiff
>
> would be unnecessary, as you already have the OME-TIFF output from
> bfconvert. The itkSCIFIOImageIOTest is an analogous tool to bfconvert
> written in the Bio-Formats C++ framework. (although comparing the outputs of
> the itkSCIFIOImageIOTest conversion would be a good way to check for errors
> in the conversion process)
>
> That said, I believe your conversion failed because the output was picked up
> by the ITK TIFF ImageIO, which I believe only supports 3D data. The
> itkSCIFIOImageIOTest utility does basically no automation - you have to tell
> it exactly how to run, and because the SCIFIOImageIO is an external module
> it is not prioritized by the ITK format detection framework over internal
> modules (I'm not sure it's part of the automatic detection framework at all,
> actually). So you need to force the use of the SCIFIOImageIO for writing.
>
> If you run:
>
> /SCIFIOTestDriver itkSCIFIOImageIOTest
>
> with no arguments from the command line, it will print the usage + available
> flags. The flag you wanted here is "-w" to write with the SCIFIOImageIO
> (which will use Bio-Formats, and thus the OME-TIFF writer).
>
> So the final syntax is:
>
> /SCIFIOTestDriver itkSCIFIOImageIOTest /path/to/output_series_0.ome.tiff
> /path/to/scifiotest.ome.tiff -w
>
> which worked for me locally.
>
> Let me know if you have any other questions or issues!
>
> Regards,
> Mark
>
> On Thu, May 29, 2014 at 4:40 AM, Michael Meuli <michael.meuli at gmail.com>
> wrote:
>>
>> ./SCIFIOTestDriver itkSCIFIOImageIOTest
>> /path/to/output_series_0.ome.tiff /path/to/scifiotest.ome.tiff
>
>
>
More information about the ome-users
mailing list