diff --git a/IMALAB_BraTS_Challenge.ipynb b/IMALAB_BraTS_Challenge.ipynb
deleted file mode 100644
index ba233b8..0000000
--- a/IMALAB_BraTS_Challenge.ipynb
+++ /dev/null
@@ -1,1397 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {
- "id": "view-in-github",
- "colab_type": "text"
- },
- "source": [
- ""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 99,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 53
- },
- "id": "O62JgC5ee6Fg",
- "outputId": "8e22c014-8007-41f4-8d91-19cae7a12c6d"
- },
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "'\\nnext steps:\\n- extracting (called \"open\" on the file viewer) all the files with \".nii.gz\" (basically getting all the files)\\n- view an image - look into: can you have multiple windows for MRIcro\\n- also look at the viewer thing in colab\\n\\nthen i can do preprocessing\\n'"
- ],
- "application/vnd.google.colaboratory.intrinsic+json": {
- "type": "string"
- }
- },
- "metadata": {},
- "execution_count": 99
- }
- ],
- "source": [
- "\"\"\"\n",
- "Training/Validation/Testing\n",
- "│\n",
- "└─── 00000\n",
- "│ │\n",
- "│ └─── FLAIR\n",
- "│ │ │ Image.nii.gz\n",
- "│ │ \n",
- "│ └─── T1\n",
- "│ │ │ Image.nii.gz\n",
- "│ │ \n",
- "│ └─── T1CE\n",
- "│ │ │ Image.nii.gz\n",
- "│ │ \n",
- "│ └─── T2\n",
- "│ │ │ Image.nii.gz\n",
- "| | \n",
- "| |___ Segmentation\n",
- "| | | Image.nii.gz\n",
- "│ \n",
- "└─── 00001\n",
- "│\n",
- "│ ... \n",
- "│ ... \n",
- "│ \n",
- "└─── 00002\n",
- "\"\"\"\n",
- "\n",
- "\"\"\"\n",
- "next steps:\n",
- "- extracting (called \"open\" on the file viewer) all the files with \".nii.gz\" (basically getting all the files)\n",
- "- view an image - look into: can you have multiple windows for MRIcro\n",
- "- also look at the viewer thing in colab\n",
- "\n",
- "then i can do preprocessing\n",
- "\"\"\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "ko8JUyqhO7TQ",
- "outputId": "321a8348-5905-4541-910f-d1266b63fdd6"
- },
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "/usr/local/lib/python3.7/dist-packages/gdown/cli.py:131: FutureWarning: Option `--id` was deprecated in version 4.3.1 and will be removed in 5.0. You don't need to pass it anymore to use a file ID.\n",
- " category=FutureWarning,\n",
- "Downloading...\n",
- "From: https://drive.google.com/uc?id=17_VDkS9f0QA8IIGqdWFgm6d2JASBtILt\n",
- "To: /content/brats_120_images.zip\n",
- "100% 235M/235M [00:01<00:00, 195MB/s]\n"
- ]
- }
- ],
- "source": [
- "!gdown --id 17_VDkS9f0QA8IIGqdWFgm6d2JASBtILt"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "xo220Y4n91xw",
- "outputId": "07aef016-219d-46b4-ace1-c8ed1680876e"
- },
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "Archive: /content/brats_120_images.zip\n",
- " creating: brats_120_images/\n",
- " inflating: brats_120_images/BraTS2021_00025_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00025_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00025_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00025_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00000_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00000_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00025_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00025_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00032_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00032_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00003_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00003_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00026_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00026_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00011_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00011_t1.nii \n",
- " inflating: brats_120_images/.DS_Store \n",
- " inflating: __MACOSX/brats_120_images/._.DS_Store \n",
- " inflating: brats_120_images/BraTS2021_00003_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00003_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00022_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00022_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00012_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00012_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00002_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00002_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00018_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00018_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00011_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00011_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00024_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00024_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00020_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00020_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00003_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00003_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00017_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00017_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00016_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00016_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00028_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00028_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00031_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00031_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00019_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00019_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00024_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00024_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00025_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00025_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00000_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00000_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00012_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00012_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00026_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00026_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00006_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00006_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00011_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00011_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00031_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00031_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00019_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00019_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00009_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00009_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00019_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00019_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00021_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00021_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00017_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00017_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00019_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00019_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00009_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00009_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00008_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00008_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00018_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00018_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00005_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00005_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00032_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00032_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00006_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00006_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00021_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00021_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00021_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00021_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00014_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00014_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00017_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00017_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00009_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00009_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00005_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00005_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00011_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00011_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00000_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00000_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00024_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00024_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00028_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00028_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00014_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00014_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00014_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00014_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00008_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00008_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00000_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00000_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00012_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00012_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00024_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00024_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00030_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00030_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00024_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00024_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00028_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00028_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00020_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00020_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00021_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00021_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00022_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00022_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00005_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00005_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00032_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00032_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00000_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00000_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00012_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00012_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00011_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00011_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00003_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00003_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00002_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00002_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00026_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00026_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00002_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00002_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00003_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00003_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00026_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00026_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00005_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00005_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00017_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00017_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00009_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00009_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00008_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00008_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00002_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00002_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00022_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00022_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00006_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00006_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00028_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00028_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00005_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00005_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00018_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00018_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00014_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00014_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00022_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00022_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00030_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00030_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00009_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00009_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00021_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00021_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00031_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00031_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00025_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00025_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00017_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00017_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00006_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00006_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00018_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00018_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00014_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00014_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00031_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00031_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00022_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00022_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00028_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00028_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00030_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00030_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00031_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00031_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00030_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00030_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00008_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00008_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00016_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00016_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00006_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00006_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00016_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00016_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00012_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00012_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00032_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00032_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00020_t1.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00020_t1.nii \n",
- " inflating: brats_120_images/BraTS2021_00016_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00016_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00008_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00008_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00019_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00019_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00016_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00016_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00018_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00018_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00002_flair.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00002_flair.nii \n",
- " inflating: brats_120_images/BraTS2021_00026_t1ce.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00026_t1ce.nii \n",
- " inflating: brats_120_images/BraTS2021_00032_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00032_t2.nii \n",
- " inflating: brats_120_images/BraTS2021_00030_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00030_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00020_seg.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00020_seg.nii \n",
- " inflating: brats_120_images/BraTS2021_00020_t2.nii \n",
- " inflating: __MACOSX/brats_120_images/._BraTS2021_00020_t2.nii \n"
- ]
- }
- ],
- "source": [
- "!unzip /content/brats_120_images.zip"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "import glob\n",
- "\"\"\"\n",
- "glob.glob\n",
- "you can have a function for retrieving the file paths by having a variable for each of the volumes + segmented\n",
- "e.x. for a segmentation file:\n",
- "\"/Users/shizacharania/Desktop/brats_data/RSNA_ASNR_MICCAI_BraTS2021_TrainingData_16July2021/BraTS2021_00000_seg.nii\"\n",
- "then you would look for the \"BraTS2021_\" in the beginning and the \"*/*\" stuff and then the \"_seg.nii\" (the extracted nifti files dont have \".gz\")\n",
- "\"\"\"\n",
- "\n",
- "flair_paths = glob.glob(\"*/*_flair.nii\")\n",
- "flair_paths = sorted(flair_paths)\n",
- "print(flair_paths)\n",
- "print(len(flair_paths))\n",
- "\n",
- "t1_paths = glob.glob(\"*/*_t1.nii\")\n",
- "t1_paths = sorted(t1_paths)\n",
- "print(t1_paths)\n",
- "print(len(t1_paths))\n",
- "\n",
- "t1ce_paths = glob.glob(\"*/*_t1ce.nii\")\n",
- "t1ce_paths = sorted(t1ce_paths)\n",
- "print(t1ce_paths)\n",
- "print(len(t1ce_paths))\n",
- "\n",
- "t2_paths = glob.glob(\"*/*_t2.nii\")\n",
- "t2_paths = sorted(t2_paths)\n",
- "print(t2_paths)\n",
- "print(len(t2_paths))\n",
- "\n",
- "seg_paths = glob.glob(\"*/*_seg.nii\")\n",
- "seg_paths = sorted(seg_paths)\n",
- "print(seg_paths)\n",
- "print(len(seg_paths))\n",
- "\n",
- "all = glob.glob(\"*/*.nii\")\n",
- "print(24*5==len(all))"
- ],
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "uxUhKxsIToTy",
- "outputId": "3ff1d250-213f-498d-84df-c2db0f44de62"
- },
- "execution_count": 32,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "['brats_120_images/BraTS2021_00000_flair.nii', 'brats_120_images/BraTS2021_00002_flair.nii', 'brats_120_images/BraTS2021_00003_flair.nii', 'brats_120_images/BraTS2021_00005_flair.nii', 'brats_120_images/BraTS2021_00006_flair.nii', 'brats_120_images/BraTS2021_00008_flair.nii', 'brats_120_images/BraTS2021_00009_flair.nii', 'brats_120_images/BraTS2021_00011_flair.nii', 'brats_120_images/BraTS2021_00012_flair.nii', 'brats_120_images/BraTS2021_00014_flair.nii', 'brats_120_images/BraTS2021_00016_flair.nii', 'brats_120_images/BraTS2021_00017_flair.nii', 'brats_120_images/BraTS2021_00018_flair.nii', 'brats_120_images/BraTS2021_00019_flair.nii', 'brats_120_images/BraTS2021_00020_flair.nii', 'brats_120_images/BraTS2021_00021_flair.nii', 'brats_120_images/BraTS2021_00022_flair.nii', 'brats_120_images/BraTS2021_00024_flair.nii', 'brats_120_images/BraTS2021_00025_flair.nii', 'brats_120_images/BraTS2021_00026_flair.nii', 'brats_120_images/BraTS2021_00028_flair.nii', 'brats_120_images/BraTS2021_00030_flair.nii', 'brats_120_images/BraTS2021_00031_flair.nii', 'brats_120_images/BraTS2021_00032_flair.nii']\n",
- "24\n",
- "['brats_120_images/BraTS2021_00000_t1.nii', 'brats_120_images/BraTS2021_00002_t1.nii', 'brats_120_images/BraTS2021_00003_t1.nii', 'brats_120_images/BraTS2021_00005_t1.nii', 'brats_120_images/BraTS2021_00006_t1.nii', 'brats_120_images/BraTS2021_00008_t1.nii', 'brats_120_images/BraTS2021_00009_t1.nii', 'brats_120_images/BraTS2021_00011_t1.nii', 'brats_120_images/BraTS2021_00012_t1.nii', 'brats_120_images/BraTS2021_00014_t1.nii', 'brats_120_images/BraTS2021_00016_t1.nii', 'brats_120_images/BraTS2021_00017_t1.nii', 'brats_120_images/BraTS2021_00018_t1.nii', 'brats_120_images/BraTS2021_00019_t1.nii', 'brats_120_images/BraTS2021_00020_t1.nii', 'brats_120_images/BraTS2021_00021_t1.nii', 'brats_120_images/BraTS2021_00022_t1.nii', 'brats_120_images/BraTS2021_00024_t1.nii', 'brats_120_images/BraTS2021_00025_t1.nii', 'brats_120_images/BraTS2021_00026_t1.nii', 'brats_120_images/BraTS2021_00028_t1.nii', 'brats_120_images/BraTS2021_00030_t1.nii', 'brats_120_images/BraTS2021_00031_t1.nii', 'brats_120_images/BraTS2021_00032_t1.nii']\n",
- "24\n",
- "['brats_120_images/BraTS2021_00000_t1ce.nii', 'brats_120_images/BraTS2021_00002_t1ce.nii', 'brats_120_images/BraTS2021_00003_t1ce.nii', 'brats_120_images/BraTS2021_00005_t1ce.nii', 'brats_120_images/BraTS2021_00006_t1ce.nii', 'brats_120_images/BraTS2021_00008_t1ce.nii', 'brats_120_images/BraTS2021_00009_t1ce.nii', 'brats_120_images/BraTS2021_00011_t1ce.nii', 'brats_120_images/BraTS2021_00012_t1ce.nii', 'brats_120_images/BraTS2021_00014_t1ce.nii', 'brats_120_images/BraTS2021_00016_t1ce.nii', 'brats_120_images/BraTS2021_00017_t1ce.nii', 'brats_120_images/BraTS2021_00018_t1ce.nii', 'brats_120_images/BraTS2021_00019_t1ce.nii', 'brats_120_images/BraTS2021_00020_t1ce.nii', 'brats_120_images/BraTS2021_00021_t1ce.nii', 'brats_120_images/BraTS2021_00022_t1ce.nii', 'brats_120_images/BraTS2021_00024_t1ce.nii', 'brats_120_images/BraTS2021_00025_t1ce.nii', 'brats_120_images/BraTS2021_00026_t1ce.nii', 'brats_120_images/BraTS2021_00028_t1ce.nii', 'brats_120_images/BraTS2021_00030_t1ce.nii', 'brats_120_images/BraTS2021_00031_t1ce.nii', 'brats_120_images/BraTS2021_00032_t1ce.nii']\n",
- "24\n",
- "['brats_120_images/BraTS2021_00000_t2.nii', 'brats_120_images/BraTS2021_00002_t2.nii', 'brats_120_images/BraTS2021_00003_t2.nii', 'brats_120_images/BraTS2021_00005_t2.nii', 'brats_120_images/BraTS2021_00006_t2.nii', 'brats_120_images/BraTS2021_00008_t2.nii', 'brats_120_images/BraTS2021_00009_t2.nii', 'brats_120_images/BraTS2021_00011_t2.nii', 'brats_120_images/BraTS2021_00012_t2.nii', 'brats_120_images/BraTS2021_00014_t2.nii', 'brats_120_images/BraTS2021_00016_t2.nii', 'brats_120_images/BraTS2021_00017_t2.nii', 'brats_120_images/BraTS2021_00018_t2.nii', 'brats_120_images/BraTS2021_00019_t2.nii', 'brats_120_images/BraTS2021_00020_t2.nii', 'brats_120_images/BraTS2021_00021_t2.nii', 'brats_120_images/BraTS2021_00022_t2.nii', 'brats_120_images/BraTS2021_00024_t2.nii', 'brats_120_images/BraTS2021_00025_t2.nii', 'brats_120_images/BraTS2021_00026_t2.nii', 'brats_120_images/BraTS2021_00028_t2.nii', 'brats_120_images/BraTS2021_00030_t2.nii', 'brats_120_images/BraTS2021_00031_t2.nii', 'brats_120_images/BraTS2021_00032_t2.nii']\n",
- "24\n",
- "['brats_120_images/BraTS2021_00000_seg.nii', 'brats_120_images/BraTS2021_00002_seg.nii', 'brats_120_images/BraTS2021_00003_seg.nii', 'brats_120_images/BraTS2021_00005_seg.nii', 'brats_120_images/BraTS2021_00006_seg.nii', 'brats_120_images/BraTS2021_00008_seg.nii', 'brats_120_images/BraTS2021_00009_seg.nii', 'brats_120_images/BraTS2021_00011_seg.nii', 'brats_120_images/BraTS2021_00012_seg.nii', 'brats_120_images/BraTS2021_00014_seg.nii', 'brats_120_images/BraTS2021_00016_seg.nii', 'brats_120_images/BraTS2021_00017_seg.nii', 'brats_120_images/BraTS2021_00018_seg.nii', 'brats_120_images/BraTS2021_00019_seg.nii', 'brats_120_images/BraTS2021_00020_seg.nii', 'brats_120_images/BraTS2021_00021_seg.nii', 'brats_120_images/BraTS2021_00022_seg.nii', 'brats_120_images/BraTS2021_00024_seg.nii', 'brats_120_images/BraTS2021_00025_seg.nii', 'brats_120_images/BraTS2021_00026_seg.nii', 'brats_120_images/BraTS2021_00028_seg.nii', 'brats_120_images/BraTS2021_00030_seg.nii', 'brats_120_images/BraTS2021_00031_seg.nii', 'brats_120_images/BraTS2021_00032_seg.nii']\n",
- "24\n",
- "True\n"
- ]
- }
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "# /content/brats_data_992/BraTS2021_00275_flair.nii\n",
- "for i in range(len(flair_paths)):\n",
- " flair_paths[i] = \"/content/\" + flair_paths[i]\n",
- "\n",
- "for i in range(len(t1_paths)):\n",
- " t1_paths[i] = \"/content/\" + t1_paths[i]\n",
- "\n",
- "for i in range(len(t1ce_paths)):\n",
- " t1ce_paths[i] = \"/content/\" + t1ce_paths[i]\n",
- "\n",
- "for i in range(len(t2_paths)):\n",
- " t2_paths[i] = \"/content/\" + t2_paths[i]\n",
- "\n",
- "for i in range(len(seg_paths)):\n",
- " seg_paths[i] = \"/content/\" + seg_paths[i]\n",
- "\n",
- "print(flair_paths[0])\n",
- "print(t1_paths[0])\n",
- "print(t1ce_paths[0])\n",
- "print(t2_paths[0])\n",
- "print(seg_paths[0])"
- ],
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "_K1Kfei6Tsr6",
- "outputId": "43f4e848-fbe0-4e8f-beca-f5e7a822d0e2"
- },
- "execution_count": 33,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "/content/brats_120_images/BraTS2021_00000_flair.nii\n",
- "/content/brats_120_images/BraTS2021_00000_t1.nii\n",
- "/content/brats_120_images/BraTS2021_00000_t1ce.nii\n",
- "/content/brats_120_images/BraTS2021_00000_t2.nii\n",
- "/content/brats_120_images/BraTS2021_00000_seg.nii\n"
- ]
- }
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 34,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 87
- },
- "id": "4JnhkIMBNnKb",
- "outputId": "a5d472cb-4e3e-42cc-97bf-3798efa8ec9c"
- },
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "'\\nmy approach to visualize 3d images:\\n- use simpleitk (sitk)\\n - i need to load the images into sitk format and then convert it into a numpy array\\n\\n- from a numpy array, i need to do 2 tasks\\n 1. i will look at a stack of 2d arrays (that form a 3d image) and visualize the slices for that\\n 2. i will visualize the 3d image entirely and have a scrolling feature that goes through these 2d array slices\\n\\nlook into basics of simpleitk - how to read the file and then convert it into np.array()\\nlook into \"Exploring 3D images with Matplotlib\" - https://www.youtube.com/watch?v=5jQVQE6yfio\\nlook into what fatemeh did: https://youtu.be/rBIetBho0x4\\n'"
- ],
- "application/vnd.google.colaboratory.intrinsic+json": {
- "type": "string"
- }
- },
- "metadata": {},
- "execution_count": 34
- }
- ],
- "source": [
- "\"\"\"\n",
- "my approach to visualize 3d images:\n",
- "- use simpleitk (sitk)\n",
- " - i need to load the images into sitk format and then convert it into a numpy array\n",
- "\n",
- "- from a numpy array, i need to do 2 tasks\n",
- " 1. i will look at a stack of 2d arrays (that form a 3d image) and visualize the slices for that\n",
- " 2. i will visualize the 3d image entirely and have a scrolling feature that goes through these 2d array slices\n",
- "\n",
- "look into basics of simpleitk - how to read the file and then convert it into np.array()\n",
- "look into \"Exploring 3D images with Matplotlib\" - https://www.youtube.com/watch?v=5jQVQE6yfio\n",
- "look into what fatemeh did: https://youtu.be/rBIetBho0x4\n",
- "\"\"\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 35,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "ddvherI7gu54",
- "outputId": "e0574fa3-0c85-4df5-980e-8d0d6c284cf8"
- },
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
- "Requirement already satisfied: SimpleITK in /usr/local/lib/python3.7/dist-packages (2.1.1.2)\n"
- ]
- }
- ],
- "source": [
- "!pip install SimpleITK"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 36,
- "metadata": {
- "id": "dkPF64fHgqOq"
- },
- "outputs": [],
- "source": [
- "import SimpleITK as sitk"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 37,
- "metadata": {
- "id": "t9ujRnCFWVpi"
- },
- "outputs": [],
- "source": [
- "# reading a file in simpleitk (sitk)\n",
- "\n",
- "flair_nparrays = []\n",
- "t1_nparrays = []\n",
- "t1ce_nparrays = []\n",
- "t2_nparrays = []\n",
- "seg_nparrays = []\n",
- "\n",
- "for flair_imagepath in flair_paths:\n",
- " img = sitk.ReadImage(flair_imagepath)\n",
- " img = sitk.GetArrayFromImage(img)\n",
- " flair_nparrays.append(img)\n",
- "\n",
- "for t1_imagepath in t1_paths:\n",
- " img = sitk.ReadImage(t1_imagepath)\n",
- " img = sitk.GetArrayFromImage(img)\n",
- " t1_nparrays.append(img)\n",
- "\n",
- "for t1ce_imagepath in t1ce_paths:\n",
- " img = sitk.ReadImage(t1ce_imagepath)\n",
- " img = sitk.GetArrayFromImage(img)\n",
- " t1ce_nparrays.append(img)\n",
- "\n",
- "for t2_imagepath in t2_paths:\n",
- " img = sitk.ReadImage(t2_imagepath)\n",
- " img = sitk.GetArrayFromImage(img)\n",
- " t2_nparrays.append(img)\n",
- "\n",
- "for seg_imagepath in seg_paths:\n",
- " img = sitk.ReadImage(seg_imagepath)\n",
- " img = sitk.GetArrayFromImage(img)\n",
- " seg_nparrays.append(img)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 97,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "FCLSjDeCjuD5",
- "outputId": "e0892b15-3b7b-4f6f-af96-1b12924d0f33"
- },
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "24\n",
- "24\n",
- "24\n",
- "24\n",
- "24\n"
- ]
- }
- ],
- "source": [
- "print(len(flair_nparrays))\n",
- "print(len(t1_nparrays))\n",
- "print(len(t1ce_nparrays))\n",
- "print(len(t2_nparrays))\n",
- "print(len(seg_nparrays))"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 96,
- "metadata": {
- "id": "lIEdCmqslIeT"
- },
- "outputs": [],
- "source": [
- "# i will look at a stack of 2d arrays (that form a 3d image) and visualize the slices for that\n",
- "\n",
- "import matplotlib.pyplot as plt\n",
- "import numpy"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 41,
- "metadata": {
- "id": "3mMi6OC51qSu"
- },
- "outputs": [],
- "source": [
- "from ipywidgets import interact, interactive, IntSlider, ToggleButtons\n",
- "\n",
- "# I'll do this part by myself after"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 95,
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 769
- },
- "id": "Y0Dp5OUNHFMa",
- "outputId": "95c27074-f409-4948-f404-16d2828d8ed2"
- },
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/plain": [
- "