{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load\n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\n\n# Input data files are available in the read-only \"../input/\" directory\n# For example, running this (by clicking run or pressing Shift+Enter) will list all files under the input directory\n\nimport os\n'''\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))\n'''\n# You can write up to 20GB to the current directory (/kaggle/working/) that gets preserved as output when you create a version using \"Save & Run All\" \n# You can also write temporary files to /kaggle/temp/, but they won't be saved outside of the current session","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2022-08-24T19:07:27.090078Z","iopub.execute_input":"2022-08-24T19:07:27.090590Z","iopub.status.idle":"2022-08-24T19:07:27.127975Z","shell.execute_reply.started":"2022-08-24T19:07:27.090464Z","shell.execute_reply":"2022-08-24T19:07:27.126818Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"## Import required libraries","metadata":{}},{"cell_type":"code","source":"import rasterio\nimport rasterio.plot\nimport json\nimport matplotlib.pylab as plt","metadata":{"execution":{"iopub.status.busy":"2022-08-24T19:08:40.492264Z","iopub.execute_input":"2022-08-24T19:08:40.492758Z","iopub.status.idle":"2022-08-24T19:08:41.016494Z","shell.execute_reply.started":"2022-08-24T19:08:40.492716Z","shell.execute_reply":"2022-08-24T19:08:41.015100Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Data Viz","metadata":{"execution":{"iopub.status.busy":"2022-08-24T19:26:37.006887Z","iopub.execute_input":"2022-08-24T19:26:37.007747Z","iopub.status.idle":"2022-08-24T19:26:37.013361Z","shell.execute_reply.started":"2022-08-24T19:26:37.007702Z","shell.execute_reply":"2022-08-24T19:26:37.012348Z"}}},{"cell_type":"code","source":"image = \"/kaggle/input/hubmap-organ-segmentation/train_images/15329.tiff\"\ntiff = rasterio.open(image)\nimg=tiff.read()","metadata":{"execution":{"iopub.status.busy":"2022-08-24T19:27:42.184758Z","iopub.execute_input":"2022-08-24T19:27:42.185188Z","iopub.status.idle":"2022-08-24T19:27:42.236878Z","shell.execute_reply.started":"2022-08-24T19:27:42.185153Z","shell.execute_reply":"2022-08-24T19:27:42.235695Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"boundry = '/kaggle/input/hubmap-organ-segmentation/train_annotations/15329.json'\nwith open(boundry) as json_file:\n    data = json.load(json_file)","metadata":{"execution":{"iopub.status.busy":"2022-08-24T19:27:43.672739Z","iopub.execute_input":"2022-08-24T19:27:43.673461Z","iopub.status.idle":"2022-08-24T19:27:43.681016Z","shell.execute_reply.started":"2022-08-24T19:27:43.673423Z","shell.execute_reply":"2022-08-24T19:27:43.679669Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"rasterio.plot.show(tiff, title = \"15329\")\n\nig, ax = plt.subplots()\nax.imshow(img[2, :, :])\nfor cord in data[0] :\n    plt.scatter(cord[0], cord[1], color='red',alpha=0.05 )\nplt.show()\n\nprint('look at a sample image and mark it with the annotation to find the area of interest marked in red')","metadata":{"execution":{"iopub.status.busy":"2022-08-24T19:29:33.740109Z","iopub.execute_input":"2022-08-24T19:29:33.740529Z","iopub.status.idle":"2022-08-24T19:29:39.084096Z","shell.execute_reply.started":"2022-08-24T19:29:33.740495Z","shell.execute_reply":"2022-08-24T19:29:39.082786Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<div class=\"list-group\" id=\"list-tab\" role=\"tablist\">\n<h3 class=\"list-group-item list-group-item-action active\" data-toggle=\"list\" style='background:#f0fff0; border:0; color:black' role=\"tab\"><center><br>If you find this notebook useful, do give me an upvote, Thanks.<br><br> 😊</center></h3>","metadata":{"execution":{"iopub.status.busy":"2022-08-24T19:11:51.422585Z","iopub.execute_input":"2022-08-24T19:11:51.423102Z","iopub.status.idle":"2022-08-24T19:11:51.429346Z","shell.execute_reply.started":"2022-08-24T19:11:51.423062Z","shell.execute_reply":"2022-08-24T19:11:51.427904Z"}}},{"cell_type":"code","source":"","metadata":{"execution":{"iopub.status.busy":"2022-08-24T19:12:04.209602Z","iopub.execute_input":"2022-08-24T19:12:04.210019Z","iopub.status.idle":"2022-08-24T19:12:04.224169Z","shell.execute_reply.started":"2022-08-24T19:12:04.209987Z","shell.execute_reply":"2022-08-24T19:12:04.222680Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}