ophth_algo_types
This module contains the dataclasses and constants used in the Ophthalmology.
Classes
ColumnFilter
class ColumnFilter( column: str, operator: str, value: Union[str, int, float], how: PartialMatchingType = 'all',):
Dataclass for column filtering.
Arguments
column
: The column name on which the filter will be applied. The filtering ignores capitalization or spaces for the column name.operator
: The operator for the filtering operation. E.g., "less than", ">=", "not equal", "==".value
: The value for the filter. This is allowed to be a string only forequals
ornot equal
operators, and needs to be a float or integer for all other operations.
Raises
ValueError
: If an inequality comparison operation is given with a value which cannot be converted to a float.
Variables
- static
column : str
- static
how : Literal['any', 'all']
- static
operator : str
- static
value : Union[str, int, float]
GAMetrics
class GAMetrics(*args, **kwargs):
Output of the GA calculation algorithm.
Attributes
total_ga_area
: Total area of GA in the image in mm^2.smallest_lesion_size
: Size of the smallest lesion in the image in mm^2.largest_lesion_size
: Size of the largest lesion in the image in mm^2.num_bscans_with_ga
: Number of B-scans with GA in the image.num_ga_lesions
: Number of GA lesions in the image.distance_from_image_centre
: Distance from the image centre to the nearest lesion in mm. Image centre is used as a proxy for the fovea.max_cnv_probability
: Maximum probability of CNV across all B-scans in the image. This value will be between 0 and 1.max_ga_bscan_index
: Index of the B-scan with the largest GA lesion if there is GA, otherwise None.segmentation_areas
: A dictionary containing the area of each segmentation class in the image in mm^2.
Ancestors
- builtins.dict
Variables
- static
distance_from_image_centre : float
- static
largest_lesion_size : float
- static
max_cnv_probability : float
- static
max_ga_bscan_index : Optional[int]
- static
num_bscans_with_ga : int
- static
num_ga_lesions : int
- static
segmentation_areas : dict
- static
smallest_lesion_size : float
- static
total_ga_area : float
ImageFieldType
class ImageFieldType(column: str):
Stores information for an image field.
Variables
- static
column : str
OCTImageMetadataColumns
class OCTImageMetadataColumns( height_mm_column: str = 'dimensions_mm_height', width_mm_column: str = 'dimensions_mm_width', depth_mm_column: str = 'dimensions_mm_depth',):
Dataclass for storing columns related to the OCT dimensions.
Arguments
height_mm_column
: The name of the column for where the height in mm of the OCT image. Defaults todimensions_mm_height
.width_mm_column
: The name of the column for where the width in mm of the OCT image. Defaults todimensions_mm_width
.depth_mm_column
: The name of the column for where the depth in mm of the OCT image. Defaults todimensions_mm_depth
.
ReportMetadata
class ReportMetadata( text_fields: list[TextFieldType], heading: Optional[str] = None, image_field: Optional[ImageFieldType] = None,):
Dataclass for storing pdf report metadata fields.
Variables
- static
heading : Optional[str]
- static
image_field : Optional[ImageFieldType]
- static
text_fields : list
SLOImageMetadataColumns
class SLOImageMetadataColumns( height_mm_column: str = 'slo_dimensions_mm_height', width_mm_column: str = 'slo_dimensions_mm_width',):
Dataclass for storing columns related to the SLO dimensions.
Arguments
height_mm_column
: The name of the column for where the height in mm of the SLO image. Defaults toslo_dimensions_mm_height
.width_mm_column
: The name of the column for where the width in mm of the SLO image. Defaults toslo_dimensions_mm_width
.
SLOSegmentationLocationPrefix
class SLOSegmentationLocationPrefix( start_x_image: str = 'loc_start_x_image_', start_y_image: str = 'loc_start_y_image_', end_x_image: str = 'loc_end_x_image_', end_y_image: str = 'loc_end_y_image_',):
Dataclass for location columns prefixes for the OCT images on the SLO.
Arguments
start_x_image
: Column name prefix where the start x-axis pixel location of the first OCT image is on SLO. Defaults toloc_start_x_image_
.start_y_image
: Column name prefix where the start y-axis pixel location of the first OCT image is on SLO. Defaults toloc_start_y_image_
.end_x_image
: Column name prefix where the end x-axis pixel location of the first OCT image is on SLO. Defaults toloc_end_x_image_
.end_y_image
: Column name prefix where the end y-axis pixel location of the first OCT image is on SLO. Defaults toloc_end_y_image_
.
Variables
- static
end_x_image : str
- static
end_y_image : str
- static
start_x_image : str
- static
start_y_image : str
TextFieldType
class TextFieldType( heading: str, column: Optional[str] = None, value: Optional[str] = None, datetime_format: Optional[str] = None,):
Stores information for a text field.
Variables
- static
column : Optional[str]
- static
datetime_format : Optional[str]
- static
heading : str
- static
value : Optional[str]
TrialNotesCSVArgs
class TrialNotesCSVArgs( columns_for_csv: list[str], columns_from_data: Optional[dict[str, str]] = None, columns_to_populate_with_static_values: Optional[dict[str, str]] = None, eligible_only: bool = True,):
Dataclass for storing the arguments for the trial notes CSV.
Arguments
columns_for_csv
: The columns to include in the trial notes CSV.columns_from_data
: The columns to include from the data. Defaults to None.columns_to_populate_with_static_values
: The columns to populate with static values. Defaults to None
Variables
- static
columns_for_csv : list
- static
columns_from_data : Optional[dict]
- static
columns_to_populate_with_static_values : Optional[dict]
- static
eligible_only : bool