Skip to content

Commit db33c67

Browse files
committed
Fix paths in colab env
1 parent 4b4362a commit db33c67

File tree

4 files changed

+42
-264
lines changed

4 files changed

+42
-264
lines changed

panoptica/example_config.ipynb

Lines changed: 14 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 1,
19+
"execution_count": 10,
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
@@ -52,7 +52,7 @@
5252
},
5353
{
5454
"cell_type": "code",
55-
"execution_count": 2,
55+
"execution_count": 11,
5656
"metadata": {},
5757
"outputs": [],
5858
"source": [
@@ -90,18 +90,9 @@
9090
},
9191
{
9292
"cell_type": "code",
93-
"execution_count": 3,
93+
"execution_count": 12,
9494
"metadata": {},
95-
"outputs": [
96-
{
97-
"name": "stdout",
98-
"output_type": "stream",
99-
"text": [
100-
"No module named 'pandas'\n",
101-
"OPTIONAL PACKAGE MISSING\n"
102-
]
103-
}
104-
],
95+
"outputs": [],
10596
"source": [
10697
"import numpy as np\n",
10798
"from auxiliary.nifti.io import read_nifti\n",
@@ -129,7 +120,7 @@
129120
},
130121
{
131122
"cell_type": "code",
132-
"execution_count": 4,
123+
"execution_count": 13,
133124
"metadata": {},
134125
"outputs": [
135126
{
@@ -141,14 +132,14 @@
141132
" 106, 107, 108, 202, 203, 204, 205, 206, 207, 208], dtype=uint8))"
142133
]
143134
},
144-
"execution_count": 4,
135+
"execution_count": 13,
145136
"metadata": {},
146137
"output_type": "execute_result"
147138
}
148139
],
149140
"source": [
150-
"ref_masks = read_nifti(\"./spine_seg/matched_instance/ref.nii.gz\")\n",
151-
"pred_masks = read_nifti(\"./spine_seg/matched_instance/pred.nii.gz\")\n",
141+
"ref_masks = read_nifti(f\"{BASE_PATH}/spine_seg/matched_instance/ref.nii.gz\")\n",
142+
"pred_masks = read_nifti(f\"{BASE_PATH}/spine_seg/matched_instance/pred.nii.gz\")\n",
152143
"\n",
153144
"# labels are matching\n",
154145
"np.unique(ref_masks), np.unique(pred_masks)"
@@ -163,74 +154,9 @@
163154
},
164155
{
165156
"cell_type": "code",
166-
"execution_count": 5,
157+
"execution_count": 14,
167158
"metadata": {},
168159
"outputs": [
169-
{
170-
"data": {
171-
"text/html": [
172-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">────────────────────────────────────────── </span>Thank you for using <span style=\"font-weight: bold\">panoptica</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ──────────────────────────────────────────</span>\n",
173-
"</pre>\n"
174-
],
175-
"text/plain": [
176-
"\u001b[92m────────────────────────────────────────── \u001b[0mThank you for using \u001b[1mpanoptica\u001b[0m\u001b[92m ──────────────────────────────────────────\u001b[0m\n"
177-
]
178-
},
179-
"metadata": {},
180-
"output_type": "display_data"
181-
},
182-
{
183-
"data": {
184-
"text/html": [
185-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> Please support our development by citing \n",
186-
"</pre>\n"
187-
],
188-
"text/plain": [
189-
" Please support our development by citing \n"
190-
]
191-
},
192-
"metadata": {},
193-
"output_type": "display_data"
194-
},
195-
{
196-
"data": {
197-
"text/html": [
198-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://github.com/BrainLesion/panoptica#citation</span> -- Thank you! \n",
199-
"</pre>\n"
200-
],
201-
"text/plain": [
202-
" \u001b[4;94mhttps://github.com/BrainLesion/panoptica#citation\u001b[0m -- Thank you! \n"
203-
]
204-
},
205-
"metadata": {},
206-
"output_type": "display_data"
207-
},
208-
{
209-
"data": {
210-
"text/html": [
211-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────────────────────────────────────────────────────────────────────────────</span>\n",
212-
"</pre>\n"
213-
],
214-
"text/plain": [
215-
"\u001b[92m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n"
216-
]
217-
},
218-
"metadata": {},
219-
"output_type": "display_data"
220-
},
221-
{
222-
"data": {
223-
"text/html": [
224-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
225-
"</pre>\n"
226-
],
227-
"text/plain": [
228-
"\n"
229-
]
230-
},
231-
"metadata": {},
232-
"output_type": "display_data"
233-
},
234160
{
235161
"name": "stdout",
236162
"output_type": "stream",
@@ -260,7 +186,7 @@
260186
},
261187
{
262188
"cell_type": "code",
263-
"execution_count": 6,
189+
"execution_count": 15,
264190
"metadata": {},
265191
"outputs": [
266192
{
@@ -306,7 +232,7 @@
306232
},
307233
{
308234
"cell_type": "code",
309-
"execution_count": 7,
235+
"execution_count": 16,
310236
"metadata": {},
311237
"outputs": [
312238
{
@@ -342,14 +268,14 @@
342268
},
343269
{
344270
"cell_type": "code",
345-
"execution_count": 8,
271+
"execution_count": 17,
346272
"metadata": {},
347273
"outputs": [
348274
{
349275
"name": "stdout",
350276
"output_type": "stream",
351277
"text": [
352-
"<panoptica.panoptica_evaluator.Panoptica_Evaluator object at 0x7002f42cf040>\n"
278+
"<panoptica.panoptica_evaluator.Panoptica_Evaluator object at 0x7002f42ccd60>\n"
353279
]
354280
}
355281
],
@@ -360,7 +286,7 @@
360286
},
361287
{
362288
"cell_type": "code",
363-
"execution_count": 9,
289+
"execution_count": 18,
364290
"metadata": {},
365291
"outputs": [
366292
{

panoptica/example_spine_matched_instance.ipynb

Lines changed: 13 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
{
1818
"cell_type": "code",
19-
"execution_count": 1,
19+
"execution_count": 10,
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
@@ -52,7 +52,7 @@
5252
},
5353
{
5454
"cell_type": "code",
55-
"execution_count": 2,
55+
"execution_count": 11,
5656
"metadata": {},
5757
"outputs": [],
5858
"source": [
@@ -90,18 +90,9 @@
9090
},
9191
{
9292
"cell_type": "code",
93-
"execution_count": 3,
93+
"execution_count": 12,
9494
"metadata": {},
95-
"outputs": [
96-
{
97-
"name": "stdout",
98-
"output_type": "stream",
99-
"text": [
100-
"No module named 'pandas'\n",
101-
"OPTIONAL PACKAGE MISSING\n"
102-
]
103-
}
104-
],
95+
"outputs": [],
10596
"source": [
10697
"import numpy as np\n",
10798
"from auxiliary.nifti.io import read_nifti\n",
@@ -129,7 +120,7 @@
129120
},
130121
{
131122
"cell_type": "code",
132-
"execution_count": 4,
123+
"execution_count": 13,
133124
"metadata": {},
134125
"outputs": [
135126
{
@@ -141,14 +132,14 @@
141132
" 106, 107, 108, 202, 203, 204, 205, 206, 207, 208], dtype=uint8))"
142133
]
143134
},
144-
"execution_count": 4,
135+
"execution_count": 13,
145136
"metadata": {},
146137
"output_type": "execute_result"
147138
}
148139
],
149140
"source": [
150-
"ref_masks = read_nifti(\"./spine_seg/matched_instance/ref.nii.gz\")\n",
151-
"pred_masks = read_nifti(\"./spine_seg/matched_instance/pred.nii.gz\")\n",
141+
"ref_masks = read_nifti(f\"{BASE_PATH}/spine_seg/matched_instance/ref.nii.gz\")\n",
142+
"pred_masks = read_nifti(f\"{BASE_PATH}/spine_seg/matched_instance/pred.nii.gz\")\n",
152143
"\n",
153144
"# labels are matching\n",
154145
"np.unique(ref_masks), np.unique(pred_masks)"
@@ -163,74 +154,9 @@
163154
},
164155
{
165156
"cell_type": "code",
166-
"execution_count": 5,
157+
"execution_count": 14,
167158
"metadata": {},
168159
"outputs": [
169-
{
170-
"data": {
171-
"text/html": [
172-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">────────────────────────────────────────── </span>Thank you for using <span style=\"font-weight: bold\">panoptica</span><span style=\"color: #00ff00; text-decoration-color: #00ff00\"> ──────────────────────────────────────────</span>\n",
173-
"</pre>\n"
174-
],
175-
"text/plain": [
176-
"\u001b[92m────────────────────────────────────────── \u001b[0mThank you for using \u001b[1mpanoptica\u001b[0m\u001b[92m ──────────────────────────────────────────\u001b[0m\n"
177-
]
178-
},
179-
"metadata": {},
180-
"output_type": "display_data"
181-
},
182-
{
183-
"data": {
184-
"text/html": [
185-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> Please support our development by citing \n",
186-
"</pre>\n"
187-
],
188-
"text/plain": [
189-
" Please support our development by citing \n"
190-
]
191-
},
192-
"metadata": {},
193-
"output_type": "display_data"
194-
},
195-
{
196-
"data": {
197-
"text/html": [
198-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"> <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">https://github.com/BrainLesion/panoptica#citation</span> -- Thank you! \n",
199-
"</pre>\n"
200-
],
201-
"text/plain": [
202-
" \u001b[4;94mhttps://github.com/BrainLesion/panoptica#citation\u001b[0m -- Thank you! \n"
203-
]
204-
},
205-
"metadata": {},
206-
"output_type": "display_data"
207-
},
208-
{
209-
"data": {
210-
"text/html": [
211-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #00ff00; text-decoration-color: #00ff00\">───────────────────────────────────────────────────────────────────────────────────────────────────────────────────</span>\n",
212-
"</pre>\n"
213-
],
214-
"text/plain": [
215-
"\u001b[92m───────────────────────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\n"
216-
]
217-
},
218-
"metadata": {},
219-
"output_type": "display_data"
220-
},
221-
{
222-
"data": {
223-
"text/html": [
224-
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
225-
"</pre>\n"
226-
],
227-
"text/plain": [
228-
"\n"
229-
]
230-
},
231-
"metadata": {},
232-
"output_type": "display_data"
233-
},
234160
{
235161
"name": "stdout",
236162
"output_type": "stream",
@@ -260,7 +186,7 @@
260186
},
261187
{
262188
"cell_type": "code",
263-
"execution_count": 6,
189+
"execution_count": 15,
264190
"metadata": {},
265191
"outputs": [
266192
{
@@ -297,7 +223,7 @@
297223
},
298224
{
299225
"cell_type": "code",
300-
"execution_count": 7,
226+
"execution_count": 16,
301227
"metadata": {},
302228
"outputs": [
303229
{
@@ -321,7 +247,7 @@
321247
},
322248
{
323249
"cell_type": "code",
324-
"execution_count": 8,
250+
"execution_count": 17,
325251
"metadata": {},
326252
"outputs": [
327253
{
@@ -387,7 +313,7 @@
387313
},
388314
{
389315
"cell_type": "code",
390-
"execution_count": 9,
316+
"execution_count": 18,
391317
"metadata": {},
392318
"outputs": [
393319
{

panoptica/example_spine_matching_algorithm.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@
147147
}
148148
],
149149
"source": [
150-
"ref_masks = read_nifti(\"./spine_seg/unmatched_instance/ref.nii.gz\")\n",
151-
"pred_masks = read_nifti(\"./spine_seg/unmatched_instance/pred.nii.gz\")\n",
150+
"ref_masks = read_nifti(f\"{BASE_PATH}/spine_seg/unmatched_instance/ref.nii.gz\")\n",
151+
"pred_masks = read_nifti(f\"{BASE_PATH}/spine_seg/unmatched_instance/pred.nii.gz\")\n",
152152
"\n",
153153
"# labels are unmatched instances\n",
154154
"pred_masks[pred_masks == 27] = 26 # For later\n",

0 commit comments

Comments
 (0)