Skip to content

Reference for pyronn/ct_reconstruction/geometry/geometry_specific.py


pyronn.ct_reconstruction.geometry.geometry_specific.SpecificGeometry

SpecificGeometry(geo_info_dict, traj_func)

Bases: ABC

geo_info_dict: All required information for creating a geometry.
Source code in pyronn/ct_reconstruction/geometry/geometry_specific.py
def __init__(self, geo_info_dict, traj_func):
    """
    Generate a specific geometry
    Args:
        geo_info_dict: All required information for creating a geometry.
    """
    self.geometry_info = geo_info_dict
    self.geometry = self.set_geo()
    temp_info = {**geo_info_dict, **self.geometry.get_dict()}
    self.trajectory = traj_func(**temp_info)
    self.geometry.set_trajectory(self.trajectory)

generate_specific_phantom

generate_specific_phantom(phantom_func, *args, **kwargs)

Generates a phantom created by the given function and its corresponding sinogram.

The method first creates a phantom based on the volume shape specified in the geometry attribute of the class. It then computes the sinogram by applying a forward projection. The projection is calculated based on the parameters defined in the geometry attribute, including the detector shape, spacing, and the source-detector configuration.

Returns:

Type Description

Tuple[np.array, np.array]: A tuple containing two numpy arrays. The first array is the generated

3D mask of the phantom, and the second array is the corresponding 3D sinogram obtained through

the cone beam forward projection.

Source code in pyronn/ct_reconstruction/geometry/geometry_specific.py
def generate_specific_phantom(self, phantom_func, *args, **kwargs):
    """
    Generates a phantom created by the given function and its corresponding sinogram.

    The method first creates a phantom based on the volume shape specified in the
    geometry attribute of the class. It then computes the sinogram by applying a forward projection.
    The projection is calculated based on the parameters defined in the
    geometry attribute, including the detector shape, spacing, and the source-detector configuration.

    Returns:
        Tuple[np.array, np.array]: A tuple containing two numpy arrays. The first array is the generated
        3D mask of the phantom, and the second array is the corresponding 3D sinogram obtained through
        the cone beam forward projection.
    """
    phantom = phantom_func(self.geometry_info['volume_shape'], *args, **kwargs)
    phantom = np.expand_dims(phantom, axis=0)
    mask = (phantom != 0)
    sinogram = self.create_sinogram(phantom)
    return mask, sinogram, phantom, self.geometry





pyronn.ct_reconstruction.geometry.geometry_specific.CircularGeometrys3D

CircularGeometrys3D(geo_dict_info)

Bases: SpecificGeometry

Source code in pyronn/ct_reconstruction/geometry/geometry_specific.py
def __init__(self, geo_dict_info):
    # TODO: Document this function on your own. Could not be documented by the model.
    # TODO: Document this function on your own. Could not be documented by the model.
    super().__init__(geo_dict_info, circular_trajectory_3d)





pyronn.ct_reconstruction.geometry.geometry_specific.ArbitraryGeometrys3D

ArbitraryGeometrys3D(geo_dict_info)

Bases: SpecificGeometry

Source code in pyronn/ct_reconstruction/geometry/geometry_specific.py
def __init__(self, geo_dict_info):
    # TODO: Document this function on your own. Could not be documented by the model.
    # TODO: Document this function on your own. Could not be documented by the model.
    super().__init__(geo_dict_info, arbitrary_projection_matrix)