Commit 71bd2078 authored by Alessia Marcolini's avatar Alessia Marcolini
Browse files

Save npy with filename given in clinical file

parent 8de02106
...@@ -55,6 +55,7 @@ for i, row in tqdm(clinical.iterrows()): ...@@ -55,6 +55,7 @@ for i, row in tqdm(clinical.iterrows()):
try: try:
patient = row['patient'] patient = row['patient']
filename_out = row['filename']
roi_name = row['ROI_name'] roi_name = row['ROI_name']
roi_modality = row['ROI_modality'] roi_modality = row['ROI_modality']
...@@ -105,7 +106,7 @@ for i, row in tqdm(clinical.iterrows()): ...@@ -105,7 +106,7 @@ for i, row in tqdm(clinical.iterrows()):
out = np.stack([sitk_to_numpy(scan_CT_box), sitk_to_numpy(scan_PT_box)], axis=0) out = np.stack([sitk_to_numpy(scan_CT_box), sitk_to_numpy(scan_PT_box)], axis=0)
# save # save
np.save(f'{OUTDIR}/{patient}.npy', out) np.save(OUTDIR / filename_out, out)
del scan_CT_box, scan_PT_box, segmentation, out del scan_CT_box, scan_PT_box, segmentation, out
gc.collect() gc.collect()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment