Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update precompressed tile documentation #390

Merged
merged 14 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sphinx/formats/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ available from our `sample image downloads site <http://downloads.openmicroscopy
/supported-formats
/metadata-summary
pattern-file
precompressed
options
34 changes: 34 additions & 0 deletions sphinx/formats/precompressed.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Support for "precompressed" tiles
=================================

Some formats allow reading and/or writing "precompressed" tiles.
This feature is primarily intended for whole slide images, each of which may have thousands of tiles.
Data representing these tiles may be compressed, either lossily or losslessly, depending on the
file format, imaging modality, or acquisition configuration.

When reading, this allows for retrieving compressed bytes that are as close as possible
to what is actually stored in the file. Decompression (if necessary) is the responsibility
of the consumer.

When writing, compressed bytes instead of raw bytes can be provided to the writer,
such that the writer will just save the provided compressed bytes instead of recompressing.

See also :doc:`how to work with precompressed tiles in bfconvert </users/comlinetools/precompressed>`

.. _precompressed#readers:

Formats that support precompressed tile reading
-----------------------------------------------

* SVS (since 7.1.0)
* NDPI (since 8.0.0)
* DICOM (since 8.0.0)

.. _precompressed#writers:

Formats that support precompressed tile writing
-----------------------------------------------

* DICOM (since 7.1.0)
* TIFF (since 8.0.0)
* OME-TIFF (since 8.0.0)
4 changes: 3 additions & 1 deletion sphinx/users/comlinetools/conversion.rst
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,12 @@ correctly. So in Windows, the above example would read::

.. code-block::

bfconvert -noflat -precompressed -compression JPEG CMU-1.svs CMU-1.dcm
bfconvert -noflat -precompressed CMU-1.svs CMU-1.dcm

.. versionadded:: 7.1.0

.. seealso:: :doc:`Summary of the precompressed tiles feature <precompressed>`

.. option:: -extra-metadata METADATA FILE

Enables the writing of additional supplemental metadata from an external file during the conversion process .
Expand Down
31 changes: 31 additions & 0 deletions sphinx/users/comlinetools/precompressed.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"Precompressed" tiles
=====================

See first :doc:`an overview of what precompressed tiles are and which formats support them </formats/precompressed>`.

This feature is primarily exposed in the :program:`bfconvert` command, using the `-precompressed` option.
When the `-precompressed` option is used, best results are obtained by:

* using the `-noflat` option
* **not** using the `-compression` option (this can work, but may force tile recompression)
* **not** using the `-tilex` or `-tiley` options (this can work, but may force tile recompression)

There are several advantages to converting using the "precompressed" feature for formats that support it:

* faster tile read and write times, as no tile compression/decompression needs to be performed
* no change in compression quality
* very little change in file sizes between input and output data

There are also a few disadvantages:

* tile sizes cannot be changed during conversion
* compression type cannot be changed during conversion
* input and output format must support same compression type and tile size
* the input format must have precompressed tile reading support (see :ref:`the list of supported readers <precompressed#readers>`)
* the output format must have precompressed tile writing support (see :ref:`the list of supported writers <precompressed#writers>`)
* command-line tools other than :program:`bfconvert` do not currently make use of the precompressed tile API

For additional discussion of the "precompressed" tiles feature, see:

* https://forum.image.sc/t/vsi-to-dcm-file-conversion/98249/5
* https://forum.image.sc/t/exporting-a-dicom-stack/99400
1 change: 1 addition & 0 deletions sphinx/users/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ for carrying out a variety of tasks:
comlinetools/ijview
comlinetools/xmlindent
comlinetools/mkfake
comlinetools/precompressed

.. seealso::
:doc:`/formats/options`
Expand Down