From fa292a6a2d5c8eefa330c48ac3a2ec25ed7aafbc Mon Sep 17 00:00:00 2001 From: Peter Mikhael Date: Mon, 17 Jun 2024 18:11:54 -0400 Subject: [PATCH] Image position should be extracted into a list rather than single float of a single slice --- scripts/data/create_nlst_metadata_json.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/data/create_nlst_metadata_json.py b/scripts/data/create_nlst_metadata_json.py index 0ed21fe..70fce1c 100644 --- a/scripts/data/create_nlst_metadata_json.py +++ b/scripts/data/create_nlst_metadata_json.py @@ -120,7 +120,7 @@ def make_metadata_dict(dataframe, pid, timepoint, series_id, use_timepoint = Fal 'slice_number': [slicenumber], 'pixel_spacing': pixel_spacing, 'slice_thickness': slice_thickness, - 'img_position': img_posn, + 'img_position': [img_posn], 'series_data': make_metadata_dict(image_data, pid, timepoint, series_id, use_timepoint_and_studyinstance = True) } @@ -135,6 +135,7 @@ def make_metadata_dict(dataframe, pid, timepoint, series_id, use_timepoint = Fal json_dataset[pt_idx]['accessions'][exam_idx]['image_series'][series_id]['paths'].append(path) json_dataset[pt_idx]['accessions'][exam_idx]['image_series'][series_id]['slice_location'].append(slicelocation) json_dataset[pt_idx]['accessions'][exam_idx]['image_series'][series_id]['slice_number'].append(slicenumber) + json_dataset[pt_idx]['accessions'][exam_idx]['image_series'][series_id]['img_position'].append(img_posn) else: exam_dict['image_series'] = {series_id: img_series_dict} json_dataset[pt_idx]['accessions'].append(exam_dict)