//------------------------------------------------------------------------------
-std::vector<vvROIActor*> & vvStructureSetActor::GetROIList()
+std::vector< QSharedPointer<vvROIActor> > & vvStructureSetActor::GetROIList()
{
return mROIActors;
}
std::cerr << "No ROI number " << n << std::endl;
return NULL;
}
- return mROIActors[mMapROIIndex[n]];
+ return mROIActors[mMapROIIndex[n]].data();
}
//------------------------------------------------------------------------------
// If already exist : delete it
int old = -1;
- if (mMapROIIndex.find(n) != mMapROIIndex.end()) {
- delete mROIActors[mMapROIIndex[n]];
+ if (mMapROIIndex.find(n) != mMapROIIndex.end())
old = mMapROIIndex[n];
- }
// Add ROI Actors
- vvROIActor * actor = new vvROIActor;
- if (old == -1) mROIActors.push_back(actor);
- else mROIActors[old] = actor;
+ QSharedPointer<vvROIActor> actor = QSharedPointer<vvROIActor>(new vvROIActor);
+ if (old == -1)
+ mROIActors.push_back(actor);
+ else
+ mROIActors[old] = actor;
actor->SetBGMode(modeBG);
actor->SetROI(roi);
actor->SetSlicerManager(mSlicerManager);
#include "clitkDicomRT_StructureSet.h"
#include <QObject>
+#include <QSharedPointer>
class vvSlicerManager;
class vvROIActor;
void CreateNewROIActor(int n, bool modeBG=true);
vvROIActor* GetROIActor(int n);
int GetNumberOfROIs();
- std::vector<vvROIActor*> & GetROIList();
+ std::vector< QSharedPointer<vvROIActor> > & GetROIList();
protected:
clitk::DicomRT_StructureSet * mStructureSet;
vvSlicerManager * mSlicerManager;
- std::vector<vvROIActor*> mROIActors;
+ std::vector< QSharedPointer<vvROIActor> > mROIActors;
std::map<int, int> mMapROIIndex;
}; // end class vvStructureSetActor
//------------------------------------------------------------------------------
vvToolStructureSetManager::~vvToolStructureSetManager()
{
- disconnect(mTree, SIGNAL(itemSelectionChanged()), this, SLOT(SelectedItemChangedInTree()));
m_NumberOfTool--;
}
//------------------------------------------------------------------------------
return;
}
vvImage::Pointer binaryImage = reader->GetOutput();
- AddImage(binaryImage, filename[i].toStdString(), mBackgroundValueSpinBox->value());
+ //AddImage(binaryImage, filename[i].toStdString(), mBackgroundValueSpinBox->value());
mOpenedBinaryImage.push_back(binaryImage);
}
+DD(mOpenedBinaryImage.back()->GetOrigin()[0]);
UpdateImage();
}
//------------------------------------------------------------------------------
mCheckBoxShowAll->setCheckState(Qt::Unchecked);
mContourCheckBoxShowAll->setCheckState(Qt::Unchecked);
- if (mCurrentSlicerManager != 0) mCurrentSlicerManager->Render();
- if (mCurrentStructureSetActor) {
- for(int i=0; i<mCurrentStructureSetActor->GetNumberOfROIs(); i++) {
- mCurrentStructureSetActor->GetROIList()[i]->SetVisible(false);
- mCurrentStructureSetActor->GetROIList()[i]->SetContourVisible(false);
- delete mCurrentStructureSetActor->GetROIList()[i];
- }
- }
+ if (mCurrentSlicerManager != 0)
+ mCurrentSlicerManager->Render();
if (!isWindow()) {
if (m_NumberOfTool == 1) {