{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":61446,"databundleVersionId":6962461,"sourceType":"competition"}],"dockerImageVersionId":30626,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"import numpy as np \nimport pandas as pd \nimport os\nimport seaborn as sns\nimport matplotlib.pyplot as plt","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2024-01-05T11:30:26.335429Z","iopub.execute_input":"2024-01-05T11:30:26.335799Z","iopub.status.idle":"2024-01-05T11:30:28.173164Z","shell.execute_reply.started":"2024-01-05T11:30:26.335770Z","shell.execute_reply":"2024-01-05T11:30:28.171889Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"!pip install imageio","metadata":{"execution":{"iopub.status.busy":"2024-01-05T11:33:20.614847Z","iopub.execute_input":"2024-01-05T11:33:20.615209Z","iopub.status.idle":"2024-01-05T11:33:32.397370Z","shell.execute_reply.started":"2024-01-05T11:33:20.615181Z","shell.execute_reply":"2024-01-05T11:33:32.396182Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import imageio.v2 as imgo","metadata":{"execution":{"iopub.status.busy":"2024-01-05T11:33:53.774023Z","iopub.execute_input":"2024-01-05T11:33:53.774360Z","iopub.status.idle":"2024-01-05T11:33:53.778752Z","shell.execute_reply.started":"2024-01-05T11:33:53.774334Z","shell.execute_reply":"2024-01-05T11:33:53.777886Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Train Paths","metadata":{}},{"cell_type":"code","source":"path_train = \"/kaggle/input/blood-vessel-segmentation/train\"\nkd1voi = \"/kaggle/input/blood-vessel-segmentation/train/kidney_1_voi\"\nkd1dense = \"/kaggle/input/blood-vessel-segmentation/train/kidney_1_dense\"\nkd2 = \"/kaggle/input/blood-vessel-segmentation/train/kidney_2\"\nkd3dense = \"/kaggle/input/blood-vessel-segmentation/train/kidney_3_dense\"\nkd3sparse = \"/kaggle/input/blood-vessel-segmentation/train/kidney_3_sparse\"","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:24:15.662544Z","iopub.execute_input":"2024-01-05T12:24:15.662925Z","iopub.status.idle":"2024-01-05T12:24:15.669855Z","shell.execute_reply.started":"2024-01-05T12:24:15.662901Z","shell.execute_reply":"2024-01-05T12:24:15.668461Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Test Paths","metadata":{}},{"cell_type":"code","source":"test_kd5 = \"/kaggle/input/blood-vessel-segmentation/test/kidney_5\"\ntest_kd6 = \"/kaggle/input/blood-vessel-segmentation/test/kidney_6\"","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:13:41.071301Z","iopub.execute_input":"2024-01-05T12:13:41.071745Z","iopub.status.idle":"2024-01-05T12:13:41.077637Z","shell.execute_reply.started":"2024-01-05T12:13:41.071714Z","shell.execute_reply":"2024-01-05T12:13:41.076078Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Sample Files .csv's","metadata":{}},{"cell_type":"code","source":"sample_submission = \"/kaggle/input/blood-vessel-segmentation/sample_submission.csv\"\ntrain_rles = \"/kaggle/input/blood-vessel-segmentation/train_rles.csv\"","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:08:14.046355Z","iopub.execute_input":"2024-01-05T12:08:14.047550Z","iopub.status.idle":"2024-01-05T12:08:14.054179Z","shell.execute_reply.started":"2024-01-05T12:08:14.047508Z","shell.execute_reply":"2024-01-05T12:08:14.052087Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"smp_sbms = pd.read_csv(sample_submission)\nsmp_sbms.head()","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:36:40.696094Z","iopub.execute_input":"2024-01-05T12:36:40.696444Z","iopub.status.idle":"2024-01-05T12:36:40.709781Z","shell.execute_reply.started":"2024-01-05T12:36:40.696416Z","shell.execute_reply":"2024-01-05T12:36:40.708258Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"trn_rel = pd.read_csv(train_rles)\ntrn_rel.head(10)","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:37:18.756380Z","iopub.execute_input":"2024-01-05T12:37:18.756741Z","iopub.status.idle":"2024-01-05T12:37:19.240468Z","shell.execute_reply.started":"2024-01-05T12:37:18.756716Z","shell.execute_reply":"2024-01-05T12:37:19.239059Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Sample Images Path\n## kidney 3 dense doesn't have image it has label only","metadata":{}},{"cell_type":"code","source":"def showImage(pth,img_name):\n    \n    image_1 = imgo.imread(f\"{path_train}/{pth}/images/{img_name}.tif\")\n    label_1 = imgo.imread(f\"{path_train}/{pth}/labels/{img_name}.tif\")\n    \n    plt.figure(figsize=(10,5))\n\n    plt.subplot(1,2,1)\n    plt.imshow(image_1, cmap='gray')\n    plt.axis('off')\n    plt.title(\"Image\")\n\n    plt.subplot(1,2,2)\n    plt.imshow(label_1, cmap='gray')\n    plt.axis('off')\n    plt.title(\"Label\")\n    \n    plt.show()","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:33:15.646880Z","iopub.execute_input":"2024-01-05T12:33:15.647263Z","iopub.status.idle":"2024-01-05T12:33:15.654351Z","shell.execute_reply.started":"2024-01-05T12:33:15.647235Z","shell.execute_reply":"2024-01-05T12:33:15.652952Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Kidney 1 Dense 0000.tif","metadata":{}},{"cell_type":"code","source":"showImage(\"kidney_1_dense\",\"0000\")","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:33:20.026309Z","iopub.execute_input":"2024-01-05T12:33:20.026646Z","iopub.status.idle":"2024-01-05T12:33:20.349074Z","shell.execute_reply.started":"2024-01-05T12:33:20.026620Z","shell.execute_reply":"2024-01-05T12:33:20.347976Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Kidney 1 VOI 0000.tif","metadata":{}},{"cell_type":"code","source":"showImage(\"kidney_1_voi\",\"0000\")","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:33:25.435955Z","iopub.execute_input":"2024-01-05T12:33:25.436363Z","iopub.status.idle":"2024-01-05T12:33:25.930452Z","shell.execute_reply.started":"2024-01-05T12:33:25.436332Z","shell.execute_reply":"2024-01-05T12:33:25.929575Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Kidney 2 0000.tif","metadata":{}},{"cell_type":"code","source":"showImage(\"kidney_2\",\"0000\")","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:33:30.530953Z","iopub.execute_input":"2024-01-05T12:33:30.531291Z","iopub.status.idle":"2024-01-05T12:33:30.849330Z","shell.execute_reply.started":"2024-01-05T12:33:30.531265Z","shell.execute_reply":"2024-01-05T12:33:30.848299Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# Kidney 3 Sparse 0010.tif","metadata":{}},{"cell_type":"code","source":"showImage(\"kidney_3_sparse\",\"0010\")","metadata":{"execution":{"iopub.status.busy":"2024-01-05T12:33:36.666386Z","iopub.execute_input":"2024-01-05T12:33:36.666778Z","iopub.status.idle":"2024-01-05T12:33:37.100086Z","shell.execute_reply.started":"2024-01-05T12:33:36.666747Z","shell.execute_reply":"2024-01-05T12:33:37.098946Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}