Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix for AnnotatedSliceDataset #276

Merged
merged 2 commits into from
Oct 24, 2022
Merged
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
16 changes: 15 additions & 1 deletion fastmri/data/mri_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
Expand Down