Metadata-Version: 2.3
Name: generate-tiff-offsets
Version: 0.1.9
Summary: A package to generate TIFF offsets
Author-email: Ilan Gold <ilan.gold@helmholtz-munich.de>
License: MIT
Classifier: Environment :: Console
Classifier: Framework :: Jupyter
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.10
Requires-Dist: tifffile>=2023.9.26
Provides-Extra: test
Requires-Dist: pytest; extra == 'test'
Description-Content-Type: text/markdown

# generate-tiff-offsets

A python cli (and web-application) for generating an Image File Directory (IFD)
index for TIFFs. See [the benchmark](https://doi.org/10.6084/m9.figshare.19416344.v1) from
[our paper](https://www.nature.com/articles/s41592-022-01482-7) or watch our
[video explainer](https://www.youtube.com/watch?v=cGB2TsSnfbo) to learn more about
how our strategy improves random chunk access speeds for OME-TIFF in
[Viv](https://github.com/hms-dbmi/viv).

## TIFF IFD Index specification

The content of an TIFF IFD Index should match the given description here.

### Version 0

Prototype spec for the structure required for TIFF IFD Index (JSON):

```
[IFD_offset_0, IFD_offset_1, IFD_offset_2, IFD_offset_3, ..., IFD_offset_N]
```

where `IFD_offset_n` corresponds to the _nth_ byte-offset for the corresponding
Image File Directory in the linear TIFF series.

> **Note** For OME-TIFF, the ordering of IFDs is determined by the `DimensionOrder`
> attribute in the OME-XML metadata. Each combination of `C`, `Z`, and `T`
> corresponds to **one IFD**, meaning the total number of IFDs is the product
> of these dimensions (`T x C x Z`) and _independent_ of the number of pyramidal
> resolutions in the OME-TIFF.

## 🐍 Python CLI

```bash
  pip install generate-tiff-offsets
  generate_tiff_offsets --input_file <my_file>.ome.tiff
```

This command writes the Version 0 Index to the local file system, adjacent to the
input TIFF with the file name `<my_file>.offsets.json`.

> **Warning** Our OME-TIFF web-viewer, [Avivator](http://avivator.gehlenborglab.org) expects
> this naming convension and folder structure in order for the Indexed
> OME-TIFF to be recognized.

## 🌎 Web application

The [website](https://hms-dbmi.github.io/generate-tiff-offsets) requires no installation and can be used to generate the Version 0 index
directly in the browser. See our [video tutorial](https://www.youtube.com/watch?v=cGB2TsSnfbo)
for usage instructions.
