bcf-scape 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.4
2
+ Name: bcf-scape
3
+ Version: 0.1.0
4
+ Summary: SCAPE light-sheet microscopy data processing (deskewing, max-projection, batch I/O).
5
+ Author: Tomas Skripcak
6
+ Author-email: HongKee Moon <moon@mpi-cbg.de>
7
+ Maintainer-email: "Scientific Computing Facility, MPI-CBG" <scicomp@mpi-cbg.de>
8
+ License-Expression: BSD-3-Clause
9
+ Project-URL: Homepage, https://git.mpi-cbg.de/scicomp/scidev_team/bcf_scape
10
+ Project-URL: Source, https://git.mpi-cbg.de/scicomp/scidev_team/bcf_scape
11
+ Project-URL: Issues, https://git.mpi-cbg.de/scicomp/scidev_team/bcf_scape/-/issues
12
+ Keywords: scape,light-sheet,microscopy,deskew,ome-tiff,pyclesperanto
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
16
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Operating System :: OS Independent
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: numpy
29
+ Requires-Dist: tifffile
30
+ Requires-Dist: pyclesperanto
31
+ Requires-Dist: pyclesperanto-prototype
32
+ Requires-Dist: tomli_w
33
+ Requires-Dist: tomli; python_version < "3.11"
34
+ Requires-Dist: tqdm
35
+ Requires-Dist: matplotlib
36
+ Requires-Dist: ipywidgets
37
+ Requires-Dist: Pillow
38
+ Provides-Extra: dev
39
+ Requires-Dist: pytest; extra == "dev"
40
+ Requires-Dist: build; extra == "dev"
41
+ Requires-Dist: twine; extra == "dev"
42
+ Dynamic: license-file
43
+
44
+ # bcf-scape
45
+
46
+ `bcf-scape` is a modular Python library for processing **SCAPE light-sheet
47
+ microscopy** data: deskewing OME-TIFF stacks, computing Z / Y max-projections,
48
+ and batch-processing multi-position / multi-timepoint acquisitions.
49
+
50
+ GPU-accelerated via [`pyclesperanto`](https://github.com/clEsperanto/pyclesperanto).
51
+
52
+ Developed and maintained by the Scientific Computing Facility at MPI-CBG.
53
+
54
+ ## Installation
55
+
56
+ ```bash
57
+ pip install bcf-scape
58
+ ```
59
+
60
+ The package imports as `scape`:
61
+
62
+ ```python
63
+ import scape
64
+ ```
65
+
66
+ ## Quick start
67
+
68
+ ### Command line
69
+
70
+ ```bash
71
+ python -m scape.pipeline \
72
+ --settings settings.toml \
73
+ --tiff /data/raw/scan.ome.tif \
74
+ --output /data/processed/Deskewed/
75
+ ```
76
+
77
+ or via the console script:
78
+
79
+ ```bash
80
+ scape --help
81
+ ```
82
+
83
+ ### Python API
84
+
85
+ ```python
86
+ from scape.config.settings import load_settings_from_file
87
+ from scape.pipeline import run
88
+
89
+ settings = load_settings_from_file("settings.toml")
90
+ run(settings, "/data/raw/scan.ome.tif", "/data/processed/Deskewed/")
91
+ ```
92
+
93
+ ## TOML configuration
94
+
95
+ `ProcessingSettings` round-trips to a human-readable TOML file:
96
+
97
+ ```python
98
+ from scape.config.settings import ProcessingSettings
99
+
100
+ settings = ProcessingSettings()
101
+ settings.lightsheet_angle_in_degrees = 39
102
+ settings.save_toml("my_run.toml")
103
+
104
+ # Later …
105
+ settings = ProcessingSettings.load_toml("my_run.toml")
106
+ ```
107
+
108
+ ## Modules
109
+
110
+ | Module | Responsibility |
111
+ | --- | --- |
112
+ | `scape.pipeline` | End-to-end deskewing pipeline (CLI entry point) |
113
+ | `scape.config.settings` | `ProcessingSettings` + TOML I/O |
114
+ | `scape.metadata.parser` | OME-TIFF metadata extraction |
115
+ | `scape.preprocessing.image_handler` | Channel/timepoint selection, dual-camera flips |
116
+ | `scape.processing.deskew_engine` | Deskewing primitives |
117
+ | `scape.batch.processor` | Multi-position / multi-timepoint orchestration |
118
+ | `scape.output.saver` | TIFF writing helpers |
119
+ | `scape.visualization.viewer` | Interactive Jupyter previews |
120
+
121
+ ## Citation
122
+
123
+ If this package contributes to a publication, please acknowledge the
124
+ Scientific Computing Facility at MPI-CBG. Contact `scicomp@mpi-cbg.de`
125
+ for the formal citation entry.
126
+
127
+ ## Links
128
+
129
+ * Source: <https://git.mpi-cbg.de/scicomp/scidev_team/bcf_scape>
130
+
131
+ ## License
132
+
133
+ BSD-3-Clause. See [LICENSE](LICENSE).
134
+
135
+ Copyright © 2026 Max Planck Institute of Molecular Cell Biology and Genetics
136
+ (MPI-CBG).
@@ -0,0 +1,25 @@
1
+ bcf_scape-0.1.0.dist-info/licenses/LICENSE,sha256=iqFi0bvnjhahB_xz3kfqktcZRBoG8g-jdJQeGNKSNLg,1577
2
+ scape/__init__.py,sha256=ccWz7FRVARgO9UpEhzaGpe7HlrMDpESMdZgWzuh6MfU,1348
3
+ scape/__main__.py,sha256=fbzsbUvmTRyHrdZkrDiedTY5_RoDpALzgkYPegCl4K0,87
4
+ scape/cli.py,sha256=46iwhWHafDpMsiJ3VLsE0jNOdA8cLbSfg6WY0enMMCg,16330
5
+ scape/pipeline.py,sha256=oTxRf0JPG9OCTBU0mIOWw083UJETTs5gxG_VrV5kC9A,13735
6
+ scape/batch/__init__.py,sha256=Sdnk2mn7ljfcDWWRtPf9IySxWmQOuUb28S-xMBIPtn4,68
7
+ scape/batch/processor.py,sha256=owK2F7KkOvIJd5aYE8EC_LybN5P0gUtS-QrQsi4qJD0,4187
8
+ scape/config/__init__.py,sha256=jzPt8SBnpXzMPuo3lcyKIhzISoLlH__Gy9MVMBDwcuc,53
9
+ scape/config/settings.py,sha256=VXV37WGznH63uKtbeTKl_frWfdJBY1Ycow3OR_UltNI,15497
10
+ scape/config/wizard.py,sha256=l1vez8AYSs7aB0o-20B5yGuDBpggsa8ka5sJh9-Pcqs,13122
11
+ scape/metadata/__init__.py,sha256=EAl0g62XPr0PkSTbZF0djtxPeR2SHDtbq8W_Eqt5g6g,48
12
+ scape/metadata/parser.py,sha256=7LFHa_EDuqDUvQY8Zxo6rnQsnm3OQxE_FRnMap9Z9G4,7118
13
+ scape/output/__init__.py,sha256=zfCsYt5iLvN47SpULged3JQ4Z7VoZpMbUcoygajJaaQ,69
14
+ scape/output/saver.py,sha256=b7zXi0pYOn9M7VLPQnoUzoJdJ0tSNQsgue-qlFqHXzk,5162
15
+ scape/preprocessing/__init__.py,sha256=7moYBUD9irai9jUPGPpDjT5q9Rm2mzIYraoUpAETL8M,61
16
+ scape/preprocessing/image_handler.py,sha256=mrkr0jRifyPSykw-S0Ki8N_aIumUGDLDj3AGeYJ-gsA,4770
17
+ scape/processing/__init__.py,sha256=3zS8XFiUr5SqmL-kBaAXETGXcCTDuoC9ax2v_NQ-Yzo,73
18
+ scape/processing/deskew_engine.py,sha256=jQUt3mAsR0-0J-TZY9QhJ4qyeQdkEry4LyQHdUr4fxo,3482
19
+ scape/visualization/__init__.py,sha256=eORIHyPdeNbhs3eQbt87hgXbZLEm538mLWgdnqY9PvM,66
20
+ scape/visualization/viewer.py,sha256=2_Qk3JxQ2-m5LGFw6zbyQdgjJ3h5IWcEtz3NfmNEues,2488
21
+ bcf_scape-0.1.0.dist-info/METADATA,sha256=itXRPk6MRMwAyjBl1Hrc_-h3VHoei2Fo83vkhEU_Wpc,4081
22
+ bcf_scape-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
23
+ bcf_scape-0.1.0.dist-info/entry_points.txt,sha256=ogaGGLSk_RLhSxSS8XEVf1y4la0n_12rLrMO_gBAuiQ,41
24
+ bcf_scape-0.1.0.dist-info/top_level.txt,sha256=ejBj0_1hE-vAMo1MUnZsD-VYcaBgK0f0YzJQf_ACxyw,6
25
+ bcf_scape-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ scape = scape.cli:main
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, Max Planck Institute of Molecular Cell Biology and Genetics (MPI-CBG)
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ scape
scape/__init__.py ADDED
@@ -0,0 +1,37 @@
1
+ """
2
+ SCAPE - Light Sheet Microscopy Image Processing Pipeline
3
+ ========================================================
4
+
5
+ A modular Python library for processing light sheet microscopy data
6
+ (deskewing, max-projection, batch processing of OME-TIFF stacks).
7
+
8
+ Quick start
9
+ -----------
10
+
11
+ Run the pipeline from the command line::
12
+
13
+ python -m scape.pipeline \\
14
+ --settings settings.toml \\
15
+ --tiff /data/raw/scan.ome.tif \\
16
+ --output /data/processed/Deskewed/
17
+
18
+ Or use the Python API::
19
+
20
+ from scape.config.settings import load_settings_from_file
21
+ from scape.pipeline import run
22
+
23
+ settings = load_settings_from_file("settings.toml")
24
+ run(settings, "/data/raw/scan.ome.tif", "/data/processed/Deskewed/")
25
+
26
+ Main modules
27
+ ------------
28
+
29
+ * :mod:`scape.pipeline` – end-to-end processing entry point
30
+ * :mod:`scape.config.settings` – ``ProcessingSettings`` and TOML I/O
31
+ * :mod:`scape.metadata.parser` – OME-TIFF metadata extraction
32
+ * :mod:`scape.preprocessing.image_handler` – channel/timepoint selection, flips
33
+ * :mod:`scape.processing.deskew_engine` – deskewing primitives
34
+ * :mod:`scape.batch.processor` – multi-position / multi-timepoint loops
35
+ * :mod:`scape.output.saver` – TIFF writing helpers
36
+ * :mod:`scape.visualization.viewer` – interactive Jupyter previews
37
+ """
scape/__main__.py ADDED
@@ -0,0 +1,4 @@
1
+ """Allows ``python -m scape`` to invoke the CLI."""
2
+ from scape.cli import main
3
+
4
+ main()
@@ -0,0 +1,3 @@
1
+ """
2
+ Batch processing workflows for light sheet microscopy data.
3
+ """
@@ -0,0 +1,135 @@
1
+ """
2
+ Batch processing workflow for light sheet microscopy data.
3
+ """
4
+
5
+ import os
6
+ import numpy as np
7
+ from tqdm import tqdm
8
+
9
+
10
+ class BatchProcessor:
11
+ """Manage batch processing workflows for light sheet microscopy data."""
12
+
13
+ def __init__(self, settings):
14
+ """
15
+ Initialize batch processor.
16
+
17
+ Args:
18
+ settings: ProcessingSettings object
19
+ """
20
+ self.settings = settings
21
+
22
+ def process_multiple_positions(self, tiff_file, output_folder, progress_bar=None):
23
+ """
24
+ Process multiple positions from a TIFF file.
25
+
26
+ Args:
27
+ tiff_file: TiffFile object
28
+ output_folder: Output folder path
29
+ progress_bar: Optional progress bar
30
+
31
+ Returns:
32
+ List of processed files
33
+ """
34
+ processed_files = []
35
+
36
+ # Determine positions to process
37
+ if self.settings.selected_positions == 0:
38
+ pos_list = list(range(len(tiff_file.series)))
39
+ else:
40
+ pos_list = self.settings.posList
41
+
42
+ # Process each position
43
+ for pp in pos_list:
44
+ img_array = tiff_file.series[pp]
45
+ image_xd = img_array.asarray()
46
+
47
+ # Process each channel
48
+ for jj in range(self.settings.number_channels):
49
+ if (
50
+ self.settings.selected_channels == 1
51
+ and jj not in self.settings.channelsList
52
+ ):
53
+ if progress_bar:
54
+ progress_bar.update(self.settings.number_timepoints)
55
+ continue
56
+
57
+ # Process each timepoint
58
+ for kk in range(
59
+ self.settings.timepoints_start,
60
+ min(
61
+ self.settings.timepoints_start + self.settings.timepoints_range,
62
+ self.settings.number_timepoints,
63
+ ),
64
+ ):
65
+ # This would call the actual processing logic
66
+ # Placeholder implementation
67
+ if progress_bar:
68
+ progress_bar.update(1)
69
+
70
+ processed_files.append(
71
+ f"Processed position {pp}, channel {jj}, timepoint {kk}"
72
+ )
73
+
74
+ return processed_files
75
+
76
+ def process_separate_timepoints(
77
+ self, source_folder, output_folder, progress_bar=None
78
+ ):
79
+ """
80
+ Process files with separate timepoints.
81
+
82
+ Args:
83
+ source_folder: Source folder path
84
+ output_folder: Output folder path
85
+ progress_bar: Optional progress bar
86
+
87
+ Returns:
88
+ List of processed files
89
+ """
90
+ processed_files = []
91
+
92
+ # This would iterate through timepoint directories
93
+ # Placeholder implementation
94
+ for root, dirs, files in os.walk(source_folder):
95
+ for file in files:
96
+ if file.endswith(".tif"):
97
+ # Process file
98
+ if progress_bar:
99
+ progress_bar.update(1)
100
+ processed_files.append(file)
101
+
102
+ return processed_files
103
+
104
+ def setup_output_directories(self, output_folder):
105
+ """Create the standard output folder layout used by the pipeline.
106
+
107
+ Ensures ``output_folder`` exists and creates the ``MaxProject_Z`` and
108
+ ``MaxProject_Y`` sub-folders used by :class:`OutputSaver`. Idempotent;
109
+ existing folders are left alone.
110
+
111
+ Args:
112
+ output_folder: Root directory for the run. Created with
113
+ ``os.makedirs`` if missing.
114
+ """
115
+ directories = [
116
+ output_folder,
117
+ os.path.join(output_folder, "MaxProject_Z"),
118
+ os.path.join(output_folder, "MaxProject_Y"),
119
+ ]
120
+
121
+ for directory in directories:
122
+ if not os.path.exists(directory):
123
+ os.makedirs(directory)
124
+
125
+ def create_progress_bar(self, total_steps):
126
+ """
127
+ Create a progress bar for processing.
128
+
129
+ Args:
130
+ total_steps: Total number of steps
131
+
132
+ Returns:
133
+ Progress bar object
134
+ """
135
+ return tqdm(total=total_steps, desc="Processing files")