From 9f3080e9d09c2269f5f36531378418bd8e0b81e8 Mon Sep 17 00:00:00 2001 From: Dan Levitas Date: Tue, 13 Aug 2024 20:50:00 +0000 Subject: [PATCH] [FIX] Correct telemetry issue --- handler/telemetry.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/handler/telemetry.py b/handler/telemetry.py index 5092250..c676b30 100755 --- a/handler/telemetry.py +++ b/handler/telemetry.py @@ -13,6 +13,7 @@ import json # Begin +telemetry_url = "http://52.87.154.236/telemetry/" DATA_DIR = sys.argv[1] os.chdir(DATA_DIR) @@ -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: @@ -67,6 +69,7 @@ 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:] @@ -74,8 +77,12 @@ def gather_telemetry(dtype): 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