X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=vv%2FvvMainWindow.cxx;h=a35922f342a414613cf16e48a9c8abae17c422cc;hb=6149d78df3e94ca789aaba50133d5277afe6ab5e;hp=924bf19b534c8534a15323e27ed94693e9797cf1;hpb=0a85e47a06c7d046d06a4645b724c4e81b19998d;p=clitk.git
diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx
index 924bf19..a35922f 100644
--- a/vv/vvMainWindow.cxx
+++ b/vv/vvMainWindow.cxx
@@ -1,31 +1,21 @@
/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Program: vv
- Module: $RCSfile: vvMainWindow.cxx,v $
- Language: C++
- Date: $Date: 2010/02/24 11:42:42 $
- Version: $Revision: 1.12 $
- Author : Pierre Seroul (pierre.seroul@gmail.com)
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
- Copyright (C) 200COLUMN_IMAGE_NAME
- Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
- CREATIS-LRMN http://www.creatis.insa-lyon.fr
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 3 of the License.
+ It is distributed under dual licence
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+======================================================================-====*/
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- =========================================================================*/
-
-// QT include
#include
#include
#include
@@ -43,7 +33,6 @@
#include "vvSlicer.h"
#include "vvInteractorStyleNavigator.h"
#include "vvImageWriter.h"
-#include "vvResamplerDialog.h"
#include "vvSegmentationDialog.h"
#include "vvSurfaceViewerDialog.h"
#include "vvDeformationDialog.h"
@@ -54,7 +43,6 @@
#include "vvMesh.h"
#include "vvStructSelector.h"
#include "vvMeshReader.h"
-#include "vvCropDialog.h"
#include "vvConstants.h"
#ifdef CLITK_VV_USE_BDCM
@@ -113,41 +101,44 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
mInputPathName = "";
mMenuTools = menuTools;
+ mContextMenu = &contextMenu;
+ mMenuExperimentalTools = menuExperimental;
mMainWidget = this;
+ mCurrentTime = -1;
//Init the contextMenu
this->setContextMenuPolicy(Qt::CustomContextMenu);
contextActions.resize(0);
- QAction* actionOpen_new_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/fileopen.png")),
+ QAction* actionOpen_new_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/fileopen.png")),
tr("O&pen new Image"));
actionOpen_new_image->setShortcut(QKeySequence(tr("Ctrl+O")));
connect(actionOpen_new_image,SIGNAL(triggered()),this,SLOT(OpenImages()));
contextActions.push_back(actionOpen_new_image);
contextMenu.addSeparator();
- QAction* actionClose_Image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")),
+ QAction* actionClose_Image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/exit.png")),
tr("Close Current Image"));
connect(actionClose_Image,SIGNAL(triggered()),this,SLOT(CloseImage()));
contextActions.push_back(actionClose_Image);
- QAction* actionReload_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")),
+ QAction* actionReload_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")),
tr("Reload Current Image"));
connect(actionReload_image,SIGNAL(triggered()),this,SLOT(ReloadImage()));
contextActions.push_back(actionReload_image);
- QAction* actionSave_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/filesave.png")),
+ QAction* actionSave_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/filesave.png")),
tr("Save Current Image"));
connect(actionSave_image,SIGNAL(triggered()),this,SLOT(SaveAs()));
contextActions.push_back(actionSave_image);
contextMenu.addSeparator();
- QAction* actionCrop_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/crop.png")),
- tr("Crop Current Image"));
- connect(actionCrop_image,SIGNAL(triggered()),this,SLOT(CropImage()));
- contextActions.push_back(actionCrop_image);
+ // QAction* actionCrop_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/crop.png")),
+ // tr("Crop Current Image"));
+ // connect(actionCrop_image,SIGNAL(triggered()),this,SLOT(CropImage()));
+ // contextActions.push_back(actionCrop_image);
- QAction* actionSplit_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/cut.png")),
+ QAction* actionSplit_image = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/cut.png")),
tr("Split Current Image"));
connect(actionSplit_image,SIGNAL(triggered()),this,SLOT(SplitImage()));
contextActions.push_back(actionSplit_image);
@@ -157,7 +148,7 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
contextMenu.addAction(actionAdd_VF_to_current_Image);
contextActions.push_back(actionAdd_VF_to_current_Image);
- QAction* actionAdd_Overlay_to_current_Image = menuOverlay->addAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/GPSup.png")),
+ QAction* actionAdd_Overlay_to_current_Image = menuOverlay->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")),
tr("Add overlay image to current image"));
contextMenu.addAction(actionAdd_Overlay_to_current_Image);
contextActions.push_back(actionAdd_Overlay_to_current_Image);
@@ -168,6 +159,21 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(AddFusionImage()));
contextActions.push_back(actionAdd_fusion_image);
+ // TRIAL DS
+ /*
+ QMenu * m = new QMenu(menubar);
+ m->setTitle("TOTO");
+ // m->setObjectName(QString::fromUtf8("TOTOTO"));
+ contextMenu.addMenu(m);
+ QAction * a = m->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")),
+ tr("BIDON"));
+ QAction * b = m->addAction(QIcon(QString::fromUtf8(":/common/icons/GPSup.png")),
+ tr("BIDON2"));
+ m->addAction(a);
+ m->addAction(b);
+ connect(a,SIGNAL(triggered()),this,SLOT(AddFusionImage()));
+ */
+
//init the DataTree
mSlicerManagers.resize(0);
@@ -249,8 +255,6 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
connect(actionDocumentation,SIGNAL(triggered()),this,SLOT(ShowDocumentation()));
///////////////////////////////////////////////
- contextMenu.addAction(actionResampler);
- connect(actionResampler,SIGNAL(triggered()),this,SLOT(ResampleCurrentImage()));
connect(actionSegmentation,SIGNAL(triggered()),this,SLOT(SegmentationOnCurrentImage()));
connect(actionSurface_Viewer,SIGNAL(triggered()),this,SLOT(SurfaceViewerLaunch()));
///////////////////////////////////////////////
@@ -308,11 +312,11 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
if ( !recent_files.empty() )
{
QMenu * rmenu = new QMenu("Recently opened files...");
- rmenu->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/open.png")));
+ rmenu->setIcon(QIcon(QString::fromUtf8(":/common/icons/open.png")));
menuFile->insertMenu(actionOpen_Image_With_Time,rmenu);
for (std::list::iterator i = recent_files.begin();i!=recent_files.end();i++)
{
- QAction* current=new QAction(QIcon(QString::fromUtf8(":/new/prefix1/icons/open.png")),
+ QAction* current=new QAction(QIcon(QString::fromUtf8(":/common/icons/open.png")),
(*i).c_str(),this);
rmenu->addAction(current);
connect(current,SIGNAL(triggered()),this,SLOT(OpenRecentImage()));
@@ -321,6 +325,9 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() {
// Adding all new tools (insertion in the menu)
vvToolManager::GetInstance()->InsertToolsInMenu(this);
+
+ if (!CLITK_EXPERIMENTAL)
+ menuExperimental->menuAction()->setVisible(false);
}
//------------------------------------------------------------------------------
@@ -332,7 +339,8 @@ void vvMainWindow::ComputeMIP()
vvSlicerManager* selected_slicer = mSlicerManagers[GetSlicerIndexFromItem(DataTree->selectedItems()[0])];
QFileInfo info(selected_slicer->GetFileName().c_str());
mip.Compute(selected_slicer);
- AddImage(mip.GetOutput(),info.path().toStdString()+"/"+info.completeBaseName().toStdString()+"_mip.mhd");
+ if (!mip.error)
+ AddImage(mip.GetOutput(),info.path().toStdString()+"/"+info.completeBaseName().toStdString()+"_mip.mhd");
}
//------------------------------------------------------------------------------
@@ -383,7 +391,7 @@ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool pro
cButton->setItem(item);
cButton->setColumn(COLUMN_CLOSE_IMAGE);
cButton->setToolTip(tr("close image"));
- cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+ cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(CloseImage(QTreeWidgetItem*, int)));
@@ -391,7 +399,7 @@ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool pro
rButton->setItem(item);
rButton->setColumn(COLUMN_RELOAD_IMAGE);
rButton->setToolTip(tr("reload image"));
- rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+ rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
rButton->setEnabled(false);
//Not implemented
//connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
@@ -416,7 +424,7 @@ void vvMainWindow::OpenVTKContour()
{
if (mSlicerManagers.size() > 0)
{
- QString Extensions = "Images ( *.vtk)";
+ QString Extensions = "Images ( *.vtk; *.obj)";
Extensions += ";;All Files (*)";
QString file = QFileDialog::getOpenFileName(this,tr("Open vtkPolyData"),mInputPathName,Extensions);
if (file.isNull())
@@ -424,6 +432,7 @@ void vvMainWindow::OpenVTKContour()
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
vvMeshReader reader;
+ reader.SetImage(mSlicerManagers[index]->GetImage());
reader.SetModeToVTK();
reader.SetFilename(file.toStdString());
reader.Update();
@@ -439,7 +448,7 @@ void vvMainWindow::OpenDCStructContour()
{
if (mSlicerManagers.size() > 0)
{
- QString Extensions = "Dicom Files ( *.dcm)";
+ QString Extensions = "Dicom Files ( *.dcm; RS*)";
Extensions += ";;All Files (*)";
QString file = QFileDialog::getOpenFileName(this,tr("Merge Images"),mInputPathName,Extensions);
if (file.isNull())
@@ -568,45 +577,45 @@ void vvMainWindow::MergeImages() {
for (int i = 0; i < files.size(); i++)
{
itk::ImageIOBase::Pointer reader = itk::ImageIOFactory::CreateImageIO(
- files[i].toStdString().c_str(), itk::ImageIOFactory::ReadMode);
+ files[i].toStdString().c_str(), itk::ImageIOFactory::ReadMode);
reader->SetFileName(files[i].toStdString().c_str());
reader->ReadImageInformation();
- if (reader) NOViewWidget->hide();
- NEViewWidget->hide();
- SOViewWidget->hide();
- SEViewWidget->hide();
- {
- if (i == 0)
- currentDim = reader->GetNumberOfDimensions();
- bool IsOk = true;
- for (unsigned int j = 0;j < currentDim; j++)
+ if (reader) {
+ //NOViewWidget->hide();
+ //NEViewWidget->hide();
+ //SOViewWidget->hide();
+ //SEViewWidget->hide();
+ if (i == 0)
+ currentDim = reader->GetNumberOfDimensions();
+ bool IsOk = true;
+ for (unsigned int j = 0;j < currentDim; j++)
{
- if (i == 0)
+ if (i == 0)
{
- if (j == 0)
+ if (j == 0)
{
- currentSpacing.resize(currentDim);
- currentSize.resize(currentDim);
- currentOrigin.resize(currentDim);
+ currentSpacing.resize(currentDim);
+ currentSize.resize(currentDim);
+ currentOrigin.resize(currentDim);
}
- currentOrigin[j] = reader->GetOrigin(j);
- currentSpacing[j] = reader->GetSpacing(j);
- currentSize[j] = reader->GetDimensions(j);
+ currentOrigin[j] = reader->GetOrigin(j);
+ currentSpacing[j] = reader->GetSpacing(j);
+ currentSize[j] = reader->GetDimensions(j);
}
- else if (currentDim != reader->GetNumberOfDimensions()
- || currentSpacing[j] != reader->GetSpacing(j)
- || currentSize[j] != (int)reader->GetDimensions(j)
- || currentOrigin[j] != reader->GetOrigin(j))
+ else if (currentDim != reader->GetNumberOfDimensions()
+ || currentSpacing[j] != reader->GetSpacing(j)
+ || currentSize[j] != (int)reader->GetDimensions(j)
+ || currentOrigin[j] != reader->GetOrigin(j))
{
- QString error = "Cannot read file (too different from others ";
- error += files[i].toStdString().c_str();
- QMessageBox::information(this,tr("Reading problem"),error);
- IsOk = false;
- break;
+ QString error = "Cannot read file (too different from others ";
+ error += files[i].toStdString().c_str();
+ QMessageBox::information(this,tr("Reading problem"),error);
+ IsOk = false;
+ break;
}
}
- if (IsOk)
- vector.push_back(files[i].toStdString());
+ if (IsOk)
+ vector.push_back(files[i].toStdString());
}
}
if (vector.size() > 0)
@@ -745,6 +754,8 @@ void vvMainWindow::OpenRecentImage()
mInputPathName = itksys::SystemTools::GetFilenamePath(images[0]).c_str();
LoadImages(images,IMAGE);
}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::OpenImageWithTime() {
@@ -764,6 +775,7 @@ void vvMainWindow::OpenImageWithTime() {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::LoadImages(std::vector files, LoadedImageType filetype) {
//Separate the way to open images and dicoms
@@ -799,11 +811,25 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi
bool SetImageSucceed=false;
+ // Change filename if an image with the same already exist
+ // DD(files[i]);
+ int number=0;
+ for(unsigned int l=0; lGetBaseFileName());
+ // DD(v->GetFileName());
+ if (v->GetBaseFileName() ==
+ vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(files[i]))) {
+ number = std::max(number, v->GetBaseFileNameNumber()+1);
+ }
+ }
+
+
if (filetype == IMAGE || filetype == IMAGEWITHTIME)
- SetImageSucceed = imageManager->SetImage(files[i],filetype);
+ SetImageSucceed = imageManager->SetImage(files[i],filetype, number);
else
{
- SetImageSucceed = imageManager->SetImages(files,filetype);
+ SetImageSucceed = imageManager->SetImages(files,filetype, number);
}
if (SetImageSucceed == false)
{
@@ -830,7 +856,7 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi
cButton->setItem(item);
cButton->setColumn(COLUMN_CLOSE_IMAGE);
cButton->setToolTip(tr("close image"));
- cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+ cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(CloseImage(QTreeWidgetItem*, int)));
@@ -838,7 +864,7 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi
rButton->setItem(item);
rButton->setColumn(COLUMN_RELOAD_IMAGE);
rButton->setToolTip(tr("reload image"));
- rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+ rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
@@ -853,29 +879,30 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi
linkPanel->addImage(imageManager->GetFileName(), id.toStdString());
- connect(mSlicerManagers.back(),SIGNAL(currentImageChanged(std::string)),
+ connect(mSlicerManagers.back(), SIGNAL(currentImageChanged(std::string)),
this,SLOT(CurrentImageChanged(std::string)));
- connect(mSlicerManagers.back(),SIGNAL(
- UpdatePosition(int, double, double, double, double, double, double, double)),this,
- SLOT(MousePositionChanged(int,double, double, double, double, double, double, double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateVector(int, double, double, double, double)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdatePosition(int, double, double, double, double, double, double, double)),
+ this,SLOT(MousePositionChanged(int,double, double, double, double, double, double, double)));
+ connect(mSlicerManagers.back(), SIGNAL(UpdateVector(int, double, double, double, double)),
this, SLOT(VectorChanged(int,double,double,double, double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateOverlay(int, double, double)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateOverlay(int, double, double)),
this, SLOT(OverlayChanged(int,double,double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateFusion(int, double)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
this, SLOT(FusionChanged(int,double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateWindows(int, int, int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
this,SLOT(WindowsChanged(int, int, int)));
- connect(mSlicerManagers.back(),SIGNAL(WindowLevelChanged(double, double,int, int)),
+ connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
this,SLOT(WindowLevelChanged(double, double, int, int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateSlice(int,int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),
this,SLOT(UpdateSlice(int,int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateTSlice(int, int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateTSlice(int, int)),
this,SLOT(UpdateTSlice(int, int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateSliceRange(int,int,int,int,int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateSliceRange(int,int,int,int,int)),
this,SLOT(UpdateSliceRange(int,int,int,int,int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateLinkManager(std::string,int,double,double,double,int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateLinkManager(std::string,int,double,double,double,int)),
this,SLOT(UpdateLinkManager(std::string,int,double,double,double,int)));
+ connect(mSlicerManagers.back(), SIGNAL(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)),
+ this,SLOT(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)));
connect(mSlicerManagers.back(),SIGNAL(LandmarkAdded()),landmarksPanel,SLOT(AddPoint()));
InitSlicers();
numberofsuccesulreads++;
@@ -893,6 +920,17 @@ void vvMainWindow::LoadImages(std::vector files, LoadedImageType fi
}
QApplication::restoreOverrideCursor();
+ // Try to guess default WindowLevel
+ double range[2];
+ mSlicerManagers.back()->GetImage()->GetFirstVTKImageData()->GetScalarRange(range);
+ // DD(range[0]);
+ // DD(range[1]);
+ if ((range[0] == 0) && (range[1] == 1)) {
+ presetComboBox->setCurrentIndex(5);// binary
+ }
+ else {
+ // TODO
+ }
}
//------------------------------------------------------------------------------
@@ -1088,8 +1126,8 @@ void vvMainWindow::ImageInfoChanged() {
}
windowSpinBox->setValue(mSlicerManagers[index]->GetColorWindow());
levelSpinBox->setValue(mSlicerManagers[index]->GetColorLevel());
- DD(mSlicerManagers[index]->GetColorMap());
- DD(mSlicerManagers[index]->GetPreset());
+ // DD(mSlicerManagers[index]->GetColorMap());
+ // DD(mSlicerManagers[index]->GetPreset());
presetComboBox->setCurrentIndex(mSlicerManagers[index]->GetPreset());
colorMapComboBox->setCurrentIndex(mSlicerManagers[index]->GetColorMap());
@@ -1278,6 +1316,18 @@ int vvMainWindow::GetSlicerIndexFromItem(QTreeWidgetItem* item) {
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+QTreeWidgetItem* vvMainWindow::GetItemFromSlicerManager(vvSlicerManager* sm) {
+ QString id = sm->GetId().c_str();
+ for (int i = 0; i < DataTree->topLevelItemCount(); i++)
+ {
+ if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id)
+ return DataTree->topLevelItem(i);
+ }
+ return NULL;
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::DisplayChanged(QTreeWidgetItem *clicked_item, int column) {
int index = GetSlicerIndexFromItem(clicked_item);
@@ -1285,6 +1335,9 @@ void vvMainWindow::DisplayChanged(QTreeWidgetItem *clicked_item, int column) {
return;
for (unsigned int i = 0; i < mSlicerManagers.size(); i++)
{
+ //Trick to avoid redoing twice the job for a key (sr)
+ mSlicerManagers[i]->GetSlicer(column-1)->GetRenderWindow()-> GetInteractor()->SetKeySym("Crap");
+
QTreeWidgetItem* current_row=DataTree->topLevelItem(i);
if (DataTree->topLevelItem(index) == current_row)
{
@@ -1492,7 +1545,7 @@ void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column) {
msgBox.addButton(tr("Cancel"), QMessageBox::RejectRole);
if (msgBox.exec() == QMessageBox::AcceptRole)
{
- this->close();
+ this->close();
}
}
else
@@ -1552,13 +1605,13 @@ void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column) {
}
//------------------------------------------------------------------------------
-void vvMainWindow::CropImage()
-{
- int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- vvCropDialog crop(mSlicerManagers,index);
- if(crop.exec())
- AddImage(crop.GetOutput(),"cropped.mhd");
-}
+// void vvMainWindow::CropImage()
+// {
+// int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+// vvCropDialog crop(mSlicerManagers,index);
+// if(crop.exec())
+// AddImage(crop.GetOutput(),"cropped.mhd");
+// }
//------------------------------------------------------------------------------
void vvMainWindow::SplitImage() {
@@ -1622,7 +1675,7 @@ void vvMainWindow::SplitImage() {
cButton->setItem(item);
cButton->setColumn(COLUMN_CLOSE_IMAGE);
cButton->setToolTip(tr("close image"));
- cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+ cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(CloseImage(QTreeWidgetItem*, int)));
@@ -1630,7 +1683,7 @@ void vvMainWindow::SplitImage() {
rButton->setItem(item);
rButton->setColumn(COLUMN_RELOAD_IMAGE);
rButton->setToolTip(tr("reload image"));
- rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+ rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
rButton->setEnabled(false);
connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
@@ -1851,6 +1904,7 @@ void vvMainWindow::SelectOverlayImage() {
//------------------------------------------------------------------------------
void vvMainWindow::AddOverlayImage(int index, QString file) {
+
mInputPathName = itksys::SystemTools::GetFilenamePath(file.toStdString()).c_str();
itk::ImageIOBase::Pointer reader = itk::ImageIOFactory::CreateImageIO(
file.toStdString().c_str(), itk::ImageIOFactory::ReadMode);
@@ -1861,7 +1915,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
vvProgressDialog progress("Opening " + file.toStdString());
qApp->processEvents();
-
+
std::string filename = itksys::SystemTools::GetFilenameWithoutExtension(file.toStdString()).c_str();
if (mSlicerManagers[index]->SetOverlay(file.toStdString(),dimension, component))
{
@@ -1876,7 +1930,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
{
item->setData(j,Qt::CheckStateRole,DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole));
mSlicerManagers[index]->GetSlicer(j-1)->SetActorVisibility("overlay",0,
- DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole).toInt());
+ DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole).toInt());
}
//Create the buttons for reload and close
@@ -1885,7 +1939,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
cButton->setItem(item);
cButton->setColumn(COLUMN_CLOSE_IMAGE);
cButton->setToolTip(tr("close image"));
- cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+ cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(CloseImage(QTreeWidgetItem*, int)));
@@ -1893,7 +1947,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
rButton->setItem(item);
rButton->setColumn(COLUMN_RELOAD_IMAGE);
rButton->setToolTip(tr("reload image"));
- rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+ rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
@@ -1975,7 +2029,7 @@ void vvMainWindow::AddFusionImage()
cButton->setItem(item);
cButton->setColumn(COLUMN_CLOSE_IMAGE);
cButton->setToolTip(tr("close image"));
- cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+ cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(CloseImage(QTreeWidgetItem*, int)));
@@ -1983,7 +2037,7 @@ void vvMainWindow::AddFusionImage()
rButton->setItem(item);
rButton->setColumn(COLUMN_RELOAD_IMAGE);
rButton->setToolTip(tr("reload image"));
- rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+ rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
@@ -2015,8 +2069,10 @@ void vvMainWindow::AddFusionImage()
}
}
}
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
void vvMainWindow::OpenField()
{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
@@ -2037,7 +2093,10 @@ void vvMainWindow::OpenField()
if (!file.isEmpty())
AddField(file,index);
}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
{
//create an item in the tree with good settings
@@ -2060,7 +2119,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
cButton->setItem(item);
cButton->setColumn(COLUMN_CLOSE_IMAGE);
cButton->setToolTip(tr("close vector field"));
- cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+ cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(CloseImage(QTreeWidgetItem*, int)));
@@ -2069,7 +2128,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
rButton->setColumn(COLUMN_RELOAD_IMAGE);
rButton->setToolTip(tr("reload vector field"));
rButton->setEnabled(from_disk);
- rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+ rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
@@ -2086,7 +2145,10 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
ImageInfoChanged();
QApplication::restoreOverrideCursor();
}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index)
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
@@ -2103,7 +2165,10 @@ void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index)
}
QApplication::restoreOverrideCursor();
}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
void vvMainWindow::AddField(QString file,int index)
{
if (QFile::exists(file))
@@ -2139,6 +2204,7 @@ void vvMainWindow::AddField(QString file,int index)
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SetVFProperty(int subsampling, int scale, int log) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
@@ -2157,6 +2223,7 @@ void vvMainWindow::SetVFProperty(int subsampling, int scale, int log) {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SetOverlayProperty(int color) {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
@@ -2300,6 +2367,21 @@ void vvMainWindow::RemoveLink(QString image1,QString image2) {
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, int offset)
+{
+ int index = 0;
+ while(sm != mSlicerManagers[index])
+ index++;
+ index = (index+offset) % mSlicerManagers.size();
+
+ QTreeWidgetItem* item = GetItemFromSlicerManager(mSlicerManagers[index]);
+ //CurrentImageChanged(mSlicerManagers[index]->GetId()); //select new image
+ item->setData(slicer+1,Qt::CheckStateRole,2); //change checkbox
+ DisplayChanged(item,slicer+1);
+}
+//------------------------------------------------------------------------------
+
void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index)
{
for (unsigned int i = 0; i < mSlicerManagers.size(); i++)
@@ -2317,28 +2399,41 @@ void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index)
}
}
}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::NOHorizontalSliderMoved() {
+ // if (mCurrentTime == NOHorizontalSlider->value()) return;
HorizontalSliderMoved(NOHorizontalSlider->value(),COLUMN_UL_VIEW,0);
+ // mCurrentTime = NOHorizontalSlider->value();
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::NEHorizontalSliderMoved() {
+ // if (mCurrentTime == NEHorizontalSlider->value()) return;
HorizontalSliderMoved(NEHorizontalSlider->value(),COLUMN_UR_VIEW,1);
+ // mCurrentTime = NEHorizontalSlider->value();
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SOHorizontalSliderMoved() {
+ // if (mCurrentTime == SOHorizontalSlider->value()) return;
HorizontalSliderMoved(SOHorizontalSlider->value(),COLUMN_DL_VIEW,2);
+ // mCurrentTime = SOHorizontalSlider->value();
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SEHorizontalSliderMoved() {
+ // if (mCurrentTime == SEHorizontalSlider->value()) return;
HorizontalSliderMoved(SEHorizontalSlider->value(),COLUMN_DR_VIEW,3);
+ // mCurrentTime = SEHorizontalSlider->value();
}
//------------------------------------------------------------------------------
@@ -2350,13 +2445,16 @@ void vvMainWindow::NOVerticalSliderChanged() {
if (DataTree->topLevelItem(i)->data(COLUMN_UL_VIEW,Qt::CheckStateRole).toInt() > 1)
{
mSlicerManagers[i]->GetSlicer(0)->SetSlice(value);
- //mSlicerManagers[i]->UpdateSlice(0); // <-- NO ! too much update...
+ mSlicerManagers[i]->VerticalSliderHasChanged(0, value);
+ // mSlicerManagers[i]->UpdateSlice(0); // <-- DS add this. Not too much update ? YES.
+ mSlicerManagers[i]->GetSlicer(0)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ?
break;
}
}
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::NEVerticalSliderChanged() {
int value = NEVerticalSlider->value();
@@ -2365,12 +2463,15 @@ void vvMainWindow::NEVerticalSliderChanged() {
if (DataTree->topLevelItem(i)->data(COLUMN_UR_VIEW,Qt::CheckStateRole).toInt() > 1)
{
mSlicerManagers[i]->GetSlicer(1)->SetSlice(value);
+ mSlicerManagers[i]->VerticalSliderHasChanged(1, value);
+ mSlicerManagers[i]->GetSlicer(1)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ?
break;
}
}
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SOVerticalSliderChanged() {
int value = SOVerticalSlider->value();
@@ -2379,12 +2480,15 @@ void vvMainWindow::SOVerticalSliderChanged() {
if (DataTree->topLevelItem(i)->data(COLUMN_DL_VIEW,Qt::CheckStateRole).toInt() > 1)
{
mSlicerManagers[i]->GetSlicer(2)->SetSlice(value);
+ mSlicerManagers[i]->VerticalSliderHasChanged(2, value);
+ mSlicerManagers[i]->GetSlicer(2)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ?
break;
}
}
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SEVerticalSliderChanged() {
int value = SEVerticalSlider->value();
@@ -2393,12 +2497,15 @@ void vvMainWindow::SEVerticalSliderChanged() {
if (DataTree->topLevelItem(i)->data(COLUMN_DR_VIEW,Qt::CheckStateRole).toInt() > 1)
{
mSlicerManagers[i]->GetSlicer(3)->SetSlice(value);
+ mSlicerManagers[i]->VerticalSliderHasChanged(3, value);
+ mSlicerManagers[i]->GetSlicer(3)->Render(); // <-- DS add this, needed for contour, seems ok ? not too slow ?
break;
}
}
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSlice(int slicer, int slice) {
if (slicer == 0) {
@@ -2414,6 +2521,7 @@ void vvMainWindow::UpdateSlice(int slicer, int slice) {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::UpdateTSlice(int slicer, int slice) {
switch (slicer)
@@ -2434,6 +2542,7 @@ void vvMainWindow::UpdateTSlice(int slicer, int slice) {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax) {
int position = int((min+max)/2);
@@ -2469,6 +2578,7 @@ void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SaveNOScreenshot() {
vtkWindowToImageFilter *w2i = vtkWindowToImageFilter::New();
@@ -2479,6 +2589,7 @@ void vvMainWindow::SaveNOScreenshot() {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SaveNEScreenshot() {
vtkWindowToImageFilter *w2i = vtkWindowToImageFilter::New();
@@ -2489,6 +2600,7 @@ void vvMainWindow::SaveNEScreenshot() {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SaveSOScreenshot() {
vtkWindowToImageFilter *w2i = vtkWindowToImageFilter::New();
@@ -2499,6 +2611,7 @@ void vvMainWindow::SaveSOScreenshot() {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SaveSEScreenshot() {
vtkWindowToImageFilter *w2i = vtkWindowToImageFilter::New();
@@ -2509,6 +2622,7 @@ void vvMainWindow::SaveSEScreenshot() {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::SaveScreenshot(vtkImageData* image) {
QString Extensions = "Images( *.png);;";
@@ -2573,6 +2687,7 @@ void vvMainWindow::SaveScreenshot(vtkImageData* image) {
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::GoToCursor() {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
@@ -2596,7 +2711,7 @@ void vvMainWindow::PlayPause() {
if (playMode)
{
playMode = 0;
- playButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/player_play.png")));
+ playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_play.png")));
ImageInfoChanged();
return;
}
@@ -2613,7 +2728,7 @@ void vvMainWindow::PlayPause() {
if (has_temporal)
{
playMode = 1;
- playButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/player_pause.png")));
+ playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_pause.png")));
QTimer::singleShot(1000/mFrameRate, this, SLOT(PlayNext()));
}
}
@@ -2659,16 +2774,6 @@ void vvMainWindow::UpdateRenderWindows() {
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-void vvMainWindow::ResampleCurrentImage() {
- vvResamplerDialog resampler;
- int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- resampler.SetSlicerManagers(mSlicerManagers,index);
- if (resampler.exec())
- AddImage(resampler.GetOutput(),resampler.GetOutputFileName());
-}
-//------------------------------------------------------------------------------
-
//------------------------------------------------------------------------------
void vvMainWindow::SegmentationOnCurrentImage() {
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
@@ -2688,18 +2793,11 @@ void vvMainWindow::SurfaceViewerLaunch()
//------------------------------------------------------------------------------
void vvMainWindow::AddImage(vvImage::Pointer image,std::string filename)
{
- vvSlicerManager* m = new vvSlicerManager(4);
- m->SetImage(image);
- m->SetFilename(filename);
- AddImage(m);
-}
-
-//------------------------------------------------------------------------------
-void vvMainWindow::AddImage(vvSlicerManager * slicer_manager) {
+ vvSlicerManager* slicer_manager = new vvSlicerManager(4);
+ slicer_manager->SetImage(image);
+ slicer_manager->SetFilename(filename);
mSlicerManagers.push_back(slicer_manager);
- std::string filename = slicer_manager->GetFileName();
-
//create an item in the tree with good settings
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setData(0,Qt::UserRole,slicer_manager->GetFileName().c_str());//files[i].c_str());
@@ -2713,14 +2811,14 @@ void vvMainWindow::AddImage(vvSlicerManager * slicer_manager) {
QTreePushButton* cButton = new QTreePushButton;
cButton->setItem(item);
cButton->setColumn(COLUMN_CLOSE_IMAGE);
- cButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/exit.png")));
+ cButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/exit.png")));
connect(cButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(CloseImage(QTreeWidgetItem*, int)));
QTreePushButton* rButton = new QTreePushButton;
rButton->setItem(item);
rButton->setColumn(COLUMN_RELOAD_IMAGE);
- rButton->setIcon(QIcon(QString::fromUtf8(":/new/prefix1/icons/rotateright.png")));
+ rButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/rotateright.png")));
rButton->setEnabled(0);
connect(rButton,SIGNAL(clickedInto(QTreeWidgetItem*, int)),
this,SLOT(ReloadImage(QTreeWidgetItem*, int)));
@@ -2736,30 +2834,31 @@ void vvMainWindow::AddImage(vvSlicerManager * slicer_manager) {
linkPanel->addImage(filename, id.toStdString());
- connect(mSlicerManagers.back(),SIGNAL(currentImageChanged(std::string)),
- this,SLOT(CurrentImageChanged(std::string)));
- connect(mSlicerManagers.back(),SIGNAL(
- UpdatePosition(int, double, double, double, double, double, double, double)),this,
- SLOT(MousePositionChanged(int,double, double, double, double, double, double, double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateVector(int, double, double, double, double)),
+ connect(mSlicerManagers.back(), SIGNAL(currentImageChanged(std::string)),
+ this, SLOT(CurrentImageChanged(std::string)));
+ connect(mSlicerManagers.back(), SIGNAL(UpdatePosition(int, double, double, double, double, double, double, double)),
+ this, SLOT(MousePositionChanged(int,double, double, double, double, double, double, double)));
+ connect(mSlicerManagers.back(), SIGNAL(UpdateVector(int, double, double, double, double)),
this, SLOT(VectorChanged(int,double,double,double, double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateOverlay(int, double, double)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateOverlay(int, double, double)),
this, SLOT(OverlayChanged(int,double,double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateFusion(int, double)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
this, SLOT(FusionChanged(int,double)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateWindows(int, int, int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
this,SLOT(WindowsChanged(int, int, int)));
- connect(mSlicerManagers.back(),SIGNAL(WindowLevelChanged(double, double,int, int)),
+ connect(mSlicerManagers.back(), SIGNAL(WindowLevelChanged(double, double,int, int)),
this,SLOT(WindowLevelChanged(double, double, int, int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateSlice(int,int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateSlice(int,int)),
this,SLOT(UpdateSlice(int,int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateTSlice(int, int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateTSlice(int, int)),
this,SLOT(UpdateTSlice(int, int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateSliceRange(int,int,int,int,int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateSliceRange(int,int,int,int,int)),
this,SLOT(UpdateSliceRange(int,int,int,int,int)));
- connect(mSlicerManagers.back(),SIGNAL(UpdateLinkManager(std::string,int,double,double,double,int)),
+ connect(mSlicerManagers.back(), SIGNAL(UpdateLinkManager(std::string,int,double,double,double,int)),
this,SLOT(UpdateLinkManager(std::string,int,double,double,double,int)));
- connect(mSlicerManagers.back(),SIGNAL(LandmarkAdded()),landmarksPanel,SLOT(AddPoint()));
+ connect(mSlicerManagers.back(), SIGNAL(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)),
+ this,SLOT(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)));
+ connect(mSlicerManagers.back(), SIGNAL(LandmarkAdded()),landmarksPanel,SLOT(AddPoint()));
UpdateTree();
qApp->processEvents();
InitSlicers();
@@ -2772,13 +2871,9 @@ void vvMainWindow::AddImage(vvSlicerManager * slicer_manager) {
//------------------------------------------------------------------------------
void vvMainWindow::UpdateCurrentSlicer() {
- DD("UpdateCurrentSlicer");
int index = -1;
- DD(DataTree->selectedItems().size());
if (DataTree->selectedItems().size() > 0) {
index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
- DD(DataTree->selectedItems()[0]);
- DD(index);
}
mSlicerManagerCurrentIndex = index;
}