|
318 | 318 | "spatial = vc.add_view(\"spatialBeta\", dataset=dataset)\n", |
319 | 319 | "layer_controller = vc.add_view(\"layerControllerBeta\", dataset=dataset)\n", |
320 | 320 | "# Tubules\n", |
321 | | - "tubules_feature_list = vc.add_view(\"featureList\", dataset=dataset)\n", |
| 321 | + "tubules_feature_list = vc.add_view(\"featureList\", dataset=dataset).set_props(title=\"Tubules\")\n", |
322 | 322 | "tubules_histogram = vc.add_view(\"featureValueHistogram\", dataset=dataset)\n", |
323 | 323 | "# Peritubular capillaries\n", |
324 | | - "pt_feature_list = vc.add_view(\"featureList\", dataset=dataset)\n", |
| 324 | + "pt_feature_list = vc.add_view(\"featureList\", dataset=dataset).set_props(title=\"Peritubular Capillaries\")\n", |
325 | 325 | "pt_histogram = vc.add_view(\"featureValueHistogram\", dataset=dataset)\n", |
| 326 | + "# GSG\n", |
| 327 | + "gsg_feature_list = vc.add_view(\"featureList\", dataset=dataset).set_props(title=\"Globally Sclerotic Glomeruli\")\n", |
| 328 | + "gsg_histogram = vc.add_view(\"featureValueHistogram\", dataset=dataset)\n", |
| 329 | + "\n", |
| 330 | + "# NGSG\n", |
| 331 | + "ngsg_feature_list = vc.add_view(\"featureList\", dataset=dataset).set_props(title=\"Non-Globally Sclerotic Glomeruli\")\n", |
| 332 | + "ngsg_histogram = vc.add_view(\"featureValueHistogram\", dataset=dataset)\n", |
326 | 333 | "\n", |
327 | 334 | "\n", |
328 | 335 | "#obs_sets = vc.add_view(\"obsSets\", dataset=dataset)\n", |
|
341 | 348 | "pt_oce_scope.set_value(\"spatialChannelColor\")\n", |
342 | 349 | "\n", |
343 | 350 | "\n", |
| 351 | + "[gsg_ot_scope, gsg_fs_scope, gsg_oce_scope, gsg_fvcr_scope] = vc.add_coordination(\"obsType\", \"featureSelection\", \"obsColorEncoding\", \"featureValueColormapRange\")\n", |
| 352 | + "gsg_ot_scope.set_value(\"Globally Sclerotic Glomerulus\")\n", |
| 353 | + "gsg_oce_scope.set_value(\"spatialChannelColor\")\n", |
| 354 | + "gsg_fvcr_scope.set_value([(3077 - 2333) / (29911 - 2333), 1.0])\n", |
| 355 | + "\n", |
| 356 | + "[ngsg_ot_scope, ngsg_fs_scope, ngsg_oce_scope, ngsg_fvcr_scope] = vc.add_coordination(\"obsType\", \"featureSelection\", \"obsColorEncoding\", \"featureValueColormapRange\")\n", |
| 357 | + "ngsg_ot_scope.set_value(\"Non-Globally Sclerotic Glomerulus\")\n", |
| 358 | + "ngsg_oce_scope.set_value(\"spatialChannelColor\")\n", |
| 359 | + "ngsg_fvcr_scope.set_value([0.0, 1 - (59451 - 29911) / (59451 - 3077)])\n", |
| 360 | + "\n", |
| 361 | + "\n", |
344 | 362 | "vc.link_views_by_dict([spatial, layer_controller], {\n", |
345 | 363 | " \"imageLayer\": CL([{\n", |
346 | 364 | " \"photometricInterpretation\": \"RGB\",\n", |
|
402 | 420 | " \"fileUid\": \"labels_globally_sclerotic_glomeruli\",\n", |
403 | 421 | " \"segmentationChannel\": CL([{\n", |
404 | 422 | " \"spatialTargetC\": 0,\n", |
405 | | - " \"obsType\": \"Globally Sclerotic Glomerulus\",\n", |
| 423 | + " \"obsType\": gsg_ot_scope,\n", |
406 | 424 | " \"featureType\": ft_scope,\n", |
407 | 425 | " \"featureValueType\": fvt_scope,\n", |
| 426 | + " \"featureSelection\": gsg_fs_scope,\n", |
408 | 427 | " \"spatialChannelVisible\": False,\n", |
409 | 428 | " \"spatialChannelColor\": [255, 255, 255],\n", |
410 | 429 | " \"spatialChannelOpacity\": 0.5,\n", |
411 | | - " \"obsColorEncoding\": \"spatialChannelColor\",\n", |
412 | | - " \"featureValueColormapRange\": [0, 1],\n", |
| 430 | + " \"obsColorEncoding\": gsg_oce_scope,\n", |
| 431 | + " \"featureValueColormapRange\": gsg_fvcr_scope,\n", |
413 | 432 | " \"featureAggregationStrategy\": \"first\",\n", |
414 | 433 | " \"obsHighlight\": None,\n", |
415 | 434 | " }]),\n", |
|
418 | 437 | " \"fileUid\": \"labels_non_globally_sclerotic_glomeruli\",\n", |
419 | 438 | " \"segmentationChannel\": CL([{\n", |
420 | 439 | " \"spatialTargetC\": 0,\n", |
421 | | - " \"obsType\": \"Non-Globally Sclerotic Glomerulus\",\n", |
| 440 | + " \"obsType\": ngsg_ot_scope,\n", |
422 | 441 | " \"featureType\": ft_scope,\n", |
423 | 442 | " \"featureValueType\": fvt_scope,\n", |
| 443 | + " \"featureSelection\": ngsg_fs_scope,\n", |
424 | 444 | " \"spatialChannelVisible\": False,\n", |
425 | 445 | " \"spatialChannelColor\": [255, 255, 255],\n", |
426 | 446 | " \"spatialChannelOpacity\": 0.5,\n", |
427 | | - " \"obsColorEncoding\": \"spatialChannelColor\",\n", |
428 | | - " \"featureValueColormapRange\": [0, 1],\n", |
| 447 | + " \"obsColorEncoding\": ngsg_oce_scope,\n", |
| 448 | + " \"featureValueColormapRange\": ngsg_fvcr_scope,\n", |
429 | 449 | " \"featureAggregationStrategy\": \"first\",\n", |
430 | 450 | " \"obsHighlight\": None,\n", |
431 | 451 | " }]),\n", |
|
473 | 493 | "pt_feature_list.use_coordination(pt_ot_scope, ft_scope, fvt_scope, pt_fs_scope, pt_oce_scope)\n", |
474 | 494 | "pt_histogram.use_coordination(pt_ot_scope, ft_scope, fvt_scope, pt_fs_scope, pt_oce_scope)\n", |
475 | 495 | "\n", |
| 496 | + "gsg_feature_list.use_coordination(gsg_ot_scope, ft_scope, fvt_scope, gsg_fs_scope, gsg_oce_scope, gsg_fvcr_scope)\n", |
| 497 | + "gsg_histogram.use_coordination(gsg_ot_scope, ft_scope, fvt_scope, gsg_fs_scope, gsg_oce_scope, gsg_fvcr_scope)\n", |
| 498 | + "\n", |
| 499 | + "ngsg_feature_list.use_coordination(ngsg_ot_scope, ft_scope, fvt_scope, ngsg_fs_scope, ngsg_oce_scope, ngsg_fvcr_scope)\n", |
| 500 | + "ngsg_histogram.use_coordination(ngsg_ot_scope, ft_scope, fvt_scope, ngsg_fs_scope, ngsg_oce_scope, ngsg_fvcr_scope)\n", |
| 501 | + "\n", |
476 | 502 | "\n", |
477 | 503 | "# Layout the views in a grid arrangement.\n", |
478 | | - "vc.layout(vconcat(hconcat(spatial, layer_controller, split=[3, 1]), hconcat((tubules_feature_list / tubules_histogram), (pt_feature_list / pt_histogram))));" |
| 504 | + "vc.layout(vconcat(hconcat(spatial, layer_controller, split=[3, 1]), hconcat(\n", |
| 505 | + " (tubules_feature_list / tubules_histogram),\n", |
| 506 | + " (pt_feature_list / pt_histogram),\n", |
| 507 | + " (gsg_feature_list / gsg_histogram),\n", |
| 508 | + " (ngsg_feature_list / ngsg_histogram)\n", |
| 509 | + ")));" |
479 | 510 | ] |
480 | 511 | }, |
481 | 512 | { |
|
496 | 527 | }, |
497 | 528 | "outputs": [], |
498 | 529 | "source": [ |
499 | | - "vw = vc.widget()\n", |
| 530 | + "vw = vc.widget(js_package_version=\"3.6.3\")\n", |
500 | 531 | "vw" |
501 | 532 | ] |
502 | 533 | }, |
|
505 | 536 | "execution_count": null, |
506 | 537 | "metadata": {}, |
507 | 538 | "outputs": [], |
508 | | - "source": [ |
509 | | - "vw.port" |
510 | | - ] |
| 539 | + "source": [] |
511 | 540 | }, |
512 | 541 | { |
513 | 542 | "cell_type": "code", |
|
0 commit comments