bfconvert behaves differently than Fiji "save as->OME-TIFF"
Posted:
Fri Sep 01, 2017 9:55 am
by SteveO
Dear Bio-Formats -
I'm not sure if this is a bug or something I'm doing wrong. I have a whole folder of .czi images from a zeiss 780 confocal. I want to convert them to ome-tiff files. They are single channel, single time point, single z plane images. They are each a single image. I tested by saving one of the images within Fiji using the file-save as -> OME-TIFF command and it worked perfectly. The output was reported by the system software (Mac OS X or Windows 7) to be a tiff file of the correct pixel dimensions, generated a reasonable looking thumbnail and, reported the disk size correctly too, close to what I calculate for the total pixels * 2 (because they're 2-byte images).
So I used the command line tool bfconvert and a shell script to iterate through all the .czi files in my folder and convert them to .ome.tiff files. The process completes and there are no errors. The ome-tiff files are nominally correct and can be opened within Fiji, but are somehow different than the files that are converted within Fiji. For instance, although the system knows the files are tiff files, it uses the generic tiff icon because it cannot generate a thumbnail, cannot report the pixel dimensions and reports them to be twice the size of the image converted within Fiji. Importantly, they give me problems when I try to use them downstream in my workflow.
I think I have the latest versions of both Bio-formats within Fiji and the command line tools. I updated my Fiji and the -version switch of bfconvert reports:
Version: 5.6.0
Build date: 14 August 2017
VCS revision: aab7b3080fbe386766fdba3d0e26128ca2cdce18
I tried the following switches on the command line -channel 0, -z 0, -separate, -expand, -timepoint 0 and they all behave the same as the command without any switches.
I uploaded the original data "25X_Intensity.czi", the file converted within Fiji "25X_Intensity_fiji.ome.tif" and the file converted using the command line bfconvert "25X_Intensity_bfconvert.ome.tiff" to your QA site.
Probably it's something silly I'm doing/not doing, but I'd appreciate any advice as I would like to use the bfconvert command on many folders of images that I have.
Thanks much,
Steve
Re: bfconvert behaves differently than Fiji "save as->OME-TI
Posted:
Fri Sep 01, 2017 2:34 pm
by rleigh
The main difference is that bfconvert preserves "original metadata" from the original file as structured annotations in the OME-XML metadata while Fiji does not (it preserves everything else though).
This is the TIFF header from Fiji:
- Code: Select all
TIFF Directory at offset 0x8 (8)
Image Width: 504 Image Length: 504
Resolution: 80607.3, 80607.3 pixels/cm
Bits/Sample: 16
Sample Format: unsigned integer
Compression Scheme: None
Photometric Interpretation: min-is-black
Samples/Pixel: 1
Rows/Strip: 1
Planar Configuration: single image plane
ImageDescription: <?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- Warning: this comment is an OME-XML metadata block, which contains crucial dimensional parameters and other important metadata. Please edit cautiously (if at all), and back up the original data before doing so. For more information, see the OME-TIFF web site: http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/. --><OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Creator="OME Bio-Formats 5.6.0" UUID="urn:uuid:e4bc19cc-d7ae-4068-ab82-8487475df0c7" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd"><Experimenter ID="Experimenter:0" UserName="LSM User"/><Instrument ID="Instrument:0"><Microscope/><Detector AmplificationGain="1.0" Gain="600.0" ID="Detector:0:0" Model="" Type="PMT" Zoom="5.439024401745128"/><Objective ID="Objective:0" Immersion="Glycerol" LensNA="0.8" Model="LD LCI Plan-Apochromat 25x/0.8 Imm Korr DIC M27" NominalMagnification="25.0"/></Instrument><Image ID="Image:0" Name="25X_Intensity #1"><ExperimenterRef ID="Experimenter:0"/><InstrumentRef ID="Instrument:0"/><ObjectiveSettings ID="Objective:0" Medium="Glycerol" RefractiveIndex="1.456"/><Pixels BigEndian="false" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="0.12405822533146922" PhysicalSizeXUnit="µm" PhysicalSizeY="0.12405822533146922" PhysicalSizeYUnit="µm" PhysicalSizeZ="1.0" PhysicalSizeZUnit="µm" SignificantBits="16" SizeC="1" SizeT="1" SizeX="504" SizeY="504" SizeZ="1" TimeIncrement="0.0" TimeIncrementUnit="s" Type="uint16"><Channel AcquisitionMode="LaserScanningConfocalMicroscopy" Color="-1" EmissionWavelength="497.5000000000001" EmissionWavelengthUnit="nm" ExcitationWavelength="405.00000000000006" ExcitationWavelengthUnit="nm" Fluor="DAPI" ID="Channel:0:0" IlluminationType="Epifluorescence" Name="Ch1" SamplesPerPixel="1"><DetectorSettings Binning="1x1" ID="Detector:0:0"/><LightPath/></Channel><TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1"><UUID FileName="Fiji.ome.tif">urn:uuid:e4bc19cc-d7ae-4068-ab82-8487475df0c7</UUID></TiffData><Plane DeltaT="4971.389150363636" DeltaTUnit="s" PositionX="248.501" PositionXUnit="µm" PositionY="1669.44" PositionYUnit="µm" PositionZ="2368.92" PositionZUnit="µm" TheC="0" TheT="0" TheZ="0"/></Pixels></Image></OME>
Software: OME Bio-Formats 5.6.0
And this is the one from bfconvert:
- Code: Select all
TIFF Directory at offset 0x8 (8)
Image Width: 504 Image Length: 504
Resolution: 80607.3, 80607.3 pixels/cm
Bits/Sample: 16
Sample Format: unsigned integer
Compression Scheme: None
Photometric Interpretation: palette color (RGB from colormap)
Samples/Pixel: 1
Rows/Strip: 1
Planar Configuration: single image plane
Color Map: (present)
ImageDescription: <?xml version="1.0" encoding="UTF-8"?><!-- Warning: this comment is an OME-XML metadata block, which contains crucial dimensional parameters and other important metadata. Please edit cautiously (if at all), and back up the original data before doing so. For more information, see the OME-TIFF web site: http://www.openmicroscopy.org/site/support/ome-model/ome-tiff/. --><OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2016-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Creator="OME Bio-Formats 5.6.0" UUID="urn:uuid:623a70e4-49dd-4568-bf89-54a3c88f9de5" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2016-06 http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd"><Experimenter ID="Experimenter:0" UserName="LSM User"/><Instrument ID="Instrument:0"><Microscope/><Detector AmplificationGain="1.0" Gain="600.0" ID="Detector:0:0" Model="" Type="PMT" Zoom="5.439024401745128"/><Objective ID="Objective:0" Immersion="Glycerol" LensNA="0.8" Model="LD LCI Plan-Apochromat 25x/0.8 Imm Korr DIC M27" NominalMagnification="25.0"/></Instrument><Image ID="Image:0" Name="25X_Intensity #1"><ExperimenterRef ID="Experimenter:0"/><InstrumentRef ID="Instrument:0"/><ObjectiveSettings ID="Objective:0" Medium="Glycerol" RefractiveIndex="1.456"/><Pixels BigEndian="false" DimensionOrder="XYCZT" ID="Pixels:0" Interleaved="false" PhysicalSizeX="0.12405822533146922" PhysicalSizeXUnit="µm" PhysicalSizeY="0.12405822533146922" PhysicalSizeYUnit="µm" SignificantBits="16" SizeC="1" SizeT="1" SizeX="504" SizeY="504" SizeZ="1" Type="uint16"><Channel AcquisitionMode="LaserScanningConfocalMicroscopy" Color="-1" EmissionWavelength="497.5000000000001" EmissionWavelengthUnit="nm" ExcitationWavelength="405.00000000000006" ExcitationWavelengthUnit="nm" Fluor="DAPI" ID="Channel:0:0" IlluminationType="Epifluorescence" Name="Ch1" SamplesPerPixel="1"><DetectorSettings Binning="1x1" ID="Detector:0:0"/><LightPath/></Channel><TiffData FirstC="0" FirstT="0" FirstZ="0" IFD="0" PlaneCount="1"><UUID FileName="25X_Intensity_bfconvert.ome.tiff">urn:uuid:623a70e4-49dd-4568-bf89-54a3c88f9de5</UUID></TiffData><Plane DeltaT="4971.389150363636" DeltaTUnit="s" PositionX="248.501" PositionXUnit="µm" PositionY="1669.44" PositionYUnit="µm" PositionZ="2368.92" PositionZUnit="µm" TheC="0" TheT="0" TheZ="0"/></Pixels></Image><StructuredAnnotations><XMLAnnotation ID="Annotation:0" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Experiment|AcquisitionBlock|MultiTrackSetup|TrackSetup|Detector|PinholeDiameter</Key><Value>[3.3203800000000002e-005]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:1" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Medium</Key><Value>[Glycerol]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:2" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Channel|VirtualPinholeSize</Key><Value>[1]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:3" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|OriginalScanData</Key><Value>[true]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:4" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Experiment|AcquisitionBlock|AcquisitionModeSetup|FilterSamplingNumber</Key><Value>[4]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:5" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Instrument|LightSource|Power</Key><Value>[30, 5]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:6" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Channel|Fluor</Key><Value>[DAPI]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:7" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Channel|Id</Key><Value>[1514336002132992587129362850843266405811]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:8" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Experiment|AcquisitionBlock|ZStackSetup|Extrapolate</Key><Value>[false]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:9" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Experiment|AcquisitionBlock|AcquisitionModeSetup|SimRotations</Key><Value>[3]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:10" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Instrument|Detector|AmplificationGain</Key><Value>[1]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:11" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Experiment|AcquisitionBlock|AcquisitionModeSetup|HdrEnabled</Key><Value>[false]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:12" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Appliance|Data|ShuttleAndFindData|Calibration|Marker|FocusPosition</Key><Value>[0, 0, 0]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:13" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Experiment|AcquisitionBlock|AcquisitionModeSetup|HdrImagingMode</Key><Value>[0]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:14" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Channel|LaserScanInfo|ZoomY</Key><Value>[5.4390244017451277]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:15" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Channel|LaserScanInfo|ZoomX</Key><Value>[5.4390244017451277]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:16" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Channel|AcquisitionMode</Key><Value>[LaserScanningConfocalMicroscopy]</Value></OriginalMetadata></Value></XMLAnnotation><XMLAnnotation ID="Annotation:17" Namespace="openmicroscopy.org/OriginalMetadata"><Value><OriginalMetadata><Key>Information|Image|Channel|TransformationXY</Key><Value>[102.16015625]</Value></OriginalMetadata></Value></XMLAnnotation>
…
</StructuredAnnotations></OME>
Software: OME Bio-Formats 5.6.0
The extra data here can be viewed in Fiji if you tick the "display metadata" under "Metadata viewing" in the Bio-Formats importer dialogue.
I'm unsure why the Bio-Formats plugin isn't preserving the extended metadata however. I'll look into this inconsistency. For now, I would suggest using bfconvert to preserve the extra metadata.
Kind regards,
Roger