Skip to content

Commit 7e08aa7

Browse files
committed
Sort label images so that we always select the same one
1 parent 01398fb commit 7e08aa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notebooks/getting_started/part3_exploring_cohorts.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,7 @@
836836
},
837837
"outputs": [],
838838
"source": [
839-
"label_image_series_UID = os.listdir(f\"IDC_sorted/{patient_ID}/{study_UID}/SEG\")[0] # Select the first segmentation\n",
839+
"label_image_series_UID = sorted(os.listdir(f\"IDC_sorted/{patient_ID}/{study_UID}/SEG\"))[-1] # Select the last segmentation\n",
840840
"label_image_SOP_UID = os.listdir(f\"IDC_sorted/{patient_ID}/{study_UID}/SEG/{label_image_series_UID}\")[0] # Get the name of the DICOM file\n",
841841
"\n",
842842
"# Read the DICOM SEG object using pydicom and pydicom_seg.\n",

0 commit comments

Comments
 (0)