Package for working with OMETIFF files in Julia!

Hi everyone :wave:

I’ve been developing a package for my work that is a pure-Julia parser of OME-TIFF files: https://github.com/tlnagy/OMETIFF.jl and the latest version is up in the registry :rocket: The best part is that Julia will automagically know how to handle OME-TIFF files. So

using FileIO
img = load("load/your/data.ome.tif")

should just work! And you get all the niceties that come with using the Julia Images ecosystem.

Features:

  • Can open a wide-range of OMETIFF files with a special focus on correctness
  • Spatial and temporal axes are annotated with units if available (like μm, s, etc)
  • Channel and position axes use their original names
  • Elapsed times are extracted and returned using the same labeled axes
  • Important metadata is extracted and included in an easy to access format

Example

As you can see, you get loads of metadata and special features just by opening an OME-TIFF file:

julia> using FileIO, Images

julia> img = load("/Users/tamasnagy/Downloads/66perc-h2o-vs-iso_1_MMStack.ome.tif")
Gray ImageMeta with:
  data: 4-dimensional AxisArray{Gray{N0f16},4,...} with axes:
    :y, 0.0 μm:0.6518 μm:666.7914000000001 μm
    :x, 0.0 μm:0.6518 μm:666.7914000000001 μm
    :time, 0.0 ms:15000.0 ms:405000.0 ms
    :position, Symbol[:A5_Site_0, :A5_Site_1, :B5_Site_0, :B5_Site_1]
And data, a 1024×1024×28×4 reshape(reinterpret(Gray{N0f16}, ::Array{UInt16,6}), 1024, 1024, 28, 4) with eltype Gray{Normed{UInt16,16}}
  properties:
    Elapsed_Times: Unitful.Quantity{Float64,𝐓,Unitful.FreeUnits{(s,),𝐓,nothing}}[2.525 s 3.35 s 5.638 s 6.534 s; 15.398 s 16.195 s 18.743 s 19.506 s; … ; 390.389 s 391.154 s 393.282 s 393.984 s; 405.391 s 406.13 s 408.316 s 409.101 s]
    Description: nd4 + nd8 in

And you can you do fancy indexing:

julia> img[Axis{:position}(:A5_Site_1)]; # get a specific slice using the name of the axis

Hopefully, some of you will find this useful and if you run into any bugs or need additional features, please open an issue against the project.

Best,
~Tamas

8 Likes