Switch to unified view

a b/notebooks/1_TRE_eval_development.ipynb
1
{
2
 "cells": [
3
  {
4
   "cell_type": "code",
5
   "execution_count": 2,
6
   "id": "4f4fc2ef-3ba9-4355-9221-be8af5ddf7ba",
7
   "metadata": {},
8
   "outputs": [],
9
   "source": [
10
    "import sys\n",
11
    "sys.path.append('../')\n",
12
    "\n",
13
    "import os\n",
14
    "import numpy as np\n",
15
    "\n",
16
    "from utils.metrics import compute_TRE"
17
   ]
18
  },
19
  {
20
   "cell_type": "markdown",
21
   "id": "d3b26f99-75c6-4638-ab91-991f7e39c9c5",
22
   "metadata": {},
23
   "source": [
24
    "From the dataset, the displacement is 25.90 (11.57) for COPD1"
25
   ]
26
  },
27
  {
28
   "cell_type": "code",
29
   "execution_count": 6,
30
   "id": "1d2a696b-ae45-452d-8322-f054a18eb428",
31
   "metadata": {},
32
   "outputs": [
33
    {
34
     "name": "stdout",
35
     "output_type": "stream",
36
     "text": [
37
      "26.33 11.42\n"
38
     ]
39
    }
40
   ],
41
   "source": [
42
    "fixed_points_file = '../rawData/copd1/copd1_300_iBH_xyz_r1.txt'\n",
43
    "moving_points_file = '../rawData/copd1/copd1_300_eBH_xyz_r1.txt'\n",
44
    "voxel_size = (0.625, 0.625, 2.5)\n",
45
    "\n",
46
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
47
    "\n",
48
    "print(TRE_mean, TRE_std)"
49
   ]
50
  },
51
  {
52
   "cell_type": "code",
53
   "execution_count": 2,
54
   "metadata": {},
55
   "outputs": [
56
    {
57
     "name": "stdout",
58
     "output_type": "stream",
59
     "text": [
60
      "26.33 11.42\n"
61
     ]
62
    }
63
   ],
64
   "source": [
65
    "fixed_points_file = '../rawData/copd1/copd1_300_iBH_xyz_r1.txt'\n",
66
    "moving_points_file = '../rawData/copd1/copd1_300_eBH_xyz_r1.txt'\n",
67
    "voxel_size = (0.625, 0.625, 2.5)\n",
68
    "\n",
69
    "TRE_mean, TRE_std = compute_TRE(moving_points_file, fixed_points_file, voxel_size)\n",
70
    "\n",
71
    "print(TRE_mean, TRE_std)"
72
   ]
73
  },
74
  {
75
   "cell_type": "markdown",
76
   "id": "0e69accd-7a87-4c06-88c9-de0df055c2fb",
77
   "metadata": {},
78
   "source": [
79
    "From the dataset, the displacement is 21.77 (6.46) for COPD2"
80
   ]
81
  },
82
  {
83
   "cell_type": "code",
84
   "execution_count": 3,
85
   "id": "ead490b2-d530-431d-ba2f-de58dc5ce5ea",
86
   "metadata": {},
87
   "outputs": [
88
    {
89
     "name": "stdout",
90
     "output_type": "stream",
91
     "text": [
92
      "21.79 6.46\n"
93
     ]
94
    }
95
   ],
96
   "source": [
97
    "fixed_points_file = '../rawData/copd2/copd2_300_iBH_xyz_r1.txt'\n",
98
    "moving_points_file = '../rawData/copd2/copd2_300_eBH_xyz_r1.txt'\n",
99
    "voxel_size = (0.645, 0.645, 2.5)\n",
100
    "\n",
101
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
102
    "\n",
103
    "print(TRE_mean, TRE_std)"
104
   ]
105
  },
106
  {
107
   "cell_type": "markdown",
108
   "id": "1621e87c-6e39-4932-bbf5-956c409dc882",
109
   "metadata": {},
110
   "source": [
111
    "From the dataset, the displacement is 12.29 (6.39) for COPD3"
112
   ]
113
  },
114
  {
115
   "cell_type": "code",
116
   "execution_count": 40,
117
   "id": "82d039ef-19b4-4561-a6c5-2ea3d2f652fc",
118
   "metadata": {},
119
   "outputs": [
120
    {
121
     "name": "stdout",
122
     "output_type": "stream",
123
     "text": [
124
      "12.64 6.38\n"
125
     ]
126
    }
127
   ],
128
   "source": [
129
    "fixed_points_file = '../rawData/copd3/copd3_300_iBH_xyz_r1.txt'\n",
130
    "moving_points_file = '../rawData/copd3/copd3_300_eBH_xyz_r1.txt'\n",
131
    "voxel_size = (0.652, 0.652, 2.5)\n",
132
    "\n",
133
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
134
    "\n",
135
    "print(TRE_mean, TRE_std)"
136
   ]
137
  },
138
  {
139
   "cell_type": "markdown",
140
   "id": "5c890035-6dd5-4138-841b-2ac65f4cb0aa",
141
   "metadata": {},
142
   "source": [
143
    "From the dataset, the displacement is 30.90 (13.49) for COPD4"
144
   ]
145
  },
146
  {
147
   "cell_type": "code",
148
   "execution_count": 39,
149
   "id": "d9266991-1dae-4cce-9a98-044444e75fa5",
150
   "metadata": {},
151
   "outputs": [
152
    {
153
     "name": "stdout",
154
     "output_type": "stream",
155
     "text": [
156
      "29.58 12.92\n"
157
     ]
158
    }
159
   ],
160
   "source": [
161
    "fixed_points_file = '../rawData/copd4/copd4_300_iBH_xyz_r1.txt'\n",
162
    "moving_points_file = '../rawData/copd4/copd4_300_eBH_xyz_r1.txt'\n",
163
    "voxel_size = (0.590, 0.590, 2.5)\n",
164
    "\n",
165
    "TRE_mean, TRE_std = compute_TRE(fixed_points_file, moving_points_file, voxel_size)\n",
166
    "\n",
167
    "print(TRE_mean, TRE_std)"
168
   ]
169
  }
170
 ],
171
 "metadata": {
172
  "kernelspec": {
173
   "display_name": "Python 3 (ipykernel)",
174
   "language": "python",
175
   "name": "python3"
176
  },
177
  "language_info": {
178
   "codemirror_mode": {
179
    "name": "ipython",
180
    "version": 3
181
   },
182
   "file_extension": ".py",
183
   "mimetype": "text/x-python",
184
   "name": "python",
185
   "nbconvert_exporter": "python",
186
   "pygments_lexer": "ipython3",
187
   "version": "3.10.4"
188
  }
189
 },
190
 "nbformat": 4,
191
 "nbformat_minor": 5
192
}