API reference¶
CuPy/SciPy blind PSF estimation and cuCIM restoration.
- tiresias.clear_cupy_memory(*, device_id: int | None = None, clear_plan_cache: bool = True, free_memory_pool: bool = True) None¶
Release CuPy FFT plans and pooled allocations for one GPU.
- tiresias.deconvolve_with_cucim(observed: Any, psf: Any, n_iters: int, *, device_id: int = 0) ndarray¶
Restore an image with cuCIM using the estimated PSF.
- tiresias.estimate_blind_psf(observed: Any, initial_psf: Any, n_iters: int, *, xp: Any, fftconvolve: Callable[[...], Any], dampar: float = 0.0, return_history: bool = False, latent_update_period: int = 1, fft_engine: str | FftConvolutionEngine | None = None) Any | tuple[Any, list[float]]¶
Estimate a fixed-support PSF with alternating Richardson-Lucy updates.
- tiresias.estimate_psf_array_cupy(observed: ndarray, initial_psf: ndarray, n_iters: int, pad_z: int, *, peak_normalization: str = 'none', peak_gamma_max: float = 2.5, dampar: float = 0.0, device_id: int | None = None, clear_plan_cache: bool = True, free_memory_pool: bool = True, latent_update_period: int = 1, fft_engine: str = 'auto') ndarray¶
Estimate one PSF directly from host arrays on a single CuPy GPU.
- tiresias.estimate_psf_from_chunks(image_path: str | Path, psf_seed: ndarray, n_iters: int = 10, chunk_xy: int = 256, pad_xy: int = 32, pad_z: int = 20, max_workers: int = 1, prefetch_chunks: int = 0, vram_gb: float | None = None, cache_dir: str | Path | None = None, use_cache: bool = True, snr_weight_cap: float = 100.0, peak_normalization: str = 'none', peak_gamma_max: float = 2.5, latent_update_period: int = 2, cupy_fft_engine: str = 'scout', blind_z_slices: int = 128, blind_max_tiles: int = 16, adaptive_scout_iters: int = 2, adaptive_keep_tiles: int = 4, tile_selection_strategy: str = 'spatial_snr_v1', coarse_region_rows: int = 4, coarse_region_columns: int = 4, coarse_region_limit: int = 8) ndarray¶
Estimate and merge tiled CuPy blind-RL PSFs from a TIFF volume.
- tiresias.generate_psf_seed(*, psf_mode: str, na: float, detection_na: float | None, illumination_na: float | None, wavelength: float, ni: float, ns: float | None, ni0: float | None, tg: float | None, tg0: float | None, ng: float | None, ng0: float | None, ti0: float | None, oversample_factor: int, psf_model: str, dxy: float, dz: float, psf_size_z: int, psf_size_xy: int, background: float, light_sheet_angle: float = 90.0) ndarray¶
Create a single-detection or light-sheet blind-estimation seed PSF.
- tiresias.generate_theoretical_psf(na: float | None = None, detection_na: float | None = None, illumination_na: float | None = None, wavelength: float | None = None, ni: float | None = None, ns: float | None = None, ni0: float | None = None, tg: float | None = None, tg0: float | None = None, ng: float | None = None, ng0: float | None = None, ti0: float | None = None, oversample_factor: int = 3, psf_model: str = 'vectorial', dxy: float | None = None, dz: float | None = None, psf_size_z: int = 61, psf_size_xy: int = 128, background: float = 0.0) ndarray¶
Generate a normalized 3-D PSF seed with
psfmodels.make_psf.
- tiresias.open_tiff_memmap(path: str | Path) ndarray¶
Return a read-only array-like TIFF volume without forcing a full RAM load.
- tiresias.resolve_cupy_blind_chunk_xy(requested_xy: int, volume_shape: tuple[int, int, int], psf_shape: tuple[int, int, int], halo_xy: int, pad_z: int, vram_gb: float | None = None) tuple[int, str]¶
Clamp a requested CuPy core size to the available FFT workspace.
- tiresias.trim_cupy_memory_pool(max_total_bytes: int | None, *, device_id: int | None = None) bool¶
Free cached CuPy blocks only when the retained pool exceeds a run budget.
Command-line entry points for Tiresias.