mMenuExperimentalTools = menuExperimental;
mMainWidget = this;
mCurrentTime = -1;
+ mCurrentSelectedImageId = "";
//Init the contextMenu
this->setContextMenuPolicy(Qt::CustomContextMenu);
//------------------------------------------------------------------------------
void vvMainWindow::CurrentImageChanged(std::string id)
{
- // DD("CurrentImageChanged");
+ // DD("CurrentImageChanged");
+// DD(id);
+// DD(mCurrentSelectedImageId);
+ if (id == mCurrentSelectedImageId) return; // Do nothing
int selected = 0;
for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString().toStdString() == id) {
}
DataTree->topLevelItem(selected)->setSelected(1);
- // DD(mSlicerManagers[selected]->GetFileName());
+ // DD(mSlicerManagers[selected]->GetFileName());
+ mCurrentSelectedImageId = id;
emit SelectedImageHasChanged(mSlicerManagers[selected]);
}
//------------------------------------------------------------------------------
QMessageBox::information(this,tr("Problem reading image !"),error);
}
}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvMainWindow::AddROI(int index, QString file)
+{
+ DD("AddImageAndROI");
+ /*
+ // Get slice manager
+
+ // Load image
+
+ vvImageReader * mReader = new vvImageReader;
+ mReader->SetInputFilename(filename.toStdString());
+ mReader->Update(IMAGE);
+ if (mReader->GetLastError().size() != 0) {
+ std::cerr << "Error while reading " << filename.toStdString() << std::endl;
+ QString error = "Cannot open file \n";
+ error += mReader->GetLastError().c_str();
+ QMessageBox::information(this,tr("Reading problem"),error);
+ delete mReader;
+ return;
+ }
+ vvImage::Pointer roi = mReader->GetOutput();
+
+ // Create roi in new tool
+ vvToolStructureSetManager::AddImage(mCurrentSlicerManager, roi);
+*/
+}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
void vvMainWindow::AddFusionImage()
{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
//------------------------------------------------------------------------------
void vvMainWindow::SOVerticalSliderChanged()
{
- // DD("SOVerticalSliderChanged");
static int value=-1;
// DD(value);
// DD(SOVerticalSlider->value());
}
//------------------------------------------------------------------------------
-void vvMainWindow::AddImage(vvImage::Pointer image,std::string filename)
+vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filename)
{
vvSlicerManager* slicer_manager = new vvSlicerManager(4);
slicer_manager->SetImage(image);
ShowLastImage();
InitDisplay();
qApp->processEvents();
+
+ // End
+ return slicer_manager;
}
//------------------------------------------------------------------------------
vvMainWindow();
~vvMainWindow();
void LoadImages(std::vector<std::string> filenames, LoadedImageType type);
- void AddImage(vvImage::Pointer image,std::string filename);
+ vvSlicerManager * AddImage(vvImage::Pointer image,std::string filename);
void AddField(QString file,int index);
void AddOverlayImage(int index, QString filename);
+ void AddROI(int index, QString filename);
///Adds a mesh to a SlicerManager, with optional warping by vector field
void AddContour(int image_index, vvMesh::Pointer contour, bool propagation);
///This is used to show an image when opened or computed
std::vector<QSlider*> horizontalSliders;
std::vector<QSlider*> verticalSliders;
int mFrameRate;
+
+ std::string mCurrentSelectedImageId;
// vvMainWindowToolInfo * mCurrentToolInfo;
// std::vector<vvToolCreatorBase*> mListOfRunningTool;