Skip to content

Commit

Permalink
fix: remove deprecated pydicom.dicomdir.DicomDir variable type option (
Browse files Browse the repository at this point in the history
…#130)

* fix: remove deprecated pydicom.dicomdir.DicomDir variable type option

* style: removed Union since dicom_data can only be a FileDataset

* refactor: remove Union import for linting
  • Loading branch information
strixy16 authored Oct 23, 2024
1 parent 272078c commit 56ef37e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/imgtools/utils/dicomutils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pydicom
from typing import Dict, TypeVar, Union
from typing import Dict, TypeVar
import copy

T = TypeVar('T')
Expand Down Expand Up @@ -59,7 +59,7 @@ def get_modality_metadata(dicom_data, modality: str):
return metadata


def all_modalities_metadata(dicom_data: Union[pydicom.dataset.FileDataset, pydicom.dicomdir.DicomDir]) -> Dict[str, T]:
def all_modalities_metadata(dicom_data: pydicom.dataset.FileDataset) -> Dict[str, T]:
metadata = get_modality_metadata(dicom_data, 'ALL')

if hasattr(dicom_data, 'PixelSpacing') and hasattr(dicom_data, 'SliceThickness'):
Expand Down

0 comments on commit 56ef37e

Please sign in to comment.