[6fe801]: / notebooks / 1_TRE_eval_development.ipynb

Download this file

193 lines (192 with data), 4.5 kB

{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "4f4fc2ef-3ba9-4355-9221-be8af5ddf7ba",
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append('../')\n",
    "\n",
    "import os\n",
    "import numpy as np\n",
    "\n",
    "from utils.metrics import compute_TRE"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d3b26f99-75c6-4638-ab91-991f7e39c9c5",
   "metadata": {},
   "source": [
    "From the dataset, the displacement is 25.90 (11.57) for COPD1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "1d2a696b-ae45-452d-8322-f054a18eb428",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "26.33 11.42\n"
     ]
    }
   ],
   "source": [
    "fixed_points_file = '../rawData/copd1/copd1_300_iBH_xyz_r1.txt'\n",
    "moving_points_file = '../rawData/copd1/copd1_300_eBH_xyz_r1.txt'\n",
    "voxel_size = (0.625, 0.625, 2.5)\n",
    "\n",
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
    "\n",
    "print(TRE_mean, TRE_std)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "26.33 11.42\n"
     ]
    }
   ],
   "source": [
    "fixed_points_file = '../rawData/copd1/copd1_300_iBH_xyz_r1.txt'\n",
    "moving_points_file = '../rawData/copd1/copd1_300_eBH_xyz_r1.txt'\n",
    "voxel_size = (0.625, 0.625, 2.5)\n",
    "\n",
    "TRE_mean, TRE_std = compute_TRE(moving_points_file, fixed_points_file, voxel_size)\n",
    "\n",
    "print(TRE_mean, TRE_std)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0e69accd-7a87-4c06-88c9-de0df055c2fb",
   "metadata": {},
   "source": [
    "From the dataset, the displacement is 21.77 (6.46) for COPD2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "ead490b2-d530-431d-ba2f-de58dc5ce5ea",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "21.79 6.46\n"
     ]
    }
   ],
   "source": [
    "fixed_points_file = '../rawData/copd2/copd2_300_iBH_xyz_r1.txt'\n",
    "moving_points_file = '../rawData/copd2/copd2_300_eBH_xyz_r1.txt'\n",
    "voxel_size = (0.645, 0.645, 2.5)\n",
    "\n",
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
    "\n",
    "print(TRE_mean, TRE_std)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1621e87c-6e39-4932-bbf5-956c409dc882",
   "metadata": {},
   "source": [
    "From the dataset, the displacement is 12.29 (6.39) for COPD3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "82d039ef-19b4-4561-a6c5-2ea3d2f652fc",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12.64 6.38\n"
     ]
    }
   ],
   "source": [
    "fixed_points_file = '../rawData/copd3/copd3_300_iBH_xyz_r1.txt'\n",
    "moving_points_file = '../rawData/copd3/copd3_300_eBH_xyz_r1.txt'\n",
    "voxel_size = (0.652, 0.652, 2.5)\n",
    "\n",
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
    "\n",
    "print(TRE_mean, TRE_std)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5c890035-6dd5-4138-841b-2ac65f4cb0aa",
   "metadata": {},
   "source": [
    "From the dataset, the displacement is 30.90 (13.49) for COPD4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "d9266991-1dae-4cce-9a98-044444e75fa5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "29.58 12.92\n"
     ]
    }
   ],
   "source": [
    "fixed_points_file = '../rawData/copd4/copd4_300_iBH_xyz_r1.txt'\n",
    "moving_points_file = '../rawData/copd4/copd4_300_eBH_xyz_r1.txt'\n",
    "voxel_size = (0.590, 0.590, 2.5)\n",
    "\n",
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
    "\n",
    "print(TRE_mean, TRE_std)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}