Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -549,3 +549,6 @@ dmypy.json

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode
**/__pycache__/**

# MacOS generated files
.DS_STORE
5 changes: 4 additions & 1 deletion src/dcm_classifier/image_type_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ def infer_contrast(self, feature_dict: dict = None) -> bool:
return False

# check if the volume has contrast
if "none" not in feature_dict[field].lower():
if (
"none" not in feature_dict[field].lower()
and feature_dict[field] != "-12345"
):
return True
return False

Expand Down
Git LFS file not shown
Git LFS file not shown
4 changes: 3 additions & 1 deletion tests/unit_testing/test_dicom_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def test_dcm_series_no_contrast(no_contrast_file_path):
study.run_inference()

for series_number, series in study.series_dictionary.items():
assert series.get_has_contrast() is False
assert (
series.get_has_contrast() is False
), f"File {series.get_volume_list()[0].get_one_volume_dcm_filenames()[0].name} came back with contrast"


def test_dcm_series_has_contrast(contrast_file_path):
Expand Down
Loading