The files are saved as individual .ome.tifs and then there is also a .xml file that contains all of the metadata. The instrument is a Bruker microscope that is running PrairieView software. I’ve attached the .xml file here 197-008_GFP-rGBD_Ect2-dNLS_ArhGAP11a.2_E-001.xml (249.5 KB) .
The exact message I am seeing in Fiji is a bio-formats importer dialogue box that says “Sorry, there was a problem during import”. In the log window, the first line says “loci.formats.FormatException: No metadata for series #47”.
There actually is a full series #47, but the microscope had just started setting up to acquire series #48 when I stopped it, so that’s where the problem lies I think. In the .xml file you can see a short chunk at the end that looks like this:
<Sequence type="TSeries ZSeries Element" cycle="48" time="16:39:18.1167068" bidirectionalZ="False" xYStageGridDefined="False" xYStageGridNumXPositions="4" xYStageGridNumYPositions="4" xYStageGridOverlapPercentage="15" xYStageGridXOverlap="88.2302405498282" xYStageGridYOverlap="88.2302405498282">
<SubindexedValue subindex="0" value="449.8" />
<SubindexedValue subindex="0" value="1959.8" />
<SubindexedValue subindex="0" value="1019.725" />
If you compare this to the cycle #47 above it, you can see that cycle #48 is just a header and there are no frames with it (because I stopped it). If I delete this section of the .xml manually, the bio-formats importer will load the data without a problem. So my current issue is, how to handle this exception without stopping the script, but more long-term, how to avoid/fix it in the future?
This might be a really beginner question, but is there a way to catch a loci formats exception in my script? I tried writing a “try/except” portion, but I think I’m missing some kind of step that lets the code know what a loci.formats.FormatException is. I’m pretty new to coding, and I can’t seem to figure it out!
Thanks so much,