forked from multiview-stitcher/multiview-stitcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved docs content and updated configuration
- Loading branch information
Showing
8 changed files
with
228 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,63 @@ | ||
# Data formats | ||
|
||
For use with `multiview-stitcher`, data needs to be transformed into a [modified `multiscaleimage.MultiscaleImage`](./objects/#image). | ||
!!! note | ||
`multiview-stitcher` works with any numpy-like input arrays. Therefore, as long as the data can be read into a numpy array, it can be used with `multiview-stitcher`. | ||
|
||
## TIFF | ||
For attaching metadata to arrays, multiview-stitcher works with [SpatialImage](https://github.com/spatial-image/spatial-image) objects (with additional transform matrices attached). They can be constructed from Numpy, Dask or CuPy arrays as such: | ||
|
||
Manual reading of tif files is supported with a convenience function. | ||
```python | ||
from multiview_stitcher import spatial_image_utils as si_utils | ||
sim = si_utils.get_sim_from_array( | ||
tile_array, | ||
dims=["c", "y", "x"], | ||
scale={'y': 0.5, 'x': 0.5}, | ||
translation={"y": 30, "x": 50}, | ||
transform_key="stage_metadata", | ||
c_coords=['DAPI', 'GFP'], | ||
) | ||
``` | ||
|
||
## CZI | ||
A multiscale version of this object is represented by instances of [MultiscaleSpatialImage](https://github.com/spatial-image/multiscale-spatial-image), which can be created as such: | ||
|
||
Mosaic czi file support thanks to [aicsimageio]. | ||
```python | ||
from multiview_stitcher import msi_utils | ||
msim = msi_utils.get_msim_from_sim(sim, scale_factors=[2, 4]) | ||
``` | ||
|
||
## LIF | ||
The following code can be used to extract a given scale from a multiscale image: | ||
|
||
Mosaic lif file support thanks to [aicsimageio]. | ||
```python | ||
sim = msi_utils.get_sim_from_msim(msim, scale="scale0") | ||
``` | ||
|
||
## NGFF | ||
|
||
Support provided by `multiscaleimage.MultiscaleImage`. | ||
## OME-Zarr | ||
|
||
The latest NGFF spec does not fully support the transformations required for stitching applications (yet). Therefore, `multiview-stitcher` currently defines its own data format, see [here](features/Coordinate systems). | ||
!!! note | ||
NGFF 0.4 (the latest OME-Zarr standard) currently only supports translation transformations. Therefore, affine transformations cannot yet be stored in OME-Zarr files. | ||
|
||
Some support for reading and writing OME-Zarrs is provided by [multiscaleimage.MultiscaleImage](https://github.com/spatial-image/multiscale-spatial-image). | ||
|
||
Further, `multiview_stitcher.ngff_utils` provides some convenience functions for reading and writing OME-Zarrs using [`ngff-zarr`](https://github.com/thewtex/ngff-zarr). | ||
|
||
|
||
## Further file formats | ||
|
||
[`bioio`](https://github.com/bioio-devs/bioio) is a very convenient library for reading a large variety of image files and it includes support for lazy loading. Here's example code of how to use `bioio` to load an image file into a tile compatible with `multiview-stitcher`: | ||
|
||
```python | ||
import bioio | ||
from multiview_stitcher import spatial_image_utils as si_utils | ||
|
||
# use bioio to load the image as a xarray.DataArray | ||
bioio_xr = BioImage("my_file.tiff").get_xarray_dask_stack().squeeze() | ||
|
||
sim = si_utils.get_sim_from_array( | ||
bioio_xr.data, | ||
dims=bioio_xr.dims, | ||
scale=si_utils.get_spatial_dims_from_sim(bioio_xr), | ||
translation=si_utils.get_origin_from_sim(bioio_xr), | ||
c_coords=bioio_xr.coords["c"].values, | ||
transform_key="stage_metadata", | ||
) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,84 @@ | ||
astor==0.8.1 | ||
Babel==2.13.0 | ||
certifi==2023.7.22 | ||
charset-normalizer==3.3.0 | ||
appnope==0.1.4 | ||
asttokens==2.4.1 | ||
attrs==24.2.0 | ||
babel==2.16.0 | ||
backcall==0.2.0 | ||
beautifulsoup4==4.12.3 | ||
bleach==6.1.0 | ||
certifi==2024.8.30 | ||
charset-normalizer==3.4.0 | ||
click==8.1.7 | ||
colorama==0.4.6 | ||
decorator==5.1.1 | ||
defusedxml==0.7.1 | ||
docopt==0.6.2 | ||
EditorConfig==0.12.4 | ||
executing==2.1.0 | ||
fastjsonschema==2.20.0 | ||
ghp-import==2.1.0 | ||
griffe==0.36.5 | ||
idna==3.4 | ||
Jinja2==3.1.3 | ||
Mako==1.2.4 | ||
Markdown==3.5 | ||
MarkupSafe==2.1.3 | ||
griffe==1.4.1 | ||
idna==3.10 | ||
importlib_metadata==8.5.0 | ||
importlib_resources==6.4.5 | ||
ipython==8.12.3 | ||
jedi==0.19.1 | ||
Jinja2==3.1.4 | ||
jsbeautifier==1.15.1 | ||
jsonschema==4.23.0 | ||
jsonschema-specifications==2024.10.1 | ||
jupyter_client==8.6.3 | ||
jupyter_core==5.7.2 | ||
jupyterlab_pygments==0.3.0 | ||
Markdown==3.7 | ||
MarkupSafe==3.0.1 | ||
matplotlib-inline==0.1.7 | ||
mergedeep==1.3.4 | ||
mike==1.1.2 | ||
mkdocs==1.5.3 | ||
mkdocs-autorefs==0.5.0 | ||
mkdocs-material==9.4.5 | ||
mkdocs-material-extensions==1.2 | ||
mkdocstrings==0.23.0 | ||
mkdocstrings-python==1.7.3 | ||
mkgendocs==0.9.2 | ||
packaging==23.2 | ||
paginate==0.5.6 | ||
pathspec==0.11.2 | ||
pip==23.3 | ||
platformdirs==3.11.0 | ||
Pygments==2.16.1 | ||
pymdown-extensions==10.3 | ||
python-dateutil==2.8.2 | ||
PyYAML==6.0.1 | ||
mike==2.1.3 | ||
mistune==3.0.2 | ||
mkdocs==1.6.1 | ||
mkdocs-autorefs==1.2.0 | ||
mkdocs-get-deps==0.2.0 | ||
mkdocs-material==9.5.41 | ||
mkdocs-material-extensions==1.3.1 | ||
mkdocs-mermaid2-plugin==1.1.1 | ||
mkdocstrings==0.26.2 | ||
mkdocstrings-python==1.12.1 | ||
nbclient==0.10.0 | ||
nbconvert==7.16.4 | ||
nbformat==5.10.4 | ||
packaging==24.1 | ||
paginate==0.5.7 | ||
pandocfilters==1.5.1 | ||
parso==0.8.4 | ||
pathspec==0.12.1 | ||
pexpect==4.9.0 | ||
pickleshare==0.7.5 | ||
pipreqs==0.5.0 | ||
platformdirs==4.3.6 | ||
prompt_toolkit==3.0.48 | ||
ptyprocess==0.7.0 | ||
pure_eval==0.2.3 | ||
Pygments==2.18.0 | ||
pymdown-extensions==10.11.2 | ||
pyparsing==3.2.0 | ||
python-dateutil==2.9.0.post0 | ||
PyYAML==6.0.2 | ||
pyyaml_env_tag==0.1 | ||
regex==2023.10.3 | ||
requests==2.31.0 | ||
setuptools==65.5.1 | ||
pyzmq==26.2.0 | ||
referencing==0.35.1 | ||
regex==2024.9.11 | ||
requests==2.32.3 | ||
rpds-py==0.20.0 | ||
six==1.16.0 | ||
urllib3==2.0.7 | ||
soupsieve==2.6 | ||
stack-data==0.6.3 | ||
tinycss2==1.3.0 | ||
tornado==6.4.1 | ||
traitlets==5.14.3 | ||
urllib3==2.2.3 | ||
verspec==0.1.0 | ||
watchdog==3.0.0 | ||
watchdog==5.0.3 | ||
wcwidth==0.2.13 | ||
webencodings==0.5.1 | ||
yarg==0.1.9 | ||
zipp==3.20.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.