<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Roger<div class=""><br class=""></div><div class="">The main body of my code can be seen here: <a href="https://cloud.karyotyper.com/s/K9SoEKgLOcbgwTg" class="">https://cloud.karyotyper.com/s/K9SoEKgLOcbgwTg</a> </div><div class=""><br class=""></div><div class="">CaptureImages is essential a sorted ArrayList of CaptureImage</div><div class="">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.</div><div class=""><br class=""></div><div class="">My BioFormatsWriter class interrogates those extra image properties to build the extra metadata.</div><div class=""><br class=""></div><div class="">Because BioFormats has to have all metadata constructed before writing the pixel data, this  BioFormatsWriter simple implementation</div><div class="">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.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">β€” Michael Ellis</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 1 Dec 2016, at 14:58, Roger Leigh <<a href="mailto:rleigh@dundee.ac.uk" class="">rleigh@dundee.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 01/12/16 14:27, Michael Ellis wrote:<br class=""><blockquote type="cite" class="">Dear Roger,<br class=""><br class="">File<br class="">uploaded <a href="https://www.openmicroscopy.org/qa2/qa2/qa/feedback/17455/?token=0d0ad37c09cfdd73ca5c28df3d42e1b0" class="">https://www.openmicroscopy.org/qa2/qa2/qa/feedback/17455/?token=0d0ad37c09cfdd73ca5c28df3d42e1b0</a><br class=""><br class="">I am currently just using Metadata methods to populate my metadata. Can<br class="">you point me in the right direction for adding this TiffData that you<br class="">refer to?<br class=""></blockquote><br class="">If you're creating your images using the FormatWriter API, then TiffData<br class="">elements should be created automatically:<br class=""><br class=""><a href="https://github.com/openmicroscopy/bioformats/blob/develop/components/formats-bsd/src/loci/formats/out/OMETiffWriter.java#L298" class="">https://github.com/openmicroscopy/bioformats/blob/develop/components/formats-bsd/src/loci/formats/out/OMETiffWriter.java#L298</a><br class=""><br class="">This is all appended to the metadata store when the writer is closed,<br class="">and then attached to the TIFF ImageDescription field.<br class=""><br class="">If you're creating images by hand, then you need to use the same<br class="">metadata store calls to do the same.<br class=""><br class="">Since they were already created for your first image, I'm wondering if<br class="">saveBytes wasn't called for the image planes in the second image?  The<br class="">first image has three TiffData elements referring to IFDs 0, 1 and 2.<br class="">There are three IFDs in the TIFF you uploaded.  But the image data for<br class="">the second image is missing--there are no extra IFDs in the TIFF for<br class="">this (I would have expected a further three TiffData elements, and<br class="">another three IFDs).<br class=""><br class="">If you have any code you could show us, I can see if there's any<br class="">critical omission there.  Otherwise, I think it might be sufficient to<br class="">add saveBytes calls for the second image, and it should be fine.<br class=""><br class="">Also, to pick up on invalid TIFF creation, you can run the "xmlvalid"<br class="">tool on the OME-TIFF file, which will highlight anything missing.  In<br class="">the case of your sample file:<br class=""><br class="">% ~/code/bioformats/tools/xmlvalid BioFormat-Mixed.ome.tif<br class="">Parsing schema path<br class="">http://www.openmicroscopy.org/Schemas/OME/2016-06/ome.xsd<br class="">Validating BioFormat-Mixed.ome.tif<br class="">cvc-pattern-valid: Value 'Instrument 1' is not facet-valid with respect<br class="">to pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for<br class="">type 'InstrumentID'.<br class="">cvc-attribute.3: The value 'Instrument 1' of attribute 'ID' on element<br class="">'Instrument' is not valid with respect to its type, 'InstrumentID'.<br class="">cvc-pattern-valid: Value 'EmulatedCamera_0' is not facet-valid with<br class="">respect to pattern<br class="">'(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type<br class="">'DetectorID'.<br class="">cvc-attribute.3: The value 'EmulatedCamera_0' of attribute 'ID' on<br class="">element 'Detector' is not valid with respect to its type, 'DetectorID'.<br class="">cvc-pattern-valid: Value 'Dapi' is not facet-valid with respect to<br class="">pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type<br class="">'FilterID'.<br class="">cvc-attribute.3: The value 'Dapi' of attribute 'ID' on element 'Filter'<br class="">is not valid with respect to its type, 'FilterID'.<br class="">cvc-pattern-valid: Value 'Fitc' is not facet-valid with respect to<br class="">pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type<br class="">'FilterID'.<br class="">cvc-attribute.3: The value 'Fitc' of attribute 'ID' on element 'Filter'<br class="">is not valid with respect to its type, 'FilterID'.<br class="">cvc-identity-constraint.4.2.2: Duplicate key value [EmulatedOpticSet_0]<br class="">declared for identity constraint "FilterIDKey" of element "OME".<br class="">cvc-pattern-valid: Value 'TxRed' is not facet-valid with respect to<br class="">pattern '(urn:lsid:([\w\-\.]+\.[\w\-\.]+)+:\S+:\S+)|(\S+:\S+)' for type<br class="">'FilterID'.<br class="">cvc-attribute.3: The value 'TxRed' of attribute 'ID' on element 'Filter'<br class="">is not valid with respect to its type, 'FilterID'.<br class="">cvc-identity-constraint.4.2.2: Duplicate key value [EmulatedOpticSet_0]<br class="">declared for identity constraint "FilterIDKey" of element "OME".<br class="">cvc-complex-type.2.4.b: The content of element 'Pixels' is not complete.<br class="">One of '{"http://www.openmicroscopy.org/Schemas/OME/2016-06":Channel,<br class="">"http://www.openmicroscopy.org/Schemas/OME/2016-06":BinData,<br class="">"http://www.openmicroscopy.org/Schemas/OME/2016-06":TiffData,<br class="">"http://www.openmicroscopy.org/Schemas/OME/2016-06":MetadataOnly}' is<br class="">expected.<br class="">Error validating document: 13 errors found<br class=""><br class="">so this can be quite useful in determining if there are any problems<br class="">with the metadata being set.<br class=""><br class=""><br class="">Regards,<br class="">Roger<br class=""><br class="">--<br class="">Dr Roger Leigh -- Open Microscopy Environment<br class="">Wellcome Trust Centre for Gene Regulation and Expression,<br class="">College of Life Sciences, University of Dundee, Dow Street,<br class="">Dundee DD1 5EH Scotland UK   Tel: (01382) 386364<br class=""><br class="">The University of Dundee is a registered Scottish Charity, No: SC015096<br class="">_______________________________________________<br class="">ome-devel mailing list<br class="">ome-devel@lists.openmicroscopy.org.uk<br class="">http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-devel<br class=""></div></div></blockquote></div><br class=""><div class="">
<div style="text-align: right;" class="">Michael Ellis (Managing Director)</div><div style="text-align: right;" class="">Digital Scientific UK Ltd.</div><div style="text-align: right;" class=""><a href="http://www.dsuk.biz" class="">http://www.dsuk.biz</a></div><div style="text-align: right;" class=""><a href="mailto:michael.ellis@dsuk.biz" class="">michael.ellis@dsuk.biz</a></div><div style="text-align: right;" class="">tel: +44(0)1223 911215</div><div style="text-align: right;" class=""><br class=""></div><div style="text-align: right;" class="">The Commercial Centre</div><div style="text-align: right;" class="">6 Green End</div><div style="text-align: right;" class="">Cambridge</div><div style="text-align: right;" class="">CB23 7DY</div>

</div>
<br class=""></div></body></html>