X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvMainWindow.cxx;h=b8447c5718bc52f93e9a8767d29317cb5165bbcd;hb=2d5b3631dbb64aaf5868d90ac9b1006dd7f4dcef;hp=1bc0759e8ee14671f60a29dcc493623f2f0293b0;hpb=a7326d6b2149dc084a7101ff8063fb38fe22aa8e;p=clitk.git diff --git a/vv/vvMainWindow.cxx b/vv/vvMainWindow.cxx index 1bc0759..b8447c5 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 @@ -131,6 +134,8 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() { setupUi(this); // this sets up the GUI + setDicomClient(); + //Qt::WindowFlags flags = windowFlags(); //setWindowFlags(flags | Qt::WindowStaysOnTopHint); @@ -230,6 +235,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 +280,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())); @@ -386,6 +397,10 @@ vvMainWindow::vvMainWindow():vvMainWindowBase() menuExperimental->menuAction()->setVisible(false); #endif +#if !CLITK_USE_PACS_CONNECTION + actionConnect_Pacs->setVisible(false); +#endif + QTimer * timerMemory = new QTimer(this); //timerMemory->setInterval(5); connect(timerMemory, SIGNAL(timeout()), this, SLOT(UpdateMemoryUsage())); @@ -758,7 +773,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 //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ @@ -3323,6 +3355,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();