pyAPIC.core.case module

class pyAPIC.core.case.Case(data: ImagingData, params: ReconParams, _result: dict | None = None)[source]

Bases: object

Encapsulates a reconstruction case: data, parameters, and results.

data: ImagingData
classmethod from_mat(mat_path: str, params: ReconParams, downsample: int = 1) Case[source]

Create a Case by loading imaging data from a .mat file and assigning parameters.

Parameters:
  • mat_path (str) – Path to the .mat file (HDF5 based).

  • params (ReconParams) – Reconstruction parameters.

  • downsample (int) – Factor to subsample the LED stack.

Returns:

Initialized Case object (results empty until run()).

Return type:

Case

params: ReconParams
plot()[source]

Generate result plot for this case.

plot_E_stack(ncols: int = 5) None[source]

Plot the LED stack as a grid of images.

Parameters:

ncols (int) – Number of columns in the grid.

plot_input(ncols: int = 5) None[source]

Plot the initial intensity stack as a grid of images.

Parameters:

ncols (int) – Number of columns in the grid.

property result: dict

Retrieve reconstruction outputs. Raises if run() has not been called.

run() None[source]

Execute the reconstruction algorithm. Populates self._result.

save(path: str) None[source]

Save the result dict to disk (e.g., pickle or HDF5).

Parameters:

path (str) – File path to save results.