From ea424ee4d8a8abe345aea3b551a2d964da4a1442 Mon Sep 17 00:00:00 2001 From: Andrey Fedorov Date: Fri, 18 Oct 2024 17:44:27 -0400 Subject: [PATCH] Updated to demonstrate how to select by admitting diagnosis --- .../slide_microscopy_metadata_search.ipynb | 2471 ++++++++++------- 1 file changed, 1455 insertions(+), 1016 deletions(-) diff --git a/notebooks/pathomics/slide_microscopy_metadata_search.ipynb b/notebooks/pathomics/slide_microscopy_metadata_search.ipynb index 5d368ea..a5957f3 100644 --- a/notebooks/pathomics/slide_microscopy_metadata_search.ipynb +++ b/notebooks/pathomics/slide_microscopy_metadata_search.ipynb @@ -5,7 +5,6 @@ "colab": { "provenance": [], "toc_visible": true, - "authorship_tag": "ABX9TyMWcnwGnKZ3t4DGjUpmrVQB", "include_colab_link": true }, "kernelspec": { @@ -40,7 +39,8 @@ "\n", "--\n", "\n", - "Initial version: Sept 2024" + "Initial version: Sept 2024\n", + "Updated: Oct 2024" ], "metadata": { "id": "iRHJXEP5ygbz" @@ -115,7 +115,7 @@ "height": 444 }, "id": "R_d926VyDONK", - "outputId": "1dc2e0ec-3696-40d6-d8a5-090ee648a9d1" + "outputId": "7b15f3f5-26c0-4f6c-a971-6308ae267a04" }, "execution_count": 3, "outputs": [ @@ -124,17 +124,17 @@ "data": { "text/plain": [ " SeriesInstanceUID \\\n", - "0 1.3.6.1.4.1.5962.99.1.3319141304.1986252809.16... \n", - "1 1.3.6.1.4.1.5962.99.1.3152197829.524344983.163... \n", - "2 1.3.6.1.4.1.5962.99.1.1999062777.1863936885.16... \n", - "3 1.3.6.1.4.1.5962.99.1.1900407564.65707978.1719... \n", - "4 1.3.6.1.4.1.5962.99.1.2901719137.315580539.168... \n", + "0 1.3.6.1.4.1.5962.99.1.1999268320.1342041208.16... \n", + "1 1.3.6.1.4.1.5962.99.1.3131780201.635930551.163... \n", + "2 1.3.6.1.4.1.5962.99.1.3659989787.665993356.164... \n", + "3 1.3.6.1.4.1.5962.99.1.1955591724.1804988297.17... \n", + "4 1.3.6.1.4.1.5962.99.1.1956843406.903021297.171... \n", "... ... \n", - "65996 1.3.6.1.4.1.5962.99.1.2427784968.111358259.172... \n", - "65997 1.3.6.1.4.1.5962.99.1.2421536925.165092872.172... \n", - "65998 1.3.6.1.4.1.5962.99.1.2424302797.1358492114.17... \n", - "65999 1.3.6.1.4.1.5962.99.1.2425957569.1826649791.17... \n", - "66000 1.3.6.1.4.1.5962.99.1.2419608874.1911229873.17... \n", + "65996 1.3.6.1.4.1.5962.99.1.2420195281.130683138.172... \n", + "65997 1.3.6.1.4.1.5962.99.1.2427576868.335178656.172... \n", + "65998 1.3.6.1.4.1.5962.99.1.2416898309.1706721250.17... \n", + "65999 1.3.6.1.4.1.5962.99.1.2426268918.1085576112.17... \n", + "66000 1.3.6.1.4.1.5962.99.1.2416522735.1131112112.17... \n", "\n", " embeddingMedium_CodeMeaning embeddingMedium_code_designator_value_str \\\n", "0 [Paraffin wax] [SCT:311731000] \n", @@ -145,7 +145,7 @@ "... ... ... \n", "65996 [Paraffin wax] [SCT:311731000] \n", "65997 [Paraffin wax] [SCT:311731000] \n", - "65998 [] [] \n", + "65998 [Paraffin wax] [SCT:311731000] \n", "65999 [Paraffin wax] [SCT:311731000] \n", "66000 [Paraffin wax] [SCT:311731000] \n", "\n", @@ -153,60 +153,60 @@ "0 [Formalin] [SCT:431510009] \n", "1 [] [] \n", "2 [Formalin] [SCT:431510009] \n", - "3 [Formalin] [SCT:431510009] \n", - "4 [Formalin] [SCT:431510009] \n", + "3 [PAXgene Tissue System] [NCIt:C185113] \n", + "4 [PAXgene Tissue System] [NCIt:C185113] \n", "... ... ... \n", "65996 [PAXgene Tissue System] [NCIt:C185113] \n", "65997 [PAXgene Tissue System] [NCIt:C185113] \n", - "65998 [Tissue freezing medium] [SCT:433469005] \n", + "65998 [PAXgene Tissue System] [NCIt:C185113] \n", "65999 [PAXgene Tissue System] [NCIt:C185113] \n", "66000 [PAXgene Tissue System] [NCIt:C185113] \n", "\n", " staining_usingSubstance_CodeMeaning \\\n", - "0 [water soluble eosin stain, hematoxylin stain] \n", + "0 [hematoxylin stain, water soluble eosin stain] \n", "1 [hematoxylin stain, water soluble eosin stain] \n", "2 [water soluble eosin stain, hematoxylin stain] \n", - "3 [water soluble eosin stain, hematoxylin stain] \n", - "4 [hematoxylin stain, water soluble eosin stain] \n", + "3 [hematoxylin stain, water soluble eosin stain] \n", + "4 [water soluble eosin stain, hematoxylin stain] \n", "... ... \n", - "65996 [hematoxylin stain, water soluble eosin stain] \n", + "65996 [water soluble eosin stain, hematoxylin stain] \n", "65997 [water soluble eosin stain, hematoxylin stain] \n", "65998 [water soluble eosin stain, hematoxylin stain] \n", "65999 [hematoxylin stain, water soluble eosin stain] \n", - "66000 [water soluble eosin stain, hematoxylin stain] \n", + "66000 [hematoxylin stain, water soluble eosin stain] \n", "\n", " staining_usingSubstance_code_designator_value_str min_PixelSpacing_2sf \\\n", - "0 [SCT:36879007, SCT:12710003] 0.00025 \n", + "0 [SCT:12710003, SCT:36879007] 0.00051 \n", "1 [SCT:12710003, SCT:36879007] 0.00025 \n", - "2 [SCT:36879007, SCT:12710003] 0.00051 \n", - "3 [SCT:36879007, SCT:12710003] 0.00026 \n", - "4 [SCT:12710003, SCT:36879007] 0.00025 \n", + "2 [SCT:36879007, SCT:12710003] 0.00025 \n", + "3 [SCT:12710003, SCT:36879007] 0.00049 \n", + "4 [SCT:36879007, SCT:12710003] 0.00049 \n", "... ... ... \n", - "65996 [SCT:12710003, SCT:36879007] 0.00049 \n", + "65996 [SCT:36879007, SCT:12710003] 0.00049 \n", "65997 [SCT:36879007, SCT:12710003] 0.00049 \n", "65998 [SCT:36879007, SCT:12710003] 0.00049 \n", "65999 [SCT:12710003, SCT:36879007] 0.00049 \n", - "66000 [SCT:36879007, SCT:12710003] 0.00049 \n", + "66000 [SCT:12710003, SCT:36879007] 0.00049 \n", "\n", " max_TotalPixelMatrixColumns max_TotalPixelMatrixRows \\\n", - "0 113543 78359 \n", - "1 101863 25687 \n", - "2 23904 20969 \n", - "3 29949 44899 \n", - "4 49799 17377 \n", + "0 19920 29475 \n", + "1 114240 21855 \n", + "2 71712 70309 \n", + "3 45815 37170 \n", + "4 53783 37464 \n", "... ... ... \n", - "65996 51791 38136 \n", - "65997 41831 29919 \n", - "65998 9959 16298 \n", - "65999 41831 30257 \n", - "66000 43823 31229 \n", + "65996 45815 37922 \n", + "65997 45815 34939 \n", + "65998 45815 34276 \n", + "65999 37847 38470 \n", + "66000 39839 31500 \n", "\n", " ObjectiveLensPower primaryAnatomicStructure_code_designator_value_str \\\n", - "0 40 SCT:15924003 \n", + "0 20 SCT:64163001 \n", "1 40 SCT:68594002 \n", - "2 20 SCT:64163001 \n", - "3 40 SCT:71836000 \n", - "4 40 SCT:117590005 \n", + "2 40 SCT:74862005 \n", + "3 20 SCT:76784001 \n", + "4 20 SCT:76784001 \n", "... ... ... \n", "65996 20 SCT:82082004 \n", "65997 20 SCT:82082004 \n", @@ -215,11 +215,11 @@ "66000 20 SCT:82082004 \n", "\n", " primaryAnatomicStructure_CodeMeaning \\\n", - "0 Maxillary sinus \n", + "0 Head of pancreas \n", "1 Adrenal cortex \n", - "2 Head of pancreas \n", - "3 Nasopharynx \n", - "4 Ear \n", + "2 Uvea \n", + "3 Vagina \n", + "4 Vagina \n", "... ... \n", "65996 Esophageal mucous membrane \n", "65997 Esophageal mucous membrane \n", @@ -230,9 +230,9 @@ " primaryAnatomicStructureModifier_code_designator_value_str \\\n", "0 None \n", "1 SCT:86049000 \n", - "2 None \n", - "3 SCT:108369006 \n", - "4 SCT:24028007 \n", + "2 SCT:86049000 \n", + "3 None \n", + "4 None \n", "... ... \n", "65996 None \n", "65997 None \n", @@ -243,9 +243,35 @@ " primaryAnatomicStructureModifier_CodeMeaning \\\n", "0 None \n", "1 Neoplasm, Primary \n", + "2 Neoplasm, Primary \n", + "3 None \n", + "4 None \n", + "... ... \n", + "65996 None \n", + "65997 None \n", + "65998 None \n", + "65999 None \n", + "66000 None \n", + "\n", + " illuminationType_code_designator_value_str illuminationType_CodeMeaning \\\n", + "0 DCM:111744 Brightfield illumination \n", + "1 DCM:111744 Brightfield illumination \n", + "2 DCM:111744 Brightfield illumination \n", + "3 DCM:111744 Brightfield illumination \n", + "4 DCM:111744 Brightfield illumination \n", + "... ... ... \n", + "65996 DCM:111744 Brightfield illumination \n", + "65997 DCM:111744 Brightfield illumination \n", + "65998 DCM:111744 Brightfield illumination \n", + "65999 DCM:111744 Brightfield illumination \n", + "66000 DCM:111744 Brightfield illumination \n", + "\n", + " admittingDiagnosis_code_designator_value_str \\\n", + "0 None \n", + "1 None \n", "2 None \n", - "3 Tumor \n", - "4 Right \n", + "3 None \n", + "4 None \n", "... ... \n", "65996 None \n", "65997 None \n", @@ -253,24 +279,24 @@ "65999 None \n", "66000 None \n", "\n", - " illuminationType_code_designator_value_str illuminationType_CodeMeaning \n", - "0 DCM:111744 Brightfield illumination \n", - "1 DCM:111744 Brightfield illumination \n", - "2 DCM:111744 Brightfield illumination \n", - "3 DCM:111744 Brightfield illumination \n", - "4 DCM:111744 Brightfield illumination \n", - "... ... ... \n", - "65996 DCM:111744 Brightfield illumination \n", - "65997 DCM:111744 Brightfield illumination \n", - "65998 DCM:111744 Brightfield illumination \n", - "65999 DCM:111744 Brightfield illumination \n", - "66000 DCM:111744 Brightfield illumination \n", - "\n", - "[66001 rows x 17 columns]" + " admittingDiagnosis_CodeMeaning \n", + "0 None \n", + "1 None \n", + "2 None \n", + "3 None \n", + "4 None \n", + "... ... \n", + "65996 None \n", + "65997 None \n", + "65998 None \n", + "65999 None \n", + "66000 None \n", + "\n", + "[66001 rows x 19 columns]" ], "text/html": [ "\n", - "
\n", + "
\n", "
\n", "