- like GoToCursor, but when we double-click a landmark in the landmark panel's table
connect(removeButton, SIGNAL(clicked()),this,SLOT(RemoveSelectedPoints()));
connect(removeAllButton, SIGNAL(clicked()),this,SLOT(RemoveAllPoints()));
connect(tableWidget,SIGNAL(cellChanged(int,int)),this,SLOT(CommentsChanged(int,int)));
+ connect(tableWidget,SIGNAL(doubleClicked(const QModelIndex &)),this,SLOT(SelectPoint()));
}
void vvLandmarksPanel::Load()
}
}
+void vvLandmarksPanel::SelectPoint()
+{
+ if (tableWidget->rowCount() > 0) {
+ QList<QTableWidgetItem *> items = tableWidget->selectedItems();
+ if (!items.empty()) {
+ // we're using single-selection mode
+ int row = items[0]->row();
+ mSelectedPoint[0] = mCurrentLandmarks->GetCoordinates(row)[0];
+ mSelectedPoint[1] = mCurrentLandmarks->GetCoordinates(row)[1];
+ mSelectedPoint[2] = mCurrentLandmarks->GetCoordinates(row)[2];
+ mSelectedPoint[3] = mCurrentLandmarks->GetCoordinates(row)[3];
+
+ emit SelectedPointChanged();
+ }
+ }
+
+}
+
+
void vvLandmarksPanel::RemoveSelectedPoints()
{
if (tableWidget->rowCount() > 0) {
mCurrentPath = path;
}
void SetCurrentImage(std::string filename);
+ double* GetSelectedPoint() { return mSelectedPoint; }
public slots:
void Load();
void RemoveSelectedPoints();
void RemoveAllPoints();
void AddPoint();
+ void SelectPoint();
void CommentsChanged(int row, int column);
signals:
void UpdateRenderWindows();
+ void SelectedPointChanged();
private:
void AddPoint(int);
+
vvLandmarks* mCurrentLandmarks;
std::string mCurrentPath;
+ double mSelectedPoint[4];
}; // end class vvLandmarksPanel
//====================================================================
connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,int,double,double, bool)),
this,SLOT(SetFusionProperty(int,int,int,double,double, bool)));
connect(landmarksPanel,SIGNAL(UpdateRenderWindows()),this,SLOT(UpdateRenderWindows()));
+ connect(landmarksPanel,SIGNAL(SelectedPointChanged()),this,SLOT(GoToLandmark()));
playMode = 0;//pause
mFrameRate = 10;
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvMainWindow::GoToLandmark()
+{
+ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+ for (int column = 1; column < 5; column++) {
+ if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) {
+ double* cursorPos = landmarksPanel->GetSelectedPoint();
+ mSlicerManagers[index]->GetSlicer(column-1)->SetCurrentPosition(
+ cursorPos[0],cursorPos[1],cursorPos[2],cursorPos[3]);
+ mSlicerManagers[index]->UpdateViews(1,column-1);
+ mSlicerManagers[index]->UpdateLinked(column-1);
+ break;
+ }
+ }
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::PlayPause()
{
void SetFusionProperty(int opacity, int tresOpacity, int colormap,double window,double level, bool showLegend);
void GoToCursor();
+ void GoToLandmark();
void PlayPause();
void PlayNext();
void ChangeFrameRate(int rate) {