Skip to content
Snippets Groups Projects
Commit ac255d26 authored by Simon Wittl's avatar Simon Wittl
Browse files

Merge branch 'dev' into 'main'

init mirror

See merge request !1
parents 29a00470 90fc88f7
No related branches found
No related tags found
1 merge request!1init mirror
from .load_projection import load_projection, load_header
__all__ = ["load_projection", "load_header"]
from PIL import Image
import numpy as np
from pathlib import Path
import json
import time
def load_projection(
projection_path: Path, load_projection_geometry: bool = True
) -> tuple[np.ndarray, dict]:
try:
projection_array = np.array(Image.open(projection_path))
except FileNotFoundError:
time.sleep(1)
projection_array = np.array(Image.open(projection_path))
if not load_projection_geometry:
return projection_array, None
else:
return projection_array, load_header(projection_path)
def load_header(projection_path) -> dict:
with open(str(projection_path.parent / f"{projection_path.stem}.json"), "r") as f:
projection_geometry = json.load(f)
return projection_geometry
uv.lock 0 → 100644
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment