MCD to Zarr conversion and stitching
Project description
MCD STITCHER
A package made for stitching ROIs into OME-TIFFS and additional OME-TIFF editing tools
Installation
To install the package, use the following command:
pip install mcd_stitcher
Requirements
Ensure you have the following dependencies installed:
click
numpy
pandas
python_dateutil
xarray
zarr
scikit-image
Command Line Usage
1. IMC2ZARR
Command:
imc2zarr <mcd_folder> <zarr_folder>
Description: Converts MCD files to Zarr format.
Arguments:
- mcd_folder: The root folder of the IMC scan containing single or multiple MCD files.
- zarr_folder: Storage location of converted MCD files in Zarr format.
Notes:
- The zarr output folder are named after mcd file name.
2. ZARR_STITCH
Command:
zarr_stitch <zarr_folder>
Description: Stitches Zarr files into a single dataset.
Arguments:
- zarr_folder: The folder containing Zarr files to be stitched.
Notes:
- The <zarr_folder> should only have one or multiple folder with zarr data. An empty or unexpected folder structure can throw an error.
- The output files will have
_stitched.ome.tiff
appended to the original filename.
3. MCD_STITCH
Command:
mcd_stitch <mcd_folder> <zarr_folder> [--lzw]
Description: Combines the MCD to Zarr conversion and Zarr stitching into a single command.
Arguments:
- mcd_folder: The root folder of the IMC scan containing single or multiple MCD files.
- zarr_folder: Storage location of converted MCD files in Zarr format and the starting point for stitching Zarr files.
- --lzw: Optional flag to enable LZW compression.
4. TIFF_SUBSET
Command:
tiff_subset <tiff_path> [-c CHANNELS] [--list-channels] [--pyramid] [--tile-size] [--levels]
Description: A function that allows to removes background channels, to view all channels in a ome-TIFF and generate OME-TIFF with pyramid and tiles.
Arguments:
- tiff_path: Path to the OME-TIFF file or directory containing OME-TIFF files.
- -c, --channels CHANNELS: Channels to subset, e.g., "0-5,7,10". If not provided, the script will keep all channels between metals 141 to 193.
- --list-channels: List the channels in the specified OME-TIFF file.
- --pyramid: Create pyramidal OME-TIFF with tiling.
- --tile-size: Tile size for pyramidal OME-TIFF. (Default: 256x256)
- --levels: Number of pyramid levels. (Default: 4)
Examples:
-
List channels in a TIFF file:
tiff_subset "path/to/file.ome.tiff" --list-channels
-
Subset channels 12 to 46:
tiff_subset "path/to/file.ome.tiff" -c "12-46"
- Other possible combination: "1,6,20" or "5,6-10,55,60"
-
Process all TIFF files in a directory:
tiff_subset "path/to/directory"
- In this example, since no channel argument is provided, the function will automatically subset channels between metals 141 to 193.
Notes:
-
When a directory is provided, all TIFF files within the directory will be processed.
-
The output files will have
_filtered.ome.tiff
appended to the original filename.
-
Pyramid and Tile generation usage
tiff_subset "path/to/file.ome.tiff" --pyramid --tile-size 256 256 --levels 4
- This will create a pyramidal OME-TIFF with 4 pyramid levels and a tile size of 256x256 pixels.
Notes:
- The output files will have
_pyramid.ome.tiff
appended to the original filename
-
Process all TIFF files in a directory default subset and pyramid/tiling
tiff_subset "path/to/directory" --pyramid
- This will process all TIFF files in the specified directory, subset from channels 141-193 and create pyramidal OME-TIFFs with tile-size 256x256 and 4 levels.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Issues
If you encounter any issues, please open a ticket on the issue tracker.
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
Hashes for mcd_stitcher-0.1.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fd8008c29c721e31c203c485fc4ab521e345fb142aa0d6815ca7964028635b5 |
|
MD5 | f47db9654e5421b6f6478cef2da7358a |
|
BLAKE2b-256 | 22ac2e9835673f2e1148067dd0610d4a479ae017e0d98469b4b5cae89000414e |