Commit 56e662df authored by Alessia Marcolini's avatar Alessia Marcolini
Browse files

Add ROI name column to clinical files

parent 7916909e
......@@ -96,6 +96,14 @@ if DATASET_NAME == 'HN_val':
lambda x: grading_dict_grouped[x]
)
old_clinical_len = len(clinical)
# Get ROI name for each segmentation mask
ROI_INFO_FILENAME = 'INFO_GTVcontours_HN.csv'
roi_info = pd.read_csv(RAW_DATA_PATH / ROI_INFO_FILENAME)
clinical = clinical.merge(roi_info, on='patient')
assert old_clinical_len == len(clinical)
clinical.to_csv(PROCESSED_DATA_PATH / CLINICAL_DATA_FILENAME_CLEAN)
################### clean metadata file to keep only CT scans, PT scans and 1 segmentation mask
......@@ -332,7 +340,6 @@ if DATASET_NAME == 'HN_val':
dicom_folder = str(path_to_study / folder)
dicom_folders.append(dicom_folder)
# TODO: finish to reconstruct path
metadata['dicom_folder'] = dicom_folders
......@@ -347,7 +354,8 @@ elif DATASET_NAME == 'HN_BZ':
clinical_no_na[LABEL_COL_LOCOREGIONAL] = clinical_no_na[
LABEL_COL_LOCOREGIONAL
].astype(np.uint8)
# clinical_no_na.sort_values(by=PATIENT_COL, inplace=True)
clinical['ROI_name'] = 'lesione'
clinical_no_na.to_csv(
PROCESSED_DATA_PATH / CLINICAL_DATA_FILENAME_CLEAN, index=False
......
Supports Markdown
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