Skip to content

Commit

Permalink
Update custom_etl.py
Browse files Browse the repository at this point in the history
  • Loading branch information
afamiliar committed May 7, 2024
1 parent 5c4503d commit 22f2876
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/image_deid_etl/image_deid_etl/custom_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ def get_fw_proj_cbtn(cbtn_df,sub_mapping):
fw_projects.append(proj_mapping[diagnosis_to_use]) # use hard-coded dictionary to map to fw-proj label
else:
# use the age-in-days at imaging (from the session labels) to find the row with the closest age-at-diagnosis value
closest_diagnosis = closest(sub_rows['Age at Event'].values.astype(int).tolist(), int(age_at_imaging[ind])) # closest age row
closest_diagnosis = closest(sub_rows['Age at Event Days'].values.astype(int).tolist(), int(age_at_imaging[ind])) # closest age row
# grab the diagnosis label for that row
diagnosis_to_use = sub_rows[sub_rows['Age at Event']==str(closest_diagnosis)]['Diagnoses'].tolist()[0]
diagnosis_to_use = sub_rows[sub_rows['Age at Event Days']==str(closest_diagnosis)]['Diagnoses'].tolist()[0]
# map to the FW-project labels
fw_projects.append(proj_mapping[diagnosis_to_use]) # use hard-coded dictionary to map to fw-proj label
ind+=1
Expand Down

0 comments on commit 22f2876

Please sign in to comment.