Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/preprocessing/01_scanDicom.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ def _extractDicom_impl(f: str, slice_counts: Dict[str, int] = None) -> Optional[
'DATE': extract.Date(),
'DOB': extract.DOB(),
'Series_desc': extract.Desc(),
'Study_desc': extract.StudyDesc(),
'Anatomic_region': extract.AnatomicRegion(),
'Modality': extract.Modality(),
'Part': extract.Part(),
'AcqTime': extract.Acq(),
Expand Down
18 changes: 18 additions & 0 deletions code/preprocessing/DICOM.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
tag.Tag('AccessionNumber'), # Accession()
tag.Tag('StudyDate'), # Date()
tag.Tag('SeriesDescription'), # Desc(), LR() fallback chain
tag.Tag('StudyDescription'), # StudyDesc()
tag.Tag(0x0018, 0x0015), # AnatomicRegion()
tag.Tag('RepetitionTime'), # Modality()
tag.Tag('AcquisitionTime'), # Acq()
tag.Tag('BodyPartExamined'), # Part()
Expand Down Expand Up @@ -122,6 +124,22 @@ def Desc(self) -> str:
except Exception as e:
self.log_error('Unable to read SeriesDescription', e)
return self.UNKNOWN

def StudyDesc(self) -> str:
"""Attempts to extract the study description"""
try:
return self.metadata.StudyDescription
except Exception as e:
self.log_error('Unable to read StudyDescription', e)
return self.UNKNOWN

def AnatomicRegion(self) -> str:
"""Attempts to extract the anatomic region of the scan"""
try:
return self.metadata.AnatomicRegion
except Exception as e:
self.log_error('Unable to read AnatomicRegion', e)
return self.UNKNOWN

def Modality(self) -> str:
"""Attempts to extract the modality of the scan"""
Expand Down
Loading