monochrome 2025.1.17__py3-none-macosx_10_9_universal2.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.
- monochrome/__init__.py +23 -0
- monochrome/__main__.py +6 -0
- monochrome/_version.py +16 -0
- monochrome/data/Monochrome.app/Contents/Info.plist +73 -0
- monochrome/data/Monochrome.app/Contents/MacOS/Monochrome +0 -0
- monochrome/data/Monochrome.app/Contents/Resources/Monochrome.icns +0 -0
- monochrome/data/Monochrome.app/Contents/Resources/npy-logo.icns +0 -0
- monochrome/fbs/Array3DataChunkf.py +90 -0
- monochrome/fbs/Array3DataChunku16.py +90 -0
- monochrome/fbs/Array3DataChunku8.py +90 -0
- monochrome/fbs/Array3Meta.py +271 -0
- monochrome/fbs/Array3MetaFlow.py +121 -0
- monochrome/fbs/ArrayDataType.py +9 -0
- monochrome/fbs/BitRange.py +17 -0
- monochrome/fbs/CloseVideo.py +52 -0
- monochrome/fbs/Color.py +47 -0
- monochrome/fbs/ColorMap.py +15 -0
- monochrome/fbs/Data.py +17 -0
- monochrome/fbs/DictEntry.py +65 -0
- monochrome/fbs/Filepaths.py +70 -0
- monochrome/fbs/OpacityFunction.py +15 -0
- monochrome/fbs/PointsVideo.py +173 -0
- monochrome/fbs/Quit.py +38 -0
- monochrome/fbs/Root.py +68 -0
- monochrome/fbs/VideoExport.py +143 -0
- monochrome/fbs/VideoExportFormat.py +8 -0
- monochrome/fbs/__init__.py +0 -0
- monochrome/ipc.py +624 -0
- monochrome-2025.1.17.dist-info/METADATA +166 -0
- monochrome-2025.1.17.dist-info/RECORD +33 -0
- monochrome-2025.1.17.dist-info/WHEEL +5 -0
- monochrome-2025.1.17.dist-info/entry_points.txt +3 -0
- monochrome-2025.1.17.dist-info/licenses/LICENSE.md +19 -0
@@ -0,0 +1,166 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: monochrome
|
3
|
+
Version: 2025.1.17
|
4
|
+
Summary: Viewer for monochromatic video data
|
5
|
+
Author-Email: Jan Lebert <mail@janlebert.com>
|
6
|
+
Classifier: Development Status :: 5 - Production/Stable
|
7
|
+
Classifier: Intended Audience :: Science/Research
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
9
|
+
Classifier: Operating System :: Microsoft :: Windows
|
10
|
+
Classifier: Operating System :: MacOS
|
11
|
+
Classifier: Operating System :: POSIX
|
12
|
+
Classifier: Programming Language :: C++
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
14
|
+
Classifier: Topic :: Desktop Environment
|
15
|
+
Classifier: Topic :: Multimedia :: Video :: Display
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Visualization
|
17
|
+
Project-URL: Documentation, https://monochrome.readthedocs.io
|
18
|
+
Project-URL: Repository, https://github.com/sitic/monochrome
|
19
|
+
Requires-Python: >=3.6
|
20
|
+
Requires-Dist: numpy
|
21
|
+
Requires-Dist: flatbuffers>=23.5.26
|
22
|
+
Requires-Dist: pytest; extra == "test"
|
23
|
+
Requires-Dist: sphinx; extra == "docs"
|
24
|
+
Requires-Dist: sphinxcontrib-napoleon; extra == "docs"
|
25
|
+
Requires-Dist: sphinxcontrib-bibtex; extra == "docs"
|
26
|
+
Requires-Dist: sphinxcontrib-video; extra == "docs"
|
27
|
+
Requires-Dist: sphinx-autobuild; extra == "docs"
|
28
|
+
Requires-Dist: sphinx-copybutton; extra == "docs"
|
29
|
+
Requires-Dist: sphinx-codeautolink; extra == "docs"
|
30
|
+
Requires-Dist: furo; extra == "docs"
|
31
|
+
Requires-Dist: myst_nb>=1.0.0; extra == "docs"
|
32
|
+
Requires-Dist: jupytext; extra == "docs"
|
33
|
+
Requires-Dist: jupyter-cache; extra == "docs"
|
34
|
+
Requires-Dist: sphinx-remove-toctrees; extra == "docs"
|
35
|
+
Requires-Dist: sphinx-design; extra == "docs"
|
36
|
+
Requires-Dist: enum-tools[sphinx]; extra == "docs"
|
37
|
+
Requires-Dist: opticalmapping[all]; extra == "docs"
|
38
|
+
Provides-Extra: test
|
39
|
+
Provides-Extra: docs
|
40
|
+
Description-Content-Type: text/markdown
|
41
|
+
|
42
|
+
# Monochrome: Viewer for Monochromatic Video Data
|
43
|
+
[](https://monochrome.readthedocs.org)
|
44
|
+
[](https://github.com/sitic/monochrome/actions/workflows/build.yml)
|
45
|
+
[](https://pypi.org/project/monochrome/)
|
46
|
+
[](https://python.org)
|
47
|
+
|
48
|
+
Monochrome is a lightweight and fast video viewer for scientific monochromatic videos with high-dynamic range (float, uint16, etc.).
|
49
|
+
|
50
|
+
It is designed for viewing high-speed monochromatic fluorescence video data from scientific cameras and meet our specific needs for cardiac optical mapping data (together with [optimap](https://github.com/cardiacvision/optimap)):
|
51
|
+
* Support for high-dynamic range (uint16, 32-bit float) data with sliders to adjust intensity range
|
52
|
+
* Playback of multiple videos in sync
|
53
|
+
* High-speed playback with precise frame-rate control
|
54
|
+
* Viewing of optical traces (average intensity in a region of interest over time)
|
55
|
+
* Rendering of layers on top of videos with transparency
|
56
|
+
* Rendering of point positions over time (e.g. for tracking or optical flow visualization)
|
57
|
+
* Exporting videos as a sequence of PNG images or MP4 videos with control over frame rate and frame skipping
|
58
|
+
* Cross-platform (Linux, Windows, MacOS)
|
59
|
+
|
60
|
+
It is designed to be fast and lightweight, i.e. it uses memory-mapping to load video files to avoid copying the data into RAM.
|
61
|
+
|
62
|
+
## Installation
|
63
|
+
|
64
|
+
There are two ways to install Monochrome: as a standalone application and/or with its Python interface through pip.
|
65
|
+
|
66
|
+
In the standalone application, supported video files can be loaded by drag & drop them into the window or by associating the file extension with Monochrome to open them with a double-click. The Python interface allows to load and play videos from Python scripts and Jupyter notebooks.
|
67
|
+
|
68
|
+
### Standalone Application
|
69
|
+
|
70
|
+
Download the relevant executable (Windows, macOS, or Linux) from the latest [release page](https://github.com/sitic/monochrome/releases/latest). See the [installation instructions](https://monochrome.readthedocs.io/latest/installation_standalone/) for details.
|
71
|
+
|
72
|
+
### Python Library
|
73
|
+
|
74
|
+
The Python library includes all necessary files and does not require the installation of the standalone Monochrome application. Open a terminal window and run the following command:
|
75
|
+
|
76
|
+
```bash
|
77
|
+
python -m pip install monochrome
|
78
|
+
```
|
79
|
+
|
80
|
+
See the [Python installation guide](https://monochrome.readthedocs.io/latest/installation_python/) for further details. To start the viewer in standalone mode, run:
|
81
|
+
```bash
|
82
|
+
python -m monochrome
|
83
|
+
```
|
84
|
+
|
85
|
+
See the [tutorial](https://monochrome.readthedocs.io/latest/tutorial/) for an introduction to the Python library, here is a brief overview:
|
86
|
+
|
87
|
+
```python
|
88
|
+
import monochrome as mc
|
89
|
+
import numpy as np
|
90
|
+
|
91
|
+
# Create some video with shape (time, height, width) as a numpy array
|
92
|
+
video = np.random.rand(500, 256, 256)
|
93
|
+
|
94
|
+
# Display the video, see the tutorial for more details and options.
|
95
|
+
# Monochrome should automatically start and show the video in a loop.
|
96
|
+
mc.show_video(video, name="First Video", cmap='viridis', vmin=0, vmax=1)
|
97
|
+
|
98
|
+
# Play second video in sync with the first (note that the videos should have the same length)
|
99
|
+
video2 = (np.random.rand(500, 256, 256) * 65535).astype(dtype=np.uint16)
|
100
|
+
mc.show_video(video2, name="Second Video", comment="This is a uint16 video", bitrange="uint16")
|
101
|
+
# `bitrange` argument is optional, Monochrome will auto-detect the data type
|
102
|
+
|
103
|
+
# Layers can be added on top of video
|
104
|
+
overlay = np.random.rand(500, 256, 256)
|
105
|
+
overlay[:, 64:192, :] = np.nan # NaN values will be transparent pixels, see tutorial
|
106
|
+
mc.show_layer(overlay, parent="Second Video", cmap='PRGn', opacity='centered')
|
107
|
+
|
108
|
+
# List of functions:
|
109
|
+
# mc.show() is a shortcut for mc.show_video()/show_layer()/show_image()/show_file(),
|
110
|
+
# it will try to auto-detect the input type and call the appropriate function.
|
111
|
+
# mc.show_video() to show videos
|
112
|
+
# mc.show_image() to show single images
|
113
|
+
# mc.show_layer() to show layers on top of videos/images
|
114
|
+
# mc.show_points() to visualize point positions over time over videos
|
115
|
+
# mc.show_flow() to visualize optical flow fields over time
|
116
|
+
# mc.show_file() to load videos from file in Monochrome
|
117
|
+
# mc.close_video() to close a video/layer/image
|
118
|
+
# mc.export_video() export a window (video+layers+...) as a MP4 video
|
119
|
+
# mc.launch() to start Monochrome from Python
|
120
|
+
# mc.quit() to close Monochrome
|
121
|
+
```
|
122
|
+
|
123
|
+
## Native Video File Formats
|
124
|
+
Monochrome supports loading the following video file formats:
|
125
|
+
|
126
|
+
* `.npy`, NumPy array with shape (time, width, height). The data type can be float (np.float32, np.float64), integer (uint8, uint16, etc.), or boolean.
|
127
|
+
* `.dat`, raw binary file with shape (time, width, height) and data type float32
|
128
|
+
* `.dat`, MultiRecorder file format (used in the cardiac optical mapping community)
|
129
|
+
|
130
|
+
Drag & drop the file into the window or associate the file extension with Monochrome to open it with a double-click.
|
131
|
+
|
132
|
+
## Usage & Key Bindings
|
133
|
+
|
134
|
+
Adjust settings for each video in the main control window. To view optical traces (average intensity in a region of interest over time), click in a video. Click and drag to move the region of interest. Right-click to remove the region of interest.
|
135
|
+
|
136
|
+
Keyboard shortcuts:
|
137
|
+
|
138
|
+
| Keybinding | Action |
|
139
|
+
| --- | --- |
|
140
|
+
| `Ctrl + q` | Quit Monochrome |
|
141
|
+
| `Esc` or `q` | Close focused recording |
|
142
|
+
| `Space` | Play/Pause |
|
143
|
+
| `Up` | Increase playback speed (frame skip) |
|
144
|
+
| `Down` | Decrease playback speed (frame skip) |
|
145
|
+
| `0` or `r` | Reset playback to beginning |
|
146
|
+
| `Left` | Skip to next frame |
|
147
|
+
| `Right` | Skip to previous frame |
|
148
|
+
| `Shift + Left` | 10x previous frame |
|
149
|
+
| `Shift + Right` | 10x next frame |
|
150
|
+
| `Ctrl + Left` | Previous frame in focused recording only |
|
151
|
+
| `Ctrl + Right` | Next frame in focused recording only |
|
152
|
+
| `Ctrl + Left + Shift` | 10x previous frame in focused recording only |
|
153
|
+
| `Ctrl + Right + Shift` | 10x next frame in focused recording only |
|
154
|
+
| `p` | Save screenshot of focused recording |
|
155
|
+
| `s` | Sync playback of all recordings |
|
156
|
+
|
157
|
+
## Additional Resources
|
158
|
+
|
159
|
+
* [Documentation](https://monochrome.readthedocs.io)
|
160
|
+
* [Python Tutorial](https://monochrome.readthedocs.io/latest/tutorial/)
|
161
|
+
* [PyPI package](https://pypi.org/project/monochrome/)
|
162
|
+
* [GitHub repository](https://github.com/sitic/monochrome)
|
163
|
+
|
164
|
+
## License
|
165
|
+
|
166
|
+
Monochrome is licensed under the MIT License.
|
@@ -0,0 +1,33 @@
|
|
1
|
+
monochrome/_version.py,sha256=St4qywsNJKhfVieJUKGfZbifZsWWMBUhRm2Q1WWW9W8,419
|
2
|
+
monochrome/ipc.py,sha256=O37_futE2nmJ6fongenplSHCg7hRAkt7i4k2jYwRYE0,22000
|
3
|
+
monochrome/__init__.py,sha256=oJZsJT9xf2_Snbkclr7d_6dn482xTloeypukWZPub2o,574
|
4
|
+
monochrome/__main__.py,sha256=if3aYd91EFJkdRUGpZDbcIFcpnPBT9CapkzfT3FyBwg,106
|
5
|
+
monochrome/fbs/Array3MetaFlow.py,sha256=swb0UNdSGXZH2ddzTiqr538cDn5Av0R92sQmHdCwMkU,4080
|
6
|
+
monochrome/fbs/ColorMap.py,sha256=me_PgOsN_H4fGQuSHTOOwCztWlKYHkAkX3JIHi_zK9U,273
|
7
|
+
monochrome/fbs/Color.py,sha256=jDgG2EoFMs0Id5Nqfgj7EgyfTpzp3OcuYhyfOrEy6AQ,1368
|
8
|
+
monochrome/fbs/DictEntry.py,sha256=avQV-YZBgsL0ZqgN0ntNi2lJ3T-TVD3jGL4kaeCHhqA,2040
|
9
|
+
monochrome/fbs/ArrayDataType.py,sha256=ugQbzt0Iw6OsFojkQ27M_H8AqqhWDul0DqvU0GaOV4A,186
|
10
|
+
monochrome/fbs/Array3DataChunku16.py,sha256=Bjj2hhcqJ7avz9kovfRjGRcYbMcTFydvCbR6MAdIZPY,3112
|
11
|
+
monochrome/fbs/Quit.py,sha256=ivWVcOhNSnEtFuIbjxhbiBWczcQBZcMGtpZCt-7_7dY,1022
|
12
|
+
monochrome/fbs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
+
monochrome/fbs/Array3Meta.py,sha256=Kkz9TyGLykbC3abFerlGuPc8x3PEhRBMNwy7YJH5e4Y,9418
|
14
|
+
monochrome/fbs/OpacityFunction.py,sha256=ICUqMo25vclASQhuQlj932w1ZJaW3T7aFCHpbXu5-GM,292
|
15
|
+
monochrome/fbs/VideoExport.py,sha256=bCuk1PX34LanHyosMufUhoaTEUI3FCGkIWdVSUAUH6g,5100
|
16
|
+
monochrome/fbs/BitRange.py,sha256=Daggt5sybilxPMxGWC6NsSRc-iGm4MKw42RjqCW7iog,305
|
17
|
+
monochrome/fbs/Root.py,sha256=jZl2bp-gfmutnkdyEdOZMTqZRDOBSDvOh5qB6fMMF-o,2073
|
18
|
+
monochrome/fbs/VideoExportFormat.py,sha256=7ekwHqACzQB68SsDnMJ4KuSbTj0EFthKTGcmUxJ_M08,174
|
19
|
+
monochrome/fbs/CloseVideo.py,sha256=QYtP0vjZVFXziUL9xzNeiUne50Kk1AOKKAzjNiif1jw,1584
|
20
|
+
monochrome/fbs/Array3DataChunkf.py,sha256=1y1cvViPfbsx4XGyU0nq6UrBSmriquf5HTIv5PlcOOc,3076
|
21
|
+
monochrome/fbs/PointsVideo.py,sha256=aMlyteMlM21czkpawy4zYNSrXo0wTdT3yCci4aNMLGE,6205
|
22
|
+
monochrome/fbs/Data.py,sha256=t3uRu58ZE2CENmH1dEC-OF9msJWw88ubLKLvs-TXptA,358
|
23
|
+
monochrome/fbs/Filepaths.py,sha256=6IdRvuEMnQEmc_yEKq01Xir1jNMx-NueSw4_-hnLNWw,2188
|
24
|
+
monochrome/fbs/Array3DataChunku8.py,sha256=2tE7TWuUOgD1cI67m1VNjhaaOQ2usumf6O1uqH_rVN8,3091
|
25
|
+
monochrome/data/Monochrome.app/Contents/Info.plist,sha256=_PwjRg-HpvdFmCZndxol17YGA-gcWV1f-ZL1ri94ByM,1957
|
26
|
+
monochrome/data/Monochrome.app/Contents/MacOS/Monochrome,sha256=y-m4S1_23umADFRsJXDCcyYMWCaTN50VS8xZpAX9cyc,7569056
|
27
|
+
monochrome/data/Monochrome.app/Contents/Resources/npy-logo.icns,sha256=lr1hdU1-wrrljc23jgR3c3csoHm-54wmFZPI5BSL750,174427
|
28
|
+
monochrome/data/Monochrome.app/Contents/Resources/Monochrome.icns,sha256=6n9G-qpyT7mBNhw_8SHd4RTU2thcHjW_vhtWNbcNtL4,220359
|
29
|
+
monochrome-2025.1.17.dist-info/RECORD,,
|
30
|
+
monochrome-2025.1.17.dist-info/WHEEL,sha256=htUCHaC3G9W7CpZNA8SRdecIaBRMX7VsLJKrQXq2Y4M,116
|
31
|
+
monochrome-2025.1.17.dist-info/entry_points.txt,sha256=kVQolmivZmjNMMIQgDe1F6gbGv1POeXEq2c5MlDwNTw,62
|
32
|
+
monochrome-2025.1.17.dist-info/METADATA,sha256=ILGuiinoKW_qLQc-2JiDtEt7h0wuXBeDND2ggN2eQsE,8338
|
33
|
+
monochrome-2025.1.17.dist-info/licenses/LICENSE.md,sha256=hlfbZDVhozFVsj1Zj5ttezKMAMg3WGOIbRCUgVaSSbQ,1054
|
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2024 Jan Lebert
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
19
|
+
SOFTWARE.
|