Skip to content

Commit

Permalink
Add a vips tilesource.
Browse files Browse the repository at this point in the history
This class can be used to write files as well.
  • Loading branch information
manthey committed Apr 8, 2022
1 parent 88cb078 commit 81966f4
Show file tree
Hide file tree
Showing 15 changed files with 600 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .circleci/make_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,5 @@ cd "$ROOTPATH/sources/test"
pip wheel . --no-deps -w ~/wheels && rm -rf build
cd "$ROOTPATH/sources/tiff"
pip wheel . --no-deps -w ~/wheels && rm -rf build
cd "$ROOTPATH/sources/vips"
pip wheel . --no-deps -w ~/wheels && rm -rf build
6 changes: 6 additions & 0 deletions .circleci/release_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,9 @@ cp "$ROOTPATH/LICENSE" .
python setup.py sdist
pip wheel . --no-deps -w dist
twine upload --verbose dist/*
cd "$ROOTPATH/sources/vips"
cp "$ROOTPATH/README.rst" .
cp "$ROOTPATH/LICENSE" .
python setup.py sdist
pip wheel . --no-deps -w dist
twine upload --verbose dist/*
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ Large Image consists of several Python modules designed to work together. These

- ``large-image-source-multi``: A tile source for compisiting other tile sources into a single multi-frame source.

- ``large-image-source-vips``: A tile source for reading any files handled by libvips. This also can be used for writing tiled images from numpy arrays.

- ``large-image-source-test``: A tile source that generates test tiles, including a simple fractal pattern. Useful for testing extreme zoom levels.

- ``large-image-source-dummy``: A tile source that does nothing.
Expand Down
2 changes: 1 addition & 1 deletion docs/config_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Configuration parameters:

- ``max_small_image_size``: The PIL tilesource is used for small images if they are no more than this many pixels along their maximum dimension.

- ``source_bioformats_ignored_names``, ``source_pil_ignored_names``: Some tile sources can read some files that are better read by other tilesources. Since reading these files is suboptimal, these tile sources have a setting that, by default, ignores files without extensions or with particular extensions. This setting is a Python regular expressions. For bioformats this defaults to ``r'(^[!.]*|\.(jpg|jpeg|jpe|png|tif|tiff|ndpi))$'``.
- ``source_bioformats_ignored_names``, ``source_pil_ignored_names``, ``source_vips_ignored_names``: Some tile sources can read some files that are better read by other tilesources. Since reading these files is suboptimal, these tile sources have a setting that, by default, ignores files without extensions or with particular extensions. This setting is a Python regular expressions. For bioformats this defaults to ``r'(^[!.]*|\.(jpg|jpeg|jpe|png|tif|tiff|ndpi))$'``.


Configuration from Python
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
_build/large_image_source_pil/modules
_build/large_image_source_test/modules
_build/large_image_source_tiff/modules
_build/large_image_source_vips/modules
_build/large_image_converter/modules
_build/large_image_tasks/modules
_build/girder_large_image/modules
Expand Down
1 change: 1 addition & 0 deletions docs/make_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ sphinx-apidoc -f -o _build/large_image_source_openslide ../sources/openslide/lar
sphinx-apidoc -f -o _build/large_image_source_pil ../sources/pil/large_image_source_pil
sphinx-apidoc -f -o _build/large_image_source_test ../sources/test/large_image_source_test
sphinx-apidoc -f -o _build/large_image_source_tiff ../sources/tiff/large_image_source_tiff
sphinx-apidoc -f -o _build/large_image_source_vips ../sources/vips/large_image_source_vips
sphinx-apidoc -f -o _build/large_image_converter ../utilities/converter/large_image_converter
sphinx-apidoc -f -o _build/large_image_tasks ../utilities/tasks/large_image_tasks
sphinx-apidoc -f -o _build/girder_large_image ../girder/girder_large_image
Expand Down
4 changes: 4 additions & 0 deletions large_image/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class SourcePriority:
TILE_FORMAT_NUMPY = 'numpy'


NEW_IMAGE_PATH_FLAG = '__new_image__'


TileOutputMimeTypes = {
# JFIF forces conversion to JPEG through PIL to ensure the image is in a
# common colorspace. JPEG colorspace is complex: see
Expand Down Expand Up @@ -79,3 +82,4 @@ class SourcePriority:
'i': 'int',
'I': 'uint',
}
GValueToDtype = {v: k for k, v in dtypeToGValue.items()}
1 change: 1 addition & 0 deletions requirements-dev-core.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
-e sources/pil
-e sources/test
-e sources/tiff
-e sources/vips
# must be after sources/tiff
-e sources/ometiff
# must be after source/gdal
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ girder-jobs>=3.0.3
-e sources/pil
-e sources/test
-e sources/tiff
-e sources/vips
# must be after sources/tiff
-e sources/ometiff
# must be after source/gdal
Expand Down
1 change: 1 addition & 0 deletions requirements-worker.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
-e sources/pil
-e sources/test
-e sources/tiff
-e sources/vips
# must be after sources/tiff
-e sources/ometiff
# must be after source/gdal
Expand Down
Loading

0 comments on commit 81966f4

Please sign in to comment.