Skip to content

Commit

Permalink
Image position should be extracted into a list rather than single flo…
Browse files Browse the repository at this point in the history
…at of a single slice
  • Loading branch information
pgmikhael authored and jsilter committed Jul 30, 2024
1 parent 3eda662 commit fa292a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/data/create_nlst_metadata_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand All @@ -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)
Expand Down

0 comments on commit fa292a6

Please sign in to comment.