Skip to content

Commit

Permalink
[FIX] Correct telemetry issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Aug 13, 2024
1 parent 924fa22 commit 9f3080e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion handler/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import json

# Begin
telemetry_url = "http://52.87.154.236/telemetry/"
DATA_DIR = sys.argv[1]
os.chdir(DATA_DIR)

Expand Down Expand Up @@ -44,6 +45,7 @@ def gather_telemetry(dtype):
idx = str(subject_idx) + str(session_idx) + str(series_idx)

seq_file_name = json_data['series'][series_idx]['nifti_path']
seq_file_name = seq_file_name.split('/')[-1]

ezBIDS_type = json_data['series'][series_idx]['type']
if '/' in ezBIDS_type:
Expand All @@ -67,15 +69,20 @@ def gather_telemetry(dtype):
else:
print(error_message)

# print(ezBIDS_telemetry_info_list)
if len(ezBIDS_telemetry_info_list) > 1:
header = ezBIDS_telemetry_info_list[0]
rows = ezBIDS_telemetry_info_list[1:]
ezBIDS_telemetry_info_json = []
for row in rows:
ezBIDS_telemetry_info_json.append(dict(zip(header, row)))

output_data = {}
output_data['description'] = 'ezBIDS'
output_data['finalized'] = ezBIDS_telemetry_info_json

with open(output_file, "w") as fp:
json.dump(ezBIDS_telemetry_info_json, fp, indent=3)
json.dump(output_data, fp, indent=3)


# Execute functionality
Expand Down

0 comments on commit 9f3080e

Please sign in to comment.