Skip to content

Commit

Permalink
Fix type hint for python3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
gacou54 committed Apr 8, 2024
1 parent d4e15dc commit be6e89c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions rt_utils/image_helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from typing import List
from typing import List, Union
from enum import IntEnum

import cv2 as cv
Expand All @@ -11,7 +11,7 @@
from rt_utils.utils import ROIData


def load_sorted_image_series(dicom_series_path: str | List[Dataset]) -> List[Dataset]:
def load_sorted_image_series(dicom_series_path: Union[str, List[Dataset]]) -> List[Dataset]:
"""
File contains helper methods for loading / formatting DICOM images and contours
"""
Expand Down
6 changes: 3 additions & 3 deletions rt_utils/rtstruct_builder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List
from typing import List, Union
from pydicom.dataset import Dataset
from pydicom.filereader import dcmread

Expand All @@ -15,7 +15,7 @@ class RTStructBuilder:
"""

@staticmethod
def create_new(dicom_series_path: str | List[Dataset]) -> RTStruct:
def create_new(dicom_series_path: Union[str, List[Dataset]]) -> RTStruct:
"""
Method to generate a new rt struct from a DICOM series
"""
Expand All @@ -25,7 +25,7 @@ def create_new(dicom_series_path: str | List[Dataset]) -> RTStruct:
return RTStruct(series_data, ds)

@staticmethod
def create_from(dicom_series_path: str | List[Dataset], rt_struct_path: str, warn_only: bool = False) -> RTStruct:
def create_from(dicom_series_path: Union[str, List[Dataset]], rt_struct_path: str, warn_only: bool = False) -> RTStruct:
"""
Method to load an existing rt struct, given related DICOM series and existing rt struct
"""
Expand Down

0 comments on commit be6e89c

Please sign in to comment.