}
//if the slicer manager was involved in a fusion sequence visualization...
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);
mSlicerManagers[index]->GetSlicer(i)->SetFusionSequenceCode(-1);
mSlicerManagers[mSlicerManagers[index]->GetFusionSequenceIndexOfLinkedManager()]->GetSlicer(i)->SetFusionSequenceCode(-1);
}
-
- //TODO: also remove the image overlaid with the main sequence, as it is becoming invalid...
- //this shall be done by calling this->CloseImage() with the correct index;...
+ */
}
linkPanel->removeImage(index);
//This loads the secondary sequence (US) as an independent sequence
LoadImages(fileNames, type);
- //reset the transforms to identiy
+ //reset the transforms to identity
+ //FIX -- and set the thickness of the US slices to a large value (necessary for visualization purposes...)
+ double sp_x, sp_y, sp_z;
+ mSlicerManagers[indexParent]->GetImage()->GetVTKImages()[0]->GetSpacing(sp_x, sp_y, sp_z);
+ sp_z = std::max(sp_x, std::max(sp_y, sp_z)) + 0.5; //
for (unsigned i=0 ; i<mSlicerManagers.back()->GetImage()->GetTransform().size() ; i++) {
+ sp_x = mSlicerManagers.back()->GetImage()->GetVTKImages()[i]->GetSpacing()[0];
+ sp_y = mSlicerManagers.back()->GetImage()->GetVTKImages()[i]->GetSpacing()[1];
+ mSlicerManagers.back()->GetImage()->GetVTKImages()[i]->SetSpacing( sp_x, sp_y, sp_z);
mSlicerManagers.back()->GetImage()->GetTransform()[i]->Identity();
mSlicerManagers.back()->GetImage()->GetTransform()[i]->Update();
}
error += mSlicerManagers[index]->GetLastError().c_str();
QMessageBox::information(this,tr("Problem reading image !"),error);
}
- //WindowLevelChanged();
+ WindowLevelChanged();
ImageInfoChanged(); //this internally calls WindowLevelChanged...
}
else {
//the secondary sequence is being reloaded.\r
void vvSlicerManager::ReloadFusionSequence()\r
{\r
+ // this is to keep the slice thickness, which needs to be artificially increased for visualization\r
+ double sp_x, sp_y, sp_z;\r
+ this->GetImage()->GetVTKImages()[0]->GetSpacing(sp_x, sp_y, sp_z);\r
+\r
mFusionSequenceReader->Update(mImage->GetNumberOfDimensions(),mFusionComponent.c_str(),vvImageReader::MERGEDWITHTIME);\r
\r
for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
this->AddFusionSequenceInitialTransformMatrices( mFusionSequenceReader->GetOutput()->GetTransform()[i]->GetMatrix() );\r
}\r
\r
+ // also update the slice thickness\r
+ for (unsigned i=0 ; i<this->GetImage()->GetTransform().size() ; i++) {\r
+ sp_x = this->GetImage()->GetVTKImages()[i]->GetSpacing()[0];\r
+ sp_y = this->GetImage()->GetVTKImages()[i]->GetSpacing()[1];\r
+ this->GetImage()->GetVTKImages()[i]->SetSpacing( sp_x, sp_y, sp_z);\r
+ }\r
+\r
}\r
//----------------------------------------------------------------------------\r
\r