X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMainWindow.cxx;h=a3d2000cbd9da993edcd9adccbd3b1130eaf9358;hb=dcb3446e7d4a04cdaac655b3181109d4463252b9;hp=3da4be743f0049b838b35193b49c03e0115f9e4b;hpb=5a3b267d800a086e0d7cc17ff5b334927e7562de;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 3da4be7..a3d2000 100644 --- a/vv/vvMainWindow.cxx +++ b/vv/vvMainWindow.cxx @@ -48,6 +48,9 @@ It is distributed under dual licence #include "vvMeshReader.h" #include "vvSaveState.h" #include "vvReadState.h" +#if CLITK_USE_PACS_CONNECTION +#include "vvQPacsConnection.h" +#endif #include "clitkConfiguration.h" #include "clitkMatrix.h" #ifdef Q_OS_OSX @@ -79,9 +82,7 @@ It is distributed under dual licence #include #include #include -#ifdef CLITK_EXPERIMENTAL -# include -#endif +#include #ifdef VTK_USE_VIDEO_FOR_WINDOWS # include #endif @@ -131,6 +132,8 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() { setupUi(this); // this sets up the GUI + setDicomClient(); + //Qt::WindowFlags flags = windowFlags(); //setWindowFlags(flags | Qt::WindowStaysOnTopHint); @@ -230,6 +233,9 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() documentation = new vvDocumentation(); help_dialog = new vvHelpDialog(); dicomSeriesSelector = new vvDicomSeriesSelector(); +#if CLITK_USE_PACS_CONNECTION + PacsConnection = new vvQPacsConnection(); +#endif inverseButton->setEnabled(0); actionAdd_overlay_image_to_current_image->setEnabled(0); @@ -272,6 +278,9 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() connect(actionWarp_image_with_vector_field,SIGNAL(triggered()),this,SLOT(WarpImage())); connect(actionLoad_images,SIGNAL(triggered()),this,SLOT(OpenImages())); connect(actionOpen_Dicom,SIGNAL(triggered()),this,SLOT(OpenDicom())); +#if CLITK_USE_PACS_CONNECTION + connect(actionConnect_Pacs,SIGNAL(triggered()),this,SLOT(ConnectPacs())); +#endif // connect(actionOpen_Dicom_Struct,SIGNAL(triggered()),this,SLOT(OpenDCStructContour())); connect(actionOpen_VTK_contour,SIGNAL(triggered()),this,SLOT(OpenVTKContour())); connect(actionOpen_Multiple_Images_As_One,SIGNAL(triggered()),this,SLOT(MergeImages())); @@ -378,12 +387,17 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() vvToolManager::GetInstance()->InsertToolsInMenu(this); vvToolManager::GetInstance()->EnableToolsInMenu(this, false); -#ifndef CLITK_EXPERIMENTAL -#define CLITK_EXPERIMENTAL 0 -#endif +//#ifndef CLITK_EXPERIMENTAL +//#define CLITK_EXPERIMENTAL 0 +//#endif +#ifdef CLITK_EXPERIMENTAL if (!CLITK_EXPERIMENTAL) menuExperimental->menuAction()->setVisible(false); +#endif +#if !CLITK_USE_PACS_CONNECTION + actionConnect_Pacs->setVisible(false); +#endif QTimer * timerMemory = new QTimer(this); //timerMemory->setInterval(5); @@ -757,7 +771,24 @@ void vvMainWindow::OpenDicom() files = *(dicomSeriesSelector->GetFilenames()); LoadImages(files, vvImageReader::DICOM); } -} +} +#if CLITK_USE_PACS_CONNECTION +void vvMainWindow::ConnectPacs() +{ + std::vector files; + + //std::cout << "dicomSeriesSelector " << std::endl; +if (PacsConnection->exec() == QDialog::Accepted) { + for (int i = 0; i < PacsConnection->getSeriesCount(); i++) + { + files = PacsConnection->getFileNames(i); + LoadImages(files, vvImageReader::DICOM); + } + PacsConnection->clearMove(); + } + } + +#endif //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ @@ -953,6 +984,7 @@ void vvMainWindow::LoadImages(std::vector files, vvImageReader::Loa connect(mSlicerManagers.back(), SIGNAL(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)), this,SLOT(ChangeImageWithIndexOffset(vvSlicerManager*,int,int))); connect(mSlicerManagers.back(),SIGNAL(LandmarkAdded()),landmarksPanel,SLOT(AddPoint())); + connect(landmarksPanel,SIGNAL(UpdateLandmarkTransform()), mSlicerManagers.back(), SLOT(UpdateLandmark())); InitSlicers(); numberofsuccesulreads++; } @@ -3309,9 +3341,7 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) #ifdef VTK_USE_MPEG2_ENCODER Extensions += ";;Video( *.mpg)"; #endif -#ifdef CLITK_EXPERIMENTAL Extensions += ";;Video( *.gif)"; -#endif int smIndex=GetSlicerIndexFromItem(DataTree->selectedItems()[0]); QString fileName = QFileDialog::getSaveFileName(this, @@ -3322,6 +3352,8 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) if (!fileName.isEmpty()) { vtkSmartPointer w2i = vtkSmartPointer::New(); w2i->SetInput(widget->GetRenderWindow()); + w2i->SetMagnification(1); + w2i->SetInputBufferTypeToRGBA(); //also record the alpha (transparency) channel w2i->Update(); vtkImageData *image = w2i->GetOutput(); @@ -3354,7 +3386,6 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) // Video vtkGenericMovieWriter *vidwriter = NULL; -#if CLITK_EXPERIMENTAL == 1 if (ext==".gif") { vvAnimatedGIFWriter *gif = vvAnimatedGIFWriter::New(); vidwriter = gif; @@ -3379,14 +3410,13 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) msgBox.addButton(tr("No"), QMessageBox::RejectRole); gif->SetDither(msgBox.exec() == QMessageBox::AcceptRole); } -#endif #ifdef VTK_USE_VIDEO_FOR_WINDOWS if (ext==".avi") { vtkAVIWriter *mpg = vtkAVIWriter::New(); vidwriter = mpg; mpg->SetQuality(2); bool ok; - int fps = QInputDialog::getInteger(this, tr("Number of frames per second"), + int fps = QInputDialog::getInt(this, tr("Number of frames per second"), tr("FPS:"), 5, 0, 1024, 1, &ok); if(!ok) fps = 5; @@ -3399,7 +3429,7 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget) vidwriter = mpg; mpg->SetQuality(2); bool ok; - int fps = QInputDialog::getInteger(this, tr("Number of frames per second"), + int fps = QInputDialog::getInt(this, tr("Number of frames per second"), tr("FPS:"), 5, 0, 1024, 1, &ok); if(!ok) fps = 5; @@ -3668,6 +3698,7 @@ vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filen connect(mSlicerManagers.back(), SIGNAL(ChangeImageWithIndexOffset(vvSlicerManager*,int,int)), this,SLOT(ChangeImageWithIndexOffset(vvSlicerManager*,int,int))); connect(mSlicerManagers.back(), SIGNAL(LandmarkAdded()),landmarksPanel,SLOT(AddPoint())); + connect(landmarksPanel,SIGNAL(UpdateLandmarkTransform()), mSlicerManagers.back(), SLOT(UpdateLandmark()));