{"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":"markdown","source":"# Lesion Sample: HGSC (High-Grade Serous Carcinoma)","metadata":{}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd \nimport os\nimport matplotlib.pyplot as plt\nimport cv2\nfrom PIL import Image\nImage.MAX_IMAGE_PIXELS = 10000000000","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","execution":{"iopub.status.busy":"2023-10-08T12:32:22.31831Z","iopub.execute_input":"2023-10-08T12:32:22.319649Z","iopub.status.idle":"2023-10-08T12:32:23.448001Z","shell.execute_reply.started":"2023-10-08T12:32:22.319601Z","shell.execute_reply":"2023-10-08T12:32:23.446356Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# 10143_thumbnail.png","metadata":{}},{"cell_type":"code","source":"img0=plt.imread('/kaggle/input/UBC-OCEAN/train_thumbnails/10143_thumbnail.png')\nplt.figure(figsize=(8,8))\nplt.imshow(img0)\nplt.show()\nprint(img0.shape)\n","metadata":{"execution":{"iopub.status.busy":"2023-10-08T12:32:23.451718Z","iopub.execute_input":"2023-10-08T12:32:23.45245Z","iopub.status.idle":"2023-10-08T12:32:26.385459Z","shell.execute_reply.started":"2023-10-08T12:32:23.452371Z","shell.execute_reply":"2023-10-08T12:32:26.3842Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train=pd.read_csv('/kaggle/input/UBC-OCEAN/train.csv')\ndisplay(train[train['image_id']==10143])","metadata":{"execution":{"iopub.status.busy":"2023-10-08T12:32:26.386844Z","iopub.execute_input":"2023-10-08T12:32:26.387169Z","iopub.status.idle":"2023-10-08T12:32:26.410468Z","shell.execute_reply.started":"2023-10-08T12:32:26.387138Z","shell.execute_reply":"2023-10-08T12:32:26.409354Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"# HGSC (High-Grade Serous Carcinoma)","metadata":{}},{"cell_type":"markdown","source":"HGSC is the most common subtype of ovarian cancer and is characterized by high malignancy. This subtype usually arises from the epithelial cells of the ovary and can be aggressive and difficult to treat.","metadata":{}},{"cell_type":"markdown","source":"https://www.pathologyoutlines.com/imgau/ovarytumorserouscarcinomahgFS02.jpg","metadata":{}},{"cell_type":"markdown","source":"![](https://www.pathologyoutlines.com/imgau/ovarytumorserouscarcinomahgFS02.jpg)","metadata":{}},{"cell_type":"markdown","source":"https://www.researchgate.net/publication/348871308/figure/fig1/AS:985289682083840@1611922774018/a-High-grade-serous-carcinoma-classic-histology-Papillary-and-micropapillary.ppm","metadata":{}},{"cell_type":"markdown","source":"![](https://www.researchgate.net/publication/348871308/figure/fig1/AS:985289682083840@1611922774018/a-High-grade-serous-carcinoma-classic-histology-Papillary-and-micropapillary.ppm)","metadata":{}},{"cell_type":"markdown","source":"# High Grade Serous Carcinoma of Ovary - Pathology mini tutorial\n","metadata":{}},{"cell_type":"markdown","source":"<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/8DW6rbPE1E0?si=7Z_6LEMMS_pcAf_m&amp;start=210\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen></iframe>","metadata":{}},{"cell_type":"markdown","source":"# 10143.png (x900)","metadata":{}},{"cell_type":"code","source":"img = Image.open('/kaggle/input/UBC-OCEAN/train_images/10143.png')\nimg = np.asarray(img)\nprint(img.shape)\nheight,width=img.shape[0],img.shape[1]\n\ndiv=30\nh=height//div\nw=width//div\nprint(h,w)\n\nfor i in range(div):#row number\n    for j in range(div):#column number\n        img2=img[h*i:h*(i+1),w*j:w*(j+1)]\n        plt.figure(figsize=(8,8))\n        plt.title('row '+str(i)+', column '+str(j))\n        plt.imshow(img2)\n        plt.show()","metadata":{"execution":{"iopub.status.busy":"2023-10-08T12:32:26.412209Z","iopub.execute_input":"2023-10-08T12:32:26.412604Z","iopub.status.idle":"2023-10-08T12:32:27.297422Z","shell.execute_reply.started":"2023-10-08T12:32:26.412573Z","shell.execute_reply":"2023-10-08T12:32:27.295836Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"    height,width = img.size[1],img.size[0]\n    img = img.resize((int(width*0.01), int(height*0.01)))\n\n    def crop_image(img, h_start, h_end, w_start, w_end):\n        \"\"\"\n        Cut rows and columns of images\n        Args:\n            img: Image object\n            h_start: start position of line to cut\n            h_end: End position of line to cut\n            w_start: start position of column to cut\n            w_end: End position of the column to cut\n        Returns:\n            cropped image\n        \"\"\"\n        img2 = img.crop((w_start, h_start, w_end, h_end))\n        return img2","metadata":{"_kg_hide-input":true}},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}