You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
841 B
41 lines
841 B
from typing import Optional, NamedTuple |
|
import torch |
|
import numpy as np |
|
|
|
|
|
class Prediction(NamedTuple): |
|
overall_probability: float |
|
is_pathology: bool |
|
report: str |
|
conclusion: str |
|
image: np.ndarray | str |
|
properties: dict |
|
|
|
|
|
class PredictorInput(NamedTuple): |
|
study_uid: str |
|
image: torch.Tensor |
|
laterality: Optional[str] |
|
px_width: Optional[float] |
|
px_height: Optional[float] |
|
|
|
|
|
class MetaTags(NamedTuple): |
|
study_iuid: str |
|
series_iuid: str |
|
patient_id: Optional[str] |
|
accession_number: Optional[str] |
|
issuer_of_patient_id: Optional[str] |
|
filler_number: Optional[str] |
|
|
|
|
|
class TagError(Exception): |
|
def __init__(self, msg): |
|
self.msg = msg |
|
super().__init__() |
|
|
|
|
|
class ImagesError(Exception): |
|
def __init__(self, msg): |
|
self.msg = msg |
|
super().__init__() |