[ome-devel] Is OME-TIF file with 2 image series of different pixel types supported?
Michael Ellis
michael.ellis at dsuk.biz
Thu Dec 1 15:26:20 GMT 2016
Dear Roger
The main body of my code can be seen here: https://cloud.karyotyper.com/s/K9SoEKgLOcbgwTg <https://cloud.karyotyper.com/s/K9SoEKgLOcbgwTg>
CaptureImages is essential a sorted ArrayList of CaptureImage
CapturedImage is a BufferImage that has a Map<String, Object> associated with it for additional image properties such as channel name, colour, stage position, exposure time etc.
My BioFormatsWriter class interrogates those extra image properties to build the extra metadata.
Because BioFormats has to have all metadata constructed before writing the pixel data, this BioFormatsWriter simple implementation
construct all the metadata as each image series is added with the addSeries() method, and then actually writes the images data when it gets to the close() method.
Some pointers in regards to what “is not facet-valid with respect to pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)’” would be much appreciated too.
— Michael Ellis
> On 1 Dec 2016, at 14:58, Roger Leigh <rleigh at dundee.ac.uk> wrote:
>
> On 01/12/16 14:27, Michael Ellis wrote:
>> Dear Roger,
>>
>> File
>> uploaded https://www.openmicroscopy.org/qa2/qa2/qa/feedback/17455/?token=0d0ad37c09cfdd73ca5c28df3d42e1b0
>>
>> I am currently just using Metadata methods to populate my metadata. Can
>> you point me in the right direction for adding this TiffData that you
>> refer to?
>
> If you're creating your images using the FormatWriter API, then TiffData
> elements should be created automatically:
>
> https://github.com/openmicroscopy/bioformats/blob/develop/components/formats-bsd/src/loci/formats/out/OMETiffWriter.java#L298
>
> This is all appended to the metadata store when the writer is closed,
> and then attached to the TIFF ImageDescription field.
>
> If you're creating images by hand, then you need to use the same
> metadata store calls to do the same.
>
> Since they were already created for your first image, I'm wondering if
> saveBytes wasn't called for the image planes in the second image? The
> first image has three TiffData elements referring to IFDs 0, 1 and 2.
> There are three IFDs in the TIFF you uploaded. But the image data for
> the second image is missing--there are no extra IFDs in the TIFF for
> this (I would have expected a further three TiffData elements, and
> another three IFDs).
>
> If you have any code you could show us, I can see if there's any
> critical omission there. Otherwise, I think it might be sufficient to
> add saveBytes calls for the second image, and it should be fine.
>
> Also, to pick up on invalid TIFF creation, you can run the "xmlvalid"
> tool on the OME-TIFF file, which will highlight anything missing. In
> the case of your sample file:
>
> % ~/code/bioformats/tools/xmlvalid BioFormat-Mixed.ome.tif
> Parsing schema path
> http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd
> Validating BioFormat-Mixed.ome.tif
> cvc-pattern-valid: Value 'Instrument 1' is not facet-valid with respect
> to pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for
> type 'InstrumentID'.
> cvc-attribute.3: The value 'Instrument 1' of attribute 'ID' on element
> 'Instrument' is not valid with respect to its type, 'InstrumentID'.
> cvc-pattern-valid: Value 'EmulatedCamera_0' is not facet-valid with
> respect to pattern
> '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type
> 'DetectorID'.
> cvc-attribute.3: The value 'EmulatedCamera_0' of attribute 'ID' on
> element 'Detector' is not valid with respect to its type, 'DetectorID'.
> cvc-pattern-valid: Value 'Dapi' is not facet-valid with respect to
> pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type
> 'FilterID'.
> cvc-attribute.3: The value 'Dapi' of attribute 'ID' on element 'Filter'
> is not valid with respect to its type, 'FilterID'.
> cvc-pattern-valid: Value 'Fitc' is not facet-valid with respect to
> pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type
> 'FilterID'.
> cvc-attribute.3: The value 'Fitc' of attribute 'ID' on element 'Filter'
> is not valid with respect to its type, 'FilterID'.
> cvc-identity-constraint.4.2.2: Duplicate key value [EmulatedOpticSet_0]
> declared for identity constraint "FilterIDKey" of element "OME".
> cvc-pattern-valid: Value 'TxRed' is not facet-valid with respect to
> pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type
> 'FilterID'.
> cvc-attribute.3: The value 'TxRed' of attribute 'ID' on element 'Filter'
> is not valid with respect to its type, 'FilterID'.
> cvc-identity-constraint.4.2.2: Duplicate key value [EmulatedOpticSet_0]
> declared for identity constraint "FilterIDKey" of element "OME".
> cvc-complex-type.2.4.b: The content of element 'Pixels' is not complete.
> One of '{"http://www.openmicroscopy.org/Schemas/OME/2016-06":Channel,
> "http://www.openmicroscopy.org/Schemas/OME/2016-06":BinData,
> "http://www.openmicroscopy.org/Schemas/OME/2016-06":TiffData,
> "http://www.openmicroscopy.org/Schemas/OME/2016-06":MetadataOnly}' is
> expected.
> Error validating document: 13 errors found
>
> so this can be quite useful in determining if there are any problems
> with the metadata being set.
>
>
> Regards,
> Roger
>
> --
> Dr Roger Leigh -- Open Microscopy Environment
> Wellcome Trust Centre for Gene Regulation and Expression,
> College of Life Sciences, University of Dundee, Dow Street,
> Dundee DD1 5EH Scotland UK Tel: (01382) 386364
>
> The University of Dundee is a registered Scottish Charity, No: SC015096
> _______________________________________________
> ome-devel mailing list
> ome-devel at lists.openmicroscopy.org.uk
> http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel
Michael Ellis (Managing Director)
Digital Scientific UK Ltd.
http://www.dsuk.biz <http://www.dsuk.biz/>
michael.ellis at dsuk.biz
tel: +44(0)1223 911215
The Commercial Centre
6 Green End
Cambridge
CB23 7DY
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20161201/1ee786d0/attachment.html>
More information about the ome-devel
mailing list