Skip to content

Commit efabe28

Browse files
committed
updated to semantic class branch
1 parent 5c102a0 commit efabe28

3 files changed

Lines changed: 226 additions & 238 deletions

File tree

panoptica/example_spine_matched_instance.ipynb

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"import numpy as np\n",
6262
"from auxiliary.nifti.io import read_nifti\n",
6363
"from rich import print as pprint\n",
64-
"from panoptica import MatchedInstancePair, Panoptic_Evaluator\n",
64+
"from panoptica import MatchedInstancePair, Panoptica_Evaluator\n",
6565
"from panoptica.metrics import Metric"
6666
]
6767
},
@@ -191,21 +191,20 @@
191191
"output_type": "stream",
192192
"text": [
193193
"Panoptic: Start Evaluation\n",
194-
"-- Got MatchedInstancePair, will evaluate instances\n",
195-
"-- evaluate took 2.0301928520202637 seconds to execute.\n"
194+
"-- Got MatchedInstancePair, will evaluate instances\n"
196195
]
197196
}
198197
],
199198
"source": [
200199
"sample = MatchedInstancePair(prediction_arr=pred_masks, reference_arr=ref_masks)\n",
201200
"\n",
202-
"evaluator = Panoptic_Evaluator(\n",
201+
"evaluator = Panoptica_Evaluator(\n",
203202
" expected_input=MatchedInstancePair,\n",
204203
" decision_metric=Metric.IOU,\n",
205204
" decision_threshold=0.5,\n",
206205
")\n",
207206
"\n",
208-
"result, debug_data = evaluator.evaluate(sample)"
207+
"result, debug_data = evaluator.evaluate(sample)[\"ungrouped\"]"
209208
]
210209
},
211210
{
@@ -237,13 +236,16 @@
237236
"+++ GLOBAL +++\n",
238237
"Global Binary Dice (global_bin_dsc): 0.9744370224078394\n",
239238
"Global Binary Centerline Dice (global_bin_cldsc): 0.9637064011802574\n",
239+
"Global Binary Average Symmetric Surface Distance (global_bin_assd): 0.1499152780072207\n",
240+
"Global Binary Relative Volume Difference (global_bin_rvd): -0.0006011763989268869\n",
240241
"\n",
241242
"+++ INSTANCE +++\n",
242243
"Segmentation Quality IoU (sq): 0.8328184295330796 +- 0.15186064004517466\n",
243244
"Panoptic Quality IoU (pq): 0.8328184295330796\n",
244245
"Segmentation Quality Dsc (sq_dsc): 0.900292616009954 +- 0.10253566174957332\n",
245246
"Panoptic Quality Dsc (pq_dsc): 0.900292616009954\n",
246247
"Segmentation Quality Assd (sq_assd): 0.250331887879225 +- 0.07696680402317076\n",
248+
"Segmentation Quality Relative Volume Difference (sq_rvd): 0.0028133049062930553 +- 0.034518928495505724\n",
247249
"\n"
248250
]
249251
}
@@ -292,17 +294,23 @@
292294
" <span style=\"color: #008000; text-decoration-color: #008000\">'tp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">22</span>,\n",
293295
" <span style=\"color: #008000; text-decoration-color: #008000\">'fp'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n",
294296
" <span style=\"color: #008000; text-decoration-color: #008000\">'fn'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0</span>,\n",
297+
" <span style=\"color: #008000; text-decoration-color: #008000\">'prec'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1.0</span>,\n",
298+
" <span style=\"color: #008000; text-decoration-color: #008000\">'rec'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1.0</span>,\n",
295299
" <span style=\"color: #008000; text-decoration-color: #008000\">'rq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1.0</span>,\n",
296300
" <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.9744370224078394</span>,\n",
297301
" <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_cldsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.9637064011802574</span>,\n",
302+
" <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_assd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.1499152780072207</span>,\n",
303+
" <span style=\"color: #008000; text-decoration-color: #008000\">'global_bin_rvd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">-0.0006011763989268869</span>,\n",
298304
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.8328184295330796</span>,\n",
299305
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.15186064004517466</span>,\n",
300306
" <span style=\"color: #008000; text-decoration-color: #008000\">'pq'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.8328184295330796</span>,\n",
301307
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.900292616009954</span>,\n",
302308
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_dsc_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.10253566174957332</span>,\n",
303309
" <span style=\"color: #008000; text-decoration-color: #008000\">'pq_dsc'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.900292616009954</span>,\n",
304310
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.250331887879225</span>,\n",
305-
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.07696680402317076</span>\n",
311+
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_assd_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.07696680402317076</span>,\n",
312+
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_rvd'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.0028133049062930553</span>,\n",
313+
" <span style=\"color: #008000; text-decoration-color: #008000\">'sq_rvd_std'</span>: <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">0.034518928495505724</span>\n",
306314
"<span style=\"font-weight: bold\">}</span>\n",
307315
"</pre>\n"
308316
],
@@ -314,17 +322,23 @@
314322
" \u001b[32m'tp'\u001b[0m: \u001b[1;36m22\u001b[0m,\n",
315323
" \u001b[32m'fp'\u001b[0m: \u001b[1;36m0\u001b[0m,\n",
316324
" \u001b[32m'fn'\u001b[0m: \u001b[1;36m0\u001b[0m,\n",
325+
" \u001b[32m'prec'\u001b[0m: \u001b[1;36m1.0\u001b[0m,\n",
326+
" \u001b[32m'rec'\u001b[0m: \u001b[1;36m1.0\u001b[0m,\n",
317327
" \u001b[32m'rq'\u001b[0m: \u001b[1;36m1.0\u001b[0m,\n",
318328
" \u001b[32m'global_bin_dsc'\u001b[0m: \u001b[1;36m0.9744370224078394\u001b[0m,\n",
319329
" \u001b[32m'global_bin_cldsc'\u001b[0m: \u001b[1;36m0.9637064011802574\u001b[0m,\n",
330+
" \u001b[32m'global_bin_assd'\u001b[0m: \u001b[1;36m0.1499152780072207\u001b[0m,\n",
331+
" \u001b[32m'global_bin_rvd'\u001b[0m: \u001b[1;36m-0.0006011763989268869\u001b[0m,\n",
320332
" \u001b[32m'sq'\u001b[0m: \u001b[1;36m0.8328184295330796\u001b[0m,\n",
321333
" \u001b[32m'sq_std'\u001b[0m: \u001b[1;36m0.15186064004517466\u001b[0m,\n",
322334
" \u001b[32m'pq'\u001b[0m: \u001b[1;36m0.8328184295330796\u001b[0m,\n",
323335
" \u001b[32m'sq_dsc'\u001b[0m: \u001b[1;36m0.900292616009954\u001b[0m,\n",
324336
" \u001b[32m'sq_dsc_std'\u001b[0m: \u001b[1;36m0.10253566174957332\u001b[0m,\n",
325337
" \u001b[32m'pq_dsc'\u001b[0m: \u001b[1;36m0.900292616009954\u001b[0m,\n",
326338
" \u001b[32m'sq_assd'\u001b[0m: \u001b[1;36m0.250331887879225\u001b[0m,\n",
327-
" \u001b[32m'sq_assd_std'\u001b[0m: \u001b[1;36m0.07696680402317076\u001b[0m\n",
339+
" \u001b[32m'sq_assd_std'\u001b[0m: \u001b[1;36m0.07696680402317076\u001b[0m,\n",
340+
" \u001b[32m'sq_rvd'\u001b[0m: \u001b[1;36m0.0028133049062930553\u001b[0m,\n",
341+
" \u001b[32m'sq_rvd_std'\u001b[0m: \u001b[1;36m0.034518928495505724\u001b[0m\n",
328342
"\u001b[1m}\u001b[0m\n"
329343
]
330344
},

0 commit comments

Comments
 (0)