Create pyramidal OME-TIFF from regular OME-TIFF images using QuPath or Python backend.
Project description
pyramid_creator
This script is used to convert regular OME-TIFF files (exported from Zeiss ZEN for example) into pyramidal OME-TIFF ready to use in QuPath (see more information here).
It uses either QuPath in console mode (eg. without graphical user interface), calling the bundled createPyramids.groovy script on each images found in the input directory, or using tifffile in Python.
Specify the path to a directory with .ome.tiff files, then the script will create a "pyramidal" subfolder with your pyramidalized images in it.
Install
Within a virtual environment with Python 3.12, install with pip from the terminal :
pip install pyramid-creator
To enable the Python backend, ask for the required dependencies instead :
pip install pyramid-creator[python_backend]
To use the QuPath backend, a working QuPath installation is required, and the pyramid-creator command needs to be aware of its location.
To do so, first, install QuPath. By default, it will install in ~\AppData\QuPath-0.X.Y. In any case, note down the installation location.
Then, you have several options :
- Create a file in your user directory called "QUPATH_PATH" (without extension), containing the full path to the QuPath console executable. In my case, it reads :
C:\Users\glegoc\AppData\Local\QuPath-0.5.1\QuPath-0.5.1 (console).exe. Then, thepyramid-creatorscript will read this file to find the QuPath executable. - Specify the QuPath path as an option when calling the command line interface (see the Usage section) :
pyramid-creator /path/to/your/images --qupath-path "C:\Users\glegoc\AppData\Local\QuPath-0.5.1\QuPath-0.5.1 (console).exe"
- Specify the QuPath path as an option when using the package in a Python script (see the Usage section) :
from pyramid_creator import pyramidalize_directory
pyramidalize_directory("/path/to/your/images/", qupath_path="C:\Users\glegoc\AppData\Local\QuPath-0.5.1\QuPath-0.5.1 (console).exe")
- If you're using Windows, using QuPath v0.6.0, v0.5.1 or v0.5.0 and chose the default installation location,
pyramid-creatorshould find it automatically and write it down in the "QUPATH_PATH" file by itself.
Usage
As a command line interface (CLI)
From a terminal within the virtual environment in which you installed videocutter, you can check the default values with :
pyramid-creator --help
Then, use it like so :
- Pyramidalize all .ome.tiff files found in a directory, using default values (therefore using QuPath backend)
pyramid-creator /path/to/your/images
- Change the tile size
pyramid-creator /path/to/your/images --tile-size 1024
- Specify the path to a custom groovy script. The latter should take exactly the same number of arguments as
pyramid-creator/scripts/createPyramids.groovy
pyramid-creator /path/to/your/images --script-path /path/to/your/custom/script.groovy
- Use the Python backend instead of QuPath :
pyramid-creator /path/to/your/images --no-use-qupath
From a Python script
Copy the example from examples/create_pyramids.py, fill in the parameters and run the script.
Credits
pyramid-creator is basically a wrapper around QuPath or tifffile for the Python backend.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyramid_creator-2024.12.18.tar.gz.
File metadata
- Download URL: pyramid_creator-2024.12.18.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be07a266e8727ff38c7885e6a91635f7ef333f8dc246a82790970e5227c8054f
|
|
| MD5 |
fdeb15e8e4449e4c4c88ef9579561858
|
|
| BLAKE2b-256 |
eae35805c7c3d12429ea07eb99ddf755940ea99bf83b1ed062b6c203178e595c
|
File details
Details for the file pyramid_creator-2024.12.18-py3-none-any.whl.
File metadata
- Download URL: pyramid_creator-2024.12.18-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
036764c418351b93d560a9ceabbe9753f2f323997b0dbb223bb8e41b53dfb0c5
|
|
| MD5 |
8dcc4d8498c203ca0e106b8b269add60
|
|
| BLAKE2b-256 |
01bb1a5a13c2bdb729bd1b4de64ee55a88cd82493b49c832b9a190297fab33d2
|