Aicsimageio

Latest version: v4.14.0

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 5

4.3.0

This release has been published to begin the process of managing some of our dependencies and their licenses.

AICSImageIO is built off of many independent file format readers, each with their own licensing. For many of our supported formats, the library that provides us the capability to read the format is licensed under a permissive license such as MIT or BSD. However, some of our formats are released under GPL licenses. Previously, AICSImageIO has included all of these dependencies in our pip extra install options, and released our package under BSD license. However, after our latest release, we received push-back on this practice and as such, we have begun the process of stripping out the specific installation of GPL licensed dependencies.

This does not mean that AICSImageIO no longer supports the various file formats covered by GPL license. We still do, however we will no longer provide a pip extra install option for such formats and we will include specific reference to readers that utilize such GPL licenses.

In this release, the two readers that have had their extra install options removed are:
* `LifReader` -- was installed with `pip install aicsimageio[lif]` but must now be installed with `pip install aicsimageio readlif>=0.6.4`
* `BioformatsReader` -- was installed with `pip install aicsimageio[bioformats]` but must now be installed with `pip install aicsimageio bioformats_jar`

Both `readlif` and `bioformats_jar` are completely separate libraries that carry with them their own GPL licenses and as such, if you use either of these readers, be sure to see how your code should now be licensed and add these libraries to your own dependency list because our install option is no longer available.

Moving forward, we plan to use this same installation pattern for any more GPL licensed file format readers. AICSImageIO will make them generally available, but will document that the downstream user must install both `aicsimageio` and the supporting file format library independent so that AICSImageIO remains BSD licensed.

Changelog

* Support for reading LIF files must now be installed separately due to licensing conflicts. (`pip install aicsimagieo readlif>=0.6.4`) 332
* Support for reading Bio-Formats supported files must now be installed separately due to licensing conflicts. (`pip install aicsimageio bioformats_jar`) 329
* More detailed error message and documentation on how to configure BioFormats reading. 324
* Shortened reader import paths for any reader. 326

