Leica lif import

Hello: I’ve tried a few searches for this and didn’t find much I can understand. I’m trying to get Leica lif files into Fiji. These are x/y tiles z stacks in 4 colors. The best I have been able to do is get Fiji to open several hundred individual files, but I am not sure how to go about assembling these… Does anyone have simple instructions for what I am trying to do? thanks for your help. Howard

Try the Grid/Collection Stitching plugin. It specializes in assembling mosaics from many individual tiles. And it uses Bio-Formats under the hood when opening your data, so it should work with LIF files.

The problem I think it that the lif format saves all acquisitions from a single session as one file. This plugin requires manual entry of data such as x/y grid size that will generally differ for each acquisition. Not sure hwo to deal with this.

The plugin should read it from the metadata if you use the “Positions from file” type with “Defined by image metadata” order. Here is the protocol used here in my lab:

  1. Plugins :arrow_forward: Stitching :arrow_forward: Grid/Collection stitching
  2. Choose Type: Positions from file
  3. Choose Order: Defined by image metadata
  4. Click OK
  5. On next dialog, click Browse and select a file from your dataset (for Prairie data it is best to select the XML or CFG file)
  6. Select a Fusion method (e.g., Linear Blending looks nice but is slower and obfuscates where tiles are joined)
  7. Uncheck “Compute overlap” (for Prairie or WiscScan data, the coordinates are already accurate enough)
  8. Reduce the “Increase overlap” slider to 0
  9. Uncheck “Subpixel accuracy”
  10. If your data is too large for computer memory, check the “Use virtual input images” box
  11. Click OK and wait

Description taken from this page.

Thank you Curtis! I was very excited when it looked like this would open them, but then I got this message:

“ERROR: Some images are 2d, some are 3d … cannot proceed”

I have to say these proprietary formats are a real PITA.

So, how is your data structured internally within the LIF file, then? What are you interested in doing? Stitching all 2D tiles? Or stitching all 3D stacks? Or something else?

I wish I could tell you about the internal structure, but I have no information on that. Usually there will be a preliminary xy scan to make sure the boundaries are properly set, etc. This is stored in the same lif file as the subsequent xyz scan, as will any single tiles, and any additional regions will have the same things. Leica gives you no way to break up the lif file…

So it sounds like what you really want, then, is to stitch the xyz scan, and ignore the xy-only data. Yeah? If so, we can probably enhance the Stitching plugin to allow that fairly easily.

Do you have a sample non-working dataset you could share (privately is fine if needed)? It would really help with testing.

Seriously? Of course! I can send you a dropbox link or however you want to do it.

Ignoring the xy only is OK, or processing it. There may be times when both are useful, but I’m not picky and certainly the xyz is most important.