- if ( item->data(1,Qt::UserRole).toString().toStdString() == "fusionSequence" ) {
- //TODO
- //make sure both SlicerManager exit the FusionSequence visualization mode
- //disable the temporal and spatial sync? make sure we reset the spatial transforms to their initial states...
+ if ( mSlicerManagers[index]->IsInvolvedInFusionSequence() ) {
+ //in both cases, close the overlay: find it... and close it
+ //ideally, I should duplicate the code, and avoid calling CloseImage, since this pops up another interactive box
+ QTreeWidgetItem* overlayItem;
+ if (mSlicerManagers[index]->IsMainSequenceOfFusionSequence()) {
+ for (unsigned i=0 ; i<item->childCount() ; i++) {
+ overlayItem = item->child(i);
+ this->CloseImage( overlayItem, 0 );
+ }
+ }
+ else {
+ QTreeWidgetItem* linkedItem = this->GetItemFromSlicerManager( mSlicerManagers[mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager()] );
+ for (unsigned i=0 ; i<linkedItem->childCount() ; i++) {
+ overlayItem = linkedItem->child(i);
+ this->CloseImage( overlayItem, 0 );
+ }
+ }
+
+ /* -- this is normally already done when closing the overlay.
+ //reset the transforms
+ overlayPanel->getFusionSequenceProperty(-1, false, 0, false);
+
+ //unlink and untie the slicer managers
+ RemoveLink(mSlicerManagers[index]->GetId().c_str(), mSlicerManagers[mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager()]->GetId().c_str());