miblab-plot 0.0.7__tar.gz → 0.0.9__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: miblab-plot
3
- Version: 0.0.7
3
+ Version: 0.0.9
4
4
  Summary: Plotting utilities for medical images
5
5
  Author-email: Steven Sourbron <s.sourbron@sheffield.ac.uk>
6
6
  License-Expression: Apache-2.0
@@ -16,15 +16,17 @@ Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: pillow
20
19
  Requires-Dist: numpy
21
20
  Requires-Dist: matplotlib
22
21
  Requires-Dist: tqdm
23
22
  Requires-Dist: pyvista
24
23
  Requires-Dist: scikit-image
25
24
  Requires-Dist: moviepy
26
- Requires-Dist: dbdicom
25
+ Requires-Dist: imageio
27
26
  Requires-Dist: zarr
27
+ Requires-Dist: pillow
28
+ Requires-Dist: dbdicom
29
+ Requires-Dist: miblab_ssa
28
30
  Dynamic: license-file
29
31
 
30
32
  # miblab-plot
@@ -6,17 +6,19 @@ requires = ['setuptools>=61.2']
6
6
 
7
7
  [project]
8
8
  name = "miblab-plot"
9
- version = "0.0.7"
9
+ version = "0.0.9"
10
10
  dependencies = [
11
- 'pillow',
12
- 'numpy',
13
- 'matplotlib',
14
- 'tqdm',
15
- 'pyvista',
16
- 'scikit-image',
17
- 'moviepy',
18
- 'dbdicom',
19
- 'zarr',
11
+ "numpy",
12
+ "matplotlib",
13
+ "tqdm",
14
+ "pyvista",
15
+ "scikit-image",
16
+ "moviepy",
17
+ "imageio",
18
+ "zarr",
19
+ "pillow",
20
+ "dbdicom",
21
+ "miblab_ssa",
20
22
  ]
21
23
 
22
24
  # optional information
@@ -135,10 +135,20 @@ def rotating_masks_grid(
135
135
  plotter.subplot(row, col)
136
136
  if labels is not None:
137
137
  plotter.add_text(str(labels[col, row]), font_size=6, color='black')
138
-
139
- plotter.add_mesh(surf, color='lightblue', smooth_shading=True)
140
- plotter.camera_position = [pos, center, (0, 0, 1)] # Simple Up-vector
141
138
 
139
+ # Catch empty masks
140
+ if surf.n_points > 0:
141
+ # Only calculate camera and add mesh if points exist
142
+ distance = surf.length * 2.5
143
+ center = list(surf.center)
144
+ pos = center + distance * np.array(vec)
145
+
146
+ plotter.add_mesh(surf, color='lightblue', smooth_shading=True)
147
+ plotter.camera_position = [pos, center, (0, 0, 1)]
148
+ else:
149
+ # Optional: Add placeholder text so you know it was empty
150
+ plotter.add_text("Empty Mask", font_size=5, color='gray')
151
+
142
152
  # 4. Save and Destroy
143
153
  # This is where the RAM resets to zero for the next angle
144
154
  file = os.path.join(dir_output, f"mosaic_{i:03d}.png")
@@ -228,10 +238,20 @@ def multiple_mosaic_masks_da(masks: list, directions: dict, labels, columns=None
228
238
  plotter.subplot(row, col)
229
239
  if labels is not None:
230
240
  plotter.add_text(labels[i], font_size=6, color='black')
231
-
232
- plotter.add_mesh(surf, color='lightblue', smooth_shading=True)
233
- plotter.camera_position = [pos, center, up]
234
241
 
242
+ # Catch empty masks
243
+ if surf.n_points > 0:
244
+ # Only calculate camera and add mesh if points exist
245
+ distance = surf.length * 2.5
246
+ center = list(surf.center)
247
+ pos = center + distance * np.array(vec)
248
+
249
+ plotter.add_mesh(surf, color='lightblue', smooth_shading=True)
250
+ plotter.camera_position = [pos, center, up]
251
+ else:
252
+ # Optional: Add placeholder text so you know it was empty
253
+ plotter.add_text("Empty Mask", font_size=5, color='gray')
254
+
235
255
  # 1. Initialize the window in the background
236
256
  plotter.show(auto_close=False, interactive=False, interactive_update=True)
237
257
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: miblab-plot
3
- Version: 0.0.7
3
+ Version: 0.0.9
4
4
  Summary: Plotting utilities for medical images
5
5
  Author-email: Steven Sourbron <s.sourbron@sheffield.ac.uk>
6
6
  License-Expression: Apache-2.0
@@ -16,15 +16,17 @@ Classifier: Programming Language :: Python
16
16
  Classifier: Programming Language :: Python :: 3
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: pillow
20
19
  Requires-Dist: numpy
21
20
  Requires-Dist: matplotlib
22
21
  Requires-Dist: tqdm
23
22
  Requires-Dist: pyvista
24
23
  Requires-Dist: scikit-image
25
24
  Requires-Dist: moviepy
26
- Requires-Dist: dbdicom
25
+ Requires-Dist: imageio
27
26
  Requires-Dist: zarr
27
+ Requires-Dist: pillow
28
+ Requires-Dist: dbdicom
29
+ Requires-Dist: miblab_ssa
28
30
  Dynamic: license-file
29
31
 
30
32
  # miblab-plot
@@ -1,9 +1,11 @@
1
- pillow
2
1
  numpy
3
2
  matplotlib
4
3
  tqdm
5
4
  pyvista
6
5
  scikit-image
7
6
  moviepy
8
- dbdicom
7
+ imageio
9
8
  zarr
9
+ pillow
10
+ dbdicom
11
+ miblab_ssa
File without changes
File without changes
File without changes