To review all changes made in this release please see our full [CHANGELOG](https://allencellmodeling.github.io/aicsimageio/CHANGELOG.html).

Contributors and Reviewers this Release (alphabetical)
Chris Allan (chris-allan)
Sébastien Besson (sbesson)
Jackson Maxfield Brown (JacksonMaxfield)
Talley Lambert (tlambert03)
Josh Moore (joshmoore)
Peter Sobolewski (psobolewskiPhD)
Madison Swain-Bowden (AetherUnbound)
Jason Swedlow (jrswedlow)
Dan Toloudis (toloudis)

4.2.0

We are happy to announce the release of AICSImageIO 4.2.0!

AICSImageIO is a library for image reading, metadata conversion, and image writing for microscopy formats in ~pure~ Python. It aims to be able to read microscopy images into a single unified API regardless of size, format, or location, while additionally writing images and converting metadata to a standard common format.

If you are new to the library, please see our full [documentation](https://allencellmodeling.github.io/aicsimageio/) for always up-to-date usage and a quickstart README.

Highlights

Bio-Formats Support
Breaking with our "reading and writing for microscopy formats in _pure Python_", and with a massive thanks to tlambert03, we now support reading any file format supported by [Bio-Formats](https://docs.openmicroscopy.org/bio-formats/6.7.0/supported-formats.html).

python
from aicsimageio import AICSImage

nd2_img = AICSImage("my-file.nd2")
dv_img = AICSImage("my-file.dv")
oir_img = AICSImage("my-file.oir")


Just like our other readers, to add this additional file format support you will need to install with `pip install aicsimageio[bioformats]`.
_Note: ensure that you have the Java executable available on your PATH, or exposed with the JAVA_HOME environment variable. Adding Java to a conda virtual environment can be done with `conda install -c conda-forge openjdk`.)_

For formats that can be read by both a native Python reader and the Bio-Formats reader, the native Python reader will always take precidence unless it has not been installed. I.e. CZI support can be added with either `pip install aicsimageio[czi]` or `pip install aicsimageio[bioformats]`, if both are installed, our native Python reader will take precidence. The different readers may result in different pixel and metadata availablity. For full control over this behavior, specify the `reader` as a parameter.

python
from aicsimageio import AICSImage
from aicsimageio.readers.bioformats_reader import BioformatsReader
from aicsimageio.readers.czi_reader import CziReader

img_from_native = AICSImage("my-file.czi", reader=CziReader)
img_from_bf = AICSImage("my-file.czi", reader=BioformatsReader)


Contributing Documentation

Aren't satisfied with the available options for image reading? Want to contribute to the project? Our updated Contributing documentation has an entire section on [adding a new file format reader](https://allencellmodeling.github.io/aicsimageio/CONTRIBUTING.html#adding-a-new-custom-reader).

We look forward to the continued growth of AICSImageIO in the community!

Experimental CZI-to-OME Metadata

For those following our experiments into ["language agnostic methods for metadata translation and access"](https://github.com/AllenCellModeling/czi-to-ome-xslt) we have added experimental support for translating CZI metadata into OME metadata.

python
from aicsimageio import AICSImage

img = AICSImage("my-file.czi")
img.ome_metadata


You can find a comparison between the produced metadata from our XSLT and the produced metadata from Bio-Formats [here](https://github.com/AllenCellModeling/czi-to-ome-xslt/tree/main/docs/comparison). This is experimental, it is missing some metadata translations and may raise errors, however if you would like to try out this feature (or the XSLT itself in another language) please let us know how it goes.

Contributors and Reviewers this Release (alphabetical)
Matte Bailey (MatteBailey)
Sébastien Besson (sbesson)
Jackson Maxfield Brown (JacksonMaxfield)
Talley Lambert (tlambert03)
Josh Moore (joshmoore)
Madison Swain-Bowden (AetherUnbound)
Dan Toloudis (toloudis)

4.1.0

This minor release includes:

* A specification for readers to convert the file format's metadata into the OME metadata model.
* A utility function to process metadata translation with XSLT.
* A bugfix to support `tifffile>=2021.7.30`. This is a breaking change only if you are using `img.xarray_data.attrs["unprocessed"]` (or any `xarray_*` variant). It changes the `"unprocessed"` metadata into a `Dict[int , str]` rather than a `tifffile.TiffTags` object.
* A minor breaking change / bugfix for LIF scale metadata correction. LIF spatial scales should now be accurate.
* An admin change of being less strict on dependencies so that `aicsimageio` can be installed in more environments.

For links to the PRs that produced these changes, see our full [CHANGELOG](https://allencellmodeling.github.io/aicsimageio/CHANGELOG.html)

Contributors and Reviewers this Release (alphabetical)
Matte Bailey (MatteBailey)
Jackson Maxfield Brown (JacksonMaxfield)
Madison Swain-Bowden (AetherUnbound)
Dan Toloudis (toloudis)

4.0.0

We are happy to announce the release of AICSImageIO 4.0.0!

AICSImageIO is a library for image reading, metadata conversion, and image writing for microscopy formats in pure Python. It aims to be able to read microscopy images into a single unified API regardless of size, format, or location, while additionally writing images and converting metadata to a standard common format.

A lot has changed and this post will only have the highlights. If you are new to the library, please see our full [documentation](https://allencellmodeling.github.io/aicsimageio/) for always up-to-date usage and a quickstart README.

Highlights

Mosaic Tile Stitching
For certain imaging formats we will stitch together the mosaic tiles stored in the image prior to returning the data. Currently the two formats supported by this functionality are `LIF` and `CZI`.

python
from aicsimageio import AICSImage

stitched_image = AICSImage("tiled.lif")
stitched_image.dims very large Y and X


_If you don't want the tiles to be stitched back together you can turn this functionality off with `reconstruct_mosaic=False` in the `AICSImage` object init._

Xarray

The entire library now rests on [xarray](http://xarray.pydata.org/en/stable/index.html). We store all metadata, coordinate planes, and imaging data all in a single `xarray.DataArray` object. This allows for not only selecting by indices with the already existing `aicsimageio` methods: `get_image_data` and `get_image_dask_data`, but additionally to select by coordinate planes.

Mosaic Images and Xarray Together

A prime example of where xarray can be incredibly powerful for microscopy images is in large mosaic images. For example, instead of selecting by index, with `xarray` you can select by spatial coordinates:

python
from aicsimageio import AICSImage

Read and stitch together a tiled image
large_stitched_image = AICSImage("tiled.lif")

Only load in-memory the first 300x300 micrometers (or whatever unit) in Y and X dimensions
larged_stitched_image.xarray_dask_data.loc[:, :, :, :300, :300].data.compute()



Writers
While we are actively working on metadata translation functions, in the meantime we are working on setting ourselves up for the easiest method for format converstion. For now, we have added a simple `save` function to the `AICSImage` object that will convert the pixel data and key pieces of metadata to OME-TIFF for all of (or a select set of) scenes in the file.

python
from aicsimageio import AICSImage

AICSImage("my_file.czi").save("my_file.ome.tiff")


For users that want greater flexibility and specificity in image writing, we have entirely reworked our writers module and this release contains three writers: `TwoDWriter`, `TimeseriesWriter`, and `OmeTiffWriter`. The objective of this rework was to make n-dimensional image writing much easier, and most importantly, to make metadata attachment as simple as possible. And, we now support multi-scene / multi-image OME-TIFF writing when providing a `List[ArrayLike]`. See full writer documentation [here](https://allencellmodeling.github.io/aicsimageio/aicsimageio.writers.html).

OME Metadata Validation
Our `OmeTiffReader` and `OmeTiffWriter` now validate the read or produced OME metadata. Thanks to the [ome-types](https://github.com/tlambert03/ome-types) library for the heavy lifting, we can now ensure that all metadata produced by this library is valid to the OME specification.

Better Scene Management
Over time while working with 3.x, we found that many formats contain a `Scene` or `Image` dimension that can be entirely different from the other instances of that dimension in pixel type, channel naming, image shape, etc. To solve this we have changed the `AICSImage` and `Reader` objects to statefully manage `Scene` while all other dimensions are still available.

In practice, this means on the `AICSImage` and `Reader` objects the user no longer receives the `Scene` dimension back in the `data` or `dimensions` properties (or any other related function or property).

To change scene while operating on a file you can call `AICSImage.set_scene(scene_id)` while retrieving which scenes are valid by using `AICSImage.scenes`.

python
from aicsimageio import AICSImage

many_scene_img = AICSImage("my_file.ome.tiff")
many_scene_img.current_scene the current operating scene
many_scene_img.scenes returns tuple of available scenes
many_scene_img.set_scene("Image:2") sets the current operating scene to "Image:2"


RGB / BGR Support
Due to the scene management changes, we no longer use the `"S"` dimension to represent "Scene". We use it to represent the "Samples" dimension (RGB / BGR) which means we now have an isolated dimension for color data. This is great because it allows us to directly support multi-channel RGB data, where previously we would expand RGB data into channels, even when the file had a channel dimension.

So if you encounter a file with `"S"` in the dimensions, you can know that you are working with an RGB file.

FSSpec Adoption
Across the board we have adopted [fsspec](https://github.com/intake/filesystem_spec) for file handling. With 4.x you can now provide any URI supported by the `fsspec` library or any implementations of `fsspec` ([s3fs (AWS S3)](https://github.com/dask/s3fs), [gcsfs (Google Cloud Storage)](https://github.com/dask/gcsfs), [adlfs (Azure Data Lake)](https://github.com/dask/adlfs), etc.).

In many cases, this means we now support direct reading from local or remote data as a base part of our API. _As well as preparing us for supporting OME-Zarr!_

python
from aicsimageio import AICSImage

wb_img = AICSImage("https://www.your-site.com/your-file.ome.tiff")
s3_img = AICSImage("s3://your-bucket/your-dir/your-file.ome.tiff")
gs_img = AICSImage("gs://your-bucket/your-dir/your-file.ome.tiff")


To read from remote storage, you must install the related `fsspec` implementation library. For `s3` for example, you must install `s3fs`.

Splitting up Dependencies

To reduce the size of AICSImageIO on fresh installs and to make it easier to manage environments, we have split up dependencies into specific format installations.

By default, `aicsimageio` supports `TIFF` and `OME-TIFF` reading and writing. If you would like to install support for reading CZI files, you would simply append `[czi]` to the `aicsimageio` pip install: `pip install aicsimageio[czi]`. For multiple formats, you would add them as a comma separated string: `pip install aicsimageio[czi,lif]`. And to simply install support for reading all format implentations: `pip install aicsimageio[all]`.

A full list of supported formats can be found [here](https://github.com/AllenCellModeling/aicsimageio/blob/main/setup.py#L11).

Roadmap and Motivation
After many discussions with the community we have finally written a roadmap and accompanying documentation for the library. If you are interested, please feel free to read them. [Roadmap and Accompanying Documentation](https://allencellmodeling.github.io/aicsimageio/ROADMAP.html)

Full List of Changes
* Added support for reading all image data (including metadata and coordinate information) into `xarray.DataArray` objects. This can be accessed with `AICSImage.xarray_data`, `AICSImage.xarray_dask_data`, or `Reader` equivalents. Where possible, we create and attach coordinate planes to the `xarray.DataArray` objects to support more options for indexed data selection such as timepoint selection by unit of time, or pixel selection by micrometers.
* Added support for reading multi-channel RGB imaging data utilizing a new `Samples` (`S`) dimension. This dimension will only appear in the `AICSImage`, `Reader`, and the produced `np.ndarray`, `da.Array`, `xr.DataArray` if present in the file and will be the last dimension, i.e. if provided an RGB image, `AICSImage` and related object dimensions will be `"...YXS"`, if provided a single sample / greyscale image, `AICSImage` and related object dimensions will be `"...YX"`. (This change also applies to `DefaultReader` and PNG, JPG, and similar formats)
* `OmeTiffReader` now validates the found XML metadata against the referenced specification. If your file has invalid OME XML, this reader will fail and roll back to the base `TiffReader`. (In the process of updating this we found many bugs in our 3.x series `OmeTiffWriter`, our 4.x `OmeTiffReader` fixes these bugs at read time but that doesn't mean the file contains _valid_ OME XML. It is recommended to upgrade and start using the new and improved, _and validated_, `OmeTiffWriter`.)
* `DefaultReader` now fully supports reading "many-image" formats such as GIF, MP4, etc.
* `OmeTiffReader.metadata` is now returned as the `OME` object from [ome-types](https://github.com/tlambert03/ome-types). This change additionally removes the `vendor.OMEXML` object.
* Dimensions received an overhaul -- when you use `AICSImage.dims` or `Reader.dims` you will be returned a `Dimensions` object. Using this object you can get the native order of the dimensions and each dimensions size through attributes, i.e. `AICSImage.dims.X` returns the size of the `X` dimension, `AICSImage.dims.order` returns the string native order of the dimensions such as `"TCZYX"`. Due to these changes we have removed all `size` functions and `size_{dim}` properties from various objects.
* Replaced function `get_physical_pixel_size` with attribute `physical_pixel_sizes` that returns a new `PhysicalPixelSizes` `NamedTuple` object. This now allows attribute axis for each physical dimension, i.e. `PhysicalPixelSizes.X` returns the size of each `X` dimension pixel. This object can be cast to a base `tuple` but be aware that we have reversed the order from `XYZ` to `ZYX` to match the rest of the library's standard dimension order. Additionally, `PhysicalPixelSizes` now defaults to `(None, None, None)` (was `(1.0, 1.0, 1.0)`)as pixel physical size is optional in the OME metadata schema.
* Replaced parameters named `known_dims` with `dim_order`.
* Replaced function `get_channel_names` with attribute `channel_names`.
* Replaced function `dtype` with attribute `dtype`.
* Renamed the `chunk_by_dims` parameter on all readers to just `chunk_dims`.
* Removed all `distributed` cluster and client spawning.
* Removed context manager usage from all objects.

Contributors and Reviewers this Release (alphabetical)
Jackson Maxfield Brown (JacksonMaxfield)
Ramón Casero (rcasero)
Julie Cass (jcass11)
Jianxu Chen (jxchen01)
Bryant Chhun (bryantChhun)
Rory Donovan-Maiye (donovanr)
Christoph Gohlke (cgohlke)
Josh Moore (joshmoore)
Sebastian Rhode (sebi06)
Jamie Sherman (heeler)
Madison Swain-Bowden (AetherUnbound)
Dan Toloudis (toloudis)
Matheus Viana (vianamp)

3.3.0

We are happy to announce the release of AICSImageIO 3.3.0!

AICSImageIO is a library for delayed parallel image reading, metadata parsing, and image writing for microscopy formats in pure Python. It is built on top of Dask to allow for any size image to act as a normal array as well as allow for distributed reading in parallel on your local machine or an HPC cluster.

Highlights

Non-Dask Functions and Properties are Fully In-Memory
The only change made in this release is to the internal behavior of our API. We found that users were very confused and questioned why certain operations were incredible slow while others were incredibly fast when considering the behaviors together.

Specifically, why did the following:
python
img = AICSImage("my_file.ome.tiff")
img.data
my_chunk = img.get_image_data("ZYX", C=1) the actual data we want to retrieve


Complete faster than this:
python
img = AICSImage("my_file.ome.tiff")
my_chunk = img.get_image_data("ZYX", C=1) the actual data we want to retrieve


(the difference being: preloading the _entire_ image into memory rather than the `get_image_data` function simply using the delayed array)

To resolve this we have made an internal change to the behavior of the library that we will hold consistent moving forward.
If the word `dask` is **not** found in the function or property name when dealing with image data, the entire image will be read into memory in full prior to the function or property completing it's operation.

_* In essence this is simply moving that preload into any of the related functions and properties._

**The end result is that the user should see much faster read times when using `get_image_data`.**
If the user was using this function on a too-large-for-memory image, this will result in them having to change over to using `get_image_dask_data` and call `.compute` on the returned value.

Contributors and Reviewers this Release (alphabetical)

Madison Bowden (AetherUnbound)
Jackson Maxfield Brown (JacksonMaxfield)
Jamie Sherman (heeler)
Dan Toloudis (toloudis)

3.2.0

We are happy to announce the release of AICSImageIO 3.2.0!

AICSImageIO is a library for delayed parallel image reading, metadata parsing, and image writing for microscopy formats in pure Python. It is built on top of Dask to allow for any size image to act as a normal array as well as allow for distributed reading in parallel on your local machine or an HPC cluster.

Highlights

LifReader

We now support reading 6D STCZYX Leica Image Files (LIF) and their metadata. Like all readers, this is implemented in a way that can be used to read and interact with any size file.

python
from aicsimageio import AICSImage, readers, imread
img = AICSImage("my_file.lif")
img = readers.LifReader("my_file.lif")
data = imread("my_file.lif")


Optimized Readers

After releasing v3.1.0, we noticed that our single threaded full image read performance wasn't as fast as the base file readers or similar microscopy file readers (`czifile`, `tifffile`, `imageio`, etc.) and set about resolving and optimizing our readers.

We are happy to report that in release v3.2.0 we now have comparable single threaded performance to similar libraries. And, like before, single threaded reading, regardless of library is beaten out when using a distributed cluster for parallel reading.

![aicsimageio read time benchmarks](https://allencellmodeling.github.io/aicsimageio/_static/benchmarks/3.1.4-feature.optimize_readers-primary.png)

See our documentation on [benchmarks](https://allencellmodeling.github.io/aicsimageio/benchmarks.html) for more information.

napari-aicsimageio

We were so excited for [napari's 0.3.0 release](https://github.com/napari/napari/releases/tag/v0.3.0) that we may have made a plugin early. If you haven't seen it, [`napari-aicsimageio`](https://github.com/AllenCellModeling/napari-aicsimageio) has also been released!

`pip install napari-aicsimageio`

By simply installing the plugin you get both a delayed and in-memory version of `aicsimageio` to use in `napari` so you get all the benefits of `aicsimageio` in the wonderful application that is `napari`.

Other Additions and Changes

* Allow sequences and iterables to be passed to `AICSImage.get_image_data` and related functions

python
from aicsimageio import AICSImage

img = AICSImage("my_file.czi")
data = img.get_image_data("CZYX", S=0, T=0, Z=slice(0, -1, 5)) get every fifth Z slice
data = img.get_image_data("CZYX", S=0, T=0, Z=[0, -1]) get first and last Z slices


* Fix written out OME metadata to support loading in ZEN
* Various package maintenance tasks
* Convert package to use Black formatting
* Update PR template for easier introduction to contributing
* Move test resources to S3

Contributors and Reviewers this Release (alphabetical)

Madison Bowden (AetherUnbound)
Jackson Maxfield Brown (JacksonMaxfield)
Jamie Sherman (heeler)
Dan Toloudis (toloudis)

Page 4 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.