connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(SelectFusionImage()));
contextActions.push_back(actionAdd_fusion_image);
+ contextMenu.addSeparator();
+ QAction* actionResetMatrix = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/identity.png")),
+ tr("Reset transformation to identity"));
+ connect(actionResetMatrix, SIGNAL(triggered()), this,SLOT(ResetTransformationToIdentity()));
+
// TRIAL DS
/*
QMenu * m = new QMenu(menubar);
connect(linkPanel,SIGNAL(removeLink(QString,QString)),this,SLOT(RemoveLink(QString,QString)));
connect(overlayPanel,SIGNAL(VFPropertyUpdated(int,int,int,int,double,double,double)),this,SLOT(SetVFProperty(int,int,int,int,double,double,double)));
connect(overlayPanel,SIGNAL(OverlayPropertyUpdated(int)),this,SLOT(SetOverlayProperty(int)));
- connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,double,double)),
- this,SLOT(SetFusionProperty(int,int,double,double)));
+ connect(overlayPanel,SIGNAL(FusionPropertyUpdated(int,int,int,double,double)),
+ this,SLOT(SetFusionProperty(int,int,int,double,double)));
connect(landmarksPanel,SIGNAL(UpdateRenderWindows()),this,SLOT(UpdateRenderWindows()));
playMode = 0;//pause
this, SLOT(OverlayChanged(int,double,double)));
connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
this, SLOT(FusionChanged(int,double)));
- connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
- this,SLOT(WindowsChanged(int, 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)),
overlayPanel->getOverlayName(mSlicerManagers[index]->GetOverlayName().c_str());
overlayPanel->getOverlayProperty(-1);
}
+
if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
overlayPanel->getFusionName(mSlicerManagers[index]->GetFusionName().c_str());
overlayPanel->getFusionProperty(mSlicerManagers[index]->GetFusionOpacity(),
+ mSlicerManagers[index]->GetFusionThresholdOpacity(),
mSlicerManagers[index]->GetFusionColorMap(),
mSlicerManagers[index]->GetFusionWindow(),
mSlicerManagers[index]->GetFusionLevel());
} else {
overlayPanel->getFusionName(mSlicerManagers[index]->GetFusionName().c_str());
- overlayPanel->getFusionProperty(-1, -1,-1,-1);
+ overlayPanel->getFusionProperty(-1, -1, -1, -1, -1);
}
}
}
mSlicerManagers[slicerManagerIndex]->UpdateInfoOnCursorPosition(column-1);
DisplaySliders(slicerManagerIndex, column-1);
if(clickedParentItem == clickedItem) {
- // Toggle or force visibility if it was not on this branch so far
+ // Toggle
vis = !draw || !vis;
}
clickedSlicer->SetActorVisibility("image", 0, vis);
}
//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-void vvMainWindow::WindowsChanged(int window, int view, int slice)
-{
- infoPanel->setViews(window, view, slice);
-}
-//------------------------------------------------------------------------------
-
//------------------------------------------------------------------------------
void vvMainWindow::WindowLevelChanged(double window, double level,int preset,int colormap)
{
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvMainWindow::ResetTransformationToIdentity()
+{
+ std::string actorType = DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString().toStdString();
+ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+ mSlicerManagers[index]->ResetTransformationToIdentity(actorType);
+ ImageInfoChanged();
+}
+//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
void vvMainWindow::AddFusionImage(int index, QString file)
{
}
QString Extensions = "Images ( *.mhd)";
+ Extensions += ";;Images ( *.mha)";
Extensions += ";;Images ( *.vf)";
QString file = QFileDialog::getOpenFileName(this,tr("Load deformation field"),mInputPathName,Extensions);
if (!file.isEmpty())
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvMainWindow::SetFusionProperty(int opacity, int colormap,double window, double level)
+void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level)
{
int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
- mSlicerManagers[index]->SetFusionOpacity(opacity);
mSlicerManagers[index]->SetFusionColorMap(colormap);
+ mSlicerManagers[index]->SetFusionOpacity(opacity);
+ mSlicerManagers[index]->SetFusionThresholdOpacity(thresOpacity);
mSlicerManagers[index]->SetFusionWindow(window);
mSlicerManagers[index]->SetFusionLevel(level);
mSlicerManagers[index]->SetColorMap(0);
OutputListeFormat.push_back(".jpeg");
OutputListeFormat.push_back(".tif");
OutputListeFormat.push_back(".mhd");
+ OutputListeFormat.push_back(".mha");
OutputListeFormat.push_back(".hdr");
OutputListeFormat.push_back(".vox");
} else if (dimension == 3) {
OutputListeFormat.push_back(".mhd");
+ OutputListeFormat.push_back(".mha");
OutputListeFormat.push_back(".hdr");
OutputListeFormat.push_back(".vox");
} else if (dimension == 4) {
OutputListeFormat.push_back(".mhd");
+ OutputListeFormat.push_back(".mha");
}
QString Extensions = "AllFiles(*.*)";
for (int i = 0; i < OutputListeFormat.count(); i++) {
void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax)
{
int position = int((min+max)/2);
- int tPosition = int((tmin+tmax)/2);
if (slicer == 0) {
NOVerticalSlider->setValue(position);
NOVerticalSlider->setRange(min,max);
NOHorizontalSlider->setRange(tmin,tmax);
- NOHorizontalSlider->setValue(tPosition);
} else if (slicer == 1) {
NEVerticalSlider->setValue(position);
NEVerticalSlider->setRange(min,max);
NEHorizontalSlider->setRange(tmin,tmax);
- NEHorizontalSlider->setValue(tPosition);
} else if (slicer == 2) {
SOVerticalSlider->setValue(position);
SOVerticalSlider->setRange(min,max);
SOHorizontalSlider->setRange(tmin,tmax);
- SOHorizontalSlider->setValue(tPosition);
} else if (slicer == 3) {
SEVerticalSlider->setValue(position);
SEVerticalSlider->setRange(min,max);
SEHorizontalSlider->setRange(tmin,tmax);
- SEHorizontalSlider->setValue(tPosition);
}
}
//------------------------------------------------------------------------------
this, SLOT(OverlayChanged(int,double,double)));
connect(mSlicerManagers.back(), SIGNAL(UpdateFusion(int, double)),
this, SLOT(FusionChanged(int,double)));
- connect(mSlicerManagers.back(), SIGNAL(UpdateWindows(int, int, int)),
- this,SLOT(WindowsChanged(int, 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)),