File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,23 @@ export default class View2D extends Component {
439
439
) {
440
440
this . subs . labelmap . unsubscribe ( ) ;
441
441
442
+ // Remove actors.
443
+ if ( this . labelmap && this . labelmap . actor ) {
444
+ this . renderer . removeVolume ( this . labelmap . actor ) ;
445
+
446
+ if ( this . api ) {
447
+ const { actors } = this . api ;
448
+
449
+ const index = actors . findIndex (
450
+ actor => actor === this . labelmap . actor
451
+ ) ;
452
+
453
+ if ( index !== - 1 ) {
454
+ actors . splice ( index , 1 ) ;
455
+ }
456
+ }
457
+ }
458
+
442
459
const labelmapImageData = this . props . paintFilterLabelMapImageData ;
443
460
444
461
const labelmap = createLabelPipeline (
@@ -449,6 +466,15 @@ export default class View2D extends Component {
449
466
450
467
this . labelmap = labelmap ;
451
468
469
+ // Add actors.
470
+ if ( this . labelmap && this . labelmap . actor ) {
471
+ this . renderer . addVolume ( this . labelmap . actor ) ;
472
+
473
+ if ( this . api ) {
474
+ this . api . actors = this . api . actors . concat ( this . labelmap . actor ) ;
475
+ }
476
+ }
477
+
452
478
labelmap . mapper . setInputConnection ( this . paintFilter . getOutputPort ( ) ) ;
453
479
454
480
// You can update the labelmap externally just by calling modified()
You can’t perform that action at this time.
0 commit comments