Skip to content

Commit

Permalink
Handle Datasets made from BytesIO
Browse files Browse the repository at this point in the history
  • Loading branch information
barrettMCW authored Sep 4, 2024
1 parent 5a3a8fe commit dc4868d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions deid/dicom/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import os
import re
from io import BytesIO
from copy import deepcopy

from pydicom import read_file
Expand Down Expand Up @@ -102,6 +103,7 @@ def load(self, dicom_file, force=True):

# Set class variables that might be helpful later
df = self.dicom.get("filename")
df = None if isinstance(df, BytesIO) else df
self.dicom_file = None if not df else os.path.abspath(df)
self.dicom_name = None if not df else os.path.basename(self.dicom_file)

Expand Down

0 comments on commit dc4868d

Please sign in to comment.