diff --git a/fastmri/data/mri_data.py b/fastmri/data/mri_data.py index bed6ca0b..c1263090 100644 --- a/fastmri/data/mri_data.py +++ b/fastmri/data/mri_data.py @@ -554,6 +554,17 @@ def get_annotation(self, empty_value, row): "height": -1, "label": "", } + elif row.study_level == "Yes": + annotation = { + "fname": str(row.file), + "slice": "", + "study_level": "Yes", + "x": -1, + "y": -1, + "width": -1, + "height": -1, + "label": str(row.label), + } else: annotation = { "fname": str(row.file), @@ -569,7 +580,10 @@ def get_annotation(self, empty_value, row): def download_csv(self, version, subsplit, path): # request file by git hash and mri type - url = f"https://raw.githubusercontent.com/microsoft/fastmri-plus/{version}/Annotations/{subsplit}.csv" + if version is None: + url = f"https://raw.githubusercontent.com/microsoft/fastmri-plus/main/Annotations/{subsplit}.csv" + else: + url = f"https://raw.githubusercontent.com/microsoft/fastmri-plus/{version}/Annotations/{subsplit}.csv" request = requests.get(url, timeout=10, stream=True) # create temporary folders