miblab-plot 0.0.5__tar.gz → 0.0.7__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.5
3
+ Version: 0.0.7
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
@@ -6,7 +6,7 @@ requires = ['setuptools>=61.2']
6
6
 
7
7
  [project]
8
8
  name = "miblab-plot"
9
- version = "0.0.5"
9
+ version = "0.0.7"
10
10
  dependencies = [
11
11
  'pillow',
12
12
  'numpy',
@@ -420,7 +420,7 @@ def display_two_kidneys(kidney1, kidney2,
420
420
  centroid_1, axes_1 = compute_principal_axes(kidney1, kidney1_voxel_size)
421
421
  centroid_2, axes_2 = compute_principal_axes(kidney2, kidney2_voxel_size)
422
422
 
423
- plotter = pv.Plotter(window_size=(1000,600), shape=(1,2))
423
+ plotter = pv.Plotter(window_size=(1000,600), shape=(1,2), off_screen=False)
424
424
  plotter.background_color = 'white'
425
425
 
426
426
  # Original
@@ -1,7 +1,6 @@
1
1
  import os
2
- from pathlib import Path
3
2
  from typing import Union
4
- import gc
3
+ import platform
5
4
 
6
5
  import numpy as np
7
6
  from tqdm import tqdm
@@ -10,25 +9,24 @@ import dbdicom as db
10
9
  import zarr
11
10
 
12
11
  import miblab_ssa as ssa
13
- import platform
14
12
 
15
13
 
16
14
  def setup_rendering_env():
15
+
16
+ # Default is no interactive rendering
17
+ pv.OFF_SCREEN = True
18
+
17
19
  current_os = platform.system().lower()
18
- # On Linux, check for DISPLAY. On Windows/Mac, we usually assume a display exists.
19
- is_headless = (os.environ.get("DISPLAY") is None) if current_os == "linux" else False
20
-
21
- if is_headless:
22
- try:
23
- pv.start_xvfb()
24
- except Exception:
25
- pass
26
-
27
- # IMPORTANT: We want to ALLOW off-screen rendering even on Windows
28
- # So we don't force pv.OFF_SCREEN to be False just because we have a screen.
29
- pv.OFF_SCREEN = True
20
+ if current_os == "linux":
30
21
 
31
- print(f"OS: {current_os} | Headless: {is_headless} | Off-screen: {pv.OFF_SCREEN}")
22
+
23
+ # 2. Environment variables to bypass X11 requirements
24
+ os.environ['QT_QPA_PLATFORM'] = 'offscreen'
25
+ os.environ['PYVISTA_OFF_SCREEN'] = 'true'
26
+
27
+ print("Linux Cluster: OSMesa/Software rendering enabled.")
28
+
29
+
32
30
 
33
31
  setup_rendering_env()
34
32
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: miblab-plot
3
- Version: 0.0.5
3
+ Version: 0.0.7
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
File without changes
File without changes
File without changes