Skip to content

Commit

Permalink
[FIX] issue with direction entity label
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Aug 4, 2023
1 parent 1eddcc5 commit 3f35e88
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions handler/ezBIDS_core/ezBIDS_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,8 @@ def entity_labels_identification(dataset_list_unique_series):
if len(entity) > 2: # an entity less than 3 characters could cause problems, though I don't think there are any entities currently this short
if entity == "res" and ("rest" in sd or "rest" in json_path): # short for "resolution", but might be confused with 'rest'
pass
elif entity == "dir": # ezBIDS already knows the phase encoding direction for dir entitiy label

Check failure on line 1433 in handler/ezBIDS_core/ezBIDS_core.py

View workflow job for this annotation

GitHub Actions / Check for spelling errors

entitiy ==> entity
series_entities[key] = ""
elif entity in sd:
item = sd.split(entity)[-1][0] # what comes right after the entity
if item.isalpha() == False and item.isnumeric() == False: # non-alphanumeric character separates entity key from its value
Expand All @@ -1445,7 +1447,7 @@ def entity_labels_identification(dataset_list_unique_series):
else:
series_entities[key] = ""
else:
series_entities[key] = ""
series_entities[key] = ""

""" If BIDS naming convention isn't detected, do a more thorough
check for certain entities labels
Expand All @@ -1459,7 +1461,7 @@ def entity_labels_identification(dataset_list_unique_series):
if len(match_index):
series_entities["task"] = cog_atlas_tasks[match_index[0]]

# dir (required for fmap/epi an highly recommended for dwi/dwi)
# dir (required for fmap/epi and highly recommended for dwi/dwi)
if any(x in unique_dic["type"] for x in ["fmap/epi", "dwi/dwi"]) and not series_entities["direction"]:
series_entities["direction"] = unique_dic["direction"]

Expand Down

0 comments on commit 3f35e88

Please sign in to comment.