Skip to content

Commit

Permalink
Projectors: disable support for SART by default in the uncorrected pr…
Browse files Browse the repository at this point in the history
…ojector

Signed-off-by: Nicola VIGANO <[email protected]>
  • Loading branch information
Obi-Wan committed Aug 2, 2023
1 parent 322fac8 commit 5648bbd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
16 changes: 8 additions & 8 deletions corrct/_projector_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def initialize_geometry(
angles_rot_rad: Union[ArrayLike, NDArray],
rot_axis_shift_pix: Union[ArrayLike, NDArray, None] = None,
prj_geom: Optional[ProjectionGeometry] = None,
create_single_projs: bool = True,
create_single_projs: bool = False,
):
"""Initialize the projector geometry.
Expand All @@ -142,7 +142,7 @@ def initialize_geometry(
The fully specified projection geometry.
When active, the rotation axis shift is ignored. The default is None.
create_single_projs : bool, optional
Whether to create projectors for single projections. Used for corrections and SART. The default is True.
Whether to create projectors for single projections. Used for corrections and SART. The default is False.
"""
self.vol_geom = vol_geom

Expand Down Expand Up @@ -276,7 +276,7 @@ def initialize_geometry(
angles_rot_rad: Union[ArrayLike, NDArray],
rot_axis_shift_pix: Union[ArrayLike, NDArray, None] = None,
prj_geom: Optional[ProjectionGeometry] = None,
create_single_projs: bool = True,
create_single_projs: bool = False,
):
"""Initialize projector backend based on scikit-image.
Expand All @@ -294,7 +294,7 @@ def initialize_geometry(
When active, the rotation axis shift is ignored. The default is None.
NOT SUPPORTED: if anything else than None is passed, it will throw an error!
create_single_projs : bool, optional
Whether to create projectors for single projections. Used for corrections and SART. The default is True.
Whether to create projectors for single projections. Used for corrections and SART. The default is False.
Raises
------
Expand Down Expand Up @@ -433,7 +433,7 @@ def initialize_geometry(
angles_rot_rad: Union[ArrayLike, NDArray],
rot_axis_shift_pix: Union[ArrayLike, NDArray, None] = None,
prj_geom: Optional[ProjectionGeometry] = None,
create_single_projs: bool = True,
create_single_projs: bool = False,
):
"""Initialize geometry of projector backend based on astra-toolbox.
Expand All @@ -449,7 +449,7 @@ def initialize_geometry(
The fully specified projection geometry.
When active, the rotation axis shift is ignored. The default is None.
create_single_projs : bool, optional
Whether to create projectors for single projections. Used for corrections and SART. The default is True.
Whether to create projectors for single projections. Used for corrections and SART. The default is False.
Raises
------
Expand Down Expand Up @@ -753,7 +753,7 @@ def initialize_geometry(
angles_rot_rad: Union[ArrayLike, NDArray],
rot_axis_shift_pix: Union[ArrayLike, NDArray, None] = None,
prj_geom: Optional[ProjectionGeometry] = None,
create_single_projs: bool = True,
create_single_projs: bool = False,
):
"""Initialize projector backend based on experimental astra-toolbox functions.
Expand All @@ -769,7 +769,7 @@ def initialize_geometry(
The fully specified projection geometry.
When active, the rotation axis shift is ignored. The default is None.
create_single_projs : bool, optional
Whether to create projectors for single projections. Used for corrections and SART. The default is True.
Whether to create projectors for single projections. Used for corrections and SART. The default is False.
Raises
------
Expand Down
7 changes: 4 additions & 3 deletions corrct/projectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __init__(
prj_intensities: Optional[ArrayLike] = None,
psf: Optional[ArrayLike] = None,
backend: Union[str, prj_backends.ProjectorBackend] = "astra" if astra_available else "skimage",
create_single_projs: bool = True,
create_single_projs: bool = False,
):
"""Initialize the base projection class.
Expand Down Expand Up @@ -152,7 +152,7 @@ def __init__(
The default is True if CUDA and ASTRA are available, otherwise False.
create_single_projs : bool, optional
Whether to create projectors for single projections.
Used for corrections and SART, by default True.
Used for corrections and SART, by default False.
Raises
------
Expand All @@ -168,7 +168,7 @@ def __init__(
raise ValueError(f"Passed ASTRA projector, but astra not available ({astra_status}).")

if not isinstance(vol_geom, models.VolumeGeometry):
vol_geom = models.VolumeGeometry(vol_shape_xyz=np.array(vol_geom))
vol_geom = models.VolumeGeometry(_vol_shape_xyz=np.array(vol_geom))
self.vol_geom = vol_geom

if not len(self.vol_geom.shape_xyz) in (2, 3):
Expand Down Expand Up @@ -448,6 +448,7 @@ def __init__(
psf=psf,
prj_intensities=prj_intensities,
backend=backend,
create_single_projs=True,
)

self.data_type = data_type
Expand Down

0 comments on commit 5648bbd

Please sign in to comment.