cmake_policy(SET CMP0007 NEW)
endif(COMMAND cmake_policy)
#=========================================================
-
-
+ OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION" OFF)
#=========================================================
#List of vv tools to compile
set(vv_TOOLS
vvToolSimpleInputSelectorWidget
vvToolInputSelectorWidget
vvRegisterForm
+ vvWipeImage
)
# All others sources
vvSlicerManager.cxx
vvSlicerManagerCommand.cxx
vvUtils.cxx
- # vvMaximumIntensityProjection.cxx
- vvMesh.cxx
+ # vvMaximumIntensityProjection.cxx
+ vvMesh.cxx
vvMeshActor.cxx
vvMeshReader.cxx
vvMidPosition.cxx
#=========================================================
# Qt related commands
-
if(vv_QT_VERSION VERSION_GREATER "4")
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
else()
QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
endif()
+
+ # Add DICOM SERVER gui selector if the adequate GDCM is available
+ if(CLITK_USE_PACS_CONNECTION)
+ SET(vv_SRCS ${vv_SRCS}
+ vvQPacsConnection.cxx
+ vvPacsSettingsDialog.cxx
+ vvDicomServerQueryFactory.cxx
+ )
+ if(vv_QT_VERSION VERSION_GREATER "4")
+ qt5_wrap_cpp(vv_SRCS vvQPacsConnection.h
+ vvPacsSettingsDialog.h)
+ qt5_wrap_ui(vv_UI_CXX
+ qt_ui/vvPacsConnection.ui
+ qt_ui/vvPacsSettingsDialog.ui)
+ else()
+ QT4_WRAP_CPP(vv_SRCS vvQPacsConnection.h
+ vvPacsSettingsDialog.h)
+ QT4_WRAP_UI(vv_UI_CXX
+ qt_ui/vvPacsConnection.ui
+ qt_ui/vvPacsSettingsDialog.ui)
+ endif()
+ endif(CLITK_USE_PACS_CONNECTION)
# Add the autotools in the header vvToolsList.h for initialization of the dummy
# variables in vv.cxx for the tools contained in vvLib
#=========================================================
# Use CxImage to create animated gifs
- if(CLITK_EXPERIMENTAL)
- set(vvCxImage clitkCxImage)
- set(vv_SRCS ${vv_SRCS} vvAnimatedGIFWriter.cxx)
- include_directories(${CLITK_SOURCE_DIR}/utilities/CxImage)
- add_subdirectory(${CLITK_SOURCE_DIR}/utilities/CxImage ${PROJECT_BINARY_DIR}/utilities/CxImage)
- endif(CLITK_EXPERIMENTAL)
+ set(vvCxImage clitkCxImage)
+ set(vv_SRCS ${vv_SRCS} vvAnimatedGIFWriter.cxx)
+ include_directories(${CLITK_SOURCE_DIR}/utilities/CxImage)
+ add_subdirectory(${CLITK_SOURCE_DIR}/utilities/CxImage ${PROJECT_BINARY_DIR}/utilities/CxImage)
#=========================================================
#-----------------------------------------------------------------------------
#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
#include <vtkPNGWriter.h>
#include <vtkJPEGWriter.h>
#include <vtkGenericMovieWriter.h>
- #ifdef CLITK_EXPERIMENTAL
- # include <vvAnimatedGIFWriter.h>
- #endif
+ #include <vvAnimatedGIFWriter.h>
#ifdef VTK_USE_VIDEO_FOR_WINDOWS
# include <vtkAVIWriter.h>
#endif
#define COLUMN_RELOAD_IMAGE 6
#define COLUMN_IMAGE_NAME 7
-#ifdef CLITK_PRIVATE_FEATURES
-#define EXTENSIONS "Images ( *.bmp *.dcm *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz *.usf *.svl)"
-#else
-#define EXTENSIONS "Images ( *.bmp *.dcm *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.nii.gz)"
-#endif
+#include <extensions.h>
/*Data Tree values
{
setupUi(this); // this sets up the GUI
+ setDicomClient();
+
//Qt::WindowFlags flags = windowFlags();
//setWindowFlags(flags | Qt::WindowStaysOnTopHint);
contextActions.push_back(actionAdd_USSequence_toCT);
#endif
+ contextMenu.addAction(actionAdd_wipe_image);
+ contextActions.push_back(actionAdd_wipe_image);
+
contextMenu.addSeparator();
QAction* actionResetMatrix = contextMenu.addAction(QIcon(QString::fromUtf8(":/common/icons/identity.png")),
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);
actionAdd_VF_to_current_Image->setEnabled(0);
actionAdd_fusion_image->setEnabled(0);
actionAdd_USSequence_toCT->setEnabled(0);
+ actionAdd_wipe_image->setEnabled(0);
//init the sliders
verticalSliders.push_back(NOVerticalSlider);
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()));
connect(actionRead_saved_state,SIGNAL(triggered()),this,SLOT(ReadSavedState()));
connect(actionExit,SIGNAL(triggered()),this,SLOT(close()));
connect(actionAdd_VF_to_current_Image,SIGNAL(triggered()),this,SLOT(OpenField()));
+ connect(actionAdd_wipe_image,SIGNAL(triggered()),this,SLOT(SelectWipeImage()));
connect(actionAdd_fusion_image,SIGNAL(triggered()),this,SLOT(SelectFusionImage()));
connect(actionAdd_overlay_image_to_current_image,SIGNAL(triggered()), this,SLOT(SelectOverlayImage()));
connect(actionAdd_USSequence_toCT,SIGNAL(triggered()), this,SLOT(SelectFusionSequence()));
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()));
files = *(dicomSeriesSelector->GetFilenames());
LoadImages(files, vvImageReader::DICOM);
}
- }
+ }
+ #if CLITK_USE_PACS_CONNECTION
+ void vvMainWindow::ConnectPacs()
+ {
+ std::vector<std::string> 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
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
actionSave_As->setEnabled(1);
actionAdd_VF_to_current_Image->setEnabled(1);
actionAdd_fusion_image->setEnabled(1);
+ actionAdd_wipe_image->setEnabled(1);
actionAdd_overlay_image_to_current_image->setEnabled(1);
actionAdd_USSequence_toCT->setEnabled(1);
actionNorth_East_Window->setEnabled(1);
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvMainWindow::SelectWipeImage()
+{
+ int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
+
+
+ if (!(CheckAddedImage(index, "wipe")))
+ return;
+
+ vvWipeImage::Pointer wipeImage = vvWipeImage::New();
+ wipeImage->Initialize(mInputPathName, mSlicerManagers);
+ wipeImage->selectWipeImage(index, GetTree());
+ QTreeWidgetItem *item = DataTree->itemAt(index, COLUMN_CLOSE_IMAGE);
+ //connect(item,SIGNAL(clickedInto(QTreeWidgetItem*, int)), this,SLOT(CloseImage(QTreeWidgetItem*, int)));
+ UpdateTree();
+ ImageInfoChanged();
+ for(int i=0; i<4; i++)
+ DisplaySliders(index, i);
+ WindowLevelChanged();
+
+ /*QString Extensions = EXTENSIONS;
+ Extensions += ";;All Files (*)";
+ QStringList files = QFileDialog::getOpenFileNames(this,tr("Load Wipe image"),mInputPathName,Extensions);
+ if (files.isEmpty())
+ return;
+
+ std::vector<std::string> vecFileNames;
+ for (int i = 0; i < files.size(); i++) {
+ vecFileNames.push_back(files[i].toStdString());
+ }*/
+
+ //AddWipeImage(index,vecFileNames,vvImageReader::IMAGE);
+}
+//------------------------------------------------------------------------------
+
+
//------------------------------------------------------------------------------
void vvMainWindow::SelectFusionImage()
{
#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,
if (!fileName.isEmpty()) {
vtkSmartPointer<vtkWindowToImageFilter> w2i = vtkSmartPointer<vtkWindowToImageFilter>::New();
w2i->SetInput(widget->GetRenderWindow());
+ w2i->SetMagnification(1);
+ w2i->SetInputBufferTypeToRGBA(); //also record the alpha (transparency) channel
w2i->Update();
vtkImageData *image = w2i->GetOutput();
// Video
vtkGenericMovieWriter *vidwriter = NULL;
- #if CLITK_EXPERIMENTAL == 1
if (ext==".gif") {
vvAnimatedGIFWriter *gif = vvAnimatedGIFWriter::New();
vidwriter = gif;
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();
/*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Authors belong to:
+ Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
#include "vvToolManager.h"
#include "vvImageReader.h"
#include "vvMesh.h"
+#include "vvWipeImage.h"
#include "clitkMemoryUsage.h"
#include "vtkSmartPointer.h"
class vtkRenderer;
class vtkMatrix4x4;
class vvDicomSeriesSelector;
+ #if CLITK_USE_PACS_CONNECTION
+ class vvQPacsConnection;
+ #endif
class vvSlicer;
class QTreeWidget;
void SliceImages();
void MergeImagesWithTime();
void OpenDicom();
+ #if CLITK_USE_PACS_CONNECTION
+ void ConnectPacs();
+ #endif
///Open a vtkPolyData surface mesh and display it over the current image
void OpenVTKContour();
void SaveAs();
void ReloadImage();
void OpenField();
void SelectOverlayImage();
+ void SelectWipeImage();
void SelectFusionImage();
//select the file(s) from the disk containing the image sequence to fuse
void SelectFusionSequence();
void UpdateMemoryUsage();
void show();
+ static vvMainWindow* Instance(){return mSingleton;}
+
protected:
void createRecentlyOpenedFilesMenu();
vvHelpDialog *help_dialog;
vvDocumentation *documentation;
vvDicomSeriesSelector *dicomSeriesSelector;
+
+ vvWipeImage::Pointer mWipeImage;
+ #if CLITK_USE_PACS_CONNECTION
+ vvQPacsConnection *PacsConnection;
+ #endif
+
bool viewMode;
bool playMode;
// vvMainWindowToolInfo * mCurrentToolInfo;
// std::vector<vvToolCreatorBase*> mListOfRunningTool;
- static vvMainWindow * mSingleton;
+ static vvMainWindow* mSingleton;
int mCurrentTime;