# 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
Python >3.11
The following packages will installed automatically:
- `click`
- `numpy`
- `pandas`
- `python_dateutil`
- `xarray`
- `zarr`
- `scikit-image`
- `tifffile`
- `xmltodict`
## 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:** (Optional) Storage location of converted MCD files in Zarr format. If not provided, the output folder `<mcd_folder>/Zarr_converted` will be automatically created.
**Notes:**
- The Zarr output folders are named after the MCD file names.
- Progress and errors will be printed to the console for better monitoring.
### 2. ZARR_STITCH
**Command:**
```
zarr_stitch <zarr_folder>
```
**Description:**
Stitches Zarr files into a multi-channeled OME-TIFF.
**Arguments:**
- **zarr_folder:** The folder containing Zarr files to be stitched.
**Notes:**
- The `<zarr_folder>` should only contain folders with Zarr data. Empty or unexpected folder structures will be skipped.
- Errors encountered during processing will be logged to `error_log.txt` in the input directory.
- The output files will have `_stitched.ome.tiff` appended to the original filename.
- Success messages will be printed for each processed folder.
### 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:** (Optional) Storage location of converted MCD files in Zarr format and the starting point for stitching Zarr files. If not provided, the output folder `<mcd_folder>/Zarr_converted` will be automatically created.
- **--lzw:** Optional flag to enable LZW compression.
### 4. TIFF_SUBSET
**Command:**
```
tiff_subset <tiff_path> [-c] [-p] [-f CHANNELS]
```
**Description:**
A function that allows you to remove background channels, view all channels in an 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:** Lists all channels in the OME-TIFF file.
- **-p:** Enables the creation of a pyramidal OME-TIFF with tiling.
- **-f CHANNELS:** Filters and subsets channels. Provide channels to subset, e.g., "0-5,7,10". If no channels are provided, default filtering is applied.
**Notes:**
- **Order of arguments:** The `-f` flag (if used) must be the last argument in the command.
- **Default filtering:** Automatically subsets all channels for metals tags between 141 to 193.
- **Pyramid and Tiling:** The hardcoded tile size is (256x256) and pyramid levels as 4.
- Errors encountered during processing will be logged to `error_log.txt` in the input directory.
**Examples:**
1. **List channels in a TIFF file:**
```
tiff_subset "path/to/file.ome.tiff" -c
```
2. **Subset channels 12 to 46:**
```
tiff_subset "path/to/file.ome.tiff" -f "12-46"
```
- Other possible combinations: "1,6,20" or "5,6-10,55,60"
3. **Subset all TIFF files in a directory:**
```
tiff_subset "path/to/directory" -f
```
**Notes:**
- In this example, since no channel argument is provided, the function will automatically use default filtering.
- 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.
4. **Subset Tiff files with Pyramid and Tile Generation:**
```
tiff_subset "path/to/file.ome.tiff" -p -f
```
**Notes:**
- This will create a pyramidal OME-TIFF with default filtering.
- The output files will have `_filtered_pyramid.ome.tiff` appended to the original filename.
## License
This project is licensed under the GNU General Public License v3.0 License. See the [LICENSE](https://github.com/PawanChaurasia/mcd_stitcher/blob/main/LICENSE) file for details.
## Issues
If you encounter any issues, please open a ticket on the [issue tracker](https://github.com/PawanChaurasia/mcd_stitcher/issues).
Raw data
{
"_id": null,
"home_page": null,
"name": "mcd-stitcher",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "imaging, microscopy, IMC, stitching",
"author": null,
"author_email": "Pawan Chaurasia <pchaurasia98@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/4b/ea/dbe3b5ba59791f217163730f7bd74e0a0c67634e4e87752f3710b5d02850/mcd_stitcher-1.1.1.tar.gz",
"platform": null,
"description": "# MCD STITCHER\n\nA package made for stitching ROIs into OME-TIFFS and additional OME-TIFF editing tools\n\n## Installation\n\nTo install the package, use the following command:\n\n```\npip install mcd_stitcher\n```\n\n### Requirements\n\nPython >3.11\n\nThe following packages will installed automatically:\n\n- `click`\n- `numpy`\n- `pandas`\n- `python_dateutil`\n- `xarray`\n- `zarr`\n- `scikit-image`\n- `tifffile`\t\n- `xmltodict`\n\n## Command Line Usage\n\n### 1. IMC2ZARR\n\n**Command:** \n\n```\nimc2zarr <mcd_folder> <zarr_folder>\n```\n\n**Description:**\nConverts MCD files to Zarr format.\n\n**Arguments:**\n- **mcd_folder:** The root folder of the IMC scan containing single or multiple MCD files.\n- **zarr_folder:** (Optional) Storage location of converted MCD files in Zarr format. If not provided, the output folder `<mcd_folder>/Zarr_converted` will be automatically created.\n\n**Notes:**\n- The Zarr output folders are named after the MCD file names.\n- Progress and errors will be printed to the console for better monitoring.\n\n### 2. ZARR_STITCH\n\n**Command:** \n\n```\nzarr_stitch <zarr_folder>\n```\n\n**Description:**\nStitches Zarr files into a multi-channeled OME-TIFF.\n\n**Arguments:**\n- **zarr_folder:** The folder containing Zarr files to be stitched.\n\n**Notes:**\n- The `<zarr_folder>` should only contain folders with Zarr data. Empty or unexpected folder structures will be skipped.\n- Errors encountered during processing will be logged to `error_log.txt` in the input directory.\n- The output files will have `_stitched.ome.tiff` appended to the original filename.\n- Success messages will be printed for each processed folder.\n\n### 3. MCD_STITCH\n\n**Command:** \n\n```\nmcd_stitch <mcd_folder> [<zarr_folder>] [--lzw]\n```\n\n**Description:**\nCombines the MCD to Zarr conversion and Zarr stitching into a single command.\n\n**Arguments:**\n- **mcd_folder:** The root folder of the IMC scan containing single or multiple MCD files.\n- **zarr_folder:** (Optional) Storage location of converted MCD files in Zarr format and the starting point for stitching Zarr files. If not provided, the output folder `<mcd_folder>/Zarr_converted` will be automatically created.\n- **--lzw:** Optional flag to enable LZW compression.\n\n### 4. TIFF_SUBSET\n\n**Command:** \n\n```\ntiff_subset <tiff_path> [-c] [-p] [-f CHANNELS]\n```\n\n**Description:**\nA function that allows you to remove background channels, view all channels in an OME-TIFF, and generate OME-TIFF with pyramid and tiles.\n\n**Arguments:**\n- **tiff_path:** Path to the OME-TIFF file or directory containing OME-TIFF files.\n- **-c:** Lists all channels in the OME-TIFF file.\n- **-p:** Enables the creation of a pyramidal OME-TIFF with tiling.\n- **-f CHANNELS:** Filters and subsets channels. Provide channels to subset, e.g., \"0-5,7,10\". If no channels are provided, default filtering is applied. \n\n**Notes:**\n- **Order of arguments:** The `-f` flag (if used) must be the last argument in the command.\n- **Default filtering:** Automatically subsets all channels for metals tags between 141 to 193.\n- **Pyramid and Tiling:** The hardcoded tile size is (256x256) and pyramid levels as 4.\n- Errors encountered during processing will be logged to `error_log.txt` in the input directory.\n\n**Examples:**\n1. **List channels in a TIFF file:**\n ```\n tiff_subset \"path/to/file.ome.tiff\" -c\n ```\n\n2. **Subset channels 12 to 46:**\n ```\n tiff_subset \"path/to/file.ome.tiff\" -f \"12-46\"\n ```\n - Other possible combinations: \"1,6,20\" or \"5,6-10,55,60\"\n\n3. **Subset all TIFF files in a directory:**\n ```\n tiff_subset \"path/to/directory\" -f\n ```\n\n\t**Notes:**\n\t- In this example, since no channel argument is provided, the function will automatically use default filtering.\n\t- When a directory is provided, all TIFF files within the directory will be processed.\n\t- The output files will have `_filtered.ome.tiff` appended to the original filename.\n\n4. **Subset Tiff files with Pyramid and Tile Generation:**\n ```\n tiff_subset \"path/to/file.ome.tiff\" -p -f\t\n ```\n\n\t**Notes:**\n\t- This will create a pyramidal OME-TIFF with default filtering.\n\t- The output files will have `_filtered_pyramid.ome.tiff` appended to the original filename.\n\n## License\n\nThis project is licensed under the GNU General Public License v3.0 License. See the [LICENSE](https://github.com/PawanChaurasia/mcd_stitcher/blob/main/LICENSE) file for details.\n\n## Issues\n\nIf you encounter any issues, please open a ticket on the [issue tracker](https://github.com/PawanChaurasia/mcd_stitcher/issues).\n",
"bugtrack_url": null,
"license": "GPL-3.0",
"summary": "MCD to Zarr conversion and stitching",
"version": "1.1.1",
"project_urls": {
"Bug Tracker": "https://github.com/PawanChaurasia/mcd_stitcher/issues",
"Homepage": "https://github.com/PawanChaurasia/mcd_stitcher",
"Repository": "https://github.com/PawanChaurasia/mcd_stitcher"
},
"split_keywords": [
"imaging",
" microscopy",
" imc",
" stitching"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "986114a86a560fa08721551ef3a24cfbcae0ae56cc9ebe7b0e3ccf569d2416ef",
"md5": "339a6d0c90dcfda13b1aa36b1de77b14",
"sha256": "933b185f52edb3f25401bf49561a4badadd08eae88753300c1841ec806992cec"
},
"downloads": -1,
"filename": "mcd_stitcher-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "339a6d0c90dcfda13b1aa36b1de77b14",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 24271,
"upload_time": "2025-08-23T13:45:57",
"upload_time_iso_8601": "2025-08-23T13:45:57.505570Z",
"url": "https://files.pythonhosted.org/packages/98/61/14a86a560fa08721551ef3a24cfbcae0ae56cc9ebe7b0e3ccf569d2416ef/mcd_stitcher-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4beadbe3b5ba59791f217163730f7bd74e0a0c67634e4e87752f3710b5d02850",
"md5": "67cecbbdb182bda4629fbe9c0a4a5846",
"sha256": "d37990a46a65050b060894947798e8476e8ca1d976f8aae55fb1541d922f01ce"
},
"downloads": -1,
"filename": "mcd_stitcher-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "67cecbbdb182bda4629fbe9c0a4a5846",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 21530,
"upload_time": "2025-08-23T13:45:58",
"upload_time_iso_8601": "2025-08-23T13:45:58.700828Z",
"url": "https://files.pythonhosted.org/packages/4b/ea/dbe3b5ba59791f217163730f7bd74e0a0c67634e4e87752f3710b5d02850/mcd_stitcher-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-23 13:45:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "PawanChaurasia",
"github_project": "mcd_stitcher",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mcd-stitcher"
}