{"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":"<h1 style=\"background-color:black; font-family:'Brush Script MT',cursive;color:#03e8fc;font-size:200%; text-align:center;border-radius: 50% 20% / 10% 40%\">Survival and the Appearance of Tumor in MRI</h1>\n\n\"MRI Manifestions Correlate with Survival of Glioblastoma Multiforme Patients\"\n\nAuthors: Wen-bin Li, Kai Tang, Qian Chen, Shuai Li, Xiao-guang Qiu, Shao-wu Li, and Tao Jiang\n\nCancer Biol Med. 2012 Jun; 9(2): 120–123. - doi: 10.3969/j.issn.2095-3941.2012.02.007\n\n\"Glioblastoma multiforme (GBM) is the most common primary brain tumor in adults, with an annual age adjusted incidence of 3.0 to 3.6 per 100,000. GBM is classified by the World Health Organization as a grade IV glioma. Treatment modes include surgery, radiotherapy, and chemotherapy.\"\n\n\"The survival time of patients with GBM is significantly shorter than that of patients with lower-grade gliomas. Even within the same grade, the survival time for patients with GBM may also be highly variable. For more than 20 years, magnetic resonance imaging (MRI) has been used in the clinical diagnosis of gliomas to serve as a guide for clinical treatment. Most diagnoses for patients with malignant gliomas are followed by MRI. Thus, determining the relationship between survival and the appearance of tumor in MRI is of importance.\"\n\n\"Imaging features such as degrees of contrasted area, edema surrounding the tumor, and intensity in T2-weighted imaging can be easily collected from routine scans.\"\n\nhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC3643659/","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Install Necessary Packages</span></h1><br>\n\n\nNOTE: In order to use plotly you will need to:\n\nInstall all necessary packages/extensions following these instructions.\n\nSign up for a free account and activate your key following these instructions (only read the section ‘Initialization for Online Plotting’).","metadata":{"_kg_hide-input":true}},{"cell_type":"code","source":"!pip install  chart_studio","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2021-07-18T23:53:27.102785Z","iopub.execute_input":"2021-07-18T23:53:27.103148Z","iopub.status.idle":"2021-07-18T23:53:35.433621Z","shell.execute_reply.started":"2021-07-18T23:53:27.103113Z","shell.execute_reply":"2021-07-18T23:53:35.432795Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Fluid Attenuated Inversion Recovery (FLAIR)</span></h1><br>\n\n\"T2 Fluid-Attenuated Inversion Recovery Resection for Glioblastoma Involving Eloquent Brain Areas Facilitated Through Awake Craniotomy and Clinical Outcome\"\n\nAuthors: MingLu; Zheng-haoFu; Xiao-junHe; Jian-kanLu; Xin-qingDeng; De-liuLin; You-mingGu; Yan-fengFan; Ming-yaoLai; JuanLi; Ming-mingYang; Zhong-pingChen\n\nhttps://doi.org/10.1016/j.wneu.2019.12.130\n\n\"Despite evidence that a greater extent of resection (EOR) improves survival, the role of extended resection based on magnetic resonance imaging (MRI) fluid-attenuated inversion recovery (FLAIR) in the prognosis of glioblastoma (GBM) remains controversial. This study aims to investigate the role of additional resection of FLAIR-detected abnormalities and its influence on clinical outcomes of patients with GBM.\"\n\n\"The threshold for removal of FLAIR abnormalities affecting survival was determined to be 25%. The median OS and PFS were shorter in the group with FLAIR resection <25% compared with the group with FLAIR resection ≥25% (12 months vs. 26 months; P = 0.001 and 6 months vs. 15 months; P = 0.016, respectively). Univariate and multivariate analyses identified tumor location within or near the eloquent brain areas and the 25% threshold for FLAIR EOR as independent factors affecting OS (overall survival) and PFS (progression-free survival).\"\n\n\"Identifying a feasible threshold for the resection of FLAIR (fluid-attenuated inversion recovery) abnormalities is valuable in improving the survival of patients with GBM (Glioblastoma Multiforme). Extended resection of GBM involving eloquent brain areas was safe when using a combination of AC and SF-guided surgery.\"\n\nhttps://www.sciencedirect.com/science/article/abs/pii/S1878875019331626","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\n#common packages \nimport numpy as np \nimport os\nimport copy\nfrom math import *\nimport matplotlib.pyplot as plt\nfrom functools import reduce\nfrom glob import glob\n\n#reading in dicom files\nimport pydicom\n\n#skimage image processing packages\nfrom skimage import measure, morphology\nfrom skimage.morphology import ball, binary_closing\nfrom skimage.measure import label, regionprops\n\n#scipy linear algebra functions \nfrom scipy.linalg import norm\nimport scipy.ndimage\n\n#ipywidgets for some interactive plots\nfrom ipywidgets.widgets import * \nimport ipywidgets as widgets\n\n#plotly 3D interactive graphs \nimport plotly\nfrom plotly.graph_objs import *\nimport chart_studio","metadata":{"execution":{"iopub.status.busy":"2021-07-18T23:53:43.196439Z","iopub.execute_input":"2021-07-18T23:53:43.196817Z","iopub.status.idle":"2021-07-18T23:53:43.224855Z","shell.execute_reply.started":"2021-07-18T23:53:43.196783Z","shell.execute_reply":"2021-07-18T23:53:43.223828Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"chart_studio.tools.set_credentials_file(username='redwankarimsony', api_key='aEbXWsleQv7PJrAtOkBk')\n#set plotly credentials here \n#this allows you to send results to your account plotly.tools.set_credentials_file(username=your_username, api_key=your_key)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2021-07-18T23:54:06.72381Z","iopub.execute_input":"2021-07-18T23:54:06.724183Z","iopub.status.idle":"2021-07-18T23:54:06.729738Z","shell.execute_reply.started":"2021-07-18T23:54:06.724154Z","shell.execute_reply":"2021-07-18T23:54:06.728733Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Sorry Md. Redwan, I promise I'll make an account of my own if I intend to work again with Dicoms.","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Loading DICOM Data</span></h1><br>\n\nLet's set the paths of the dicom files and then we will be able to have a look at them.","metadata":{}},{"cell_type":"markdown","source":"Instead of BraTS21ID (Brain Tumor Classification ID) I called them as Samples. ","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\nsample_id = '00003'\nsample_folder = f'../input/rsna-miccai-brain-tumor-radiogenomic-classification/train/{sample_id}/'\ndata_paths = glob(sample_folder + '/*/*.dcm')\n\n# Print out the first 5 file names to verify we're in the right folder.\nprint (f'Total of {len(data_paths)} DICOM images.\\nFirst 5 filenames:' )\ndata_paths[:5]","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2021-07-18T23:54:23.007529Z","iopub.execute_input":"2021-07-18T23:54:23.007862Z","iopub.status.idle":"2021-07-18T23:54:23.075419Z","shell.execute_reply.started":"2021-07-18T23:54:23.007835Z","shell.execute_reply":"2021-07-18T23:54:23.074572Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">T1 weighted image</span></h1><br>\n\nBy Dr Yahya Baba and Dr Jeremy Jones et al.\n\n\"T1 weighted image (also referred to as T1WI or the \"spin-lattice\" relaxation time) is one of the basic pulse sequences in MRI and demonstrates differences in the T1 relaxation times of tissues.\n\nA T1WI relies upon the longitudinal relaxation of a tissue's net magnetization vector (NMV). Basically, spins aligned in an external field (B0) are put into the transverse plane by a radiofrequency (RF) pulse. They then slide back toward the original equilibrium of B0. Not all tissues return back to equilibrium in the same amount of time, and a tissue's T1 reflects the amount of time taken for its protons' spins to realign with the main magnetic field (B0).\n\nT1 weighting tends to have short TE and TR times.\"\n\nhttps://radiopaedia.org/articles/t1-weighted-image","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">T2 weighted image</span></h1><br>\n\nBy Dr Ammar Haouimi and Dr Jeremy Jones et al.\n\nT2 weighted image (T2WI) is one of the basic pulse sequences on MRI. The sequence weighting highlights differences on the T2 relaxation time of tissues.\n\n<font color=\"#0000FF\">Summary</font>\n\nrepetition time (TR): long\n\necho time (TE): long\n\nflip angle: less important than with T1 weighting\n\nfat: intermediate-bright\n\nfluid: bright\n\n<font color=\"#0000FF\">Physics</font>\n\nA T2WI relies upon the transverse relaxation (also known as \"spin-spin\" relaxation) of the net magnetization vector (NMV). T2 weighting tends to require long TE and TR times.\n\nhttps://radiopaedia.org/articles/t2-weighted-image","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\ndef load_scan(paths):\n    slices = [pydicom.read_file(path ) for path in paths]\n    slices.sort(key = lambda x: int(x.InstanceNumber), reverse = True)\n    try:\n        slice_thickness = np.abs(slices[0].ImagePositionSample[2] - slices[1].ImagePositionSample[2])\n    except:\n        slice_thickness = np.abs(slices[0].SliceLocation - slices[1].SliceLocation)\n        \n    for s in slices:\n        s.SliceThickness = slice_thickness\n        \n    return slices\n\ndef get_pixels_hu(scans):\n    image = np.stack([s.pixel_array for s in scans])\n    image = image.astype(np.int16)\n    # Set outside-of-scan pixels to 0\n    # The intercept is usually -1024, so air is approximately 0\n    image[image == -2000] = 0\n    \n    # Convert to Hounsfield units (HU)\n    intercept = scans[0].RescaleIntercept\n    slope = scans[0].RescaleSlope\n    \n    if slope != 1:\n        image = slope * image.astype(np.float64)\n        image = image.astype(np.int16)\n        \n    image += np.int16(intercept)\n    \n    return np.array(image, dtype=np.int16)","metadata":{"execution":{"iopub.status.busy":"2021-07-18T23:54:47.981546Z","iopub.execute_input":"2021-07-18T23:54:47.981925Z","iopub.status.idle":"2021-07-18T23:54:47.9909Z","shell.execute_reply.started":"2021-07-18T23:54:47.981887Z","shell.execute_reply":"2021-07-18T23:54:47.989929Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Sex Differences in MRI-Based Metrics of Glioma Invasion</span></h1><br>\n\n\"Sex Differences in MRI-Based Metrics of Glioma Invasion and Brain Mechanics\"\n\nAuthors: Barrett J. Anderies, Sara F. Yee, Pamela R. Jackson, Cassandra R. Rickertsen, Andrea J.,Hawkins-Daarud, Sandra K. Johnston, Kamala R. Clark-Swanson, Joseph M. Hoxworth,Yuan Le, Yuxiang Zhou, Kay M. Pepin, Susan C. Massey, Leland S. Hu, John R. Huston III, Kristin R. Swanson \n\ndoi: https://doi.org/10.1101/2020.11.21.352724 November 22, 2020.\n\nAbbreviations:\n\nHGG = high grade gliomas, T1Gd = T1-weighted gadolinium contrasted, T2-FLAIR = T2 weighted fluid\nattenuated inversion recovery, ROI = region of interest, CC = contralateral control, CE = contrast\nenhancing, MRI = magnetic resonance imaging; MRE = magnetic resonance elastography; MNO =\nMathematical Neuro-Oncology Lab; PNT = Precision Neurotherapeutics Innovation Program, D = tumor\ndiffusiveness, ⍴ = tumor proliferation, D/⍴ = tumor invasiveness\n\n\"Understanding how the true underlying tumor invasion profile corresponds to radiographic imaging is\ncritical to providing informed clinical care. To date, such studies have been limited due to the difficulty\nof acquiring tissue for histological analysis. MRI imaging is a proxy measurement of tumors as it\nprimarily resolves contrast (T1Gd) and interstitial fluid accumulation (T2/FLAIR), which are measures of\nleaky vasculature and edema, respectively. These measures may be correlated with clinical pathology\nbut do not necessarily relate to the local chemical and physical microenvironment within which the\ntumor cells proliferate and migrate.\"\n\n\"Clinical imaging remains the primary method of monitoring gliomas and is mostly interpreted with\nrespect to changes in size. Increasing any understanding of how imaging features correspond to tumor\ncharacteristics can drastically influence how therapy is chosen and how response to therapy is\ndetermined. Much remains to be done, but that work represents a first look at how similar imaging may\nreflect different tumor invasion depending on the sex of the patient.\"\n\nhttps://www.biorxiv.org/content/10.1101/2020.11.21.352724v2\n\nhttps://www.biorxiv.org/content/10.1101/2020.11.21.352724v1.full.pdf","metadata":{}},{"cell_type":"markdown","source":"![](https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSidNItQO2zsxd1oZ4Hwmy0vGM-su6fJLqZJZRLimrbEUpW9IcTwl1opbA_9YhkEsLquQ&usqp=CAU)biorxivorg","metadata":{}},{"cell_type":"markdown","source":"#Run the following code to extract DICOM pixels for each slice location and display a single slice:","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\n# set path and load files \nsample_dicom = load_scan(data_paths)\nsample_pixels = get_pixels_hu(sample_dicom)\n#sanity check\nplt.imshow(sample_pixels[80], cmap=plt.cm.bone);","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2021-07-18T23:54:57.804445Z","iopub.execute_input":"2021-07-18T23:54:57.804832Z","iopub.status.idle":"2021-07-18T23:55:04.548212Z","shell.execute_reply.started":"2021-07-18T23:54:57.804803Z","shell.execute_reply":"2021-07-18T23:55:04.547346Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import pandas as pd\n\ntrain = pd.read_csv('../input/rsna-miccai-brain-tumor-radiogenomic-classification/train_labels.csv')\ntrain.head().style.set_properties(**{'background-color':'black',\n                                     'color': '#03e8fc'})","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"import seaborn as sns\n\ntrain.corr()\nplt.figure(figsize=(10,4))\nsns.heatmap(train.corr(),annot=True,cmap='Blues')\nplt.show()","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Image Processing</span></h1><br>\n\nLet' s use some thresholding and morphological operations to segment just the brain from the rest of the scan:","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\ndef largest_label_volume(im, bg=-1):\n    vals, counts = np.unique(im, return_counts=True)\n    counts = counts[vals != bg]\n    vals = vals[vals != bg]\n    if len(counts) > 0:\n        return vals[np.argmax(counts)]\n    else:\n        return None\n    \ndef segment_brain_mask(image, fill_brain_structures=True):\n    # not actually binary, but 1 and 2. \n    # 0 is treated as background, which we do not want\n    binary_image = np.array(image >= -700, dtype=np.int8)+1\n    labels = measure.label(binary_image)\n \n    # Pick the pixel in the very corner to determine which label is air.\n    # Improvement: Pick multiple background labels from around the  patient\n    # More resistant to “trays” on which the patient lays cutting the air around the person in half\n    background_label = labels[0,0,0]\n \n    # Fill the air around the person\n    binary_image[background_label == labels] = 2\n \n    # Method of filling the brain structures (that is superior to \n    # something like morphological closing)\n    if fill_brain_structures:\n        # For every slice we determine the largest solid structure\n        for i, axial_slice in enumerate(binary_image):\n            axial_slice = axial_slice - 1\n            labeling = measure.label(axial_slice)\n            l_max = largest_label_volume(labeling, bg=0)\n \n            if l_max is not None: #This slice contains some lung\n                binary_image[i][labeling != l_max] = 1\n    binary_image -= 1 #Make the image actual binary\n    binary_image = 1-binary_image # Invert it, lungs are now 1\n \n    # Remove other air pockets inside body\n    labels = measure.label(binary_image, background=0)\n    l_max = largest_label_volume(labels, bg=0)\n    if l_max is not None: # There are air pockets\n        binary_image[labels != l_max] = 0\n \n    return binary_image","metadata":{"execution":{"iopub.status.busy":"2021-07-18T23:11:58.537678Z","iopub.execute_input":"2021-07-18T23:11:58.538081Z","iopub.status.idle":"2021-07-18T23:11:58.548105Z","shell.execute_reply.started":"2021-07-18T23:11:58.538041Z","shell.execute_reply":"2021-07-18T23:11:58.546785Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">MGMT promoter methylation</span></h1><br>\n\n\"MGMT promoter methylation in malignant gliomas: ready for personalized medicine?\"\n\nCitation: Weller, M., Stupp, R., Reifenberger, G. et al. MGMT promoter methylation in malignant gliomas: ready for personalized medicine?. Nat Rev Neurol 6, 39–51 (2010). https://doi.org/10.1038/nrneurol.2009.197\n\n\"The DNA repair enzyme O6-methylguanine-DNA methyltransferase (MGMT) antagonizes the genotoxic effects of alkylating agents. MGMT promoter methylation is the key mechanism of MGMT gene silencing and predicts a favorable outcome in patients with glioblastoma who are exposed to alkylating agent chemotherapy. This biomarker is on the verge of entering clinical decision-making and is currently used to stratify or even select glioblastoma patients for clinical trials. In other subtypes of glioma, such as anaplastic gliomas, the relevance of MGMT promoter methylation might extend beyond the prediction of chemosensitivity, and could reflect a distinct molecular profile.\"\n\n<font color=\"#0000FF\">Key Points</font>\n\nMGMT (O6-methylguanine-DNA methyltransferase) promoter methylation has become the most powerful molecular prognosticator in malignant gliomas.\n\nMGMT promoter methylation is predictive for response to alkylating agent chemotherapy in glioblastoma.\n\nMethylation-specific PCR is the only validated technique to derive prognostic information from determination of the MGMT status.\n\nThe MGMT status has become a parameter for stratification of patients with glioma within clinical trials.\n\nhttps://www.nature.com/articles/nrneurol.2009.197","metadata":{}},{"cell_type":"markdown","source":"By running the code below, you are using skimage functions from above to create a mask that covers the brain. Redwan used both fill_brain_structures=True and fill_brain_structures=False, to isolate the brain and the internal structures. Let’s run the code below, and display an example of isolating the brain from the rest of the scan:","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\n# get masks \nsegmented_brains = segment_brain_mask(sample_pixels, fill_brain_structures=False)\nsegmented_brains_fill = segment_brain_mask(sample_pixels, fill_brain_structures=True)\ninternal_structures = segmented_brains_fill - segmented_brains\n\n# isolate brain from the rest of the scan\ncopied_pixels = copy.deepcopy(sample_pixels)\nfor i, mask in enumerate(segmented_brains_fill): \n    get_high_vals = mask == 0\n    copied_pixels[i][get_high_vals] = 0\nseg_brain_pixels = copied_pixels\n# sanity check\nf, ax = plt.subplots(1,2, figsize=(10,6))\nax[0].imshow(sample_pixels[80], cmap=plt.cm.bone)\nax[0].axis(False)\nax[0].set_title('Original')\nax[1].imshow(seg_brain_pixels[80], cmap=plt.cm.bone)\nax[1].axis(False)\nax[1].set_title('Segmented')\nplt.show()","metadata":{"execution":{"iopub.status.busy":"2021-07-18T23:12:11.846287Z","iopub.execute_input":"2021-07-18T23:12:11.846649Z","iopub.status.idle":"2021-07-18T23:13:22.893727Z","shell.execute_reply.started":"2021-07-18T23:12:11.846617Z","shell.execute_reply":"2021-07-18T23:13:22.892493Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#What did I make wrong? I tried to isolate the brain from the rest of the scan. But I failed.\n\n#If anybody knows how to fix that, please tell me. I will fail in all the segmentation below.\n\nDon’t worry about the masks yet, Redwan will show you some visualizations later on.\n\nI'm worried because I failed to isolate the brain. Read the Original code to learn:\n\nhttps://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">2D Visualizations Techniques</span></h1><br>\n\n\nNon Interactive: When visualizing data, Redwan found very beneficial to visualize each process of your script. This will not only help you understand each step of your code, but it makes for a very nice, clean presentation. The code below will, in essence, visually convey a story on how you segmented your data:\n\nOriginal image\n\nThe binary mask that covers the brain\n\nHighlighting internal structures of the brain using one of the masks\n\nExtracting internal structures using GK clustering","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">MGMT Promoter Methylation and Gene Expression Levels in Glioblastoma</span></h1><br>\n\n\"Correlation of MGMT promoter methylation status with gene and protein expression levels in glioblastoma\"\n\nAuthors: Miyuki Uno, Sueli Mieko Oba-Shinjo, Anamaria Aranha Camargo, Ricardo Pereira Moura, Paulo Henrique de Aguiar, Hector Navarro Cabrera, Marcos Begnami, Sérgio Rosemberg, Manoel Jacobsen Teixeira, Suely Kazue Nagahashi Marie\n\nClinical Sciences,  Clinics 66 (10),  2011  https://doi.org/10.1590/S1807-59322011001000013\n\n\"RESULTS: MGMT promoter methylation was found in 43.1% of glioblastoma by methylation-specific PCR and 38.8% by pyrosequencing. A low level of MGMT gene expression was correlated with positive MGMT promoter methylation (p = 0.001).\"\n\n\"However, no correlation was found between promoter methylation and MGMT protein expression (p = 0.297). The mean survival time of glioblastoma patients submitted to adjuvant therapy was significantly higher among patients with MGMT promoter methylation (log rank = 0.025 by methylation-specific PCR and 0.004 by pyrosequencing), and methylation was an independent predictive factor that was associated with improved prognosis by multivariate analysis.\"\n\n\"DISCUSSION AND CONCLUSION: MGMT promoter methylation status was a more reliable predictor of susceptibility to adjuvant therapy and prognosis of glioblastoma than were MGMT protein or gene expression levels. Methylation-specific polymerase chain reaction and pyrosequencing methods were both sensitive methods for determining MGMT promoter methylation status using DNA extracted from frozen tissue.\"\n\nhttps://www.scielo.br/j/clin/a/tzYgxYpz9b6Y54ftcD7bJ6F/?lang=en","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\nf, ax = plt.subplots(2,2, figsize = (10,10))\n\n# pick random slice \nslice_id = 80\n\nax[0,0].imshow(sample_pixels[slice_id], cmap=plt.cm.bone)\nax[0,0].set_title('Original Dicom')\nax[0,0].axis(False)\n\n\nax[0,1].imshow(segmented_brains_fill[slice_id], cmap=plt.cm.bone)\nax[0,1].set_title('Brain Mask')\nax[0,1].axis(False)\n\nax[1,0].imshow(seg_brain_pixels[slice_id], cmap=plt.cm.bone)\nax[1,0].set_title('Segmented Brain')\nax[1,0].axis(False)\n\nax[1,1].imshow(seg_brain_pixels[slice_id], cmap=plt.cm.bone)\nax[1,1].imshow(internal_structures[slice_id], cmap='jet', alpha=0.7)\nax[1,1].set_title('Segmentation with \\nInternal Structure')\nax[1,1].axis(False);","metadata":{"execution":{"iopub.status.busy":"2021-07-18T23:13:40.212725Z","iopub.execute_input":"2021-07-18T23:13:40.213144Z","iopub.status.idle":"2021-07-18T23:13:40.706172Z","shell.execute_reply.started":"2021-07-18T23:13:40.213109Z","shell.execute_reply":"2021-07-18T23:13:40.705131Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Even copying the script, I ruined it! ","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Interactive</span></h1><br>\n\nThere are really only a few ways to display multiple images on jupyter notebook — manually plot each image one by one, or make a plot with multiple columns and rows to display in one figure. Unfortunately, this is not helpful for those that want to scan through each image and get a better understanding of the data. With the code below you create an interactive slide bar that lets you scroll through the images (But the catch is that you have to run the code in **interactive window**. So if you want to use the slider window to browse through the slices, fork the code and run it manually in interactive mode):","metadata":{}},{"cell_type":"markdown","source":"#Below there is a slide bar that didn't slide. Hence, I tried to make another slide. \n\nInside the 2nd slide bar slides. In the viewer the image disappears. No show with ipywidgets.","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\n# slide through dicom images using a slide bar #It doesn't Slide! \n#plt.figure(1)\ndef dicom_animation(x):\n    plt.imshow(sample_pixels[x], cmap = plt.cm.gray)\n    return x\ninteract(dicom_animation, x=(0, len(sample_pixels)-1));","metadata":{"execution":{"iopub.status.busy":"2021-07-18T22:15:14.351496Z","iopub.execute_input":"2021-07-18T22:15:14.351877Z","iopub.status.idle":"2021-07-18T22:15:14.587632Z","shell.execute_reply.started":"2021-07-18T22:15:14.351832Z","shell.execute_reply":"2021-07-18T22:15:14.586783Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Jose Carmona @josecarmona\n\n%matplotlib widget\n\nfrom ipywidgets import interact\n\ndef dicom_animation(x):\n    plt.imshow(sample_pixels[x], cmap = plt.cm.gray)\n    plt.plot()\n\ninteract(dicom_animation, x=(0, len(sample_pixels)-1))","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Interactive 2</span></h1><br>\n\n\"Another way to visualize the MRI scans in a bit lively fashion is to use gif images. Basically GIFs are a series of images shown at an preconfigured interval automatically. However, the upper side of GIF is that, it stores images in lossless compression. </blue>. So it is highly efficent and accurate for storing MRI scan slides.\"","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\nimport imageio\nfrom IPython import display\nprint('Original Image Slices before processing')\nimageio.mimsave(f'./{sample_id}.gif', sample_pixels, duration=0.1)\ndisplay.Image(f'./{sample_id}.gif', format='png')","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2021-07-18T23:14:06.99084Z","iopub.execute_input":"2021-07-18T23:14:06.99162Z","iopub.status.idle":"2021-07-18T23:14:22.775645Z","shell.execute_reply.started":"2021-07-18T23:14:06.991563Z","shell.execute_reply":"2021-07-18T23:14:22.774261Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Prediction of malignant glioma</span></h1><br>\n\n\"Prediction of malignant glioma grades using contrast-enhanced T1-weighted and T2-weighted magnetic resonance images based on a radiomic analysis\"\n\nCitation: Nakamoto, T., Takahashi, W., Haga, A. et al. Prediction of malignant glioma grades using contrast-enhanced T1-weighted and T2-weighted magnetic resonance images based on a radiomic analysis. Sci Rep 9, 19411 (2019). https://doi.org/10.1038/s41598-019-55922-0\n\n\n\"The authors conducted a feasibility study to predict malignant glioma grades via radiomic analysis using contrast-enhanced T1-weighted magnetic resonance images (CE-T1WIs) and T2-weighted magnetic resonance images (T2WIs). They proposed a framework and applied it to CE-T1WIs and T2WIs (with tumor region data) acquired preoperatively from 157 patients with malignant glioma (grade III: 55, grade IV: 102) as the primary dataset and 67 patients with malignant glioma (grade III: 22, grade IV: 45) as the validation dataset.\"\n\n\"Radiomic features such as size/shape, intensity, histogram, and texture features were extracted from the tumor regions on the CE-T1WIs and T2WIs.\"\n\n\"The Wilcoxon–Mann–Whitney (WMW) test and least absolute shrinkage and selection operator logistic regression (LASSO-LR) were employed to select the radiomic features. Various machine learning (ML) algorithms were used to construct prediction models for the malignant glioma grades using the selected radiomic features.\"\n\n\"The prediction models were constructed using the LR, a support vector machine (SVM), a standard neural network (SNN), a random forest (RF), and a Naïve Bayes (NB).\" \n\n\"Leave-one-out cross-validation (LOOCV) was implemented to evaluate the performance of the prediction models in the primary dataset. The selected radiomic features for all folds in the LOOCV of the primary dataset were used to perform an independent validation. As evaluation indices, accuracies, sensitivities, specificities, and values for the area under receiver operating characteristic curve (or simply the area under the curve (AUC)) for all prediction models were calculated.\"\n\n\"The mean AUC value for all prediction models constructed by the ML algorithms in the LOOCV of the primary dataset was 0.902 ± 0.024 (95% CI (confidence interval), 0.873–0.932). In the independent validation, the mean AUC value for all prediction models was 0.747 ± 0.034 (95% CI, 0.705–0.790).\"\n\n\"In conclusion, they investigated the feasibility of a framework for predicting malignant glioma grades based on radiomics using CE-T1WIs and T2WIs. The authors proposed framework could sufficiently and easily predict malignant glioma grades by preparing images acquired by a few structural MRI sequences.\"\n\n\"The proposed framework with a few MRI sequences could mitigate the tedious process of tumor contouring on each MRI sequence image compared with the frameworks with multiple MRI sequences. In addition, the best prediction performances of this study indicated that their proposed framework with a few MRI sequences could have versatility to varied datasets. Their proposed framework for noninvasively grading malignant gliomas based on the preoperative images could be an effective tool for selection of appropriate surgery and educating the patients.\"\n\nhttps://www.nature.com/articles/s41598-019-55922-0","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\nprint('Brain Segmentation Mask')\nimageio.mimsave(f'./{sample_id}.gif', segmented_brains_fill, duration=0.1)\ndisplay.Image(f'./{sample_id}.gif', format='png')","metadata":{"_kg_hide-output":false,"_kg_hide-input":true,"execution":{"iopub.status.busy":"2021-07-18T23:18:17.876916Z","iopub.execute_input":"2021-07-18T23:18:17.877281Z","iopub.status.idle":"2021-07-18T23:18:29.653098Z","shell.execute_reply.started":"2021-07-18T23:18:17.877252Z","shell.execute_reply":"2021-07-18T23:18:29.652231Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Prediction of Malignant Glioma using MRI</span></h1><br>\n\nCitation: Nakamoto, T., Takahashi, W., Haga, A. et al. Prediction of malignant glioma grades using contrast-enhanced T1-weighted and T2-weighted magnetic resonance images based on a radiomic analysis. Sci Rep 9, 19411 (2019).\n\nhttps://doi.org/10.1038/s41598-019-55922-0\n\n![](https://media.springernature.com/m685/springer-static/image/art%3A10.1038%2Fs41598-019-55922-0/MediaObjects/41598_2019_55922_Fig1_HTML.png)nature.com\n\nhttps://www.nature.com/articles/s41598-019-55922-0","metadata":{}},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Imaging Microglia and Astrocytes using Diffusion MRI</span></h1><br>\n\nImaging Microglia and Astrocytes non-invasively using Diffusion MRI\n\nAuthors: Raquel Garcia-Hernandez, Alejandro Trouve Carpena, Mark Drakesmith, Kristen Koller, Derek K. Jones, Santiago Canals, Silvia De Santis\n\ndoi: https://doi.org/10.1101/2020.02.07.938910\n\n\"The authors demonstrate that the MRI signal carries the fingerprint of microglia and astrocytes activation, and that specific signatures from each glia population can be extracted in vivo.\"\n\n<font color=\"#0000FF\">Data analysis and statistics</font>\n\n\"The statistical analysis was done using GraphPad Prism 7 software and Rstudio. The presence of outlier values and parametric distribution was checked. In most of the analysis the authors applied t-test comparing, for each time point, control hemisphere versus injected hemisphere.\"\n\n\"For regression analysis, Pearson’s correlation was applied and coefficients were transformed to apply Fisher’s 1925 test for significant values. Polar analysis and dispersion estimation was performed to obtain kappa values, before transforming them into an Orientation Dispersion Index (ODI).\"\n\n\"Conclusion: the authors proposed there a new generation of non-invasive glia-centric biomarkers, which are expected to transform the study of many diseases associated with a glial response: those where inflammation is as a known or possible cause, as well as those in which the glial reaction can serve as a powerful early diagnostic and/or prognostic marker.\"\n\nhttps://www.biorxiv.org/content/10.1101/2020.02.07.938910v1.full","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\nprint('Segmented Part of Brain Tissue')\nimageio.mimsave(f'./{sample_id}.gif', seg_brain_pixels, duration=0.1)\ndisplay.Image(f'./{sample_id}.gif', format='png')","metadata":{"_kg_hide-input":true,"_kg_hide-output":true,"execution":{"iopub.status.busy":"2021-07-18T23:19:48.727525Z","iopub.execute_input":"2021-07-18T23:19:48.727889Z","iopub.status.idle":"2021-07-18T23:20:00.450404Z","shell.execute_reply.started":"2021-07-18T23:19:48.727858Z","shell.execute_reply":"2021-07-18T23:20:00.44927Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\nfrom skimage.morphology import opening, closing\nfrom skimage.morphology import disk\n\ndef plot_comparison(original, filtered, filter_name):\n\n    fig, (ax1, ax2) = plt.subplots(ncols=2, figsize=(8, 4), sharex=True,\n                                   sharey=True)\n    ax1.imshow(original, cmap=plt.cm.gray)\n    ax1.set_title('original')\n    ax1.axis('off')\n    ax2.imshow(filtered, cmap=plt.cm.gray)\n    ax2.set_title(filter_name)\n    ax2.axis('off')","metadata":{"execution":{"iopub.status.busy":"2021-07-18T23:20:14.440623Z","iopub.execute_input":"2021-07-18T23:20:14.441162Z","iopub.status.idle":"2021-07-18T23:20:14.447896Z","shell.execute_reply.started":"2021-07-18T23:20:14.441123Z","shell.execute_reply":"2021-07-18T23:20:14.446995Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\noriginal = segmented_brains_fill[65]\n\nrows = 4\ncols = 4\nf, ax = plt.subplots(rows, cols, figsize = (15,12))\n\nfor i in range(rows*cols):\n    if i==0:\n        ax[0,0].imshow(original, cmap = plt.cm.gray)\n        ax[0,0].set_title('Original')\n        ax[0,0].axis(False)\n    else:\n        closed = closing(original, disk(i))\n        ax[int(i/rows),int(i % rows)].set_title(f'closed disk({i})')\n        ax[int(i/rows),int(i % rows)].imshow(closed, cmap = plt.cm.gray)\n        ax[int(i/rows),int(i % rows)].axis('off')\nplt.show()","metadata":{"_kg_hide-output":true,"_kg_hide-input":true,"execution":{"iopub.status.busy":"2021-07-18T23:20:27.764088Z","iopub.execute_input":"2021-07-18T23:20:27.764608Z","iopub.status.idle":"2021-07-18T23:20:32.277651Z","shell.execute_reply.started":"2021-07-18T23:20:27.764572Z","shell.execute_reply":"2021-07-18T23:20:32.276511Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"#Above, I failed again! Hence, I hid input/outputs.","metadata":{}},{"cell_type":"markdown","source":"We can select the desired filters from here and just multiply that with the original image to get brain segmentation from these. Before selecting any particular filter, let's see the segmentation quality of the filters and then we can select the desired filter.","metadata":{}},{"cell_type":"code","source":"#Code by Md. Redwan Karim Sony https://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\noriginal_image = sample_pixels[65]\noriginal = segmented_brains_fill[65]\nf, ax = plt.subplots(rows, cols, figsize = (10,10))\n\nfor i in range(rows*cols):\n    if i==0:\n        ax[0,0].imshow(original_image, cmap = plt.cm.gray)\n        ax[0,0].set_title('Original')\n        ax[0,0].axis(False)\n    else:\n        closed = closing(original, disk(i))\n        ax[int(i/rows),int(i % rows)].set_title(f'closed disk({i})')\n        ax[int(i/rows),int(i % rows)].imshow(original_image * closed, cmap = plt.cm.gray)\n        ax[int(i/rows),int(i % rows)].axis('off')\nplt.show() ","metadata":{"_kg_hide-output":true,"execution":{"iopub.status.busy":"2021-07-18T23:21:10.921891Z","iopub.execute_input":"2021-07-18T23:21:10.922252Z","iopub.status.idle":"2021-07-18T23:21:15.5796Z","shell.execute_reply.started":"2021-07-18T23:21:10.92222Z","shell.execute_reply":"2021-07-18T23:21:15.578355Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Differentiation between Glioblastoma and Solitary Metastasis</span></h1><br>\n\nDifferentiation between Glioblastoma and Solitary Metastasis: Morphologic Assessment by Conventional Brain MR Imaging and Diffusion-Weighted Imaging\n\nAuthors: Bo Young Jung, Eun Ja Lee, Jong Myon Bae, Young Jae Choi, Eun Kyoung Lee, and Dae Bong Kim\n\nInvestig Magn Reson Imaging. 2021 Mar;25(1):23-34. English.\nPublished online Mar 31, 2021.  https://doi.org/10.13104/imri.2021.25.1.23\n\n\"Differentiating between glioblastoma and solitary metastasis is very important for the planning of further workup and treatment. The authors assessed the ability of various morphological parameters using conventional MRI and diffusion-based techniques to distinguish between glioblastomas and solitary metastases in tumoral and peritumoral regions.\"\n\nStatistical Analysis\n\n\"The authors did statistical analyses using the SPSS software package (ver. 20.0). To find out whether there were significant differences between glioblastoma and metastasis, they analyzed the morphologic parameters of the enhancing tumor and peritumoral regions using the chi-squared test. They also evaluated which sequence was best for depicting peritumoral neoplastic cell infiltration. Furthermore, they used receiver operating characteristic (ROC) analysis to assess the extent of the peritumoral non-enhancing lesion and to find the cutoff value with the optimum combination of sensitivity and specificity for distinguishing glioblastoma from metastasis; P < 0.05 was taken to indicate statistical significance.\"\n\n\"This study had several limitations. Biopsy of peritumoral non-enhancing lesions was not done as part of the histologic examination at the time of surgery. A limited number of patients. Because of the small sample, factors that were less useful for differentiating glioblastoma from metastasis may not have been included.\"\n\n\"Depending on the isocitrate dehydrogenase (IDH1) mutation status, 1p19q codeletion and methylation status of O-6-methylguanine-DNA methyltransferase (MGMT), glioblastoma has had different treatment successes, different patient populations, and different imaging findings in both conventional and advanced MR imaging.\"\n\n\"In their study, patient's diagnoses with glioblastoma were based only on histological phenotypes, because they were diagnosed before WHO 2016 revision.\"\n\n<font color=\"#DC143C\">\"Therefore, the authors failed to evaluate the different imaging findings of glioblastoma based on genetic mutations and molecular markers.\"</font>\n\n\n\"In conclusion, they found that visual assessment of tumoral and peritumoral regions, using conventional MRI and diffusion-based techniques, allows them to distinguish these two types of tumor.\"\n\nhttps://i-mri.org/DOIx.php?id=10.13104/imri.2021.25.1.23","metadata":{}},{"cell_type":"code","source":"df=pd.read_csv('/kaggle/input/cusersmarildownloadstumorcsv/tumor.csv',encoding ='ISO-8859-1',sep=\";\")\ndf.head(10)","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2021-07-18T22:57:19.054317Z","iopub.execute_input":"2021-07-18T22:57:19.054622Z","iopub.status.idle":"2021-07-18T22:57:19.088354Z","shell.execute_reply.started":"2021-07-18T22:57:19.054598Z","shell.execute_reply":"2021-07-18T22:57:19.087201Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"<h1><span class=\"label label-default\" style=\"background-color:black;border-radius:100px 100px; font-weight: bold; font-family:Garamond; font-size:20px; color:#03e8fc; padding:10px\">Glioblastoma</span></h1><br>\n\n\"Glioblastoma (GBM) accounts for 40%∼50% of all primary malignant brain tumors in adults. Brain metastases are the most common complication of systemic cancer, and half of them are solitary at diagnosis. It is clinically important to distinguish GBM from solitary brain metastasis (SBM) because of the vast differences in these 2 entities with regard to tumor staging, treatment approach, and clinical outcomes. Structural gadolinium-enhanced MR imaging is the preferred imaging examination for brain tumors, but with a limited capacity to differentiate GBM (Glioblastoma) and SBM (solitary brain metastasis). They share similar imaging features, such as extensive edema and ring-enhancement, which is a great challenge in clinical practice.\"\n\nhttp://www.ajnr.org/content/early/2020/03/05/ajnr.A6466","metadata":{}},{"cell_type":"code","source":"#By Glioblastoma\n\nglioblastoma = pd.DataFrame( {     \n\"age\" : [\"60 ± 10.05\"], \n\"sex_perc_of_men)\" : ['57,1'],    \n\"irregular_shape\" : [\"18/21 (85.7%)\"] ,\n\"round_or_ovoid_shape\" : [\"3/21 (14.3%)\"],\n\"Ill_defined_margin\" : [\"16/21 (76.2%)\"], \n\"well_defined_margin\" : [\"5/21 (23.8%)\"],\n\"heterogeneous_enhancement\" : [\"16/21 (76.2%)\"], \n\"homogeneous_enhancement\" : [\"5/21 (23.8%)\"],\n\"presence_of_hemorrhage\" : [\"13/14 (92.9%)\"],\n\"absence_of_hemorrhage\" : [\"1/14 (7.1%)\"],} ) \nglioblastoma","metadata":{"_kg_hide-input":true,"execution":{"iopub.status.busy":"2021-07-18T22:57:27.413997Z","iopub.execute_input":"2021-07-18T22:57:27.414319Z","iopub.status.idle":"2021-07-18T22:57:27.431087Z","shell.execute_reply.started":"2021-07-18T22:57:27.41429Z","shell.execute_reply":"2021-07-18T22:57:27.429676Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"\"Glioblastomas had an irregular shape, ill-defined margins, and a heterogeneous enhancement pattern; on the other hand, metastases had an ovoid or round shape, well-defined margins, and homogeneous enhancement. Metastases had significantly more extensive peritumoral T2 high signal intensity than glioblastomas had. In visual assessment of peritumoral neoplastic cell infiltration using T2-weighted and diffusion-based images, all sequences differed significantly between the two groups. Exponential DWI (Diffusion-weighted images) had the highest sensitivity for the diagnosis of both glioblastoma (100%) and metastasis (70.6%). A combination of exponential DWI and ADC maps (Attenuation Coefficient (AC) map.) was optimal for the depiction of peritumoral neoplastic cell infiltration in glioblastoma.\"\n\nConclusion\n\n\"In the differentiation of glioblastoma from solitary metastatic lesions, visual morphologic assessment of tumoral and peritumoral regions using conventional MRI and diffusion-based techniques can also offer diagnostic information.\"\n\nhttps://i-mri.org/DOIx.php?id=10.13104/imri.2021.25.1.23","metadata":{}},{"cell_type":"markdown","source":"#Thanks to Md. Redwan Karim Sony for all the Dicom script. Give support to his work.\n\nhttps://www.kaggle.com/redwankarimsony/visualizing-and-analyzing-dicoms-in-python/notebook?select=train.csv\n\n#Thanks to Jose Carmona for the Slider with ipywidgets. \n","metadata":{}}]}