{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"toc_visible": true,
"authorship_tag": "ABX9TyPotQgaDae5unK7mzZ8iXCP",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"8704637776df4491aff4cb076ec747b7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_a25def0acbde4f12aa2b4801a055aa9c",
"IPY_MODEL_6a071231c92c42af8bf8c916747093d0",
"IPY_MODEL_ae4fe03cbe154f8dafeec004bda2ebb3"
],
"layout": "IPY_MODEL_d4e9d18824434de18d92844cbe200690"
}
},
"a25def0acbde4f12aa2b4801a055aa9c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_8d54a2aee61d4a7eaef94cd79b835fb3",
"placeholder": "",
"style": "IPY_MODEL_c3fd8e317aa4424bac265e68e20fcdf3",
"value": "Downloading builder script: 100%"
}
},
"6a071231c92c42af8bf8c916747093d0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_4084d2e1128244eb834e6b06aada193f",
"max": 6060,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_9674f72f3f7042e380e6bdd7640be8d0",
"value": 6060
}
},
"ae4fe03cbe154f8dafeec004bda2ebb3": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_e604c7ae9fb74a34920d889b125df28f",
"placeholder": "",
"style": "IPY_MODEL_e6582c9a929d4b00972856b26d2b302f",
"value": " 6.06k/6.06k [00:00<00:00, 162kB/s]"
}
},
"d4e9d18824434de18d92844cbe200690": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"8d54a2aee61d4a7eaef94cd79b835fb3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"c3fd8e317aa4424bac265e68e20fcdf3": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"4084d2e1128244eb834e6b06aada193f": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"9674f72f3f7042e380e6bdd7640be8d0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"e604c7ae9fb74a34920d889b125df28f": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e6582c9a929d4b00972856b26d2b302f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"faf30a43a3524dcfb62c023df84cf60f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_5e979c8a86814e76851dcb5e1b374109",
"IPY_MODEL_846a6b2c61734d9b8b260e67ed015130",
"IPY_MODEL_deff0a759e6b4436a62e5b5f36d6f253"
],
"layout": "IPY_MODEL_5c8a04925d3245cca39be5ca0d0a7108"
}
},
"5e979c8a86814e76851dcb5e1b374109": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_86eefe0b146b48fbb4a4acb420c8eee2",
"placeholder": "",
"style": "IPY_MODEL_f1d2cd7d5e4c47218adb65f51b8bd139",
"value": "Generating test split: "
}
},
"846a6b2c61734d9b8b260e67ed015130": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_847ac67c5fe34f03ada4c18eca01010d",
"max": 1,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_2543dcd0cdea4437bd9b68c8b2075aaa",
"value": 1
}
},
"deff0a759e6b4436a62e5b5f36d6f253": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_d447567cf4294705bb16c4fba36c4ee1",
"placeholder": "",
"style": "IPY_MODEL_9aa1bc98b74c4a64ac0b815925db5545",
"value": " 15/0 [00:00<00:00, 235.38 examples/s]"
}
},
"5c8a04925d3245cca39be5ca0d0a7108": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"86eefe0b146b48fbb4a4acb420c8eee2": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"f1d2cd7d5e4c47218adb65f51b8bd139": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"847ac67c5fe34f03ada4c18eca01010d": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "20px"
}
},
"2543dcd0cdea4437bd9b68c8b2075aaa": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"d447567cf4294705bb16c4fba36c4ee1": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"9aa1bc98b74c4a64ac0b815925db5545": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
""
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"id": "aB8AjX-DOLI1"
},
"outputs": [],
"source": [
"!pip install -q datasets nibabel"
]
},
{
"cell_type": "code",
"source": [
"from datasets import load_dataset\n",
"\n",
"# downloads data from Zenodo through the Hugging Face hub\n",
"# - might take several minutes (~5 minutes in CoLab)\n",
"# - when finished \"num_rows\" attribute should say '27', which is #CTs in dataset\n",
"dataset = load_dataset(\"andreped/LyNoS\")\n",
"print(dataset)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 200,
"referenced_widgets": [
"8704637776df4491aff4cb076ec747b7",
"a25def0acbde4f12aa2b4801a055aa9c",
"6a071231c92c42af8bf8c916747093d0",
"ae4fe03cbe154f8dafeec004bda2ebb3",
"d4e9d18824434de18d92844cbe200690",
"8d54a2aee61d4a7eaef94cd79b835fb3",
"c3fd8e317aa4424bac265e68e20fcdf3",
"4084d2e1128244eb834e6b06aada193f",
"9674f72f3f7042e380e6bdd7640be8d0",
"e604c7ae9fb74a34920d889b125df28f",
"e6582c9a929d4b00972856b26d2b302f",
"faf30a43a3524dcfb62c023df84cf60f",
"5e979c8a86814e76851dcb5e1b374109",
"846a6b2c61734d9b8b260e67ed015130",
"deff0a759e6b4436a62e5b5f36d6f253",
"5c8a04925d3245cca39be5ca0d0a7108",
"86eefe0b146b48fbb4a4acb420c8eee2",
"f1d2cd7d5e4c47218adb65f51b8bd139",
"847ac67c5fe34f03ada4c18eca01010d",
"2543dcd0cdea4437bd9b68c8b2075aaa",
"d447567cf4294705bb16c4fba36c4ee1",
"9aa1bc98b74c4a64ac0b815925db5545"
]
},
"id": "gmRtqpxoPnTb",
"outputId": "28c24cb5-934e-41bd-8bd5-275ce86ba1f4"
},
"execution_count": 13,
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": [
"Downloading builder script: 0%| | 0.00/6.06k [00:00, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "8704637776df4491aff4cb076ec747b7"
}
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"data is downloaded to: /root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"Generating test split: 0 examples [00:00, ? examples/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "faf30a43a3524dcfb62c023df84cf60f"
}
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"DatasetDict({\n",
" test: Dataset({\n",
" features: ['ct', 'lymphnodes', 'azygos', 'brachiocephalicveins', 'esophagus', 'subclaviancarotidarteries'],\n",
" num_rows: 15\n",
" })\n",
"})\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# get paths of features (ct/airways/lungs) for a single patient\n",
"curr = dataset[\"test\"][0]\n",
"print(curr)\n",
"print(curr[\"ct\"])\n",
"print(curr[\"lymphnodes\"])\n",
"print(curr[\"azygos\"])\n",
"print(curr[\"brachiocephalicveins\"])\n",
"print(curr[\"esophagus\"])\n",
"print(curr[\"subclaviancarotidarteries\"])"
],
"metadata": {
"id": "7CaqauK8p7o4",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "5559b932-58f7-46e1-e188-fe0ad1e5d053"
},
"execution_count": 34,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_SubCarArt.nii.gz'}\n",
"/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_data.nii.gz\n",
"/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_LymphNodes.nii.gz\n",
"/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_Azygos.nii.gz\n",
"/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_BrachiocephalicVeins.nii.gz\n",
"/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_Esophagus.nii.gz\n",
"/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_SubCarArt.nii.gz\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"# list all available patients and corresponding features (ct/airways/lungs)\n",
"for d in dataset[\"test\"]:\n",
" print(d)"
],
"metadata": {
"id": "Ib8QbkOxdaPi",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "256af015-8268-4bec-dae3-aa922e114f60"
},
"execution_count": 16,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat2/pat2_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat6/pat6_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat6/pat6_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat6/pat6_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat6/pat6_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat6/pat6_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat6/pat6_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat1/pat1_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat1/pat1_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat1/pat1_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat1/pat1_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat1/pat1_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat1/pat1_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat3/pat3_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat3/pat3_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat3/pat3_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat3/pat3_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat3/pat3_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat3/pat3_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat4/pat4_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat4/pat4_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat4/pat4_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat4/pat4_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat4/pat4_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat4/pat4_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat7/pat7_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat7/pat7_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat7/pat7_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat7/pat7_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat7/pat7_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat7/pat7_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat12/pat12_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat12/pat12_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat12/pat12_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat12/pat12_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat12/pat12_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat12/pat12_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat11/pat11_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat11/pat11_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat11/pat11_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat11/pat11_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat11/pat11_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat11/pat11_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat13/pat13_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat13/pat13_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat13/pat13_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat13/pat13_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat13/pat13_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat13/pat13_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat9/pat9_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat9/pat9_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat9/pat9_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat9/pat9_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat9/pat9_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat9/pat9_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat15/pat15_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat15/pat15_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat15/pat15_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat15/pat15_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat15/pat15_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat15/pat15_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat5/pat5_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat5/pat5_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat5/pat5_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat5/pat5_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat5/pat5_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat5/pat5_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat10/pat10_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat10/pat10_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat10/pat10_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat10/pat10_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat10/pat10_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat10/pat10_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat8/pat8_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat8/pat8_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat8/pat8_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat8/pat8_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat8/pat8_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat8/pat8_labels_SubCarArt.nii.gz'}\n",
"{'ct': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat14/pat14_data.nii.gz', 'lymphnodes': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat14/pat14_labels_LymphNodes.nii.gz', 'azygos': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat14/pat14_labels_Azygos.nii.gz', 'brachiocephalicveins': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat14/pat14_labels_BrachiocephalicVeins.nii.gz', 'esophagus': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat14/pat14_labels_Esophagus.nii.gz', 'subclaviancarotidarteries': '/root/.cache/huggingface/datasets/downloads/extracted/25432ffc15a3650a47da3d9223aeead84213a3aa1e5b23bbe6b40eec124e7c2c/Benchmark/Pat14/pat14_labels_SubCarArt.nii.gz'}\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"import nibabel as nib\n",
"import matplotlib.pyplot as plt\n",
"\n",
"from nibabel.processing import resample_to_output\n",
"\n",
"# load CT, airways, and lungs to numpy arrays for one patient\n",
"patient_1 = dataset[\"test\"][0]\n",
"slice_nr = 205\n",
"\n",
"ct_image = nib.load(patient_1[\"ct\"])\n",
"ct_image = resample_to_output(ct_image, order=1)\n",
"ct_data = ct_image.get_fdata().astype(\"int32\")\n",
"\n",
"print(\"CT:\", ct_data.shape, ct_data.dtype)\n",
"\n",
"airways_image = nib.load(patient_1[\"lymphnodes\"])\n",
"airways_image = resample_to_output(airways_image, order=0)\n",
"airways_data = airways_image.get_fdata().astype(\"uint8\")\n",
"\n",
"print(\"Lymph Nodes:\", airways_data.shape, airways_data.dtype)\n",
"\n",
"azygos_image = nib.load(patient_1[\"azygos\"])\n",
"azygos_image = resample_to_output(azygos_image, order=0)\n",
"azygos_data = azygos_image.get_fdata().astype(\"uint8\")\n",
"\n",
"print(\"Azygos:\", azygos_data.shape, azygos_data.dtype)\n",
"\n",
"# HU-clip CT for better contrast\n",
"ct_data[ct_data < -1024] = -1024\n",
"ct_data[ct_data > 400] = 400\n",
"\n",
"# plot corresponding CT, Airways, and Lungs for a single 2D slide side-by-side\n",
"fig, ax = plt.subplots(1, 3, figsize=(20, 12))\n",
"ax[0].imshow(ct_data[..., slice_nr], cmap=\"gray\")\n",
"ax[1].imshow(airways_data[..., slice_nr], cmap=\"jet\", interpolation=\"none\")\n",
"ax[2].imshow(azygos_data[..., slice_nr], cmap=\"jet\", interpolation=\"none\")\n",
"\n",
"for i, title in enumerate([\"CT\", \"Lymph Nodes\", \"Azygos\"]):\n",
" ax[i].set_title(title)\n",
"plt.show()"
],
"metadata": {
"id": "At1iznVwf6Zg",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 512
},
"outputId": "b040b156-64b1-4a94-fde7-b0995b33acaf"
},
"execution_count": 33,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"CT: (353, 353, 358) int32\n",
"Lymph Nodes: (353, 353, 358) uint8\n",
"Azygos: (353, 353, 358) uint8\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"