]> Creatis software - clitk.git/commitdiff
First Modification for Qt5 & VTK6
authortbaudier <thomas.baudier@etu.unistra.fr>
Thu, 19 Nov 2015 14:20:57 +0000 (15:20 +0100)
committertbaudier <thomas.baudier@etu.unistra.fr>
Thu, 19 Nov 2015 14:20:57 +0000 (15:20 +0100)
Change GetExtent() into DATA_EXTENT or WHOLE_EXTENT according context
Open File Debug
Corner Information Display Debug
Cross Cursor Display Debug
Overlay Debug
Fusion Debug
Rigid Registration Debug (without overlay)

55 files changed:
common/clitkCommonGenericFilter.h
common/clitkDicomRTStruct2ImageFilter.cxx
common/clitkDicomRT_ROI.cxx
common/vvImage.cxx
itk/clitkMeshToBinaryImageFilter.txx
tools/clitkDicom2Image.cxx
vv/CMakeLists.txt
vv/vtkVOXImageWriter.cxx
vv/vtkVOXImageWriter.h
vv/vvAnimatedGIFWriter.cxx
vv/vvBinaryImageOverlayActor.cxx
vv/vvDeformableRegistration.cxx
vv/vvGlyph2D.cxx
vv/vvGlyph2D.h
vv/vvGlyphSource.cxx
vv/vvGlyphSource.h
vv/vvImageContour.cxx
vv/vvIntensityValueSlider.h
vv/vvInteractorStyleNavigator.cxx
vv/vvInteractorStyleNavigator.h
vv/vvLabelImageLoaderWidget.h
vv/vvLandmarks.cxx
vv/vvLandmarksGlyph.cxx
vv/vvLandmarksGlyph.h
vv/vvLandmarksPanel.cxx
vv/vvMainWindow.cxx
vv/vvMesh.cxx
vv/vvMeshActor.cxx
vv/vvMeshReader.cxx
vv/vvQDicomSeriesSelector.cxx
vv/vvRegisterForm.cxx
vv/vvSegmentationDialog.cxx
vv/vvSegmentationDialog.h
vv/vvSlicer.cxx
vv/vvSlicer.h
vv/vvSlicerManager.cxx
vv/vvSlicerManagerCommand.cxx
vv/vvSurfaceViewerDialog.cxx
vv/vvSurfaceViewerDialog.h
vv/vvToolBinarize.h
vv/vvToolCropImage.cxx
vv/vvToolCropImage.h
vv/vvToolImageArithm.h
vv/vvToolInputSelectorWidget.h
vv/vvToolMIP.h
vv/vvToolMedianFilter.h
vv/vvToolROIManager.cxx
vv/vvToolROIManager.h
vv/vvToolResample.h
vv/vvToolRigidReg.cxx
vv/vvToolRigidReg.h
vv/vvToolSegmentation.cxx
vv/vvToolSegmentation.h
vv/vvToolSimpleInputSelectorWidget.h
vv/vvToolWidgetBase.h

index fe04c5dafb821b312681c6f1ddff5cb1bf184392..13491f7f3722ab41d905b7b5ae8e419466ab85fb 100644 (file)
@@ -61,7 +61,7 @@ namespace clitk {
 
     ImageTypesManager(FilterType * f) { mFilter = f;  }
     virtual void DoIt(int dim, int ncomp, std::string pixelname) {
-      // std::cout << "ImageTypesManager DoIt " << dim << " " << pixelname << std::endl;
+      //std::cout << "ImageTypesManager DoIt " << dim << " " << pixelname << std::endl;
       if (mMapOfImageTypeToFunction[dim][ncomp][pixelname])
         mMapOfImageTypeToFunction[dim][ncomp][pixelname]->Execute();
     }
index ad90bef4d56220dfff44e3f7dda190c75a0f9e87..20a4b7009c14e8707b080b1225a615130ceec9b5 100644 (file)
 #include "clitkImageCommon.h"
 
 // vtk
+#include <vtkVersion.h>
 #include <vtkPolyDataToImageStencil.h>
 #include <vtkSmartPointer.h>
 #include <vtkImageStencil.h>
 #include <vtkLinearExtrusionFilter.h>
 #include <vtkMetaImageWriter.h>
+#include <vtkVersion.h>
 
 
 //--------------------------------------------------------------------
@@ -199,6 +201,7 @@ void clitk::DicomRTStruct2ImageFilter::Update()
 
   // Create new output image
   mBinaryImage = vtkSmartPointer<vtkImageData>::New();
+#if VTK_MAJOR_VERSION <= 5
   mBinaryImage->SetScalarTypeToUnsignedChar();
   mBinaryImage->SetOrigin(&origin[0]);
   mBinaryImage->SetSpacing(&mSpacing[0]);
@@ -206,13 +209,25 @@ void clitk::DicomRTStruct2ImageFilter::Update()
                           0, extend[1],
                           0, extend[2]);
   mBinaryImage->AllocateScalars();
+#else
+  mBinaryImage->SetOrigin(&origin[0]);
+  mBinaryImage->SetSpacing(&mSpacing[0]);
+  mBinaryImage->SetExtent(0, extend[0],
+                          0, extend[1],
+                          0, extend[2]);
+  mBinaryImage->AllocateScalars(VTK_UNSIGNED_CHAR, 1);
+#endif
 
   memset(mBinaryImage->GetScalarPointer(), 0,
          mBinaryImage->GetDimensions()[0]*mBinaryImage->GetDimensions()[1]*mBinaryImage->GetDimensions()[2]*sizeof(unsigned char));
 
   // Extrude
   vtkSmartPointer<vtkLinearExtrusionFilter> extrude=vtkSmartPointer<vtkLinearExtrusionFilter>::New();
+#if VTK_MAJOR_VERSION <= 5
   extrude->SetInput(mesh);
+#else
+  extrude->SetInputData(mesh);
+#endif
   ///We extrude in the -slice_spacing direction to respect the FOCAL convention (NEEDED !)
   extrude->SetVector(0, 0, -mSpacing[2]);
 
@@ -222,12 +237,24 @@ void clitk::DicomRTStruct2ImageFilter::Update()
   //http://www.nabble.com/Bug-in-vtkPolyDataToImageStencil--td23368312.html#a23370933
   sts->SetTolerance(0);
   sts->SetInformationInput(mBinaryImage);
+#if VTK_MAJOR_VERSION <= 5
   sts->SetInput(extrude->GetOutput());
+#else
+  sts->SetInputData(extrude->GetOutput());
+#endif
   //sts->SetInput(mesh);
 
   vtkSmartPointer<vtkImageStencil> stencil=vtkSmartPointer<vtkImageStencil>::New();
+#if VTK_MAJOR_VERSION <= 5
   stencil->SetStencil(sts->GetOutput());
+#else
+  stencil->SetStencilData(sts->GetOutput());
+#endif
+#if VTK_MAJOR_VERSION <= 5
   stencil->SetInput(mBinaryImage);
+#else
+  stencil->SetInputData(mBinaryImage);
+#endif
   stencil->ReverseStencilOn();
   stencil->Update();
 
index 1fd9fe1f1c6b806bd0f08be65c15d32d47a42f7f..7bec8c51f47b1be17104b0fb16da56c22f3e9317 100644 (file)
@@ -23,6 +23,7 @@
 #include <vtkImageClip.h>
 #include <vtkMarchingSquares.h>
 #include <vtkPolyDataWriter.h>
+#include <vtkVersion.h>
 
 #if GDCM_MAJOR_VERSION == 2
 #include "gdcmAttribute.h"
@@ -276,7 +277,11 @@ void clitk::DicomRT_ROI::ComputeMeshFromContour()
 {
   vtkSmartPointer<vtkAppendPolyData> append = vtkSmartPointer<vtkAppendPolyData>::New();
   for(unsigned int i=0; i<mListOfContours.size(); i++) {
-    append->AddInput(mListOfContours[i]->GetMesh());
+#if VTK_MAJOR_VERSION <= 5
+       append->AddInput(mListOfContours[i]->GetMesh());
+#else
+       append->AddInputData(mListOfContours[i]->GetMesh());
+#endif
   }
   append->Update();
  
@@ -394,7 +399,12 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage()
   
   // Get initial extend for the clipping
   vtkSmartPointer<vtkImageClip> clipper = vtkSmartPointer<vtkImageClip>::New();
+#if VTK_MAJOR_VERSION <= 5
   clipper->SetInput(image);
+#else
+  clipper->SetInputData(image);
+#endif
+  
   int* extent = image->GetExtent();
   DDV(extent, 6);
   //  std::vector<int> extend;
@@ -414,7 +424,11 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage()
 
 
     vtkSmartPointer<vtkMarchingSquares> squares = vtkSmartPointer<vtkMarchingSquares>::New();
+#if VTK_MAJOR_VERSION <= 5
     squares->SetInput(image);
+#else
+    squares->SetInputData(image);
+#endif
     squares->SetImageRange(extent[0], extent[1], extent[2], extent[3], i, i);
     squares->SetValue(1, 1.0);
     squares->Update();
@@ -446,7 +460,11 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage()
  
   vtkSmartPointer<vtkAppendPolyData> append = vtkSmartPointer<vtkAppendPolyData>::New();
   for(unsigned int i=0; i<n; i++) {
+#if VTK_MAJOR_VERSION <= 5
     append->AddInput(contours[i]);
+#else
+    append->AddInputData(contours[i]);
+#endif
   }
   append->Update();
  
@@ -455,7 +473,11 @@ void clitk::DicomRT_ROI::ComputeContoursFromImage()
   
   // Write vtk
   vtkPolyDataWriter * w = vtkPolyDataWriter::New();
+#if VTK_MAJOR_VERSION <= 5
   w->SetInput(mMesh);
+#else
+  w->SetInputData(mMesh);
+#endif
   w->SetFileName("toto.vtk");
   w->Write();
 
index 9842d4a7f2f64945580c53a6779b82957f561e55..6ba06c5a17b4b0de30d07af5eb887e13c68dce05 100644 (file)
 // vtk
 #include <vtkImageData.h>
 #include <vtkTransform.h>
+#include <vtkDataObject.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkInformation.h>
+#include <vtkVersion.h>
 
 // std
 #include <cassert>
@@ -71,7 +75,12 @@ void vvImage::AddVtkImage(vtkImageData* input)
   // mItkToVtkConverters is therefore not being updated, but 
   // up to here it's not being used anyway...
   mImageDimension = 0;
+#if VTK_MAJOR_VERSION <= 5
   int* extent = input->GetWholeExtent();
+#else
+  int* extent = input->GetInformation()->Get(vtkDataObject::DATA_EXTENT());
+#endif
+  
   if (extent[4] != extent[5])
     mImageDimension = 3;
   else if (extent[3] != extent[4])
index cd9a3bafbbc2a421b780a7f837df371429345b98..b67cca0c96825563329c2a4534071956c6b4820e 100644 (file)
@@ -20,6 +20,7 @@
 #include <vtkLinearExtrusionFilter.h>
 #include <vtkImageStencil.h>
 #include <vtkMetaImageWriter.h>
+#include <vtkVersion.h>
 
 #include "itkVTKImageImport.h"
 #include "vtkImageExport.h"
@@ -68,6 +69,7 @@ GenerateData()
 {
   // GO
   vtkSmartPointer<vtkImageData> binary_image=vtkSmartPointer<vtkImageData>::New();
+#if VTK_MAJOR_VERSION <= 5
   binary_image->SetScalarTypeToUnsignedChar();
 
   // Set spacing
@@ -91,6 +93,29 @@ GenerateData()
   
   // Allocate data
   binary_image->AllocateScalars();
+#else
+  // Set spacing
+  PointType samp_origin = m_LikeImage->GetOrigin();
+  SpacingType spacing=m_LikeImage->GetSpacing();
+  double * spacing2 = new double[3];
+  spacing2[0] = spacing[0];
+  spacing2[1] = spacing[1];
+  spacing2[2] = spacing[2];
+  binary_image->SetSpacing(spacing2);
+
+  // Set origin
+  /// Put the origin on a voxel to avoid small skips
+  binary_image->SetOrigin(samp_origin[0], samp_origin[1], samp_origin[2]);
+
+  // Compute image bounds
+  binary_image->SetExtent(0,m_LikeImage->GetLargestPossibleRegion().GetSize()[0],
+                          0,m_LikeImage->GetLargestPossibleRegion().GetSize()[1],
+                          0,m_LikeImage->GetLargestPossibleRegion().GetSize()[2] 
+                          );
+  
+  // Allocate data
+  binary_image->AllocateScalars(VTK_UNSIGNED_CHAR, 1);
+#endif
   memset(binary_image->GetScalarPointer(),0,
          binary_image->GetDimensions()[0]*binary_image->GetDimensions()[1]*binary_image->GetDimensions()[2]*sizeof(unsigned char));
 
@@ -105,10 +130,18 @@ GenerateData()
   if (m_Extrude)
   {
     vtkSmartPointer<vtkLinearExtrusionFilter> extrude=vtkSmartPointer<vtkLinearExtrusionFilter>::New();
+#if VTK_MAJOR_VERSION <= 5
     extrude->SetInput(m_Mesh);
+#else
+    extrude->SetInputData(m_Mesh);
+#endif
     // We extrude in the -slice_spacing direction to respect the FOCAL convention 
     extrude->SetVector(0, 0, -m_LikeImage->GetSpacing()[2]);
+#if VTK_MAJOR_VERSION <= 5
     sts->SetInput(extrude->GetOutput());
+#else
+    sts->SetInputData(extrude->GetOutput());
+#endif
     
     // When extrude ScaleFactor indicate the extrusion scaling (default = 1)
     /*
@@ -118,12 +151,21 @@ GenerateData()
     */ 
   }
   else
+#if VTK_MAJOR_VERSION <= 5
     sts->SetInput(m_Mesh);
+#else
+    sts->SetInputData(m_Mesh);
+#endif
 
   // Stencil
   vtkSmartPointer<vtkImageStencil> stencil=vtkSmartPointer<vtkImageStencil>::New();
+#if VTK_MAJOR_VERSION <= 5
   stencil->SetStencil(sts->GetOutput());
   stencil->SetInput(binary_image);
+#else
+  stencil->SetStencilData(sts->GetOutput());
+  stencil->SetInputData(binary_image);
+#endif
 
   // Convert VTK to ITK
   vtkImageExport * m_Exporter = vtkImageExport::New();
@@ -143,7 +185,11 @@ GenerateData()
   m_Importer->SetBufferPointerCallback( m_Exporter->GetBufferPointerCallback());
   m_Importer->SetCallbackUserData( m_Exporter->GetCallbackUserData());
 
+#if VTK_MAJOR_VERSION <= 5
   m_Exporter->SetInput( stencil->GetOutput() );
+#else
+  m_Exporter->SetInputData( stencil->GetOutput() );
+#endif
   m_Importer->Update();
 
   // writeImage<ImageType>(m_Importer->GetOutput(), "f.mhd");
index b25b001dea3a19c75edec04b1bcf790891c5cf6a..a6323da9de5ba6ad89c75ab8372049ef569b3200 100644 (file)
@@ -23,6 +23,7 @@
 #include "vvImageReader.h"
 #include "vvImageWriter.h"
 #include <gdcmFile.h>
+#include <vtkVersion.h>
 #include <vtkImageChangeInformation.h>
 #if GDCM_MAJOR_VERSION == 2
   #include <gdcmImageHelper.h>
@@ -191,7 +192,11 @@ int main(int argc, char * argv[])
       std::vector<int> size = image->GetSize();
       origin[0] = -spacing[0]*size[0]/2.0;
       origin[1] = -spacing[1]*size[1]/2.0;
+#if VTK_MAJOR_VERSION <= 5
       modifier->SetInput(vtk_image);
+#else
+      modifier->SetInputData(vtk_image);
+#endif
       modifier->SetOutputOrigin(origin[0], origin[1], locs[sliceIndex[0]]);
       modifier->Update();
       vvImage::Pointer focal_image = vvImage::New();
index df4081e5883ac1f69f813e40d278065651842b5d..11c3b1f805cb1824426604dba1d941fc0900e771 100644 (file)
@@ -106,11 +106,14 @@ set(vv_SRCS
 
 #=========================================================
 # Qt related commands
-find_package(Qt4 REQUIRED)
-link_directories(${QT_LIBRARY_DIR})
+find_package(Qt5Widgets REQUIRED)
+find_package(Qt5Network REQUIRED)
+find_package(Qt5Designer REQUIRED)
+link_directories(${QT5Widgets_LIBRARIES})
+link_directories(${QT5Network_LIBRARIES})
+link_directories(${QT5Designer_LIBRARIES})
 
-
-QT4_WRAP_CPP(vv_SRCS
+qt5_wrap_cpp(vv_SRCS
   vvMainWindowBase.h
   QTreePushButton.h
   vvDocumentation.h
@@ -122,14 +125,14 @@ QT4_WRAP_CPP(vv_SRCS
   vvToolCreatorBase.h
   )
 
-QT4_WRAP_UI(vv_UI_CXX
+qt5_wrap_ui(vv_UI_CXX
   qt_ui/vvHelpDialog.ui
   qt_ui/vvDocumentation.ui
   qt_ui/vvDicomSeriesSelector.ui
   qt_ui/vvDummyWindow.ui #For testing
   )
 
-QT4_ADD_RESOURCES(vv_SRCS vvIcons.qrc)
+QT5_add_resources(vv_SRCS vvIcons.qrc)
 
 # Add the autotools in the header vvToolsList.h for initialization of the dummy
 # variables in vv.cxx for the tools contained in vvLib
@@ -145,25 +148,25 @@ endif(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_B
 # Add the autotools and the common files ui
 foreach(tool ${vv_TOOLS} ${vv_COMMON_WITH_UI})
     set(vv_SRCS ${vv_SRCS} ${tool}.cxx)
-    QT4_WRAP_CPP(vv_SRCS ${tool}.h)
-    QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
+    QT5_WRAP_CPP(vv_SRCS ${tool}.h)
+    QT5_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
 endforeach(tool)
 
 # Add the common source files
 foreach(tool ${vv_COMMON})
     set(vv_SRCS ${vv_SRCS} ${tool}.cxx)
-    QT4_WRAP_CPP(vv_SRCS ${tool}.h)
+    QT5_WRAP_CPP(vv_SRCS ${tool}.h)
 endforeach(tool)
 
 # if Windows and Qt was built as a static lib then don't set QT_DLL flag
 set(QT_STATIC 0)
 if(WIN32)
-  if(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
-    file(READ ${QT_LIBRARY_DIR}/QtCore.prl QT_CORE_PRL)
+  if(EXISTS ${Qt5Widgets_LIBRARIES}/QtCore.prl)
+    file(READ ${Qt5Widgets_LIBRARIES}/QtCore.prl QT_CORE_PRL)
     if(${QT_CORE_PRL} MATCHES "static")
       set(QT_STATIC 1)
     endif(${QT_CORE_PRL} MATCHES "static")
-  endif(EXISTS ${QT_LIBRARY_DIR}/QtCore.prl)
+  endif(EXISTS ${Qt5Widgets_LIBRARIES}/QtCore.prl)
 endif(WIN32)
 if(NOT QT_STATIC)
   add_definitions(-DQT_DLL)
@@ -172,10 +175,11 @@ endif(NOT QT_STATIC)
 add_definitions(-DQT_THREAD_SUPPORT)
 
 include_directories(
-  ${QT_INCLUDES}
-  ${QT_INCLUDE_DIR}
-  ${QT_QTGUI_INCLUDE_DIR}
-  ${QT_QTCORE_INCLUDE_DIR}
+  ${Qt5Widgets_INCLUDE_DIRS}
+  ${Qt5GUI_INCLUDE_DIRS}
+  ${Qt5CORE_INCLUDE_DIRS}
+  ${Qt5Network_INCLUDE_DIRS}
+  ${Qt5Designer_INCLUDE_DIRS}
   ${CMAKE_CURRENT_BINARY_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}
 )
@@ -206,7 +210,8 @@ endforeach(tool)
 #=========================================================
 #Add Foundation Libraries (this should be after our libraries, since we depend
 #on them)
-set(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
+#set(foundationLibraries clitkCommon ${ITK_LIBRARIES} QVTK vtkHybrid)
+set(foundationLibraries clitkCommon ${ITK_LIBRARIES} ${VTK_LIBRARIES})
 
 #=========================================================
 # Use CxImage to create animated gifs
@@ -236,7 +241,8 @@ if(APPLE)
 endif()
 #=========================================================
 #Create binary and libs for tests
-set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} ${QT_LIBRARIES} ${QT_QTNETWORK_LIBRARY} ${APPLE_FRAMEWORKS})
+#set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} ${Qt5Widgets_LIBRARIES_DIRS} ${Qt5Network_LIBRARIES_DIRS} ${APPLE_FRAMEWORKS})
+set(vvExternalLibs clitkSegmentationGgoLib ${toolLibs} ${foundationLibraries} ${vvCxImage} Qt5::Widgets Qt5::Network Qt5::Designer ${APPLE_FRAMEWORKS})
 # QtNetwork is required by vvRegisterForm
 
 add_library(vvLib ${vv_SRCS} ${vv_UI_CXX})
index 4d7c92cc63b1f25fb3b7f4685c1e65dace9ecffb..7ffecb5edbe6e4b3671005864ce82b435c31788d 100644 (file)
 #include "vtkObjectFactory.h"
 #include "vtkStreamingDemandDrivenPipeline.h"
 #include "vtkDataSetAttributes.h"
-
-#include <vtkstd/string>
+#include <vtkVersion.h>
+#include <vtkAlgorithm.h>
 
 #include <sys/stat.h>
 
 //----------------------------------------------------------------------------
-vtkCxxRevisionMacro(vtkVOXImageWriter, "DummyRevision");
 vtkStandardNewMacro(vtkVOXImageWriter);
 
 //----------------------------------------------------------------------------
@@ -55,9 +54,11 @@ vtkVOXImageWriter::~vtkVOXImageWriter()
 void vtkVOXImageWriter::Write( )
 {
   this->SetErrorCode(vtkErrorCode::NoError);
-
+#if VTK_MAJOR_VERSION <= 5
   this->GetInput()->UpdateInformation();
-
+#else
+  this->UpdateInformation();
+#endif
   // Error checking
   if (this->GetInput() == NULL ) {
     vtkErrorMacro(<<"Write:Please specify an input!");
@@ -70,7 +71,11 @@ void vtkVOXImageWriter::Write( )
   }
 
   int nDims = 3;
+#if VTK_MAJOR_VERSION <= 5
   int * ext = this->GetInput()->GetWholeExtent();
+#else
+  int * ext = this->GetInformation()->Get(vtkDataObject::DATA_EXTENT());
+#endif
   if ( ext[4] == ext[5] ) {
     nDims = 2;
     if ( ext[2] == ext[3] ) {
@@ -134,12 +139,15 @@ void vtkVOXImageWriter::Write( )
   origin[1] += ext[2] * spacing[1];
   origin[2] += ext[4] * spacing[2];
 
+#if VTK_MAJOR_VERSION <= 5
   this->GetInput()->SetUpdateExtent(ext[0], ext[1],
                                     ext[2], ext[3],
                                     ext[4], ext[5]);
   this->GetInput()->UpdateData();
-
-
+#else
+  this->SetUpdateExtent(ext);
+  this->Update();
+#endif
   this->SetFileDimensionality(nDims);
 
   this->InvokeEvent(vtkCommand::StartEvent);
index d64fbf0292c46fde3da17ba411f8f15f44787bbf..a4ce3e334a0fd601e8bf05d2ad6960ea4d3500ba 100644 (file)
@@ -24,7 +24,7 @@
 class vtkVOXImageWriter : public vtkImageWriter
 {
 public:
-    vtkTypeRevisionMacro(vtkVOXImageWriter,vtkImageWriter);
+    vtkTypeMacro(vtkVOXImageWriter,vtkImageWriter);
     void PrintSelf(ostream& os, vtkIndent indent);
 
     // Description:
index 1efd50dcc1cc5f27be12899c980d41815be88587..5dbf51abc300d251e94d48b880467229ed235f2a 100644 (file)
@@ -1,6 +1,9 @@
 #include "vvAnimatedGIFWriter.h"
 #include "clitkDD.h"
 
+#include <vtkVersion.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkInformation.h>
 #include <vtkImageData.h>
 #include <vtkImageQuantizeRGBToIndex.h>
 #include <vtkImageAppend.h>
@@ -39,14 +42,25 @@ void vvAnimatedGIFWriter::Start()
 void vvAnimatedGIFWriter::Write()
 {
   // get the data
+#if VTK_MAJOR_VERSION <= 5
   this->GetInput()->UpdateInformation();
   int *wExtent = this->GetInput()->GetWholeExtent();
   this->GetInput()->SetUpdateExtent(wExtent);
   this->GetInput()->Update();
+#else
+  this->UpdateInformation();
+  int *wExtent = this->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT());
+  this->SetUpdateExtent(wExtent);
+  this->Update();
+#endif
 
   RGBslices.push_back( vtkSmartPointer<vtkImageData>::New() );
   RGBslices.back()->ShallowCopy(this->GetInput());
+#if VTK_MAJOR_VERSION <= 5
   RGBvolume->AddInput(RGBslices.back());
+#else
+  RGBvolume->AddInputData(RGBslices.back());
+#endif
 }
 
 //---------------------------------------------------------------------------
@@ -57,12 +71,20 @@ void vvAnimatedGIFWriter::End()
   // Quantize to 8 bit colors
   vtkSmartPointer<vtkImageQuantizeRGBToIndex> quant = vtkSmartPointer<vtkImageQuantizeRGBToIndex>::New();
   quant->SetNumberOfColors(256);
+#if VTK_MAJOR_VERSION <= 5
   quant->SetInput(RGBvolume->GetOutput());
+#else
+  quant->SetInputData(RGBvolume->GetOutput());
+#endif
   quant->Update();
 
   // Convert to 8 bit image
   vtkSmartPointer<vtkImageCast> cast =  vtkSmartPointer<vtkImageCast>::New();
+#if VTK_MAJOR_VERSION <= 5
   cast->SetInput( quant->GetOutput() );
+#else
+  cast->SetInputData( quant->GetOutput() );
+#endif
   cast->SetOutputScalarTypeToUnsignedChar();
   cast->Update();
 
index b4a4a3df204dfcd5ce4980939010c8bfd1bd756f..dc953201cfba5755ed51378705455aed66cde0d7 100644 (file)
@@ -18,6 +18,9 @@
 
 #include "vvBinaryImageOverlayActor.h"
 #include "vvImage.h"
+#include <vtkVersion.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkInformation.h>
 #include <vtkImageActor.h>
 #include <vtkCamera.h>
 #include <vtkRenderer.h>
@@ -107,7 +110,11 @@ void vvBinaryImageOverlayActor::Initialize(bool IsVisible)
   for (unsigned int numImage = 0; numImage < mSlicer->GetImage()->GetVTKImages().size(); numImage++) {
     // how many intensity ?
     vtkSmartPointer<vtkImageMapToRGBA> mOverlayMapper = vtkSmartPointer<vtkImageMapToRGBA>::New();
+#if VTK_MAJOR_VERSION <= 5
     mOverlayMapper->SetInput(mImage->GetVTKImages()[0]); // DS TODO : to change if it is 4D !!!
+#else
+    mOverlayMapper->SetInputData(mImage->GetVTKImages()[0]); // DS TODO : to change if it is 4D !!!
+#endif
 
     double range[2];
     mImage->GetVTKImages()[0]->GetScalarRange(range);
@@ -133,7 +140,11 @@ void vvBinaryImageOverlayActor::Initialize(bool IsVisible)
     mOverlayMapper->SetLookupTable(mColorLUT);
 
     vtkSmartPointer<vtkImageActor> mOverlayActor = vtkSmartPointer<vtkImageActor>::New();
+#if VTK_MAJOR_VERSION <= 5
     mOverlayActor->SetInput(mOverlayMapper->GetOutput());
+#else
+    mOverlayActor->SetInputData(mOverlayMapper->GetOutput());
+#endif
     mOverlayActor->SetPickable(0);
     mOverlayActor->SetVisibility(IsVisible);
     //mOverlayActor->SetOpacity(1.0);  
@@ -248,7 +259,11 @@ void vvBinaryImageOverlayActor::UpdateColor()
     mOverlayMapper->SetLookupTable(mColorLUT);
 
     vtkImageActor * mOverlayActor = mImageActorList[numImage];
+#if VTK_MAJOR_VERSION <= 5
     mOverlayActor->SetInput(mOverlayMapper->GetOutput());
+#else
+    mOverlayActor->SetInputData(mOverlayMapper->GetOutput());
+#endif
   }
 }
 //------------------------------------------------------------------------------
@@ -276,7 +291,11 @@ void vvBinaryImageOverlayActor::UpdateSlice(int slicer, int slice, bool force)
   int maskExtent[6];
   ComputeExtent(orientation, mSlice, imageExtent, maskExtent);
   ComputeExtent(maskExtent, maskExtent, mSlicer->GetImage()->GetFirstVTKImageData(), mImage->GetFirstVTKImageData());
+#if VTK_MAJOR_VERSION <= 5
   mSlicer->ClipDisplayedExtent(maskExtent, mMapperList[mTSlice]->GetInput()->GetWholeExtent());
+#else
+  mSlicer->ClipDisplayedExtent(maskExtent, mMapperList[mTSlice]->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
+#endif
   SetDisplayExtentAndCameraPosition(orientation, mSlice, maskExtent, mImageActorList[mTSlice], mDepth);
 
   // set previous slice
index 5d429a8b71f1c15d9486320f47ba53612be0fdc8..12a2959aa33679b8ab5f6bde9349e0d859eeba5c 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "vtkVOXImageWriter.h"
 #include <vtkImageData.h>
+#include <vtkVersion.h>
 
 #include "clitkCommon.h"
 #include "vvSlicerManager.h"
@@ -133,7 +134,11 @@ void vvDeformableRegistration::run()
   for (unsigned int i=0; i<images.size(); i++) {
     std::stringstream filename;
     filename << temp_dir << "/temp_" << i << ".vox";
+#if VTK_MAJOR_VERSION <= 5
     vox->SetInput(images[i]);
+#else
+    vox->SetInputData(images[i]);
+#endif
     vox->SetFileName(filename.str().c_str());
     if (i==refimage)
       ref_file=filename.str();
index 594996011266e8b19df3f6ddd071611f71727f37..1856dd272602231ebce81c60c099174390e7c24b 100644 (file)
@@ -17,6 +17,7 @@
 ===========================================================================**/
 #include "vvGlyph2D.h"
 
+#include <vtkVersion.h>
 #include "vtkCell.h"
 #include "vtkDataSet.h"
 #include "vtkFloatArray.h"
@@ -32,7 +33,6 @@
 #include "vtkTransform.h"
 #include "vtkUnsignedCharArray.h"
 
-vtkCxxRevisionMacro(vvGlyph2D, "DummyRevision");
 vtkStandardNewMacro(vvGlyph2D);
 
 vvGlyph2D::vvGlyph2D()
@@ -171,9 +171,14 @@ int vvGlyph2D::RequestData(
     defaultPointIds[0] = 0;
     defaultPointIds[1] = 1;
     defaultSource->SetPoints(defaultPoints);
-    defaultSource->InsertNextCell(VTK_LINE, 2, defaultPointIds);
+    defaultSource->InsertNextCell(VTK_LINE, 2, defaultPointIds); 
+#if VTK_MAJOR_VERSION <= 5
     defaultSource->SetUpdateExtent(0, 1, 0);
     this->SetSource(defaultSource);
+#else
+    this->SetUpdateExtent(0, 1, 0);
+    this->SetSourceData(defaultSource);
+#endif
     defaultSource->Delete();
     defaultSource = NULL;
     defaultPoints->Delete();
index 6ffd68deeb7e555fff9380b49cbe9d5960836647..377bf34433e2571c82ef93d5c657fcebaf17b8d2 100644 (file)
@@ -22,7 +22,7 @@
 class vvGlyph2D : public vtkGlyph3D
 {
 public:
-    vtkTypeRevisionMacro(vvGlyph2D,vtkGlyph3D);
+    vtkTypeMacro(vvGlyph2D,vtkGlyph3D);
     void PrintSelf(ostream& os, vtkIndent indent);
 
     // Description
index 949ecf19010f09571ab7d9d8eb3e550953b168df..3a6763b480aab632c7c199a151f8902e6466a4f5 100644 (file)
@@ -26,7 +26,6 @@
 #include "vtkPolyData.h"
 #include "vtkUnsignedCharArray.h"
 
-vtkCxxRevisionMacro(vvGlyphSource, "DummyRevision");
 vtkStandardNewMacro(vvGlyphSource);
 
 
index a9bebf9944d3d2eb58c425c59fd2f84256b40974..c3db9a06c7dc6a0a03f694407cc03ca1afc5d487 100644 (file)
@@ -25,7 +25,7 @@ class vvGlyphSource: public vtkGlyphSource2D
 {
 public:
     static vvGlyphSource *New();
-    vtkTypeRevisionMacro(vvGlyphSource,vtkGlyphSource2D);
+    vtkTypeMacro(vvGlyphSource,vtkGlyphSource2D);
     void PrintSelf(ostream& os, vtkIndent indent);
 
     void SetGlyphTypeToSpecificArrow() {
index 4fecf93e9371f52703dfc9634899547f74965f11..8fb22ae4d000428bd0fb50317b2843fa22372c80 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "vvImageContour.h"
 #include "vvImage.h"
+#include <vtkVersion.h>
 #include <vtkImageActor.h>
 #include <vtkCamera.h>
 #include <vtkRenderer.h>
@@ -82,7 +83,11 @@ void vvImageContour::SetSlicer(vvSlicer * slicer) {
 //------------------------------------------------------------------------------
 void vvImageContour::SetImage(vvImage::Pointer image) {
   for (unsigned int numImage = 0; numImage < image->GetVTKImages().size(); numImage++) {
+#if VTK_MAJOR_VERSION <= 5
     mClipperList[numImage]->SetInput(image->GetVTKImages()[numImage]);
+#else
+    mClipperList[numImage]->SetInputData(image->GetVTKImages()[numImage]);
+#endif
   }
   mHiddenImageIsUsed = true;
   mHiddenImage = image;
@@ -295,13 +300,27 @@ void vvImageContour::CreateNewActor(int numImage) {
   vtkSmartPointer<vtkMarchingSquares> squares = vtkSmartPointer<vtkMarchingSquares>::New();
   vtkSmartPointer<vtkPolyDataMapper> squaresMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
 
-  if (mHiddenImageIsUsed)
+  if (mHiddenImageIsUsed) {
+#if VTK_MAJOR_VERSION <= 5
     clipper->SetInput(mHiddenImage->GetVTKImages()[0]);
-  else
+#else
+    clipper->SetInputData(mHiddenImage->GetVTKImages()[0]);
+#endif
+  } else {
+#if VTK_MAJOR_VERSION <= 5
     clipper->SetInput(mSlicer->GetImage()->GetVTKImages()[numImage]);
-  
+#else
+    clipper->SetInputData(mSlicer->GetImage()->GetVTKImages()[numImage]);
+#endif
+  }
+
+#if VTK_MAJOR_VERSION <= 5
   squares->SetInput(clipper->GetOutput());
   squaresMapper->SetInput(squares->GetOutput());
+#else
+  squares->SetInputData(clipper->GetOutput());
+  squaresMapper->SetInputData(squares->GetOutput());
+#endif
   squaresMapper->ScalarVisibilityOff();
   squaresActor->SetMapper(squaresMapper);
   squaresActor->GetProperty()->SetColor(1.0,0,0);
index 41b3ef105f16b21ee80fcf8103dc071736aa82c6..4e2bfb3a923e12650ec2e130c9955fa8c54733c8 100644 (file)
@@ -19,7 +19,7 @@
 #define VVINTENSITYVALUESLIDER_H
 
 // qt
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QDialog>
 
 // clitk 
index ac37a8fd22c95442157365a2a03ad3409d662ed1..8ddc4df78c71c06a24a8466ac40664ede6a9ef4a 100644 (file)
@@ -29,8 +29,6 @@
 #include <vtkRendererCollection.h>
 #include "clitkCommon.h"
 
-
-vtkCxxRevisionMacro(vvInteractorStyleNavigator, "DummyRevision");
 vtkStandardNewMacro(vvInteractorStyleNavigator);
 
 //----------------------------------------------------------------------------
index 5b3da5d19be2aaf67fab33d31e1c2fe8aeb307fc..e0de7c0fc0fda275f06fa261b45b17f46747c391 100644 (file)
@@ -29,7 +29,7 @@ class vvInteractorStyleNavigator : public vtkInteractorStyle
 {
 public:
     static vvInteractorStyleNavigator *New();
-    vtkTypeRevisionMacro(vvInteractorStyleNavigator, vtkInteractorStyle);
+    vtkTypeMacro(vvInteractorStyleNavigator, vtkInteractorStyle);
     void PrintSelf(ostream& os, vtkIndent indent);
 
     // Description:
index 62ae8892184e89b381946c040c0cb8ecd4633701..ff7446440ad05db029614ace3795b500fa5fb407 100644 (file)
@@ -23,7 +23,7 @@
 #include "vvImage.h"
 
 // qt
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QDialog>
 #include "ui_vvLabelImageLoaderWidget.h"
 
index fed697ebc2a218943ac125b4676e15ac1f3afd70..d0f2c916daa2fcc6224f248740e26e3436631cfb 100644 (file)
@@ -23,6 +23,7 @@
 #include <string>
 #include <locale.h>
 
+#include <vtkVersion.h>
 #include "vtkPolyData.h"
 #include "vtkPoints.h"
 #include "vtkFloatArray.h"
@@ -451,7 +452,11 @@ void vvLandmarks::SetTime(int time)
     mPolyData->GetPointData()->SetScalars(mIds[time]);
     mPolyData->GetPointData()->AddArray(mLabels[time]);
     mPolyData->Modified();
+#if VTK_MAJOR_VERSION <= 5
     mPolyData->Update();
+#else
+    //mPolyData->Update();
+#endif
     mTime = time;
   }
 }
index d3d80c288ec0264cb326d81409d6f0d770361637..d25173132f7d7993fe86f6c8745b8f9e5dc3fd65 100644 (file)
@@ -27,7 +27,6 @@
 #include "vtkUnsignedCharArray.h"
 #include <cassert>
 
-vtkCxxRevisionMacro(vvLandmarksGlyph, "DummyRevision");
 vtkStandardNewMacro(vvLandmarksGlyph);
 
 #define vtkfont_width 9
index 8b5020d30ac8776530000dde03e30fa8435f3d29..a8fe029552af7aa1b479a332f742308522a3dca3 100644 (file)
@@ -23,7 +23,7 @@
 class vvLandmarksGlyph : public vtkTextSource
 {
 public:
-    vtkTypeRevisionMacro(vvLandmarksGlyph,vtkTextSource);
+    vtkTypeMacro(vvLandmarksGlyph,vtkTextSource);
     void PrintSelf(ostream& os, vtkIndent indent);
 
     // Description:
index 2d3e1a5503ca4f0702e13947935035afd690d16f..99d8628b3e9f296cc7bcdba89c38c23bcbcef621 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <QtGui>
 #include <Qt>
+#include <QFileDialog>
 #include "QTreePushButton.h"
 #include "vvLandmarks.h"
 
index af39d3e15fb1eda8910f965b8d31566d16f93bd2..590f3dd6fb577e5007cabb9be3297a2ccccbedac 100644 (file)
@@ -58,6 +58,9 @@ It is distributed under dual licence
 #include <itkNumericSeriesFileNames.h>
 
 // VTK include
+#include <vtkImageMapper3D.h>
+#include <vtkInformation.h>
+#include <vtkVersion.h>
 #include <vtkImageData.h>
 #include <vtkImageActor.h>
 #include <vtkCornerAnnotation.h>
@@ -121,7 +124,7 @@ It is distributed under dual licence
 
 //------------------------------------------------------------------------------
 vvMainWindow::vvMainWindow():vvMainWindowBase()
-{
+{ //out << __func__ << endl;
   setupUi(this); // this sets up the GUI
 
   mInputPathName = "";
@@ -384,13 +387,13 @@ vvMainWindow::vvMainWindow():vvMainWindowBase()
 }
 //------------------------------------------------------------------------------
 void vvMainWindow::show()
-{
+{ //out << __func__ << endl;
   vvMainWindowBase::show();
   PopupRegisterForm(true);
 }
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateMemoryUsage()
-{
+{ //out << __func__ << endl;
   //  clitk::PrintMemory(true);
   if (clitk::GetMemoryUsageInMb() == 0) infoPanel->setMemoryInMb("NA");
   else infoPanel->setMemoryInMb(QString::number(clitk::GetMemoryUsageInMb())+" MiB");
@@ -400,7 +403,7 @@ void vvMainWindow::UpdateMemoryUsage()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::createRecentlyOpenedFilesMenu()
-{
+{ //out << __func__ << endl;
   recentlyOpenedFilesMenu = new QMenu("Recently opened files...");
   recentlyOpenedFilesMenu->setIcon(QIcon(QString::fromUtf8(":/common/icons/open.png")));
   menuFile->insertMenu(actionOpen_Image_With_Time,recentlyOpenedFilesMenu);
@@ -412,7 +415,7 @@ void vvMainWindow::createRecentlyOpenedFilesMenu()
 //------------------------------------------------------------------------------
 
 void vvMainWindow::updateRecentlyOpenedFilesMenu(const std::list<std::string> &recent_files)
-{
+{ //out << __func__ << endl;
   if(recentlyOpenedFilesMenu==NULL) {
     createRecentlyOpenedFilesMenu();
   } else {
@@ -429,11 +432,11 @@ void vvMainWindow::updateRecentlyOpenedFilesMenu(const std::list<std::string> &r
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ComputeMidPosition()
-{
+{ //out << __func__ << endl;
   bool ok;
   int index=GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
-  int ref = QInputDialog::getInteger(this,"Chose reference phase","Reference phase",0,0,\
-    mSlicerManagers[index]->GetImage()->GetVTKImages().size()-1,1,&ok);
+  int ref = QInputDialog::getInt(this,"Chose reference phase","Reference phase",0,0,\
+mSlicerManagers[index]->GetImage()->GetVTKImages().size()-1,1,&ok);
   if (ok) {
     vvMidPosition midp;
     midp.slicer_manager = mSlicerManagers[index];
@@ -454,7 +457,7 @@ void vvMainWindow::ComputeMidPosition()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool propagation)
-{
+{ //out << __func__ << endl;
   QTreeWidgetItem *item = new QTreeWidgetItem();
   item->setData(0,Qt::UserRole,"filename.vtk");
   item->setData(1,Qt::UserRole,tr("contour"));
@@ -501,7 +504,7 @@ void vvMainWindow::AddContour(int image_index, vvMesh::Pointer contour, bool pro
 
 //------------------------------------------------------------------------------
 void vvMainWindow::OpenVTKContour()
-{
+{ //out << __func__ << endl;
   if (mSlicerManagers.size() > 0) {
     QString Extensions = "Images ( *.vtk *.obj)";
     Extensions += ";;All Files (*)";
@@ -524,7 +527,7 @@ void vvMainWindow::OpenVTKContour()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddDCStructContour(int index, QString file)
-{
+{ //out << __func__ << endl;
   vvMeshReader reader;
   reader.SetFilename(file.toStdString());
   vvStructSelector selector;
@@ -548,7 +551,7 @@ void vvMainWindow::AddDCStructContour(int index, QString file)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::OpenDCStructContour()
-{
+{ //out << __func__ << endl;
   if (mSlicerManagers.size() > 0) {
     QString Extensions = "Dicom Files ( *.dcm RS*)";
     Extensions += ";;All Files (*)";
@@ -564,7 +567,7 @@ void vvMainWindow::OpenDCStructContour()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ComputeDeformableRegistration()
-{
+{ //out << __func__ << endl;
   if (mSlicerManagers.size() > 0) {
     int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
     vvDeformationDialog dialog(index,mSlicerManagers);
@@ -581,11 +584,11 @@ void vvMainWindow::ComputeDeformableRegistration()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::WarpImage()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if (!mSlicerManagers[index]->GetVF().IsNull()) {
     bool ok;
-    int ref = QInputDialog::getInteger(this,"Chose reference phase","Reference phase",0,0,\
+    int ref = QInputDialog::getInt(this,"Chose reference phase","Reference phase",0,0,\
       mSlicerManagers[index]->GetImage()->GetVTKImages().size()-1,1,&ok);
     if (ok) {
       WarpImage(mSlicerManagers[index],ref);
@@ -598,7 +601,7 @@ void vvMainWindow::WarpImage()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::WarpImage(vvSlicerManager* selected_slicer,int reference_phase)
-{
+{ //out << __func__ << endl;
   if (!selected_slicer->GetVF().IsNull()) {
     QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
     QFileInfo info(selected_slicer->GetFileName().c_str());
@@ -621,7 +624,7 @@ void vvMainWindow::WarpImage(vvSlicerManager* selected_slicer,int reference_phas
 
 //------------------------------------------------------------------------------
 vvMainWindow::~vvMainWindow()
-{
+{ //out << __func__ << endl;
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
     if (mSlicerManagers[i] != NULL)
       delete mSlicerManagers[i];
@@ -631,7 +634,7 @@ vvMainWindow::~vvMainWindow()
 
 //------------------------------------------------------------------------------
 QTabWidget * vvMainWindow::GetTab()
-{
+{ //out << __func__ << endl;
   return tabWidget;
 }
 //------------------------------------------------------------------------------
@@ -639,7 +642,7 @@ QTabWidget * vvMainWindow::GetTab()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::MergeImages()
-{
+{ //out << __func__ << endl;
   QString Extensions = EXTENSIONS;
   Extensions += ";;All Files (*)";
   QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images"),mInputPathName,Extensions);
@@ -698,7 +701,7 @@ void vvMainWindow::MergeImages()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SliceImages()
-{
+{ //out << __func__ << endl;
   QString Extensions = EXTENSIONS;
   Extensions += ";;All Files (*)";
 
@@ -715,7 +718,7 @@ void vvMainWindow::SliceImages()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::MergeImagesWithTime()
-{
+{ //out << __func__ << endl;
   QString Extensions = EXTENSIONS;
   Extensions += ";;All Files (*)";
   QStringList files = QFileDialog::getOpenFileNames(this,tr("Merge Images With Time"),mInputPathName,Extensions);
@@ -737,7 +740,7 @@ void vvMainWindow::MergeImagesWithTime()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::OpenDicom()
-{
+{ //out << __func__ << endl;
   std::vector<std::string> files;
 
   //std::cout << "dicomSeriesSelector " << std::endl;
@@ -750,7 +753,7 @@ void vvMainWindow::OpenDicom()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::OpenImages()
-{
+{ //out << __func__ << endl;
   QString Extensions = EXTENSIONS;
   Extensions += ";;All Files (*)";
 
@@ -765,7 +768,7 @@ void vvMainWindow::OpenImages()
 }
 //------------------------------------------------------------------------------
 void vvMainWindow::OpenRecentImage()
-{
+{ //out << __func__ << endl;
   QAction * caller = qobject_cast<QAction*>(sender());
   std::vector<std::string> images;
   images.push_back(caller->text().toStdString());
@@ -777,7 +780,7 @@ void vvMainWindow::OpenRecentImage()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::OpenImageWithTime()
-{
+{ //out << __func__ << endl;
   QString Extensions = EXTENSIONS;
   Extensions += ";;All Files (*)";
 
@@ -796,7 +799,7 @@ void vvMainWindow::OpenImageWithTime()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::LoadedImageType filetype)
-{
+{ //out << __func__ << endl;
   //Separate the way to open images and dicoms
   int fileSize;
   if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME)
@@ -859,19 +862,19 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::Loa
       // Change filename if an image with the same already exist
       int number = GetImageDuplicateFilenameNumber(files[i] + std::string("_slice"));
 
-      if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME || filetype == vvImageReader::SLICED)
+      if (filetype == vvImageReader::IMAGE || filetype == vvImageReader::IMAGEWITHTIME || filetype == vvImageReader::SLICED) {
         SetImageSucceed = imageManager->SetImage(files[i],filetype, number, j);
-      else {
+      else {
         SetImageSucceed = imageManager->SetImages(files,filetype, number);
       }
-
-      if (!SetImageSucceed) {
+      if (!SetImageSucceed) {;
         QApplication::restoreOverrideCursor();
         QString error = "Cannot open file \n";
         error += imageManager->GetLastError().c_str();
         QMessageBox::information(this,tr("Reading problem"),error);
         delete imageManager;
       } else {
+
         mSlicerManagers.push_back(imageManager);
 
         //create an item in the tree with good settings
@@ -941,12 +944,12 @@ void vvMainWindow::LoadImages(std::vector<std::string> 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()));
-
         InitSlicers();
         numberofsuccesulreads++;
       }
     }
   }
+
   if (numberofsuccesulreads) {
     NOViewWidget->show();
     NEViewWidget->show();
@@ -971,7 +974,7 @@ void vvMainWindow::LoadImages(std::vector<std::string> files, vvImageReader::Loa
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateTree()
-{
+{ //out << __func__ << endl;
   DataTree->resizeColumnToContents(COLUMN_TREE);
   DataTree->resizeColumnToContents(COLUMN_UL_VIEW);
   DataTree->resizeColumnToContents(COLUMN_UR_VIEW);
@@ -985,7 +988,7 @@ void vvMainWindow::UpdateTree()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::CurrentImageChanged(std::string id)
-{
+{ //out << __func__ << endl;
   if (id == mCurrentSelectedImageId) return; // Do nothing
   int selected = 0;
   for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
@@ -1012,7 +1015,7 @@ void vvMainWindow::CurrentImageChanged(std::string id)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::CurrentPickedImageChanged(std::string id)
-{
+{ //out << __func__ << endl;
   if (id == mCurrentPickedImageId) return; // Do nothing
   int selected = 0;
   for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
@@ -1033,7 +1036,7 @@ void vvMainWindow::CurrentPickedImageChanged(std::string id)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ImageInfoChanged()
-{
+{ //out << __func__ << endl;
   contextActions[6]->setEnabled(1);
   contextActions[5]->setEnabled(1);
   actionSave_As->setEnabled(1);
@@ -1211,14 +1214,14 @@ void vvMainWindow::ImageInfoChanged()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ShowDocumentation()
-{
+{ //out << __func__ << endl;
   documentation->show();
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::PopupRegisterForm(bool checkCanPush)
-{
+{ //out << __func__ << endl;
   vvRegisterForm* registerForm = new vvRegisterForm(QUrl("http://www.creatis.insa-lyon.fr/~dsarrut/vvregister/write.php"), getVVSettingsPath(), getSettingsOptionFormat());
   if(!checkCanPush) {
     registerForm->show();
@@ -1233,14 +1236,14 @@ void vvMainWindow::PopupRegisterForm(bool checkCanPush)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ShowHelpDialog()
-{
+{ //out << __func__ << endl;
   help_dialog->show();
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ChangeViewMode()
-{
+{ //out << __func__ << endl;
   typedef struct _SIZE{
     QSplitter* splitter;
     QList<int> size1, size2;
@@ -1324,7 +1327,7 @@ void vvMainWindow::ChangeViewMode()
 
 //------------------------------------------------------------------------------
 QString vvMainWindow::GetSizeInBytes(unsigned long size)
-{
+{ //out << __func__ << endl;
   QString result = "";// QString::number(size);
   //result += " bytes (";
   if (size > 1000000000) {
@@ -1346,7 +1349,7 @@ QString vvMainWindow::GetSizeInBytes(unsigned long size)
 
 //------------------------------------------------------------------------------
 QString vvMainWindow::GetVectorDoubleAsString(std::vector<double> vectorDouble)
-{
+{ //out << __func__ << endl;
   QString result;
   for (unsigned int i= 0; i < vectorDouble.size(); i++) {
     if (i != 0)
@@ -1359,7 +1362,7 @@ QString vvMainWindow::GetVectorDoubleAsString(std::vector<double> vectorDouble)
 
 //------------------------------------------------------------------------------
 QString vvMainWindow::GetVectorIntAsString(std::vector<int> vectorInt)
-{
+{ //out << __func__ << endl;
   QString result;
   for (unsigned int i= 0; i < vectorInt.size(); i++) {
     if (i != 0)
@@ -1373,7 +1376,7 @@ QString vvMainWindow::GetVectorIntAsString(std::vector<int> vectorInt)
 //------------------------------------------------------------------------------
 //this actually returns the SlicerManager index!
 int vvMainWindow::GetSlicerIndexFromItem(QTreeWidgetItem* item)
-{
+{ //out << __func__ << endl;
   QString id = item->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString();
   for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
     if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id)
@@ -1385,7 +1388,7 @@ int vvMainWindow::GetSlicerIndexFromItem(QTreeWidgetItem* item)
 
 //------------------------------------------------------------------------------
 QTreeWidgetItem* vvMainWindow::GetItemFromSlicerManager(vvSlicerManager* sm)
-{
+{ //out << __func__ << endl;
   QString id = sm->GetId().c_str();
   for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
     if (DataTree->topLevelItem(i)->data(COLUMN_IMAGE_NAME,Qt::UserRole).toString() == id)
@@ -1397,7 +1400,7 @@ QTreeWidgetItem* vvMainWindow::GetItemFromSlicerManager(vvSlicerManager* sm)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::DisplayChanged(QTreeWidgetItem *clickedItem, int column)
-{
+{ //out << __func__ << endl;
   if ( column >= COLUMN_CLOSE_IMAGE || column <= 0)
     return;
 
@@ -1465,10 +1468,9 @@ void vvMainWindow::DisplayChanged(QTreeWidgetItem *clickedItem, int column)
 //------------------------------------------------------------------------------
 
 void vvMainWindow::InitSlicers()
-{
+{ //out << __func__ << endl;
   if (mSlicerManagers.size()) {
     mSlicerManagers.back()->GenerateDefaultLookupTable();
-
     mSlicerManagers.back()->SetSlicerWindow(0,NOViewWidget->GetRenderWindow());
     mSlicerManagers.back()->SetSlicerWindow(1,NEViewWidget->GetRenderWindow());
     mSlicerManagers.back()->SetSlicerWindow(2,SOViewWidget->GetRenderWindow());
@@ -1479,7 +1481,7 @@ void vvMainWindow::InitSlicers()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::InitDisplay()
-{
+{ //out << __func__ << endl;
   if (mSlicerManagers.size()) {
     //BE CAREFUL : this is absolutely necessary to set the interactor style
     //in order to have the same style instanciation for all SlicerManagers in
@@ -1490,14 +1492,14 @@ void vvMainWindow::InitDisplay()
       bool AlreadySelected = false;
       for (int i = 0; i < DataTree->topLevelItemCount(); i++) {
         mSlicerManagers[i]->SetInteractorStyleNavigator(j,style);
-
         //select the image only if previous are not selected
         if (DataTree->topLevelItem(i)->data(j+1,Qt::CheckStateRole).toInt() > 1) {
           mSlicerManagers[i]->UpdateSlicer(j,1);
           AlreadySelected = true;
         } else if (i == DataTree->topLevelItemCount()-1 && !AlreadySelected) {
-          if (DataTree->selectedItems().size() == 0)
+          if (DataTree->selectedItems().size() == 0) {
             DataTree->topLevelItem(i)->setSelected(1);
+          }
           DataTree->topLevelItem(i)->setData(j+1,Qt::CheckStateRole,2);
           mSlicerManagers[i]->UpdateSlicer(j,1);
           DisplaySliders(i,j);
@@ -1514,7 +1516,7 @@ void vvMainWindow::InitDisplay()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::DisplaySliders(int slicer, int window)
-{
+{ //out << __func__ << endl;
   if(!mSlicerManagers[slicer]->GetSlicer(window)->GetRenderer()->GetDraw())
     return;
 
@@ -1543,7 +1545,7 @@ void vvMainWindow::DisplaySliders(int slicer, int window)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column)
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(item);
 
   if (DataTree->topLevelItem(index) != item) {
@@ -1661,7 +1663,7 @@ void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column)
-{
+{ //out << __func__ << endl;
   // int index = GetSlicerIndexFromItem(item);
   //   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   //   if (item->data(1,Qt::UserRole).toString() == "vector")
@@ -1701,28 +1703,28 @@ void vvMainWindow::ReloadImage(QTreeWidgetItem* item, int column)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::MousePositionChanged(int visibility,double x, double y, double z, double X, double Y, double Z , double value)
-{
+{ //out << __func__ << endl;
   infoPanel->setCurrentInfo(visibility,x,y,z,X,Y,Z,value);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::VectorChanged(int visibility,double x, double y, double z, double value)
-{
+{ //out << __func__ << endl;
   overlayPanel->getCurrentVectorInfo(visibility,x,y,z,value);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::OverlayChanged(int visibility, double valueOver, double valueRef)
-{
+{ //out << __func__ << endl;
   overlayPanel->getCurrentOverlayInfo(visibility,valueOver, valueRef);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::FusionChanged(int visibility, double value)
-{
+{ //out << __func__ << endl;
   overlayPanel->getCurrentFusionInfo(visibility,value);
 }
 //------------------------------------------------------------------------------
@@ -1732,7 +1734,7 @@ void vvMainWindow::FusionChanged(int visibility, double value)
 //or when UpdateWindowLevel() is called ; when slicerManager emits WindowLevelChanged
 //when ImageInfoChanged() is called
 void vvMainWindow::WindowLevelChanged()
-{
+{ //out << __func__ << endl;
   // Base image
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if(index==-1) return;
@@ -1787,7 +1789,7 @@ void vvMainWindow::WindowLevelChanged()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::WindowLevelEdited()
-{
+{ //out << __func__ << endl;
   presetComboBox->setCurrentIndex(WL_USER);
   UpdateWindowLevel();
 }
@@ -1795,7 +1797,7 @@ void vvMainWindow::WindowLevelEdited()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SetWindowLevel(double w, double l)
-{
+{ //out << __func__ << endl;
   windowSpinBox->setValue(w);
   levelSpinBox->setValue(l);
   presetComboBox->setCurrentIndex(WL_USER);
@@ -1806,7 +1808,7 @@ void vvMainWindow::SetWindowLevel(double w, double l)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateWindowLevel()
-{
+{ //out << __func__ << endl;
   if (DataTree->selectedItems().size()) {
     if (presetComboBox->currentIndex() == WL_VENTILATION) //For ventilation
       colorMapComboBox->setCurrentIndex(5);
@@ -1822,7 +1824,7 @@ void vvMainWindow::UpdateWindowLevel()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateSlicingPreset()
-{
+{ //out << __func__ << endl;
   if (DataTree->selectedItems().size()) {
     int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
     mSlicerManagers[index]->SetSlicingPreset(vvSlicerManager::SlicingPresetType(slicingPresetComboBox->currentIndex()));
@@ -1832,7 +1834,7 @@ void vvMainWindow::UpdateSlicingPreset()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateColorMap()
-{
+{ //out << __func__ << endl;
   if (DataTree->selectedItems().size()) {
     int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
     mSlicerManagers[index]->SetColorMap(colorMapComboBox->currentIndex());
@@ -1841,7 +1843,7 @@ void vvMainWindow::UpdateColorMap()
 }
 //------------------------------------------------------------------------------
 void vvMainWindow::SwitchWindowLevel()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   int window = mSlicerManagers[index]->GetColorWindow();
   presetComboBox->setCurrentIndex(WL_USER);
@@ -1852,7 +1854,7 @@ void vvMainWindow::SwitchWindowLevel()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ApplyWindowLevelToAllImages()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if(index==-1) return;
   double window = mSlicerManagers[index]->GetColorWindow();
@@ -1881,7 +1883,7 @@ void vvMainWindow::ApplyWindowLevelToAllImages()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ApplyWindowToSetOfImages(double window, unsigned int indexMin, unsigned int indexMax)
-{
+{ //out << __func__ << endl;
   for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) {
     if (mSlicerManagers[i] == NULL)
       continue;
@@ -1894,7 +1896,7 @@ void vvMainWindow::ApplyWindowToSetOfImages(double window, unsigned int indexMin
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ApplyLevelToSetOfImages(double level, unsigned int indexMin, unsigned int indexMax)
-{
+{ //out << __func__ << endl;
   for (unsigned int i = indexMin; i <= indexMax && i < mSlicerManagers.size(); i++) {
     if (mSlicerManagers[i] == NULL)
       continue;
@@ -1907,7 +1909,7 @@ void vvMainWindow::ApplyLevelToSetOfImages(double level, unsigned int indexMin,
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, double y, double z, int temps)
-{
+{ //out << __func__ << endl;
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
     if (mSlicerManagers[i]->GetId() == id) {
       mSlicerManagers[i]->GetSlicer(slicer)->SetCurrentPosition(x,y,z,temps);
@@ -1920,7 +1922,7 @@ void vvMainWindow::UpdateLinkManager(std::string id, int slicer, double x, doubl
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateLinkedNavigation(std::string id, vvSlicerManager * sm, vvSlicer* refSlicer)
-{
+{ //out << __func__ << endl;
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
     if (id == mSlicerManagers[i]->GetId()) {
       mSlicerManagers[i]->UpdateLinkedNavigation(refSlicer);
@@ -1931,7 +1933,7 @@ void vvMainWindow::UpdateLinkedNavigation(std::string id, vvSlicerManager * sm,
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ShowContextMenu(QPoint point)
-{
+{ //out << __func__ << endl;
   if (!DataTree->selectedItems().size()) {
     contextActions[1]->setEnabled(0);
     contextActions[2]->setEnabled(0);
@@ -1960,21 +1962,21 @@ void vvMainWindow::ShowContextMenu(QPoint point)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::CloseImage()
-{
+{ //out << __func__ << endl;
   CloseImage(DataTree->selectedItems()[0],0);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ReloadImage()
-{
+{ //out << __func__ << endl;
   ReloadImage(DataTree->selectedItems()[0],0);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SelectOverlayImage()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
 
   //check if one overlay image is added
@@ -1997,13 +1999,14 @@ void vvMainWindow::SelectOverlayImage()
     for (int i = 0; i < files.size(); i++) {
       vecFileNames.push_back(files[i].toStdString());
     }
+
     AddOverlayImage(index,vecFileNames,vvImageReader::IMAGE);
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddOverlayImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
-{
+{ //out << __func__ << endl;
   QString file(fileNames[0].c_str());
   if (QFile::exists(file))
   {
@@ -2083,7 +2086,7 @@ void vvMainWindow::AddOverlayImage(int index, std::vector<std::string> fileNames
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddROI(int index, QString file)
-{
+{ //out << __func__ << endl;
   /*
   // Get slice manager
 
@@ -2110,7 +2113,7 @@ void vvMainWindow::AddROI(int index, QString file)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SelectFusionImage()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
 
   //check if one fusion image is added
@@ -2140,7 +2143,7 @@ void vvMainWindow::SelectFusionImage()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ResetTransformationToIdentity()
-{
+{ //out << __func__ << endl;
   std::string actorType = DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString().toStdString();
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   mSlicerManagers[index]->ResetTransformationToIdentity(actorType);
@@ -2150,7 +2153,7 @@ void vvMainWindow::ResetTransformationToIdentity()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddFusionImage(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
-{
+{ //out << __func__ << endl;
   QString file(fileNames[0].c_str());
   if (QFile::exists(file))
   {
@@ -2228,7 +2231,7 @@ void vvMainWindow::AddFusionImage(int index, std::vector<std::string> fileNames,
 //------------------------------------------------------------------------------
 //------------------------------------------------------------------------------
 void vvMainWindow::AddLandmarks(int index, std::vector<std::string> files)
-{
+{ //out << __func__ << endl;
     if (!landmarksPanel->LoadFromFile(files))
       QMessageBox::information(this,tr("Problem reading Landmarks !"),"File doesn't exist!");
 
@@ -2238,7 +2241,7 @@ void vvMainWindow::AddLandmarks(int index, std::vector<std::string> files)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::OpenField()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   //check if a vector field has already been added
   for (int child = 0; child < DataTree->topLevelItem(index)->childCount(); child++)
@@ -2266,7 +2269,7 @@ void vvMainWindow::OpenField()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
-{
+{ //out << __func__ << endl;
   //create an item in the tree with good settings
   QTreeWidgetItem *item = new QTreeWidgetItem();
   item->setData(0,Qt::UserRole,filename.toStdString().c_str());
@@ -2317,7 +2320,7 @@ void vvMainWindow::AddFieldEntry(QString filename,int index,bool from_disk)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index)
-{
+{ //out << __func__ << endl;
   QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
   vvSlicerManager* imageManager = mSlicerManagers[index];
   if (imageManager->SetVF(vf,file.toStdString())) {
@@ -2334,7 +2337,7 @@ void vvMainWindow::AddField(vvImage::Pointer vf,QString file,int index)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddField(QString file,int index)
-{
+{ //out << __func__ << endl;
   if (QFile::exists(file)) {
     mInputPathName = itksys::SystemTools::GetFilenamePath(file.toStdString()).c_str();
 
@@ -2366,7 +2369,7 @@ void vvMainWindow::AddField(QString file,int index)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SetVFProperty(int subsampling, int scale, int log, int width, double r, double g, double b)
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if (mSlicerManagers[index]->GetSlicer(0)->GetVF()) {
     for (int i = 0; i < 4; i++) {
@@ -2386,7 +2389,7 @@ void vvMainWindow::SetVFProperty(int subsampling, int scale, int log, int width,
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SetOverlayProperty(int color, int linked, double window, double level)
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if (mSlicerManagers[index]->GetSlicer(0)->GetOverlay()) {
     mSlicerManagers[index]->SetOverlayColor(color);
@@ -2401,7 +2404,7 @@ void vvMainWindow::SetOverlayProperty(int color, int linked, double window, doub
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap,double window, double level, bool showLegend)
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   if (mSlicerManagers[index]->GetSlicer(0)->GetFusion()) {
     mSlicerManagers[index]->SetFusionColorMap(colormap);
@@ -2419,7 +2422,7 @@ void vvMainWindow::SetFusionProperty(int opacity, int thresOpacity, int colormap
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SelectFusionSequence()
-{
+{ //out << __func__ << endl;
   //get the index of the slicer manager of the main sequence (CT)
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   //check if one overlay image is already associated
@@ -2451,8 +2454,8 @@ void vvMainWindow::SelectFusionSequence()
 
 
 //------------------------------------------------------------------------------
-void vvMainWindow::SelectFusionSequenceCorrespondances() {
-
+void vvMainWindow::SelectFusionSequenceCorrespondances() 
+{ //out << __func__ << endl;
   //make sure the index is right?
   //in the end, I should attach the temporal data to the right sequence!
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
@@ -2480,7 +2483,7 @@ void vvMainWindow::SelectFusionSequenceCorrespondances() {
   bool signalOK = true;
   unsigned nbFrameMain = mSlicerManagers[index]->GetImage()->GetTransform().size();
   unsigned nbFrameSecondary = mSlicerManagers[index]->GetFusionSequenceNbFrames();
-std::cout<<"nbFrameMain = "<<nbFrameMain<<", nbFrameSecondary= "<<nbFrameSecondary<<", signal size: "<<tmpVect.size()<<std::endl;
+  std::cout<<"nbFrameMain = "<<nbFrameMain<<", nbFrameSecondary= "<<nbFrameSecondary<<", signal size: "<<tmpVect.size()<<std::endl;
   std::vector<unsigned> temporalCorrespondances;
   if ( tmpVect.size() == nbFrameMain + nbFrameSecondary ) {
     for (unsigned i=0 ; i<tmpVect.size() ; i++) {
@@ -2516,7 +2519,7 @@ std::cout<<"nbFrameMain = "<<nbFrameMain<<", nbFrameSecondary= "<<nbFrameSeconda
 //when this function is called index is the slicer manager index corresponding to the main sequence (CT)
 //the files behind fileNames points to the data for the secondary sequence
 void vvMainWindow::AddFusionSequence(int index, std::vector<std::string> fileNames, vvImageReader::LoadedImageType type)
-{
+{ //out << __func__ << endl;
   QString file(fileNames[0].c_str());
   if (QFile::exists(file))
   {
@@ -2637,7 +2640,7 @@ void vvMainWindow::AddFusionSequence(int index, std::vector<std::string> fileNam
 //------------------------------------------------------------------------------
 //fusionSequenceFrameIndex and fusionSequenceNbFrames are relative to the secondary sequence (US)
 void vvMainWindow::SetFusionSequenceProperty(int fusionSequenceFrameIndex, bool spatialSyncFlag, unsigned int fusionSequenceNbFrames, bool temporalSyncFlag)
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
 
   if (!mSlicerManagers[index]->IsInvolvedInFusionSequence()) return;
@@ -2717,7 +2720,7 @@ void vvMainWindow::SetFusionSequenceProperty(int fusionSequenceFrameIndex, bool
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveAs()
-{
+{ //out << __func__ << endl;
   if (DataTree->selectedItems()[0]->data(1,Qt::UserRole).toString() == "vector") {
     QMessageBox::warning(this,tr("Unsupported type"),tr("Sorry, saving a vector field is unsupported for the moment"));
     return;
@@ -2821,7 +2824,7 @@ void vvMainWindow::SaveAs()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveCurrentState()
-{
+{ //out << __func__ << endl;
   QString Extensions = "XML Files(*.xml)";
   QString fileName = QFileDialog::getSaveFileName(this,
     tr("Save Current Window State"),
@@ -2834,14 +2837,14 @@ void vvMainWindow::SaveCurrentState()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveCurrentStateAs(const std::string& stateFile)
-{
+{ //out << __func__ << endl;
   vvSaveState save_state;
   save_state.Run(this, stateFile);
 }
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ReadSavedState()
-{
+{ //out << __func__ << endl;
   QString Extensions = "XML Files(*.xml)";
   QString fileName = QFileDialog::getOpenFileName(this,
     tr("Load Window State"),
@@ -2854,7 +2857,7 @@ void vvMainWindow::ReadSavedState()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ReadSavedStateFile(const std::string& stateFile)
-{
+{ //out << __func__ << endl;
   vvReadState read_state;
   read_state.Run(this, stateFile);
 }
@@ -2862,13 +2865,13 @@ void vvMainWindow::ReadSavedStateFile(const std::string& stateFile)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::LinkAllImages()
-{
+{ //out << __func__ << endl;
   linkPanel->linkAll();
 }
 
 //------------------------------------------------------------------------------
 void vvMainWindow::AddLink(QString image1,QString image2,bool fromPanel)
-{
+{ //out << __func__ << endl;
   if (!fromPanel) {
     // delegate to linkPanel if call came from elsewhere...
     linkPanel->addLinkFromIds(image1, image2);
@@ -2902,7 +2905,7 @@ void vvMainWindow::AddLink(QString image1,QString image2,bool fromPanel)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::RemoveLink(QString image1,QString image2)
-{
+{ //out << __func__ << endl;
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
     if (image1.toStdString() == mSlicerManagers[i]->GetId()) {
       mSlicerManagers[i]->RemoveLink(image2.toStdString());
@@ -2916,7 +2919,7 @@ void vvMainWindow::RemoveLink(QString image1,QString image2)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, int offset)
-{
+{ //out << __func__ << endl;
   if(mSlicerManagers.size()==1)
     return;
 
@@ -2932,7 +2935,7 @@ void vvMainWindow::ChangeImageWithIndexOffset(vvSlicerManager *sm, int slicer, i
 }
 //------------------------------------------------------------------------------
 void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index)
-{
+{ //out << __func__ << endl;
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
     if (DataTree->topLevelItem(i)->data(column,Qt::CheckStateRole).toInt() > 1) {
       //i is the SlicerManager that is in charge of this slicer.
@@ -2969,7 +2972,7 @@ void vvMainWindow::HorizontalSliderMoved(int value,int column, int slicer_index)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::NOHorizontalSliderMoved()
-{
+{ //out << __func__ << endl;
   // if (mCurrentTime == NOHorizontalSlider->value()) return;
   HorizontalSliderMoved(NOHorizontalSlider->value(),COLUMN_UL_VIEW,0);
   //  mCurrentTime = NOHorizontalSlider->value();
@@ -2979,7 +2982,7 @@ void vvMainWindow::NOHorizontalSliderMoved()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::NEHorizontalSliderMoved()
-{
+{ //out << __func__ << endl;
   // if (mCurrentTime == NEHorizontalSlider->value()) return;
   HorizontalSliderMoved(NEHorizontalSlider->value(),COLUMN_UR_VIEW,1);
   //  mCurrentTime = NEHorizontalSlider->value();
@@ -2989,7 +2992,7 @@ void vvMainWindow::NEHorizontalSliderMoved()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SOHorizontalSliderMoved()
-{
+{ //out << __func__ << endl;
   // if (mCurrentTime == SOHorizontalSlider->value()) return;
   HorizontalSliderMoved(SOHorizontalSlider->value(),COLUMN_DL_VIEW,2);
   // mCurrentTime = SOHorizontalSlider->value();
@@ -2999,7 +3002,7 @@ void vvMainWindow::SOHorizontalSliderMoved()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SEHorizontalSliderMoved()
-{
+{ //out << __func__ << endl;
   // if (mCurrentTime == SEHorizontalSlider->value()) return;
   HorizontalSliderMoved(SEHorizontalSlider->value(),COLUMN_DR_VIEW,3);
   // mCurrentTime = SEHorizontalSlider->value();
@@ -3008,7 +3011,7 @@ void vvMainWindow::SEHorizontalSliderMoved()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::NOVerticalSliderChanged()
-{
+{ //out << __func__ << endl;
   static int value=-1;
   if (value == NOVerticalSlider->value()) return;
   else value = NOVerticalSlider->value();
@@ -3034,7 +3037,7 @@ void vvMainWindow::NOVerticalSliderChanged()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::NEVerticalSliderChanged()
-{
+{ //out << __func__ << endl;
   static int value=-1;
   if (value == NEVerticalSlider->value()) return;
   else value = NEVerticalSlider->value();
@@ -3056,7 +3059,7 @@ void vvMainWindow::NEVerticalSliderChanged()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SOVerticalSliderChanged()
-{
+{ //out << __func__ << endl;
   static int value=-1;
   if (value == SOVerticalSlider->value()) return;
   else value = SOVerticalSlider->value();
@@ -3079,7 +3082,7 @@ void vvMainWindow::SOVerticalSliderChanged()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SEVerticalSliderChanged()
-{
+{ //out << __func__ << endl;
   static int value=-1;
   if (value == SEVerticalSlider->value()) return;
   else value = SEVerticalSlider->value();
@@ -3101,7 +3104,7 @@ void vvMainWindow::SEVerticalSliderChanged()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateSlice(int slicer, int slice)
-{
+{ //out << __func__ << endl;
   // DD("vvMainWindow::UpdateSlice");
   //   DD(slicer);
   //   DD(slice);
@@ -3127,7 +3130,7 @@ void vvMainWindow::UpdateSlice(int slicer, int slice)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateTSlice(int slicer, int slice, int code)
-{
+{ //out << __func__ << endl;
   //FusionSequence: the slider value should be updated for slicers which show the same sequence as requested
   bool doUpdate=false;
   if (code==-1) doUpdate=true;
@@ -3166,7 +3169,7 @@ void vvMainWindow::UpdateTSlice(int slicer, int slice, int code)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int tmax)
-{
+{ //out << __func__ << endl;
   //int position = int((min+max)/2);
   int position = mSlicerManagers[mCurrentPickedImageIndex]->GetSlicer(slicer)->GetSlice();
   if (slicer == 0) {
@@ -3192,7 +3195,7 @@ void vvMainWindow::UpdateSliceRange(int slicer, int min, int max, int tmin, int
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveNOScreenshot()
-{
+{ //out << __func__ << endl;
   SaveScreenshot(NOViewWidget);
 }
 //------------------------------------------------------------------------------
@@ -3200,7 +3203,7 @@ void vvMainWindow::SaveNOScreenshot()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveNEScreenshot()
-{
+{ //out << __func__ << endl;
   SaveScreenshot(NEViewWidget);
 }
 //------------------------------------------------------------------------------
@@ -3208,7 +3211,7 @@ void vvMainWindow::SaveNEScreenshot()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveSOScreenshot()
-{
+{ //out << __func__ << endl;
   SaveScreenshot(SOViewWidget);
 }
 //------------------------------------------------------------------------------
@@ -3216,7 +3219,7 @@ void vvMainWindow::SaveSOScreenshot()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveSEScreenshot()
-{
+{ //out << __func__ << endl;
   SaveScreenshot(SEViewWidget);
 }
 //------------------------------------------------------------------------------
@@ -3224,7 +3227,7 @@ void vvMainWindow::SaveSEScreenshot()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveScreenshotAllSlices()
-{
+{ //out << __func__ << endl;
   QVTKWidget *widget = NOViewWidget;
 
   int index = 0;// GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
@@ -3265,7 +3268,11 @@ void vvMainWindow::SaveScreenshotAllSlices()
     fn = itksys::SystemTools::GetFilenamePath(filename.toStdString()) + "/"+ fn
       + "_" + num + itksys::SystemTools::GetFilenameLastExtension(filename.toStdString());
     writer->SetFileName(fn.c_str());
+#if VTK_MAJOR_VERSION <= 5
     writer->SetInput(windowToImageFilter->GetOutput());
+#else
+    writer->SetInputData(windowToImageFilter->GetOutput());
+#endif
     writer->Write();
   }
 }
@@ -3274,7 +3281,7 @@ void vvMainWindow::SaveScreenshotAllSlices()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
-{
+{ //out << __func__ << endl;
   QString Extensions = "Images( *.png);;";
   Extensions += "Images( *.jpg);;";
   Extensions += "Images( *.bmp);;";
@@ -3319,7 +3326,11 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
 
     // Snapshot image if not null
     if(imgwriter!=NULL) {
+#if VTK_MAJOR_VERSION <= 5
       imgwriter->SetInput(image);
+#else
+      imgwriter->SetInputData(image);
+#endif
       imgwriter->SetFileName(fileName.toStdString().c_str());
       imgwriter->Write();
       return;
@@ -3334,13 +3345,13 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
 
       // FPS
       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, 1000, 1, &ok);
       if(ok)
         gif->SetRate(fps);
 
       // Loops
-      int loops = QInputDialog::getInteger(this, tr("Loops"),
+      int loops = QInputDialog::getInt(this, tr("Loops"),
         tr("Number of loops (0 means infinite):"), 0, 0, 1000000000, 1, &ok);
       if(ok)
         gif->SetLoops(loops);
@@ -3389,7 +3400,11 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
 
     // Take video if not null
     if(vidwriter!=NULL){
+#if VTK_MAJOR_VERSION <= 5
       vidwriter->SetInput(image);
+#else
+      vidwriter->SetInputData(image);
+#endif
       vidwriter->SetFileName(fileName.toStdString().c_str());
       vidwriter->Start();
       int nSlice = mSlicerManagers[smIndex]->GetSlicer(0)->GetTMax();
@@ -3398,7 +3413,11 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
         vtkSmartPointer<vtkWindowToImageFilter> w2i = vtkSmartPointer<vtkWindowToImageFilter>::New();
         w2i->SetInput(widget->GetRenderWindow());
         w2i->Update();
+#if VTK_MAJOR_VERSION <= 5
         vidwriter->SetInput(w2i->GetOutput());
+#else
+        vidwriter->SetInputData(w2i->GetOutput());
+#endif
         vidwriter->Write();
       }
       vidwriter->End();
@@ -3414,7 +3433,7 @@ void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
 
 //------------------------------------------------------------------------------
 void vvMainWindow::GoToCursor()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   for (int column = 1; column < 5; column++) {
     if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) {
@@ -3431,7 +3450,7 @@ void vvMainWindow::GoToCursor()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::GoToLandmark()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
   for (int column = 1; column < 5; column++) {
     if (DataTree->selectedItems()[0]->data(column,Qt::CheckStateRole).toInt() > 1) {
@@ -3448,7 +3467,7 @@ void vvMainWindow::GoToLandmark()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::PlayPause()
-{
+{ //out << __func__ << endl;
   if (playMode) {
     playMode = 0;
     playButton->setIcon(QIcon(QString::fromUtf8(":/common/icons/player_play.png")));
@@ -3473,7 +3492,7 @@ void vvMainWindow::PlayPause()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::PlayNext()
-{
+{ //out << __func__ << endl;
   if (playMode && !this->isHidden()) {
     int image_number=DataTree->topLevelItemCount();
     ///Only play one slicer per SM, and only if the SM is being displayed
@@ -3490,7 +3509,7 @@ void vvMainWindow::PlayNext()
 //------------------------------------------------------------------------------
 
 void vvMainWindow::ShowLastImage()
-{
+{ //out << __func__ << endl;
   if (mSlicerManagers.size() > 1) {
     QTreeWidgetItem * item=DataTree->topLevelItem(DataTree->topLevelItemCount()-1);
     CurrentImageChanged(mSlicerManagers.back()->GetId()); //select new image
@@ -3501,7 +3520,7 @@ void vvMainWindow::ShowLastImage()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateRenderWindows()
-{
+{ //out << __func__ << endl;
   for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
     mSlicerManagers[i]->GetSlicer(0)->UpdateLandmarks();
     mSlicerManagers[i]->GetSlicer(1)->UpdateLandmarks();
@@ -3517,7 +3536,7 @@ void vvMainWindow::UpdateRenderWindows()
 
 //------------------------------------------------------------------------------
 void vvMainWindow::SegmentationOnCurrentImage()
-{
+{ //out << __func__ << endl;
   int index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
 
   vvSegmentationDialog segmentation;
@@ -3527,7 +3546,7 @@ void vvMainWindow::SegmentationOnCurrentImage()
 //------------------------------------------------------------------------------
 
 void vvMainWindow::SurfaceViewerLaunch()
-{
+{ //out << __func__ << endl;
   vvSurfaceViewerDialog surfaceViewer;
   surfaceViewer.exec();
 }
@@ -3536,7 +3555,7 @@ void vvMainWindow::SurfaceViewerLaunch()
 
 //------------------------------------------------------------------------------
 int vvMainWindow::GetImageDuplicateFilenameNumber(std::string filename)
-{
+{ //out << __func__ << endl;
   int number=0;
   for(unsigned int l=0; l<mSlicerManagers.size(); l++) {
     vvSlicerManager * v = mSlicerManagers[l];
@@ -3552,7 +3571,7 @@ int vvMainWindow::GetImageDuplicateFilenameNumber(std::string filename)
 
 //------------------------------------------------------------------------------
 vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filename)
-{
+{ //out << __func__ << endl;
   // Change filename if another image exist with the same name
   int number = GetImageDuplicateFilenameNumber(filename);
 
@@ -3650,7 +3669,7 @@ vvSlicerManager* vvMainWindow::AddImage(vvImage::Pointer image,std::string filen
 
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateCurrentSlicer()
-{
+{ //out << __func__ << endl;
   int index = -1;
   if (DataTree->selectedItems().size() > 0) {
     index = GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
index 5b11d48e2d65e1a0bc8a9edb52384127a7e4c55d..fd4faa84018f067ceffc71f137c1fd084f9aa649 100644 (file)
@@ -31,6 +31,7 @@
 #include <itksys/SystemTools.hxx>
 
 // vtk
+#include <vtkVersion.h>
 #include <vtkSmartPointer.h>
 #include <vtkFloatArray.h>
 #include <vtkPointData.h>
@@ -135,6 +136,7 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude)
     double *bounds=mesh->GetBounds();
 
     vtkSmartPointer<vtkImageData> binary_image=vtkSmartPointer<vtkImageData>::New();
+#if VTK_MAJOR_VERSION <= 5
     binary_image->SetScalarTypeToUnsignedChar();
     ///Use the smallest mask in which the mesh fits
     // Add two voxels on each side to make sure the mesh fits
@@ -151,6 +153,23 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude)
                             0,ceil((bounds[3]-origin[1])/spacing[1]+4),
                             0,ceil((bounds[5]-origin[2])/spacing[2])+4);
     binary_image->AllocateScalars();
+#else
+    ///Use the smallest mask in which the mesh fits
+    // Add two voxels on each side to make sure the mesh fits
+    double * samp_origin=sample->GetOrigin();
+    double * spacing=sample->GetSpacing();
+    binary_image->SetSpacing(spacing);
+
+    /// Put the origin on a voxel to avoid small skips
+    binary_image->SetOrigin(floor((bounds[0]-samp_origin[0])/spacing[0]-2)*spacing[0]+samp_origin[0],
+                            floor((bounds[2]-samp_origin[1])/spacing[1]-2)*spacing[1]+samp_origin[1],
+                            floor((bounds[4]-samp_origin[2])/spacing[2]-2)*spacing[2]+samp_origin[2]);
+    double * origin=binary_image->GetOrigin();
+    binary_image->SetExtent(0,ceil((bounds[1]-origin[0])/spacing[0]+4),
+                            0,ceil((bounds[3]-origin[1])/spacing[1]+4),
+                            0,ceil((bounds[5]-origin[2])/spacing[2])+4);
+    binary_image->AllocateScalars(VTK_UNSIGNED_CHAR, 1);
+#endif
     memset(binary_image->GetScalarPointer(),0,binary_image->GetDimensions()[0]*binary_image->GetDimensions()[1]*binary_image->GetDimensions()[2]*sizeof(unsigned char));
 
 
@@ -162,16 +181,34 @@ void vvMesh::ComputeMasks(vtkImageData* sample,bool extrude)
 
     if (extrude) {
       vtkSmartPointer<vtkLinearExtrusionFilter> extrude=vtkSmartPointer<vtkLinearExtrusionFilter>::New();
+#if VTK_MAJOR_VERSION <= 5
       extrude->SetInput(mesh);
+#else
+      extrude->SetInputData(mesh);
+#endif
       ///We extrude in the -slice_spacing direction to respect the FOCAL convention
       extrude->SetVector(0, 0, -slice_spacing);
+#if VTK_MAJOR_VERSION <= 5
       sts->SetInput(extrude->GetOutput());
-    } else
+#else
+      sts->SetInputData(extrude->GetOutput());
+#endif
+    } else {
+#if VTK_MAJOR_VERSION <= 5
       sts->SetInput(mesh);
+#else
+      sts->SetInputData(mesh);
+#endif
+   }
 
     vtkSmartPointer<vtkImageStencil> stencil=vtkSmartPointer<vtkImageStencil>::New();
+#if VTK_MAJOR_VERSION <= 5
     stencil->SetStencil(sts->GetOutput());
     stencil->SetInput(binary_image);
+#else
+    stencil->SetStencilData(sts->GetOutput());
+    stencil->SetInputData(binary_image);
+#endif
     stencil->Update();
     this->AddMask(stencil->GetOutput());
 
@@ -189,7 +226,11 @@ void vvMesh::ComputeMeshes()
   this->RemoveMeshes();
   for (std::vector<vtkImageData*>::iterator i=masks.begin(); i!=masks.end(); i++) {
     vtkSmartPointer<vtkMarchingCubes> marching = vtkSmartPointer<vtkMarchingCubes>::New();
+#if VTK_MAJOR_VERSION <= 5
     marching->SetInput(*i);
+#else
+    marching->SetInputData(*i);
+#endif
     marching->SetValue(0,0.5);
     marching->Update();
     this->AddMesh(marching->GetOutput());
index 4ace9bb389239a1956477d035e51a8b7e8b48c95..04ea49d70e7648404654a231b750cea03eba29fd 100644 (file)
@@ -17,6 +17,7 @@
 ===========================================================================**/
 #include "vvMeshActor.h"
 #include "clitkCommon.h"
+#include <vtkVersion.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkMarchingSquares.h>
 #include <vtkImageData.h>
@@ -45,15 +46,28 @@ void vvMeshActor::Init(vvMesh::Pointer mesh,int time_slice,vvImage::Pointer vf)
 
   mMarching=vtkMarchingSquares::New();
   mTimeSlice=time_slice;
-  if (static_cast<unsigned int>(time_slice)<mMesh->GetNumberOfMeshes())
+  if (static_cast<unsigned int>(time_slice)<mMesh->GetNumberOfMeshes()) {
+#if VTK_MAJOR_VERSION <= 5
     mMarching->SetInput(mMesh->GetMask(time_slice));
-  else
+#else
+    mMarching->SetInputData(mMesh->GetMask(time_slice));
+#endif
+  } else {
+#if VTK_MAJOR_VERSION <= 5
     mMarching->SetInput(mMesh->GetMask(0));
+#else
+    mMarching->SetInputData(mMesh->GetMask(0));
+#endif
+  }
   mMarching->SetValue(0,0.5);
   //mMarching->Update();
 
   mMapper=vtkPolyDataMapper::New();
+#if VTK_MAJOR_VERSION <= 5
   mMapper->SetInput(mMarching->GetOutput());
+#else
+  mMapper->SetInputData(mMarching->GetOutput());
+#endif
   //The following line allows to display the contour over the image
   //(http://www.nabble.com/What-happens-when-two-actors-are-at-the-same-depth--td23175458.html)
   vtkMapper::SetResolveCoincidentTopologyToPolygonOffset();
@@ -96,10 +110,19 @@ void vvMeshActor::SetCutSlice(double slice)
 void vvMeshActor::SetTimeSlice(int time)
 {
   mTimeSlice=time;
-  if (static_cast<unsigned int>(time)<mMesh->GetNumberOfMasks())
+  if (static_cast<unsigned int>(time)<mMesh->GetNumberOfMasks()) {
+#if VTK_MAJOR_VERSION <= 5
     mMarching->SetInput(mMesh->GetMask(time));
-  else
+#else
+    mMarching->SetInputData(mMesh->GetMask(time));
+#endif
+  } else {
+#if VTK_MAJOR_VERSION <= 5
     mMarching->SetInput(mMesh->GetMask(0));
+#else
+    mMarching->SetInputData(mMesh->GetMask(0));
+#endif
+ }
   SetCutSlice(mCutSlice); //We need to find the new mask cut slice,
   //since masks do not all have the same origin
 }
index d03b0ac29c69013051926ae048ddebaa51deb1ca..75afc697748c1677316d434ac4beb700efb47a3c 100644 (file)
@@ -34,6 +34,7 @@
 #endif
 
 // vtk
+#include <vtkVersion.h>
 #include <vtkSmartPointer.h>
 #include <vtkAppendPolyData.h>
 #include <vtkCellArray.h>
@@ -297,7 +298,11 @@ std::vector<vvMesh::Pointer> vvMeshReader::readSelectedContours()
                       ids[1] = (ids[0] + 1) % tpoint_number.GetValue(); //0-1,1-2,...,n-1-0
                       contour->GetLines()->InsertNextCell(2, ids);
                     }
+#if VTK_MAJOR_VERSION <= 5
                   append->AddInput(contour);
+#else
+                  append->AddInputData(contour);
+#endif
                 }
               else
                 if (contour_type == "POINT ")
index c1f821516be03f05f697cf00925bbf5040f5d5aa..44850bb158aadbd504b4d2edd3c033023e1d2ec5 100644 (file)
@@ -94,8 +94,12 @@ void vvDicomSeriesSelector::close()
 void vvDicomSeriesSelector::BrowseButtonRelease()
 {
   QFileDialog dialog(this);
+  QStringList filters;
+  filters << "DICOM files (*.dcm)"
+          << "All files (*)";
   dialog.setFileMode(QFileDialog::AnyFile);
-  dialog.setFilter("DICOM files (*.dcm); All files (*)");
+  dialog.setNameFilters(filters);
+  //dialog.setFilter(tr("DICOM files (*.dcm); All files (*)"));
   mFoldername = dialog.getExistingDirectory(this,
                 "Select a folder to find DICOM image",
                 mPreviousPath);
index 112330aca32513e1d9e373f397f4d85738c665ac..dab97ad8169474430be2415e38a415e5ffd81497 100644 (file)
@@ -20,6 +20,7 @@
 #include "vvRegisterForm.h"
 #include <QNetworkRequest>
 #include <QDir>
+#include <QUrlQuery>
 #include <QPalette>
 #include "clitkConfiguration.h"
 #include "vvConfiguration.h"
@@ -33,16 +34,19 @@ vvRegisterForm::vvRegisterForm(QUrl url, QString path, QSettings::Format format)
 
 void vvRegisterForm::sendData(){
   QUrl url2(url);
-  url2.addQueryItem("name", firstName->text().toUtf8());
-  url2.addQueryItem("lastName", lastName->text().toUtf8());
-  url2.addQueryItem("email", email->text().toUtf8());
-  url2.addQueryItem("group", group->text().toUtf8());
-  url2.addQueryItem("os", OS_NAME);
-  url2.addQueryItem("vvVersion", VV_VERSION);
-  url2.addQueryItem("architecture", ARCHITECTURE);
-  url2.addQueryItem("adressing", QString::number(sizeof(char*)*8)+"-bit");
-  url2.addQueryItem("compilationDate", QString(__DATE__) + ", " + QString(__TIME__) );
-
+  QUrlQuery url2Query;
+    
+  url2Query.addQueryItem("name", firstName->text().toUtf8());
+  url2Query.addQueryItem("lastName", lastName->text().toUtf8());
+  url2Query.addQueryItem("email", email->text().toUtf8());
+  url2Query.addQueryItem("group", group->text().toUtf8());
+  url2Query.addQueryItem("os", OS_NAME);
+  url2Query.addQueryItem("vvVersion", VV_VERSION);
+  url2Query.addQueryItem("architecture", ARCHITECTURE);
+  url2Query.addQueryItem("adressing", QString::number(sizeof(char*)*8)+"-bit");
+  url2Query.addQueryItem("compilationDate", QString(__DATE__) + ", " + QString(__TIME__) );
+  url2.setQuery(url2Query);
+  
   manager->get(QNetworkRequest(url2));
 }
 void vvRegisterForm::accept(){
index 888375eefbb2449001e80dd5300998298e421894..d4bea5baa088d8728298f9c364b995859710fa0f 100644 (file)
@@ -27,6 +27,9 @@
 #include "vvInteractorStyleNavigator.h"
 #include "vvSlicer.h"
 
+#include <vtkVersion.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkInformation.h>
 #include "vtkMarchingCubes.h"
 #include "vtkMarchingSquares.h"
 #include "vtkImageClip.h"
@@ -56,6 +59,7 @@
 #include <vtkPolyDataWriter.h>
 
 #include <QMessageBox>
+#include <QFileDialog>
 
 //====================================================================
 vvSegmentationDialog::vvSegmentationDialog(QWidget * parent, Qt::WindowFlags f)
@@ -188,14 +192,27 @@ void vvSegmentationDialog::SetImage(vvImage::Pointer image)
   clipping1Slider->setValue(range[0]);
   clipping2Slider->setValue(range[1]);
 
+#if VTK_MAJOR_VERSION <= 5
   mClipper->SetInput(mManager->GetSlicer(0)->GetInput());
+#else
+  mClipper->SetInputData(mManager->GetSlicer(0)->GetInput());
+#endif
   mSquares1->SetValue(0,clipping1Slider->value());
   mSquares2->SetValue(0,clipping2Slider->value());
+
+#if VTK_MAJOR_VERSION <= 5
   mSquares1->SetInput(mClipper->GetOutput());
   mSquares2->SetInput(mClipper->GetOutput());
 
   mSquaresMapper1->SetInput(mSquares1->GetOutput());
   mSquaresMapper2->SetInput(mSquares2->GetOutput());
+#else
+  mSquares1->SetInputData(mClipper->GetOutput());
+  mSquares2->SetInputData(mClipper->GetOutput());
+
+  mSquaresMapper1->SetInputData(mSquares1->GetOutput());
+  mSquaresMapper2->SetInputData(mSquares2->GetOutput());
+#endif
   mSquaresMapper1->ScalarVisibilityOff();
   mSquaresMapper2->ScalarVisibilityOff();
 
@@ -225,7 +242,11 @@ void vvSegmentationDialog::UpdateSlice(int slicer,int slices)
 {
   int slice = mManager->GetSlicer(0)->GetSlice();
   int tslice = mManager->GetSlicer(0)->GetTSlice();
+#if VTK_MAJOR_VERSION <= 5
   mClipper->SetInput(mManager->GetSlicer(0)->GetInput());
+#else
+  mClipper->SetInputData(mManager->GetSlicer(0)->GetInput());
+#endif
   int* extent = mManager->GetSlicer(0)->GetImageActor()->GetDisplayExtent();
   mClipper->SetOutputWholeExtent(extent[0],extent[1],extent[2],extent[3],extent[4],extent[5]);
   int i;
@@ -320,7 +341,11 @@ void vvSegmentationDialog::BinariseSurface()
   for (unsigned int numImage = 0; numImage < mManager->GetSlicer(0)->GetImage()->GetVTKImages().size(); numImage++) {
     vtkImageData* image = mManager->GetSlicer(0)->GetImage()->GetVTKImages()[numImage];
     int ext[6];
+#if VTK_MAJOR_VERSION <= 5
     image->GetWholeExtent(ext);
+#else
+    image->GetExtent(ext);
+#endif
     void *in1Ptr;
     in1Ptr = image->GetScalarPointerForExtent(ext);
 
@@ -337,17 +362,34 @@ void vvSegmentationDialog::BinariseSurface()
     outputImage->SetExtent(ext);
     outputImage->SetOrigin(image->GetOrigin());
     outputImage->SetSpacing(image->GetSpacing());
+#if VTK_MAJOR_VERSION <= 5
     outputImage->SetScalarTypeToUnsignedChar();
+#else
+    outputImage->AllocateScalars(VTK_UNSIGNED_CHAR, 1);
+#endif
     outputImage->CopyAndCastFrom(image,ext);
+#if VTK_MAJOR_VERSION <= 5
     outputImage->Update();
+#else
+    //outputImage->Update();
+#endif
 
     image->DeepCopy(outputImage);
+#if VTK_MAJOR_VERSION <= 5
     image->UpdateInformation();
     image->PropagateUpdateExtent();
+#else
+    //image->UpdateInformation();
+    //image->PropagateUpdateExtent();
+#endif
 
     vtkImageData* imageBin = vtkImageData::New();
     imageBin->DeepCopy(image);
+#if VTK_MAJOR_VERSION <= 5
     imageBin->Update();
+#else
+    //imageBin->Update();
+#endif
     mBinaireImages.push_back(imageBin);
   }
 
@@ -366,10 +408,19 @@ void vvSegmentationDialog::Erode()
   erode->SetKernelSize(mKernelValue,mKernelValue,mKernelValue);
   for (unsigned int numImage = 0; numImage < mManager->GetSlicer(0)->GetImage()->GetVTKImages().size(); numImage++) {
     vtkImageData* image = mManager->GetSlicer(0)->GetImage()->GetVTKImages()[numImage];
+#if VTK_MAJOR_VERSION <= 5
     erode->SetInput(image);
     erode->Update();
+#else
+    erode->SetInputData(image);
+    //erode->Update();
+#endif
     image->DeepCopy(erode->GetOutput());
+#if VTK_MAJOR_VERSION <= 5
     image->Update();
+#else
+    //image->Update();
+#endif
   }
   erode->Delete();
   dilateButton->setEnabled(1);
@@ -386,13 +437,26 @@ void vvSegmentationDialog::Dilate()
   dilate->SetKernelSize(mKernelValue,mKernelValue,mKernelValue);
   for (unsigned int numImage = 0; numImage < mManager->GetSlicer(0)->GetImage()->GetVTKImages().size(); numImage++) {
     vtkImageData* image = mManager->GetSlicer(0)->GetImage()->GetVTKImages()[numImage];
+#if VTK_MAJOR_VERSION <= 5
     dilate->SetInput(image);
+#else
+    dilate->SetInputData(image);
+#endif
     vtkImageData* mask = mBinaireImages[numImage];
+#if VTK_MAJOR_VERSION <= 5
     And->SetInput1(dilate->GetOutput());
     And->SetInput2(mask);
+#else
+    And->SetInput1Data(dilate->GetOutput());
+    And->SetInput2Data(mask);
+#endif
     And->Update();
     image->DeepCopy(And->GetOutput());
+#if VTK_MAJOR_VERSION <= 5
     image->Update();
+#else
+    //image->Update();
+#endif
   }
   And->Delete();
   dilate->Delete();
@@ -425,10 +489,18 @@ void vvSegmentationDialog::InsertSeed()
 
   for (unsigned int numImage = 0; numImage < mManager->GetSlicer(0)->GetImage()->GetVTKImages().size(); numImage++) {
     vtkImageData* image = mManager->GetSlicer(0)->GetImage()->GetVTKImages()[numImage];
+#if VTK_MAJOR_VERSION <= 5
     seed->SetInput(image);
+#else
+    seed->SetInputData(image);
+#endif
     seed->Update();
     image->DeepCopy(seed->GetOutput());
+#if VTK_MAJOR_VERSION <= 5
     image->Update();
+#else
+    //image->Update();
+#endif
   }
 
   seed->Delete();
@@ -444,11 +516,19 @@ void vvSegmentationDialog::ChangeDimRendering()
       m3DExtractor->SetValue(0,0.5);
       for (unsigned int numImage = 0; numImage < mManager->GetSlicer(0)->GetImage()->GetVTKImages().size(); numImage++) {
         vtkActor* actor = vtkActor::New();
+#if VTK_MAJOR_VERSION <= 5
         m3DExtractor->SetInput(mManager->GetSlicer(0)->GetImage()->GetVTKImages()[numImage]);
+#else
+        m3DExtractor->SetInputData(mManager->GetSlicer(0)->GetImage()->GetVTKImages()[numImage]);
+#endif
         m3DExtractor->Update();
 
         vtkPolyDataMapper* mapper = vtkPolyDataMapper::New();
+#if VTK_MAJOR_VERSION <= 5
         mapper->SetInput(m3DExtractor->GetOutput());
+#else
+        mapper->SetInputData(m3DExtractor->GetOutput());
+#endif
         m3DMappers.push_back(mapper);
 
         actor->SetMapper(mapper);
@@ -503,7 +583,11 @@ void vvSegmentationDialog::Save()
                        "Mesh Files (*.vtk *.vtp)");
     if (!fileName.isEmpty()) {
       vtkSmartPointer<vtkPolyDataWriter> w = vtkSmartPointer<vtkPolyDataWriter>::New();
+#if VTK_MAJOR_VERSION <= 5
       w->SetInput(m3DExtractor->GetOutput());
+#else
+      w->SetInputData(m3DExtractor->GetOutput());
+#endif
       w->SetFileName(fileName.toStdString().c_str());
       w->Write();
     }
index a3af4a39575b6be2efc1034649a8108b43099ae0..07f1fdc23a2810ba6ff88d4386adf4d6dad27fb2 100644 (file)
@@ -32,7 +32,7 @@
 #include "vtkPolyData.h"
 #include <vtkPolyDataMapper.h>
 
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QTreeWidget>
 
 //====================================================================
index dd585636c5a76227817ec14cc8ded56fd548f132..317dc0670f411f54cea1c6f9cb57139aa1c045a8 100644 (file)
 #include "vvGlyphSource.h"
 #include "vvGlyph2D.h"
 
+#include <vtkVersion.h>
+#include <vtkExtentTranslator.h>
+#include <vtkAlgorithm.h>
+#include <vtkExecutive.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkInformation.h>
 #include <vtkTextProperty.h>
 #include <vtkTextActor.h>
 #include <vtkTextSource.h>
 #include <vtkAssignAttribute.h>
 #include <vtkImageAccumulate.h>
 #include <vtkImageReslice.h>
+#include <vtkOpenGLImageSliceMapper.h>
 #if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10)
 #  include <vtkImageMapper3D.h>
 #  include <vtkImageSliceMapper.h>
 #endif
 
-vtkCxxRevisionMacro(vvSlicer, "DummyRevision");
 vtkStandardNewMacro(vvSlicer);
 static void copyExtent(int* in, int* to){
- for(int i=0; i<6; ++i) to[i]=in[i]; 
+ for(int i=0; i<6; ++i) 
+ {
+       to[i]=in[i];
+ } 
 }
 //------------------------------------------------------------------------------
 vvSlicer::vvSlicer()
-{
+{ //out << __func__ << endl;
        mFusionSequenceCode = -1;
   this->UnInstallPipeline();
   mImage = NULL;
   mReducedExtent = new int[6];
+  mRegisterExtent = new int[6];
   mCurrentTSlice = 0;
   mCurrentFusionTSlice = 0;
   mCurrentOverlayTSlice = 0;
@@ -115,7 +125,11 @@ vvSlicer::vvSlicer()
   crossCursor->SetRadius(2);
 
   pdm = vtkSmartPointer<vtkPolyDataMapper2D>::New();
+#if VTK_MAJOR_VERSION <= 5
   pdm->SetInput(crossCursor->GetOutput());
+#else
+  pdm->SetInputData(crossCursor->GetOutput());
+#endif
 
   pdmA = vtkSmartPointer<vtkActor2D>::New();
   pdmA->SetMapper(pdm);
@@ -162,7 +176,7 @@ vvSlicer::vvSlicer()
 
 //------------------------------------------------------------------------------
 vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper()
-{
+{ //out << __func__ << endl;
   return mOverlayMapper.GetPointer();
 }
 //------------------------------------------------------------------------------
@@ -170,7 +184,7 @@ vtkImageMapToWindowLevelColors* vvSlicer::GetOverlayMapper()
 
 //------------------------------------------------------------------------------
 vvBlendImageActor* vvSlicer::GetOverlayActor()
-{
+{ //out << __func__ << endl;
   return mOverlayActor.GetPointer();
 }
 //------------------------------------------------------------------------------
@@ -178,7 +192,7 @@ vvBlendImageActor* vvSlicer::GetOverlayActor()
 
 //------------------------------------------------------------------------------
 vtkImageMapToColors* vvSlicer::GetFusionMapper()
-{
+{ //out << __func__ << endl;
   return mFusionMapper.GetPointer();
 }
 //------------------------------------------------------------------------------
@@ -186,7 +200,7 @@ vtkImageMapToColors* vvSlicer::GetFusionMapper()
 
 //------------------------------------------------------------------------------
 vtkImageActor* vvSlicer::GetFusionActor()
-{
+{ //out << __func__ << endl;
   return mFusionActor.GetPointer();
 }
 //------------------------------------------------------------------------------
@@ -194,7 +208,7 @@ vtkImageActor* vvSlicer::GetFusionActor()
 
 //------------------------------------------------------------------------------
 vtkActor* vvSlicer::GetVFActor()
-{
+{ //out << __func__ << endl;
   return mVFActor.GetPointer();
 }
 //------------------------------------------------------------------------------
@@ -202,7 +216,7 @@ vtkActor* vvSlicer::GetVFActor()
 
 //------------------------------------------------------------------------------
 vtkCornerAnnotation* vvSlicer::GetAnnotation()
-{
+{ //out << __func__ << endl;
   return ca.GetPointer();
 }
 //------------------------------------------------------------------------------
@@ -210,7 +224,7 @@ vtkCornerAnnotation* vvSlicer::GetAnnotation()
 
 //------------------------------------------------------------------------------
 void vvSlicer::EnableReducedExtent(bool b)
-{
+{ //out << __func__ << endl;
   mUseReducedExtent = b;
 }
 //------------------------------------------------------------------------------
@@ -218,7 +232,7 @@ void vvSlicer::EnableReducedExtent(bool b)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetReducedExtent(int * ext)
-{
+{ //out << __func__ << endl;
   copyExtent(ext, mReducedExtent);
 }
 //------------------------------------------------------------------------------
@@ -226,7 +240,7 @@ void vvSlicer::SetReducedExtent(int * ext)
 
 //------------------------------------------------------------------------------
 void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate)
-{
+{ //out << __func__ << endl;
 
   mSurfaceCutActors.push_back(new vvMeshActor());
   if (propagate)
@@ -243,7 +257,7 @@ void vvSlicer::AddContour(vvMesh::Pointer contour,bool propagate)
 
 //------------------------------------------------------------------------------
 void vvSlicer::ToggleContourSuperposition()
-{
+{ //out << __func__ << endl;
   for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
        i!=mSurfaceCutActors.end(); i++)
     (*i)->ToggleSuperposition();
@@ -253,7 +267,7 @@ void vvSlicer::ToggleContourSuperposition()
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetCursorColor(int r,int g, int b)
-{
+{ //out << __func__ << endl;
   pdmA->GetProperty()->SetColor(r,g,b);
 }
 //------------------------------------------------------------------------------
@@ -261,7 +275,7 @@ void vvSlicer::SetCursorColor(int r,int g, int b)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetCursorVisibility(bool s)
-{
+{ //out << __func__ << endl;
   pdmA->SetVisibility(s);
 }
 //------------------------------------------------------------------------------
@@ -269,7 +283,7 @@ void vvSlicer::SetCursorVisibility(bool s)
 
 //------------------------------------------------------------------------------
 bool vvSlicer::GetCursorVisibility()
-{
+{ //out << __func__ << endl;
   return pdmA->GetVisibility();
 }
 //------------------------------------------------------------------------------
@@ -277,7 +291,7 @@ bool vvSlicer::GetCursorVisibility()
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetCornerAnnotationVisibility(bool s)
-{
+{ //out << __func__ << endl;
   ca->SetVisibility(s);
 }
 //------------------------------------------------------------------------------
@@ -285,7 +299,7 @@ void vvSlicer::SetCornerAnnotationVisibility(bool s)
 
 //------------------------------------------------------------------------------
 bool vvSlicer::GetCornerAnnotationVisibility()
-{
+{ //out << __func__ << endl;
   return ca->GetVisibility();
 }
 //------------------------------------------------------------------------------
@@ -293,24 +307,25 @@ bool vvSlicer::GetCornerAnnotationVisibility()
 
 //------------------------------------------------------------------------------
 vvSlicer::~vvSlicer()
-{
+{ //out << __func__ << endl;
   for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
        i!=mSurfaceCutActors.end(); i++)
     delete (*i);
   delete [] mReducedExtent;
+  delete [] mRegisterExtent;
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 double* vvSlicer::GetCurrentPosition()
-{
+{ //out << __func__ << endl;
   return mCurrentBeforeSlicingTransform;
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
-{
+{ //out << __func__ << endl;
   mCurrentBeforeSlicingTransform[0]=x;
   mCurrentBeforeSlicingTransform[1]=y;
   mCurrentBeforeSlicingTransform[2]=z;
@@ -322,7 +337,7 @@ void vvSlicer::SetCurrentPosition(double x, double y, double z, int t)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetImage(vvImage::Pointer image)
-{
+{ //out << __func__ << endl;
   if (image->GetVTKImages().size()) {
     mImage = image;
 
@@ -337,13 +352,26 @@ void vvSlicer::SetImage(vvImage::Pointer image)
     mConcatenatedTransform->Concatenate(mImage->GetTransform()[0]);
     mConcatenatedTransform->Concatenate(mSlicingTransform);
     mImageReslice->SetResliceTransform(mConcatenatedTransform);
+#if VTK_MAJOR_VERSION <= 5
     mImageReslice->SetInput(0, mImage->GetFirstVTKImageData());
+#else
+    mImageReslice->SetInputData(0, mImage->GetFirstVTKImageData());
+#endif
     mImageReslice->UpdateInformation();
 
+#if VTK_MAJOR_VERSION <= 5
     this->Superclass::SetInput(mImageReslice->GetOutput());
+#else
+    this->Superclass::SetInputConnection(mImageReslice->GetOutputPort());
+#endif
 
     int extent[6];
+#if VTK_MAJOR_VERSION <= 5
     this->GetInput()->GetWholeExtent(extent);
+#else
+    int* ext = mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
+    copyExtent(ext, extent);
+#endif
 
     // Prevent crash when reload -> change slice if outside extent
     if (Slice < extent[SliceOrientation*2] || Slice>=extent[SliceOrientation*2+1]) {
@@ -352,9 +380,15 @@ void vvSlicer::SetImage(vvImage::Pointer image)
 
     // Make sure that the required part image has been computed
     extent[SliceOrientation*2] = Slice;
-    extent[SliceOrientation*2+1] = Slice;
+    extent[SliceOrientation*2+1] = Slice;    
+
+#if VTK_MAJOR_VERSION <= 5
     mImageReslice->GetOutput()->SetUpdateExtent(extent);
     mImageReslice->GetOutput()->Update();
+#else
+    mImageReslice->SetUpdateExtent(extent);
+    mImageReslice->Update();
+#endif
 
     this->UpdateDisplayExtent();
 
@@ -367,7 +401,7 @@ void vvSlicer::SetImage(vvImage::Pointer image)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetOverlay(vvImage::Pointer overlay)
-{
+{ //out << __func__ << endl;
   if (overlay->GetVTKImages().size()) {
     mOverlay = overlay;
     mOverlayVisibility = true;
@@ -383,16 +417,29 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay)
     mConcatenatedOverlayTransform->Concatenate(mOverlay->GetTransform()[0]);
     mConcatenatedOverlayTransform->Concatenate(mSlicingTransform);
     mOverlayReslice->SetResliceTransform(mConcatenatedOverlayTransform);
+#if VTK_MAJOR_VERSION <= 5
     mOverlayReslice->SetInput(0, mOverlay->GetFirstVTKImageData());
+#else
+    mOverlayReslice->SetInputData(0, mOverlay->GetFirstVTKImageData());
+#endif
     mImageReslice->UpdateInformation();
+    mOverlayReslice->Update();
 
     if (!mOverlayMapper)
       mOverlayMapper = vtkSmartPointer<vtkImageMapToWindowLevelColors>::New();
+#if VTK_MAJOR_VERSION <= 5
     mOverlayMapper->SetInput(mOverlayReslice->GetOutput());
+#else
+    mOverlayMapper->SetInputData(mOverlayReslice->GetOutput());
+#endif
 
     if (!mOverlayActor) {
       mOverlayActor = vtkSmartPointer<vvBlendImageActor>::New();
+#if VTK_MAJOR_VERSION <= 5
       mOverlayActor->SetInput(mOverlayMapper->GetOutput());
+#else
+      mOverlayActor->GetMapper()->SetInputConnection(mOverlayMapper->GetOutputPort());
+#endif
       mOverlayActor->SetPickable(0);
       mOverlayActor->SetVisibility(true);
       mOverlayActor->SetOpacity(0.5);
@@ -420,7 +467,7 @@ void vvSlicer::SetOverlay(vvImage::Pointer overlay)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode)
-{
+{ //out << __func__ << endl;
        mFusionSequenceCode = fusionSequenceCode;
   if (fusion->GetVTKImages().size()) {
     mFusion = fusion;
@@ -437,8 +484,12 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode)
     mConcatenatedFusionTransform->Concatenate(mFusion->GetTransform()[0]);
     mConcatenatedFusionTransform->Concatenate(mSlicingTransform);
     mFusionReslice->SetResliceTransform(mConcatenatedFusionTransform);
+#if VTK_MAJOR_VERSION <= 5
     mFusionReslice->SetInput(0, mFusion->GetFirstVTKImageData());
-    mFusionReslice->UpdateInformation();
+#else
+    mFusionReslice->SetInputData(0, mFusion->GetFirstVTKImageData());
+#endif
+    mFusionReslice->Update();
 
     if (!mFusionMapper)
       mFusionMapper = vtkSmartPointer<vtkImageMapToColors>::New();
@@ -449,17 +500,26 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode)
     lut->SetSaturationRange(0, 0);
     lut->Build();
     mFusionMapper->SetLookupTable(lut);
+#if VTK_MAJOR_VERSION <= 5
     mFusionMapper->SetInput(mFusionReslice->GetOutput());
-
+#else
+    mFusionMapper->SetInputData(mFusionReslice->GetOutput());
+#endif
+    
     if (!mFusionActor) {
       mFusionActor = vtkSmartPointer<vtkImageActor>::New();
+#if VTK_MAJOR_VERSION <= 5
       mFusionActor->SetInput(mFusionMapper->GetOutput());
+#else
+      mFusionActor->GetMapper()->SetInputConnection(mFusionMapper->GetOutputPort());
+#endif
       mFusionActor->SetPickable(0);
       mFusionActor->SetVisibility(true);
       mFusionActor->SetOpacity(0.7);
 #if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10)
       mFusionActor->GetMapper()->BorderOn();
 #endif
+
       this->GetRenderer()->AddActor(mFusionActor);
     }
 
@@ -474,7 +534,7 @@ void vvSlicer::SetFusion(vvImage::Pointer fusion, int fusionSequenceCode)
 
 //------------------------------------------------------------------------------
 bool vvSlicer::GetActorVisibility(const std::string& actor_type, int overlay_index)
-{
+{ //out << __func__ << endl;
   bool vis = false;
   if (actor_type == "image")
     vis = mImageVisibility;
@@ -492,7 +552,7 @@ bool vvSlicer::GetActorVisibility(const std::string& actor_type, int overlay_ind
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_index ,bool vis)
-{
+{ //out << __func__ << endl;
   if (actor_type == "image")
     mImageVisibility = vis;
   else if (actor_type == "vector")
@@ -509,7 +569,7 @@ void vvSlicer::SetActorVisibility(const std::string& actor_type, int overlay_ind
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetVF(vvImage::Pointer vf)
-{
+{ //out << __func__ << endl;
   if (vf->GetVTKImages().size()) {
     mVF = vf;
     mVFVisibility = true;
@@ -519,8 +579,13 @@ void vvSlicer::SetVF(vvImage::Pointer vf)
       mVOIFilter = vtkSmartPointer<vtkExtractVOI>::New();
       mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
     }
+#if VTK_MAJOR_VERSION <= 5
     mVOIFilter->SetInput(vf->GetFirstVTKImageData());
     mAAFilter->SetInput(mVOIFilter->GetOutput());
+#else
+    mVOIFilter->SetInputData(vf->GetFirstVTKImageData());
+    mAAFilter->SetInputData(mVOIFilter->GetOutput());
+#endif
     ///This tells VTK to use the scalar (pixel) data of the image to draw the little arrows
     mAAFilter->Assign(vtkDataSetAttributes::SCALARS, vtkDataSetAttributes::VECTORS, vtkAssignAttribute::POINT_DATA);
 
@@ -533,8 +598,13 @@ void vvSlicer::SetVF(vvImage::Pointer vf)
     // Glyph the gradient vector (with arrows)
     if (!mGlyphFilter)
       mGlyphFilter = vtkSmartPointer<vvGlyph2D>::New();
+#if VTK_MAJOR_VERSION <= 5
     mGlyphFilter->SetInput(mAAFilter->GetOutput());
     mGlyphFilter->SetSource(mArrow->GetOutput());
+#else
+    mGlyphFilter->SetInputData(mAAFilter->GetOutput());
+    mGlyphFilter->SetSourceData(mArrow->GetOutput());
+#endif
     mGlyphFilter->ScalingOn();
     mGlyphFilter->SetScaleModeToScaleByVector();
     mGlyphFilter->OrientOn();
@@ -552,7 +622,11 @@ void vvSlicer::SetVF(vvImage::Pointer vf)
 
     if (!mVFMapper)
       mVFMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
+#if VTK_MAJOR_VERSION <= 5
     mVFMapper->SetInput(mGlyphFilter->GetOutput());
+#else
+    mVFMapper->SetInputData(mGlyphFilter->GetOutput());
+#endif
     mVFMapper->ImmediateModeRenderingOn();
     mVFMapper->SetLookupTable(mVFColorLUT);
 
@@ -573,7 +647,7 @@ void vvSlicer::SetVF(vvImage::Pointer vf)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
-{
+{ //out << __func__ << endl;
   mLandmarks = landmarks;
   if (landmarks) {
 
@@ -597,10 +671,17 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
 
     mLandClipper->SetClipFunction(mClipBox);
     mLandClipper->InsideOutOn();
+#if VTK_MAJOR_VERSION <= 5
     mLandClipper->SetInput(mLandmarks->GetOutput());
 
     mLandGlyph->SetSource(mCross->GetOutput());
     mLandGlyph->SetInput(mLandClipper->GetOutput());
+#else
+    mLandClipper->SetInputData(mLandmarks->GetOutput());
+
+    mLandGlyph->SetSourceData(mCross->GetOutput());
+    mLandGlyph->SetInputData(mLandClipper->GetOutput());
+#endif
     //mLandGlyph->SetIndexModeToScalar();
     //mLandGlyph->SetRange(0,1);
     //mLandGlyph->ScalingOff();
@@ -626,7 +707,7 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
 //------------------------------------------------------------------------------
 //FIXME: this function leaks memory, we should fix it someday :)
 void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
-{
+{ //out << __func__ << endl;
   if (actor_type == "vector") {
     Renderer->RemoveActor(mVFActor);
     mGlyphFilter=NULL;
@@ -659,7 +740,7 @@ void vvSlicer::RemoveActor(const std::string& actor_type, int overlay_index)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetVFSubSampling(int sub)
-{
+{ //out << __func__ << endl;
   if (mVOIFilter) {
     mVOIFilter->SetSampleRate(mSubSampling,mSubSampling,mSubSampling);
     mSubSampling = sub;
@@ -672,7 +753,7 @@ void vvSlicer::SetVFSubSampling(int sub)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetVFScale(int scale)
-{
+{ //out << __func__ << endl;
   mScale = scale;
   if (mArrow)
     mArrow->SetScale(mScale);
@@ -683,7 +764,7 @@ void vvSlicer::SetVFScale(int scale)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetVFWidth(int width)
-{
+{ //out << __func__ << endl;
   mVFWidth = width;
   if (mVFActor)
     mVFActor->GetProperty()->SetLineWidth(mVFWidth);
@@ -695,7 +776,7 @@ void vvSlicer::SetVFWidth(int width)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetVFLog(int log)
-{
+{ //out << __func__ << endl;
   mVFLog = log;
   if (mGlyphFilter) {
     mGlyphFilter->SetUseLog(mVFLog);
@@ -709,10 +790,14 @@ void vvSlicer::SetVFLog(int log)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetTSlice(int t, bool updateLinkedImages)
-{
+{ //out << __func__ << endl;
        if (!updateLinkedImages) {
                mCurrentTSlice = t;
-               mImageReslice->SetInput( mImage->GetVTKImages()[mCurrentTSlice] );
+#if VTK_MAJOR_VERSION <= 5
+                mImageReslice->SetInput( mImage->GetVTKImages()[mCurrentTSlice] );
+#else
+                mImageReslice->SetInputData( mImage->GetVTKImages()[mCurrentTSlice] );
+#endif
                // Update transform
                mConcatenatedTransform->Identity();
                mConcatenatedTransform->Concatenate(mImage->GetTransform()[mCurrentTSlice]);
@@ -720,7 +805,6 @@ void vvSlicer::SetTSlice(int t, bool updateLinkedImages)
                UpdateDisplayExtent();
                return;
        }
-
   if (t < 0)
     mCurrentTSlice = 0;
   else if ((unsigned int)t >= mImage->GetVTKImages().size())
@@ -734,16 +818,28 @@ void vvSlicer::SetTSlice(int t, bool updateLinkedImages)
   mConcatenatedTransform->Concatenate(mSlicingTransform);
 
   // Update image data
-  mImageReslice->SetInput( mImage->GetVTKImages()[mCurrentTSlice] );
+#if VTK_MAJOR_VERSION <= 5
+   mImageReslice->SetInput( mImage->GetVTKImages()[mCurrentTSlice] );
+#else
+  mImageReslice->SetInputData( mImage->GetVTKImages()[mCurrentTSlice] );
+#endif
   if (mVF && mVFActor->GetVisibility()) {
     if (mVF->GetVTKImages().size() > (unsigned int)mCurrentTSlice)
+#if VTK_MAJOR_VERSION <= 5
       mVOIFilter->SetInput(mVF->GetVTKImages()[mCurrentTSlice]);
+#else
+      mVOIFilter->SetInputData(mVF->GetVTKImages()[mCurrentTSlice]);
+#endif
   }
   //update the overlay
   if (mOverlay && mOverlayActor->GetVisibility()) {
     if (mOverlay->GetVTKImages().size() > (unsigned int)t) {
       mCurrentOverlayTSlice = t;
+#if VTK_MAJOR_VERSION <= 5
       mOverlayReslice->SetInput( mOverlay->GetVTKImages()[mCurrentOverlayTSlice] );
+#else
+      mOverlayReslice->SetInputData( mOverlay->GetVTKImages()[mCurrentOverlayTSlice] );
+#endif
 
       // Update overlay transform
       mConcatenatedOverlayTransform->Identity();
@@ -755,7 +851,11 @@ void vvSlicer::SetTSlice(int t, bool updateLinkedImages)
   if (mFusion && mFusionActor->GetVisibility() && (mFusionSequenceCode<0)) {
     if (mFusion->GetVTKImages().size() > (unsigned int)t) {
       mCurrentFusionTSlice = t;
+#if VTK_MAJOR_VERSION <= 5
       mFusionReslice->SetInput( mFusion->GetVTKImages()[mCurrentFusionTSlice]);
+#else
+      mFusionReslice->SetInputData( mFusion->GetVTKImages()[mCurrentFusionTSlice]);
+#endif
 
       // Update fusion transform
       mConcatenatedFusionTransform->Identity();
@@ -774,11 +874,15 @@ void vvSlicer::SetTSlice(int t, bool updateLinkedImages)
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetFusionSequenceTSlice(int t)
-{
+{ //out << __func__ << endl;
   if (mFusion && mFusionActor->GetVisibility() && (mFusionSequenceCode>=0)) {
     if (mFusion->GetVTKImages().size() > (unsigned int)t) {
       mCurrentFusionTSlice = t;
+#if VTK_MAJOR_VERSION <= 5
       mFusionReslice->SetInput( mFusion->GetVTKImages()[mCurrentFusionTSlice] );
+#else
+      mFusionReslice->SetInputData( mFusion->GetVTKImages()[mCurrentFusionTSlice] );
+#endif
       // Update fusion transform
       mConcatenatedFusionTransform->Identity();
       mConcatenatedFusionTransform->Concatenate(mFusion->GetTransform()[mCurrentFusionTSlice]); //not really useful...
@@ -793,14 +897,14 @@ void vvSlicer::SetFusionSequenceTSlice(int t)
 
 //------------------------------------------------------------------------------
 int vvSlicer::GetTSlice()
-{
+{ //out << __func__ << endl;
   return mCurrentTSlice;
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 int vvSlicer::GetMaxCurrentTSlice()
-{
+{ //out << __func__ << endl;
   int t = mCurrentTSlice;
   if(mOverlay)
     t = std::max(t, mCurrentOverlayTSlice);
@@ -812,24 +916,30 @@ int vvSlicer::GetMaxCurrentTSlice()
 
 //------------------------------------------------------------------------------
 int vvSlicer::GetFusionTSlice()
-{
+{ //out << __func__ << endl;
   return mCurrentFusionTSlice;
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 int vvSlicer::GetOverlayTSlice()
-{
+{ //out << __func__ << endl;
   return mCurrentOverlayTSlice;
 }
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
 void vvSlicer::SetSliceOrientation(int orientation)
-{
+{ //out << __func__ << endl;
   //if 2D image, force to watch in Axial View
   int extent[6];
-  this->GetInput()->GetWholeExtent(extent);
+#if VTK_MAJOR_VERSION <= 5
+    this->GetInput()->GetWholeExtent(extent);
+#else
+    int* ext = mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
+    copyExtent(ext, extent);
+#endif
+
   if (extent[5]-extent[4] <= 2)
     orientation = vtkImageViewer2::SLICE_ORIENTATION_XY;
 
@@ -858,7 +968,9 @@ void vvSlicer::SetSliceOrientation(int orientation)
     int *range = this->GetSliceRange();
     if (range)
       this->Slice = static_cast<int>((range[0] + range[1]) * 0.5);
-    mFirstSetSliceOrientation = false;
+#if VTK_MAJOR_VERSION <= 5
+      mFirstSetSliceOrientation = false;
+#endif
   }
   else if (this->Renderer && this->GetInput()) {
     double s = mCursor[orientation];
@@ -867,8 +979,13 @@ void vvSlicer::SetSliceOrientation(int orientation)
   }
 
   this->UpdateOrientation();
+  
   this->UpdateDisplayExtent();
-
+  
+  if (mFirstSetSliceOrientation) {
+    mFirstSetSliceOrientation = false;
+  }
+  
   if (this->Renderer && this->GetInput()) {
     double scale = this->Renderer->GetActiveCamera()->GetParallelScale();
     this->Renderer->ResetCamera();
@@ -885,11 +1002,15 @@ void vvSlicer::SetSliceOrientation(int orientation)
 // In other words, we change the grid of the reslice in the same way as the grid
 // of the displayed image in the slicing direction.
 void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice)
-{
+{ //out << __func__ << endl;
   // Reset autocrop and update output information
   reslice->SetOutputOriginToDefault();
   reslice->SetOutputSpacingToDefault();
+#if VTK_MAJOR_VERSION <= 5
   reslice->GetOutput()->UpdateInformation();
+#else
+  reslice->UpdateInformation();
+#endif
 
   // Ge new origin / spacing
   double origin[3];
@@ -919,16 +1040,23 @@ void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice)
   reslice->SetOutputOrigin(origin);
   reslice->SetOutputSpacing(spacing);
   reslice->UpdateInformation();
-  reslice->GetOutput()->UpdateInformation();
 }
 //------------------------------------------------------------------------------
 
 //----------------------------------------------------------------------------
-int * vvSlicer::GetExtent(){
+int * vvSlicer::GetExtent()
+{ //out << __func__ << endl;
   int *w_ext;
   if (mUseReducedExtent) {
     w_ext = mReducedExtent;
-  } else w_ext = GetInput()->GetWholeExtent();
+  }
+  else {
+#if VTK_MAJOR_VERSION <= 5
+    w_ext = GetInput()->GetWholeExtent();
+#else
+    w_ext = mImageReslice->GetInputInformation()->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
+#endif
+  }
   return w_ext;
 }
 //----------------------------------------------------------------------------
@@ -936,7 +1064,7 @@ int * vvSlicer::GetExtent(){
 
 //----------------------------------------------------------------------------
 int vvSlicer::GetOrientation()
-{
+{ //out << __func__ << endl;
   return this->SliceOrientation;
 }
 //----------------------------------------------------------------------------
@@ -944,25 +1072,54 @@ int vvSlicer::GetOrientation()
 
 //----------------------------------------------------------------------------
 void vvSlicer::UpdateDisplayExtent()
-{
+{ //out << __func__ << endl;
   vtkImageData *input = this->GetInput();
+  
   if (!input || !this->ImageActor) {
     return;
   }
+  
+#if VTK_MAJOR_VERSION <= 5
   input->UpdateInformation();
+#endif
   this->SetSlice( this->GetSlice() ); //SR: make sure the update let the slice in extents
 
   // Local copy of extent
   int w_ext[6];
   int* ext = GetExtent();
   copyExtent(ext, w_ext);
+
   // Set slice value
+
   w_ext[ this->SliceOrientation*2   ] = this->Slice;
   w_ext[ this->SliceOrientation*2+1 ] = this->Slice;
   
   // Image actor
   this->ImageActor->SetVisibility(mImageVisibility);
+#if VTK_MAJOR_VERSION <= 5
   this->ImageActor->SetDisplayExtent(w_ext);
+#else
+  vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
+  try {
+        mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
+  } catch (const std::bad_cast& e) {
+               std::cerr << e.what() << std::endl;
+               std::cerr << "Conversion error" << std::endl;
+               return;
+  }
+  if (mFirstSetSliceOrientation) {
+    copyExtent(ext, mRegisterExtent);
+    this->ImageActor->SetDisplayExtent(w_ext); //initialisation
+  } else {
+    int w_croppingRegion[6];
+    copyExtent(mRegisterExtent, w_croppingRegion);
+    this->ImageActor->SetDisplayExtent(w_ext);
+    w_croppingRegion[ this->SliceOrientation*2   ] = this->Slice;
+    w_croppingRegion[ this->SliceOrientation*2+1 ] = this->Slice;
+    mapperOpenGL->SetCroppingRegion(w_croppingRegion);
+  }
+#endif 
+  
 #if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10)
   // Fix for bug #1882
   dynamic_cast<vtkImageSliceMapper *>(this->ImageActor->GetMapper())->SetOrientation(this->GetOrientation());
@@ -973,7 +1130,11 @@ void vvSlicer::UpdateDisplayExtent()
     AdjustResliceToSliceOrientation(mOverlayReslice);
     int overExtent[6];
     this->ConvertImageToImageDisplayExtent(input, w_ext, mOverlayReslice->GetOutput(), overExtent);
+#if VTK_MAJOR_VERSION <= 5
     bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetWholeExtent());
+#else
+    bool out = ClipDisplayedExtent(overExtent, mOverlayMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
+#endif
     mOverlayActor->SetVisibility(!out);
     mOverlayActor->SetDisplayExtent( overExtent );
 #if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10)
@@ -989,7 +1150,11 @@ void vvSlicer::UpdateDisplayExtent()
     AdjustResliceToSliceOrientation(mFusionReslice);
     int fusExtent[6];
     this->ConvertImageToImageDisplayExtent(input, w_ext, mFusionReslice->GetOutput(), fusExtent);
+#if VTK_MAJOR_VERSION <= 5
     bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetWholeExtent());
+#else
+    bool out = ClipDisplayedExtent(fusExtent, mFusionMapper->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
+#endif
     mFusionActor->SetVisibility(!out);
     mFusionActor->SetDisplayExtent( fusExtent );
 #if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10)
@@ -999,7 +1164,6 @@ void vvSlicer::UpdateDisplayExtent()
   }
   else if(mFusion)
     mFusionActor->SetVisibility(false);
-
   // Vector field actor
   double* camera = Renderer->GetActiveCamera()->GetPosition();
   double* image_bounds = ImageActor->GetBounds();
@@ -1020,9 +1184,17 @@ void vvSlicer::UpdateDisplayExtent()
   
   if (mVF && mVFVisibility) {
     int vfExtent[6];
+#if VTK_MAJOR_VERSION <= 5
     mVF->GetVTKImages()[0]->UpdateInformation();
+#else
+    //this->UpdateInformation();
+#endif
     this->ConvertImageToImageDisplayExtent(input, w_ext, mVF->GetVTKImages()[0], vfExtent);
+#if VTK_MAJOR_VERSION <= 5
     bool out = ClipDisplayedExtent(vfExtent, mVOIFilter->GetInput()->GetWholeExtent());
+#else
+    bool out = ClipDisplayedExtent(vfExtent, mVOIFilter->GetInput()->GetInformation()->Get(vtkDataObject::DATA_EXTENT()));
+#endif
     mVFActor->SetVisibility(!out);
     mVOIFilter->SetVOI(vfExtent);
     int orientation[3] = {1,1,1};
@@ -1077,7 +1249,7 @@ void vvSlicer::UpdateDisplayExtent()
 //----------------------------------------------------------------------------
 void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const int sourceExtent[6],
                                                 vtkImageData *targetImage, int targetExtent[6])
-{
+{ //out << __func__ << endl;
   double dExtents[6];
   for(unsigned int i=0; i<6; i++) {
     // From source voxel coordinates to world coordinates
@@ -1099,7 +1271,7 @@ void vvSlicer::ConvertImageToImageDisplayExtent(vtkImageData *sourceImage, const
 
 //----------------------------------------------------------------------------
 bool vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
-{
+{ //out << __func__ << endl;
   bool out = false;
   int maxBound = 6;
 
@@ -1127,7 +1299,7 @@ bool vvSlicer::ClipDisplayedExtent(int extent[6], int refExtent[6])
 
 //----------------------------------------------------------------------------
 void vvSlicer::UpdateOrientation()
-{
+{ //out << __func__ << endl;
   // Set the camera position
   vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
   if (cam) {
@@ -1157,7 +1329,7 @@ void vvSlicer::UpdateOrientation()
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetOpacity(double s)
-{
+{ //out << __func__ << endl;
   this->GetImageActor()->SetOpacity(s);
 }
 //----------------------------------------------------------------------------
@@ -1165,7 +1337,7 @@ void vvSlicer::SetOpacity(double s)
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
-{
+{ //out << __func__ << endl;
   this->Superclass::SetRenderWindow(rw);
   this->SetupInteractor(rw->GetInteractor());
   ca->SetImageActor(this->GetImageActor());
@@ -1181,8 +1353,8 @@ void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
   bounds[3] = max;
   bounds[4] = -max;
   bounds[5] = max;
-
   crossCursor->SetModelBounds(bounds);
+
   this->GetRenderer()->AddActor(pdmA);
   this->GetRenderer()->AddActor(ca);
   this->GetRenderer()->ResetCamera();
@@ -1197,7 +1369,7 @@ void vvSlicer::SetRenderWindow(int orientation, vtkRenderWindow * rw)
 
 //----------------------------------------------------------------------------
 void vvSlicer::ResetCamera()
-{
+{ //out << __func__ << endl;
   this->GetRenderer()->ResetCamera();
 }
 //----------------------------------------------------------------------------
@@ -1205,7 +1377,7 @@ void vvSlicer::ResetCamera()
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetDisplayMode(bool i)
-{
+{ //out << __func__ << endl;
        this->GetRenderer()->SetDraw(i);
        if (i) UpdateDisplayExtent();
 }
@@ -1214,7 +1386,7 @@ void vvSlicer::SetDisplayMode(bool i)
 
 //----------------------------------------------------------------------------
 void vvSlicer::FlipHorizontalView()
-{
+{ //out << __func__ << endl;
   vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
   if (cam) {
     double *position = cam->GetPosition();
@@ -1245,7 +1417,7 @@ void vvSlicer::FlipHorizontalView()
 
 //----------------------------------------------------------------------------
 void vvSlicer::FlipVerticalView()
-{
+{ //out << __func__ << endl;
   vtkCamera *cam = this->Renderer ? this->Renderer->GetActiveCamera() : NULL;
   if (cam) {
     FlipHorizontalView();
@@ -1259,7 +1431,7 @@ void vvSlicer::FlipVerticalView()
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetColorWindow(double window)
-{
+{ //out << __func__ << endl;
   vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
   if ( LUT ) {
     double level = this->GetWindowLevel()->GetLevel();
@@ -1272,7 +1444,7 @@ void vvSlicer::SetColorWindow(double window)
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetColorLevel(double level)
-{
+{ //out << __func__ << endl;
   vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
   if ( LUT ) {
     double window = this->GetWindowLevel()->GetWindow();
@@ -1285,7 +1457,7 @@ void vvSlicer::SetColorLevel(double level)
 
 //----------------------------------------------------------------------------
 double vvSlicer::GetOverlayColorWindow()
-{
+{ //out << __func__ << endl;
   if(mOverlayMapper)
     return mOverlayMapper->GetWindow();
   else
@@ -1295,7 +1467,7 @@ double vvSlicer::GetOverlayColorWindow()
 
 //----------------------------------------------------------------------------
 double vvSlicer::GetOverlayColorLevel()
-{
+{ //out << __func__ << endl;
   if(mOverlayMapper)
     return mOverlayMapper->GetLevel();
   else
@@ -1305,7 +1477,7 @@ double vvSlicer::GetOverlayColorLevel()
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetOverlayColorWindow(double window)
-{
+{ //out << __func__ << endl;
   if(mOverlayMapper)
     mOverlayMapper->SetWindow(window);
 }
@@ -1313,7 +1485,7 @@ void vvSlicer::SetOverlayColorWindow(double window)
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetOverlayColorLevel(double level)
-{
+{ //out << __func__ << endl;
   if(mOverlayMapper)
     mOverlayMapper->SetLevel(level);
 }
@@ -1322,7 +1494,7 @@ void vvSlicer::SetOverlayColorLevel(double level)
 //----------------------------------------------------------------------------
 // Returns the min an the max value in a 20%x20% region around the mouse pointer
 void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImageData *image, vtkTransform *transform)
-{
+{ //out << __func__ << endl;
   //Get mouse pointer position in view coordinates
   double corner1[3];
   double corner2[3];
@@ -1360,7 +1532,11 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImag
   }
 
   vtkSmartPointer<vtkExtractVOI> voiFilter = vtkSmartPointer<vtkExtractVOI>::New();
+#if VTK_MAJOR_VERSION <= 5
   voiFilter->SetInput(image);
+#else
+  voiFilter->SetInputData(image);
+#endif
   voiFilter->SetVOI(iLocalExtents);
   voiFilter->Update();
   if (!voiFilter->GetOutput()->GetNumberOfPoints()) {
@@ -1370,7 +1546,11 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImag
   }
 
   vtkSmartPointer<vtkImageAccumulate> accFilter = vtkSmartPointer<vtkImageAccumulate>::New();
+#if VTK_MAJOR_VERSION <= 5
   accFilter->SetInput(voiFilter->GetOutput());
+#else
+  accFilter->SetInputData(voiFilter->GetOutput());
+#endif
   accFilter->Update();
 
   min = *(accFilter->GetMin());
@@ -1380,11 +1560,11 @@ void vvSlicer::GetExtremasAroundMousePointer(double & min, double & max, vtkImag
 
 //----------------------------------------------------------------------------
 double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, double Y, double Z, int &ix, int &iy, int &iz, int component)
-{
+{ //out << __func__ << endl;
   ix = lrint(X);
   iy = lrint(Y);
   iz = lrint(Z);
-
+#if VTK_MAJOR_VERSION <= 5
   if (ix < image->GetWholeExtent()[0] ||
       ix > image->GetWholeExtent()[1] ||
       iy < image->GetWholeExtent()[2] ||
@@ -1392,16 +1572,27 @@ double vvSlicer::GetScalarComponentAsDouble(vtkImageData *image, double X, doubl
       iz < image->GetWholeExtent()[4] ||
       iz > image->GetWholeExtent()[5] )
     return std::numeric_limits<double>::quiet_NaN();
-
   image->SetUpdateExtent(ix, ix, iy, iy, iz, iz);
   image->Update();
+#else
+  if (ix < image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[0] ||
+      ix > image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[1] ||
+      iy < image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[2] ||
+      iy > image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[3] ||
+      iz < image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[4] ||
+      iz > image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[5] )
+    return std::numeric_limits<double>::quiet_NaN();
+  //image->SetUpdateExtent(ix, ix, iy, iy, iz, iz);
+  //image->Update();
+#endif
+
   return image->GetScalarComponentAsDouble(ix, iy, iz, component);
 }
 //----------------------------------------------------------------------------
 
 //----------------------------------------------------------------------------
 void vvSlicer::Render()
-{
+{ //out << __func__ << endl;
   if (this->mFusion && mFusionActor->GetVisibility() && showFusionLegend) {
     legend->SetLookupTable(this->GetFusionMapper()->GetLookupTable());
     legend->UseOpacityOn();
@@ -1414,13 +1605,13 @@ void vvSlicer::Render()
   } else legend->SetVisibility(0);
 
   if (ca->GetVisibility()) {
-    std::stringstream worldPos;
+    std::stringstream worldPos(" ");
     double pt[3];
     mConcatenatedTransform->TransformPoint(mCurrent, pt);
     double X = (pt[0] - mImage->GetVTKImages()[mCurrentTSlice]->GetOrigin()[0])/mImage->GetVTKImages()[mCurrentTSlice]->GetSpacing()[0];
     double Y = (pt[1] - mImage->GetVTKImages()[mCurrentTSlice]->GetOrigin()[1])/mImage->GetVTKImages()[mCurrentTSlice]->GetSpacing()[1];
     double Z = (pt[2] - mImage->GetVTKImages()[mCurrentTSlice]->GetOrigin()[2])/mImage->GetVTKImages()[mCurrentTSlice]->GetSpacing()[2];
-
+#if VTK_MAJOR_VERSION <= 5
     if (X >= mImage->GetVTKImages()[mCurrentTSlice]->GetWholeExtent()[0]-0.5 &&
         X <= mImage->GetVTKImages()[mCurrentTSlice]->GetWholeExtent()[1]+0.5 &&
         Y >= mImage->GetVTKImages()[mCurrentTSlice]->GetWholeExtent()[2]-0.5 &&
@@ -1446,6 +1637,33 @@ void vvSlicer::Render()
                              << mCurrentTSlice
                              << std::endl;
     }
+#else
+    if (X >= mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[0]-0.5 &&
+        X <= mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[1]+0.5 &&
+        Y >= mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[2]-0.5 &&
+        Y <= mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[3]+0.5 &&
+        Z >= mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[4]-0.5 &&
+        Z <= mImage->GetVTKImages()[mCurrentTSlice]->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[5]+0.5) {
+      
+      int ix, iy, iz;
+      double value = this->GetScalarComponentAsDouble(mImage->GetVTKImages()[mCurrentTSlice], X, Y, Z, ix, iy, iz);
+
+      if(ImageActor->GetVisibility())
+        worldPos << "data value : " << value << std::endl;
+
+      worldPos << "mm : " << lrint(mCurrentBeforeSlicingTransform[0]) << ' '
+                          << lrint(mCurrentBeforeSlicingTransform[1]) << ' '
+                          << lrint(mCurrentBeforeSlicingTransform[2]) << ' '
+                          << mCurrentTSlice
+                          << std::endl;
+      worldPos << "pixel : " << ix << ' '
+                             << iy << ' '
+                             << iz << ' '
+                             << mCurrentTSlice
+                             << std::endl;
+    
+    }
+#endif
     ca->SetText(1,worldPos.str().c_str());
 
     std::stringstream slicePos;
@@ -1460,7 +1678,7 @@ void vvSlicer::Render()
     double xCursor = (x - this->GetInput()->GetOrigin()[0])/this->GetInput()->GetSpacing()[0];
     double yCursor = (y - this->GetInput()->GetOrigin()[1])/this->GetInput()->GetSpacing()[1];
     double zCursor = (z - this->GetInput()->GetOrigin()[2])/this->GetInput()->GetSpacing()[2];
-
+#if VTK_MAJOR_VERSION <= 5    
     if (xCursor >= this->GetImageActor()->GetDisplayExtent()[0]-0.5 &&
         xCursor < this->GetImageActor()->GetDisplayExtent()[1]+0.5 &&
         yCursor >= this->GetImageActor()->GetDisplayExtent()[2]-0.5 &&
@@ -1477,18 +1695,57 @@ void vvSlicer::Render()
       crossCursor->SetFocalPoint(x,y,z);
     } else
       crossCursor->SetFocalPoint(-1,-1,z);
+    crossCursor->Update();
   }
+#else
+    vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
+    try {
+        mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(GetImageActor()->GetMapper());
+    } catch (const std::bad_cast& e) {
+               std::cerr << e.what() << std::endl;
+               std::cerr << "Conversion error" << std::endl;
+               return;
+       }
+    if (xCursor >= mapperOpenGL->GetCroppingRegion()[0]-0.5 &&
+        xCursor < mapperOpenGL->GetCroppingRegion()[1]+0.5 &&
+        yCursor >= mapperOpenGL->GetCroppingRegion()[2]-0.5 &&
+        yCursor < mapperOpenGL->GetCroppingRegion()[3]+0.5 &&
+        zCursor >= mapperOpenGL->GetCroppingRegion()[4]-0.5 &&
+        zCursor < mapperOpenGL->GetCroppingRegion()[5]+0.5 ) {
+      vtkRenderer * renderer = this->Renderer;
 
+      renderer->WorldToView(x,y,z);
+      renderer->ViewToNormalizedViewport(x,y,z);
+      renderer->NormalizedViewportToViewport(x,y);
+      renderer->ViewportToNormalizedDisplay(x,y);
+      renderer->NormalizedDisplayToDisplay(x,y);
+      crossCursor->SetFocalPoint(x,y,z);
+    } else
+      crossCursor->SetFocalPoint(-1,-1,z);
+    crossCursor->Update();
+  }
+#endif
 
   if (mOverlay && mOverlayActor->GetVisibility()) {
     if(mLinkOverlayWindowLevel) {
       mOverlayMapper->SetWindow(this->GetColorWindow());
       mOverlayMapper->SetLevel(this->GetColorLevel());
     }
+#if VTK_MAJOR_VERSION <= 5
     mOverlayMapper->GetOutput()->SetUpdateExtent(mOverlayActor->GetDisplayExtent());
-    mOverlayMapper->GetOutput()->Update();
+#else
+    mOverlayMapper->SetUpdateExtent(mOverlayActor->GetDisplayExtent());
+#endif
     mOverlayMapper->Update();
   }
+  if (mFusion && mFusionActor->GetVisibility()) {
+#if VTK_MAJOR_VERSION <= 5
+    mFusionMapper->GetOutput()->SetUpdateExtent(mFusionActor->GetDisplayExtent());
+#else
+    mFusionMapper->SetUpdateExtent(mFusionActor->GetDisplayExtent());
+#endif
+    mFusionMapper->Update();
+  }
   if (mLandMapper)
     UpdateLandmarks();
 
@@ -1499,7 +1756,7 @@ void vvSlicer::Render()
 
 //----------------------------------------------------------------------------
 void vvSlicer::UpdateCursorPosition()
-{
+{ //out << __func__ << endl;
   pdmA->SetVisibility(true);
   mCursor[0] = mCurrent[0];
   mCursor[1] = mCurrent[1];
@@ -1511,7 +1768,7 @@ void vvSlicer::UpdateCursorPosition()
 
 //----------------------------------------------------------------------------
 void vvSlicer::UpdateLandmarks()
-{
+{ //out << __func__ << endl;
   vtkPolyData *pd = static_cast<vtkPolyData*>(mLandClipper->GetInput());
   if (pd->GetPoints()) {
     //mLandGlyph->SetRange(0,1);
@@ -1554,7 +1811,7 @@ void vvSlicer::UpdateLandmarks()
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetSlice(int slice)
-{
+{ //out << __func__ << endl;
   int *range = this->GetSliceRange();
   if (range) {
     if (slice < range[0]) {
@@ -1579,7 +1836,8 @@ void vvSlicer::SetSlice(int slice)
 //----------------------------------------------------------------------------
 
 //----------------------------------------------------------------------------
-int vvSlicer::GetTMax() {
+int vvSlicer::GetTMax() 
+{ //out << __func__ << endl;
   int tmax = (int)mImage->GetVTKImages().size() - 1;
   if(mOverlay)
     tmax = std::max(tmax, (int)mOverlay->GetVTKImages().size()-1);
@@ -1589,7 +1847,7 @@ int vvSlicer::GetTMax() {
 
 //----------------------------------------------------------------------------
 void vvSlicer::SetContourSlice()
-{
+{ //out << __func__ << endl;
   if (mSurfaceCutActors.size() > 0)
     for (std::vector<vvMeshActor*>::iterator i=mSurfaceCutActors.begin();
          i!=mSurfaceCutActors.end(); i++) {
@@ -1604,7 +1862,7 @@ void vvSlicer::SetContourSlice()
 
 //----------------------------------------------------------------------------
 void vvSlicer::ForceUpdateDisplayExtent()
-{
+{ //out << __func__ << endl;
   this->UpdateDisplayExtent();
 }
 //----------------------------------------------------------------------------
@@ -1612,7 +1870,7 @@ void vvSlicer::ForceUpdateDisplayExtent()
 
 //----------------------------------------------------------------------------
 int* vvSlicer::GetDisplayExtent()
-{
+{ //out << __func__ << endl;
   return this->GetImageActor()->GetDisplayExtent();
 }
 //----------------------------------------------------------------------------
@@ -1620,14 +1878,15 @@ int* vvSlicer::GetDisplayExtent()
 
 //----------------------------------------------------------------------------
 void vvSlicer::PrintSelf(ostream& os, vtkIndent indent)
-{
+{ //out << __func__ << endl;
   this->Superclass::PrintSelf(os, indent);
 }
 //----------------------------------------------------------------------------
 
+
 //----------------------------------------------------------------------------
 void vvSlicer::SetVFColor(double r, double g, double b)
-{
+{ //out << __func__ << endl;
   double mVFColorHSV[3];
   mVFColor[0] = r;
   mVFColor[1] = g;
@@ -1640,4 +1899,21 @@ void vvSlicer::SetVFColor(double r, double g, double b)
 
   this->Render();
 }  
+//----------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
+void vvSlicer::SetRegisterExtent(int ext[6])
+{ //out << __func__ << endl;
+    copyExtent(ext, mRegisterExtent);
+}
+//----------------------------------------------------------------------------
+
+
+//----------------------------------------------------------------------------
+void vvSlicer::GetRegisterExtent(int ext[6])
+{ //out << __func__ << endl;
+    copyExtent(mRegisterExtent, ext);
+}
+//----------------------------------------------------------------------------
 
index 0bffd1f36abcc46f92d5b43a3c51aab519685e59..48d14de3c80272cdcdfccd2a2fadf359a5ace108 100644 (file)
@@ -62,7 +62,7 @@ class vvSlicer: public vtkImageViewer2
 {
 public:
   static vvSlicer *New();
-  vtkTypeRevisionMacro(vvSlicer,vtkImageViewer2);
+  vtkTypeMacro(vvSlicer,vtkImageViewer2);
   void PrintSelf(ostream& os, vtkIndent indent);
 
   void SetImage(vvImage::Pointer inputImages);
@@ -205,9 +205,12 @@ public:
     return mVFColor;
   }
   void SetVFColor(double r, double g, double b);
-
+  
   //necessary to flag the secondary sequence
   void SetFusionSequenceCode(int code) {mFusionSequenceCode=code;}
+  void SetRegisterExtent(int [6]);
+  void GetRegisterExtent(int [6]);
+  
 protected:
   vvSlicer();
   ~vvSlicer();
@@ -277,7 +280,7 @@ protected:
   double mVFColor[3];
   bool mUseReducedExtent;
   int * mReducedExtent;
-  int * mInitialExtent;
+  int * mRegisterExtent;
   bool mLinkOverlayWindowLevel;
   bool showFusionLegend;
 
index 89fd42b49fae4177e89ec0c2ee4590e38c9a6f54..d2bf5f2fc3f4437c376d877bad4ced81b868831f 100644 (file)
@@ -25,6 +25,9 @@
 #include "vvMesh.h"\r
 #include "vvBlendImageActor.h"\r
 \r
+#include <vtkVersion.h>\r
+#include <vtkStreamingDemandDrivenPipeline.h>\r
+#include <vtkInformation.h>\r
 #include <vtkImageActor.h>\r
 #include <vtkImageData.h>\r
 #include <vtkRenderWindow.h>\r
@@ -43,7 +46,7 @@
 #include <QMessageBox>\r
 //----------------------------------------------------------------------------\r
 vvSlicerManager::vvSlicerManager(int numberOfSlicers)\r
-{\r
+{ //out << __func__ << endl;\r
   mFileName = "";\r
   mId = "";\r
   mVFName = "";\r
@@ -88,7 +91,7 @@ vvSlicerManager::vvSlicerManager(int numberOfSlicers)
 \r
 //----------------------------------------------------------------------------\r
 vvSlicerManager::~vvSlicerManager()\r
-{\r
+{ //out << __func__ << endl;\r
   if (mLandmarks)\r
     delete mLandmarks;\r
 }\r
@@ -97,7 +100,7 @@ vvSlicerManager::~vvSlicerManager()
 \r
 //------------------------------------------------------------------------------\r
 void vvSlicerManager::SetFilename(std::string filename, int number)\r
-{\r
+{ //out << __func__ << endl;\r
   mFileName = filename;\r
   mFileName = vtksys::SystemTools::GetFilenameName(mFileName);\r
   mBaseFileName = vtksys::SystemTools::GetFilenameName(vtksys::SystemTools::GetFilenameWithoutLastExtension(mFileName));\r
@@ -119,7 +122,7 @@ void vvSlicerManager::SetFilename(std::string filename, int number)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::AddContour(vvMesh::Pointer contour,bool propagate)\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->AddContour(contour,propagate);\r
   }\r
@@ -129,7 +132,7 @@ void vvSlicerManager::AddContour(vvMesh::Pointer contour,bool propagate)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::ToggleContourSuperposition()\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++)\r
     mSlicers[i]->ToggleContourSuperposition();\r
 }\r
@@ -137,7 +140,7 @@ void vvSlicerManager::ToggleContourSuperposition()
 \r
 //----------------------------------------------------------------------------\r
 std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::string &actorType)\r
-{\r
+{ //out << __func__ << endl;\r
   vvImageReader *reader = NULL;\r
 \r
   if(actorType=="image")\r
@@ -168,7 +171,7 @@ std::string vvSlicerManager::GetListOfAbsoluteFilePathInOneString(const std::str
 \r
 //----------------------------------------------------------------------------\r
 bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageType type, int n, unsigned int slice)\r
-{\r
+{ //out << __func__ << endl;\r
   mType = type;\r
   if (mReader.IsNull())\r
     mReader = vvImageReader::New();\r
@@ -203,7 +206,7 @@ bool vvSlicerManager::SetImage(std::string filename, vvImageReader::LoadedImageT
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetImage(vvImage::Pointer image)\r
-{\r
+{ //out << __func__ << endl;\r
   mImage=image;\r
   for (unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetImage(image);\r
@@ -214,7 +217,7 @@ void vvSlicerManager::SetImage(vvImage::Pointer image)
 \r
 //----------------------------------------------------------------------------\r
 bool vvSlicerManager::SetImages(std::vector<std::string> filenames, vvImageReader::LoadedImageType type, int n)\r
-{\r
+{ //out << __func__ << endl;\r
   mType = type;\r
   std::string fileWithoutExtension = vtksys::SystemTools::GetFilenameWithoutExtension(filenames[0]);\r
   if (type == vvImageReader::DICOM)\r
@@ -254,7 +257,7 @@ bool vvSlicerManager::SetImages(std::vector<std::string> filenames, vvImageReade
 \r
 //----------------------------------------------------------------------------\r
 bool vvSlicerManager::SetOverlay(std::vector<std::string> filenames,int dim, std::string component, vvImageReader::LoadedImageType type)\r
-{\r
+{ //out << __func__ << endl;\r
   mOverlayName = filenames[0];\r
   mOverlayComponent = component;\r
   if (dim > mImage->GetNumberOfDimensions()) {\r
@@ -280,7 +283,7 @@ bool vvSlicerManager::SetOverlay(std::vector<std::string> filenames,int dim, std
 \r
 //----------------------------------------------------------------------------\r
 bool vvSlicerManager::SetFusion(std::vector<std::string> filenames,int dim, std::string component, vvImageReader::LoadedImageType type)\r
-{\r
+{ //out << __func__ << endl;\r
   mFusionName = filenames[0];\r
   mFusionComponent = component;\r
   if (dim > mImage->GetNumberOfDimensions()) {\r
@@ -310,7 +313,7 @@ bool vvSlicerManager::SetFusion(std::vector<std::string> filenames,int dim, std:
 //----------------------------------------------------------------------------\r
 //this function is called by vvMainWindow::AddFusionSequence for the primary sequence (CT), while the given files constitute the secondary sequence.\r
 bool vvSlicerManager::SetFusionSequence(std::vector<std::string> filenames, int dim, std::string component, vvImageReader::LoadedImageType type)\r
-{\r
+{ //out << __func__ << endl;\r
        mFusionSequenceInvolvementCode = 0;\r
 \r
        mFusionName = filenames[0];\r
@@ -359,7 +362,7 @@ bool vvSlicerManager::SetFusionSequence(std::vector<std::string> filenames, int
 \r
 //----------------------------------------------------------------------------\r
 bool vvSlicerManager::SetVF(std::string filename)\r
-{\r
+{ //out << __func__ << endl;\r
   if (mVectorReader.IsNull())\r
     mVectorReader = vvImageReader::New();\r
   mVectorReader->SetInputFilename(filename);\r
@@ -379,7 +382,7 @@ bool vvSlicerManager::SetVF(std::string filename)
 \r
 //----------------------------------------------------------------------------\r
 bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename)\r
-{\r
+{ //out << __func__ << endl;\r
   if (vf->GetNumberOfDimensions() > mImage->GetNumberOfDimensions()) {\r
     mLastError = "Sorry, vector field dimension cannot be greater then reference image.";\r
     return false;\r
@@ -406,7 +409,7 @@ bool vvSlicerManager::SetVF(vvImage::Pointer vf,std::string filename)
 \r
 //----------------------------------------------------------------------------\r
 vvSlicer* vvSlicerManager::GetSlicer(int i)\r
-{\r
+{ //out << __func__ << endl;\r
   return mSlicers[i];\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -414,7 +417,7 @@ vvSlicer* vvSlicerManager::GetSlicer(int i)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateSlicer(int num, bool state)\r
-{\r
+{ //out << __func__ << endl;\r
   if (mSlicers[num]->GetImage()) {\r
     mSlicers[num]->SetDisplayMode(state);\r
   }\r
@@ -424,7 +427,7 @@ void vvSlicerManager::UpdateSlicer(int num, bool state)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetSlicerWindow(int i, vtkRenderWindow* RW)\r
-{\r
+{ //out << __func__ << endl;\r
   mSlicers[i]->SetRenderWindow(i,RW);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -432,7 +435,7 @@ void vvSlicerManager::SetSlicerWindow(int i, vtkRenderWindow* RW)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetInteractorStyleNavigator(int i, vtkInteractorStyle* style)\r
-{\r
+{ //out << __func__ << endl;\r
   vvSlicerManagerCommand *smc = vvSlicerManagerCommand::New();\r
   smc->SM = this;\r
   smc->SetSlicerNumber(i);\r
@@ -471,7 +474,7 @@ void vvSlicerManager::SetInteractorStyleNavigator(int i, vtkInteractorStyle* sty
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::LeftButtonReleaseEvent(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   emit LeftButtonReleaseSignal(slicer);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -479,7 +482,7 @@ void vvSlicerManager::LeftButtonReleaseEvent(int slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::EmitMousePositionUpdated(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   emit MousePositionUpdatedSignal(slicer);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -487,7 +490,7 @@ void vvSlicerManager::EmitMousePositionUpdated(int slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::EmitKeyPressed(std::string KeyPress)\r
-{\r
+{ //out << __func__ << endl;\r
   emit KeyPressedSignal(KeyPress);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -495,7 +498,7 @@ void vvSlicerManager::EmitKeyPressed(std::string KeyPress)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetSliceOrientation(int slicer, int orientation)\r
-{\r
+{ //out << __func__ << endl;\r
   mSlicers[slicer]->SetSliceOrientation(orientation);\r
   emit UpdateOrientation(slicer, orientation);\r
 }\r
@@ -503,14 +506,14 @@ void vvSlicerManager::SetSliceOrientation(int slicer, int orientation)
 \r
 //----------------------------------------------------------------------------\r
 int vvSlicerManager::GetTSlice()\r
-{\r
+{ //out << __func__ << endl;\r
   return mSlicers[0]->GetTSlice();\r
 }\r
 //----------------------------------------------------------------------------\r
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetTSlice(int slice, bool updateLinkedImages)\r
-{\r
+{ //out << __func__ << endl;\r
        if (!updateLinkedImages) { //for fusionSequence, TMax / MaxCurrentTSlice are irrelevant.\r
                for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
                        mSlicers[i]->SetTSlice(slice, updateLinkedImages);\r
@@ -537,7 +540,7 @@ void vvSlicerManager::SetTSlice(int slice, bool updateLinkedImages)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetFusionSequenceTSlice(int slice)\r
-{\r
+{ //out << __func__ << endl;\r
        for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
                mSlicers[i]->SetFusionSequenceTSlice(slice);\r
                UpdateTSlice(i);\r
@@ -548,12 +551,11 @@ void vvSlicerManager::SetFusionSequenceTSlice(int slice)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetNextTSlice(int originating_slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   int t = mSlicers[0]->GetMaxCurrentTSlice();\r
   t++;\r
   if (t > mSlicers[0]->GetTMax())\r
     t = 0;\r
-  //std::cout << "vvSlicerManager::SetNextTSlice" << std::endl;\r
   emit UpdateTSlice(originating_slicer,t, mFusionSequenceInvolvementCode);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -561,12 +563,11 @@ void vvSlicerManager::SetNextTSlice(int originating_slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetPreviousTSlice(int originating_slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   int t = mSlicers[0]->GetMaxCurrentTSlice();\r
   t--;\r
   if (t < 0)\r
     t = mSlicers[0]->GetTMax();\r
-  //std::cout << "vvSlicerManager::SetPreviousTSlice" << std::endl;\r
   emit UpdateTSlice(originating_slicer,t, mFusionSequenceInvolvementCode);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -574,7 +575,7 @@ void vvSlicerManager::SetPreviousTSlice(int originating_slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::ToggleInterpolation()\r
-{\r
+{ //out << __func__ << endl;\r
   bool interpolate=!(mSlicers[0]->GetImageActor()->GetInterpolate());\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->GetImageActor()->SetInterpolate(interpolate);\r
@@ -589,7 +590,7 @@ void vvSlicerManager::ToggleInterpolation()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetTSliceInSlicer(int tslice, int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   if (tslice < 0)\r
     tslice = 0;\r
   else if (tslice > mSlicers[slicer]->GetTMax())\r
@@ -615,7 +616,7 @@ void vvSlicerManager::SetTSliceInSlicer(int tslice, int slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetColorWindow(double s)\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetColorWindow(s);\r
   }\r
@@ -624,7 +625,7 @@ void vvSlicerManager::SetColorWindow(double s)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetColorLevel(double s)\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetColorLevel(s);\r
   }\r
@@ -633,7 +634,7 @@ void vvSlicerManager::SetColorLevel(double s)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetOverlayColorWindow(double s)\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetOverlayColorWindow(s);\r
   }\r
@@ -642,7 +643,7 @@ void vvSlicerManager::SetOverlayColorWindow(double s)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetOverlayColorLevel(double s)\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetOverlayColorLevel(s);\r
   }\r
@@ -651,7 +652,7 @@ void vvSlicerManager::SetOverlayColorLevel(double s)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetLinkOverlayWindowLevel(bool b)\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetLinkOverlayWindowLevel(b);\r
   }\r
@@ -660,7 +661,7 @@ void vvSlicerManager::SetLinkOverlayWindowLevel(bool b)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetCursorAndCornerAnnotationVisibility(int s)\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetCursorVisibility(s);\r
     mSlicers[i]->SetCornerAnnotationVisibility(s);\r
@@ -670,7 +671,7 @@ void vvSlicerManager::SetCursorAndCornerAnnotationVisibility(int s)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetOpacity(int i, double factor)\r
-{\r
+{ //out << __func__ << endl;\r
   mSlicers[i]->SetOpacity(1/factor);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -678,7 +679,7 @@ void vvSlicerManager::SetOpacity(int i, double factor)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateViews(int current,int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   double p[3], pt[3];\r
   p[0] = mSlicers[slicer]->GetCurrentPosition()[0];\r
   p[1] = mSlicers[slicer]->GetCurrentPosition()[1];\r
@@ -691,7 +692,7 @@ void vvSlicerManager::UpdateViews(int current,int slicer)
     /mSlicers[slicer]->GetInput()->GetSpacing()[1];\r
   double z = (pt[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2])\r
     /mSlicers[slicer]->GetInput()->GetSpacing()[2];\r
-\r
+#if VTK_MAJOR_VERSION <= 5\r
   if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0]-0.5 &&\r
       x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1]+0.5 &&\r
       y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2]-0.5 &&\r
@@ -758,13 +759,83 @@ void vvSlicerManager::UpdateViews(int current,int slicer)
       }\r
     }\r
   }\r
+#else\r
+int extentImageReslice[6];\r
+mSlicers[slicer]->GetRegisterExtent(extentImageReslice);\r
+  if (x >= extentImageReslice[0]-0.5 &&\r
+      x <= extentImageReslice[1]+0.5 &&\r
+      y >= extentImageReslice[2]-0.5 &&\r
+      y <= extentImageReslice[3]+0.5 &&\r
+      z >= extentImageReslice[4]-0.5 &&\r
+      z <= extentImageReslice[5]+0.5) {\r
+    mSlicers[slicer]->UpdateCursorPosition();\r
+    mSlicers[slicer]->SetCursorColor(10,212,255);\r
+    mSelectedSlicer = slicer;\r
+\r
+    switch (mSlicers[slicer]->GetSliceOrientation()) {\r
+    case vtkImageViewer2::SLICE_ORIENTATION_XY:\r
+      if (mSlicers[slicer]->GetSlice() != (int)lrint(z))\r
+        mSlicers[slicer]->SetSlice((int)lrint(z));\r
+      break;\r
+\r
+    case vtkImageViewer2::SLICE_ORIENTATION_XZ:\r
+      if (mSlicers[slicer]->GetSlice() != (int)lrint(y))\r
+        mSlicers[slicer]->SetSlice((int)lrint(y));\r
+      break;\r
+\r
+    case vtkImageViewer2::SLICE_ORIENTATION_YZ:\r
+      if (mSlicers[slicer]->GetSlice() != (int)lrint(x))\r
+        mSlicers[slicer]->SetSlice((int)lrint(x));\r
+      break;\r
+    }\r
+    mSlicers[slicer]->Render();\r
+\r
+    for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
+      if (i != (unsigned int)slicer\r
+          && mSlicers[i]->GetRenderer()->GetDraw()\r
+          && mSlicers[i]->GetRenderWindow()->GetSize()[0] > 2\r
+          && mSlicers[i]->GetRenderWindow()->GetSize()[1] > 2) {\r
+        mSlicers[i]->SetCurrentPosition(p[0], p[1], p[2], mSlicers[slicer]->GetMaxCurrentTSlice());\r
+        mSlicers[i]->UpdateCursorPosition();\r
+        if (current) { //do not display corner annotation if image is the one picked\r
+          mSlicers[i]->SetCurrentPosition(-VTK_DOUBLE_MAX,-VTK_DOUBLE_MAX,\r
+                                          -VTK_DOUBLE_MAX, mSlicers[slicer]->GetMaxCurrentTSlice());\r
+          mSlicers[i]->SetCursorColor(255,10,212);\r
+        } else {\r
+          mSlicers[i]->SetCursorColor(150,10,282);\r
+        }\r
+        switch (mSlicers[i]->GetSliceOrientation()) {\r
+        case vtkImageViewer2::SLICE_ORIENTATION_XY:\r
+          if (mSlicers[i]->GetSlice() != (int)lrint(z))\r
+            mSlicers[i]->SetSlice((int)lrint(z));\r
+          break;\r
+\r
+        case vtkImageViewer2::SLICE_ORIENTATION_XZ:\r
+          if (mSlicers[i]->GetSlice() != (int)lrint(y))\r
+            mSlicers[i]->SetSlice((int)lrint(y));\r
+          break;\r
+\r
+        case vtkImageViewer2::SLICE_ORIENTATION_YZ:\r
+          if (mSlicers[i]->GetSlice() != (int)lrint(x))\r
+            mSlicers[i]->SetSlice((int)lrint(x));\r
+          break;\r
+        }\r
+        \r
+        mSlicers[i]->Render();\r
+        \r
+        UpdateSlice(i);\r
+        UpdateTSlice(i);\r
+      }\r
+    }\r
+  }\r
+#endif\r
 }\r
 //----------------------------------------------------------------------------\r
 \r
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateLinked(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   double p[3], pt[3];\r
   p[0] = mSlicers[slicer]->GetCurrentPosition()[0];\r
   p[1] = mSlicers[slicer]->GetCurrentPosition()[1];\r
@@ -773,7 +844,7 @@ void vvSlicerManager::UpdateLinked(int slicer)
   double x = (pt[0] - mSlicers[slicer]->GetInput()->GetOrigin()[0]) / mSlicers[slicer]->GetInput()->GetSpacing()[0];\r
   double y = (pt[1] - mSlicers[slicer]->GetInput()->GetOrigin()[1]) / mSlicers[slicer]->GetInput()->GetSpacing()[1];\r
   double z = (pt[2] - mSlicers[slicer]->GetInput()->GetOrigin()[2]) / mSlicers[slicer]->GetInput()->GetSpacing()[2];\r
-\r
+#if VTK_MAJOR_VERSION <= 5\r
   if (x >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0]-0.5 &&\r
       x <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1]+0.5 &&\r
       y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2]-0.5 &&\r
@@ -790,12 +861,32 @@ void vvSlicerManager::UpdateLinked(int slicer)
                }\r
     }\r
   }\r
+#else\r
+int extentImageReslice[6];\r
+mSlicers[slicer]->GetRegisterExtent(extentImageReslice);\r
+  if (x >= extentImageReslice[0]-0.5 &&\r
+      x <= extentImageReslice[1]+0.5 &&\r
+      y >= extentImageReslice[2]-0.5 &&\r
+      y <= extentImageReslice[3]+0.5 &&\r
+      z >= extentImageReslice[4]-0.5 &&\r
+      z <= extentImageReslice[5]+0.5) {\r
+    for (std::list<std::string>::const_iterator i = mLinkedId.begin(); i != mLinkedId.end(); i++) {\r
+               if (this->IsInvolvedInFusionSequence()) {\r
+                       //this SlicerManager is involved in fusionSequence => do not synchronize the times\r
+                       emit UpdateLinkManager(*i, slicer, p[0], p[1], p[2], -1);\r
+               }\r
+               else {\r
+                       emit UpdateLinkManager(*i, slicer, p[0], p[1], p[2], mSlicers[slicer]->GetMaxCurrentTSlice());\r
+               }\r
+    }\r
+  }\r
+#endif\r
 }\r
 //----------------------------------------------------------------------------\r
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateLinkedNavigation(vvSlicer *refSlicer, bool bPropagate)\r
-{\r
+{ //out << __func__ << endl;\r
   vtkCamera *refCam = refSlicer->GetRenderer()->GetActiveCamera();\r
 \r
   double refPosition[3];\r
@@ -838,7 +929,7 @@ void vvSlicerManager::UpdateLinkedNavigation(vvSlicer *refSlicer, bool bPropagat
 \r
 //----------------------------------------------------------------------------\r
 double vvSlicerManager::GetColorWindow() const\r
-{\r
+{ //out << __func__ << endl;\r
   if (mSlicers.size())\r
     return mSlicers[0]->GetColorWindow();\r
   return -1;\r
@@ -848,7 +939,7 @@ double vvSlicerManager::GetColorWindow() const
 \r
 //----------------------------------------------------------------------------\r
 double vvSlicerManager::GetColorLevel() const\r
-{\r
+{ //out << __func__ << endl;\r
   if (mSlicers.size())\r
     return mSlicers[0]->GetColorLevel();\r
   return -1;\r
@@ -857,7 +948,7 @@ double vvSlicerManager::GetColorLevel() const
 \r
 //----------------------------------------------------------------------------\r
 double vvSlicerManager::GetOverlayColorWindow() const\r
-{\r
+{ //out << __func__ << endl;\r
   if (mSlicers.size())\r
     return mSlicers[0]->GetOverlayColorWindow();\r
   return -1;\r
@@ -866,7 +957,7 @@ double vvSlicerManager::GetOverlayColorWindow() const
 \r
 //----------------------------------------------------------------------------\r
 double vvSlicerManager::GetOverlayColorLevel() const\r
-{\r
+{ //out << __func__ << endl;\r
   if (mSlicers.size())\r
     return mSlicers[0]->GetOverlayColorLevel();\r
   return -1;\r
@@ -875,7 +966,7 @@ double vvSlicerManager::GetOverlayColorLevel() const
 \r
 //----------------------------------------------------------------------------\r
 bool vvSlicerManager::GetLinkOverlayWindowLevel() const\r
-{\r
+{ //out << __func__ << endl;\r
   if (mSlicers.size())\r
     return mSlicers[0]->GetLinkOverlayWindowLevel();\r
   return -1;\r
@@ -884,7 +975,7 @@ bool vvSlicerManager::GetLinkOverlayWindowLevel() const
 \r
 //------------------------------------------------------------------------------\r
 void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType)\r
-{\r
+{ //out << __func__ << endl;\r
   if(actorType == "image")\r
     for(unsigned int i=0; i<this->GetImage()->GetTransform().size(); i++)\r
       this->GetImage()->GetTransform()[i]->Identity();\r
@@ -913,7 +1004,7 @@ void vvSlicerManager::ResetTransformationToIdentity(const std::string actorType)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::Render()\r
-{\r
+{ //out << __func__ << endl;\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->Render();\r
   }\r
@@ -923,7 +1014,7 @@ void vvSlicerManager::Render()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::GenerateDefaultLookupTable()\r
-{\r
+{ //out << __func__ << endl;\r
   SetPreset(mPreset);\r
   SetColorMap(mColorMap);\r
 }\r
@@ -932,7 +1023,7 @@ void vvSlicerManager::GenerateDefaultLookupTable()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::Reload()\r
-{\r
+{ //out << __func__ << endl;\r
   mReader->Update(mType);\r
   mImage=mReader->GetOutput();\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
@@ -949,7 +1040,7 @@ void vvSlicerManager::Reload()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::ReloadFusion()\r
-{\r
+{ //out << __func__ << endl;\r
   mFusionReader->Update(mImage->GetNumberOfDimensions(),mFusionComponent.c_str(),mType);\r
 \r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
@@ -962,7 +1053,7 @@ void vvSlicerManager::ReloadFusion()
 //----------------------------------------------------------------------------\r
 //the secondary sequence is being reloaded.\r
 void vvSlicerManager::ReloadFusionSequence()\r
-{\r
+{ //out << __func__ << endl;\r
   //  this is to keep the slice thickness, which needs to be artificially increased for visualization\r
   double sp_x, sp_y, sp_z;\r
   this->GetImage()->GetVTKImages()[0]->GetSpacing(sp_x, sp_y, sp_z);\r
@@ -999,7 +1090,7 @@ void vvSlicerManager::ReloadFusionSequence()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::ReloadOverlay()\r
-{\r
+{ //out << __func__ << endl;\r
   mOverlayReader->Update(mImage->GetNumberOfDimensions(),mOverlayComponent.c_str(),mType);\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
     mSlicers[i]->SetOverlay(mOverlayReader->GetOutput());\r
@@ -1011,7 +1102,7 @@ void vvSlicerManager::ReloadOverlay()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::ReloadVF()\r
-{\r
+{ //out << __func__ << endl;\r
   mVectorReader->Update(vvImageReader::VECTORFIELD); //deletes the old images through the VF::Init() function\r
   mVF=mVectorReader->GetOutput();\r
   for ( unsigned int i = 0; i < mSlicers.size(); i++) {\r
@@ -1024,7 +1115,7 @@ void vvSlicerManager::ReloadVF()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_index)\r
-{\r
+{ //out << __func__ << endl;\r
   if (actor_type =="overlay")\r
     mOverlayReader = NULL;\r
 \r
@@ -1048,7 +1139,7 @@ void vvSlicerManager::RemoveActor(const std::string& actor_type, int overlay_ind
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::RemoveActors()\r
-{\r
+{ //out << __func__ << endl;\r
   ///This method leaks a few objects. See RemoveActor for what a\r
   ///correct implementation would look like\r
   //DS -> probably due to the reader (now released in the\r
@@ -1063,7 +1154,7 @@ void vvSlicerManager::RemoveActors()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   //  int view = mSlicers[slicer]->GetSliceOrientation();\r
   //  int slice = mSlicers[slicer]->GetSlice();\r
   double x = mSlicers[slicer]->GetCursorPosition()[0];\r
@@ -1081,7 +1172,8 @@ void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer)
   int displayOver = 0;\r
   int displayFus = 0;\r
   double valueOver=0, valueFus=0;\r
-  if (X >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&\r
+#if VTK_MAJOR_VERSION <= 5\r
+    if (X >= mSlicers[slicer]->GetInput()->GetWholeExtent()[0] &&\r
       X <= mSlicers[slicer]->GetInput()->GetWholeExtent()[1] &&\r
       Y >= mSlicers[slicer]->GetInput()->GetWholeExtent()[2] &&\r
       Y <= mSlicers[slicer]->GetInput()->GetWholeExtent()[3] &&\r
@@ -1140,13 +1232,76 @@ void vvSlicerManager::UpdateInfoOnCursorPosition(int slicer)
     emit UpdateOverlay(displayOver,valueOver,value);\r
     emit UpdateFusion(displayFus,valueFus);\r
   }\r
+#else\r
+int extentImageReslice[6];\r
+mSlicers[slicer]->GetRegisterExtent(extentImageReslice);\r
+    if (X >= extentImageReslice[0] &&\r
+      X <= extentImageReslice[1] &&\r
+      Y >= extentImageReslice[2] &&\r
+      Y <= extentImageReslice[3] &&\r
+      Z >= extentImageReslice[4] &&\r
+      Z <= extentImageReslice[5]) {\r
+\r
+    value = this->GetScalarComponentAsDouble(mSlicers[slicer]->GetInput(), X, Y, Z);\r
+\r
+    if (mSlicers[slicer]->GetVFActor() ) {\r
+      displayVec = 1;\r
+      unsigned int currentTime = mSlicers[slicer]->GetMaxCurrentTSlice();\r
+      vtkImageData *vf = NULL;\r
+\r
+      if (mSlicers[slicer]->GetVF()->GetVTKImages().size() > currentTime)\r
+        vf = mSlicers[slicer]->GetVF()->GetVTKImages()[currentTime];\r
+      else\r
+        vf = mSlicers[slicer]->GetVF()->GetVTKImages()[0];\r
+\r
+      if (vf) {\r
+        double Xvf = (x - vf->GetOrigin()[0])/ vf->GetSpacing()[0];\r
+        double Yvf = (y - vf->GetOrigin()[1])/ vf->GetSpacing()[1];\r
+        double Zvf = (z - vf->GetOrigin()[2])/ vf->GetSpacing()[2];\r
+        xVec = this->GetScalarComponentAsDouble( vf, Xvf, Yvf, Zvf, 0);\r
+        yVec = this->GetScalarComponentAsDouble( vf, Xvf, Yvf, Zvf, 1);\r
+        zVec = this->GetScalarComponentAsDouble( vf, Xvf, Yvf, Zvf, 2);\r
+        valueVec = sqrt(xVec*xVec + yVec*yVec + zVec*zVec);\r
+      }\r
+    }\r
+    if (mSlicers[slicer]->GetOverlayActor() ) {\r
+      displayOver = 1;\r
+      vtkImageData *overlay = dynamic_cast<vtkImageData*>(mSlicers[slicer]->GetOverlayMapper()->GetInput());\r
+      double Xover = (x - overlay->GetOrigin()[0]) / overlay->GetSpacing()[0];\r
+      double Yover = (y - overlay->GetOrigin()[1]) / overlay->GetSpacing()[1];\r
+      double Zover = (z - overlay->GetOrigin()[2]) / overlay->GetSpacing()[2];\r
+      valueOver = this->GetScalarComponentAsDouble(overlay, Xover, Yover, Zover);\r
+    }\r
+\r
+       if ( mSlicers[slicer]->GetFusionActor() ) {\r
+               displayFus = 1;\r
+               vtkImageData *fusion = dynamic_cast<vtkImageData*>(mSlicers[slicer]->GetFusionMapper()->GetInput());\r
+               double Xover = (x - fusion->GetOrigin()[0]) / fusion->GetSpacing()[0];\r
+               double Yover = (y - fusion->GetOrigin()[1]) / fusion->GetSpacing()[1];\r
+               double Zover = (z - fusion->GetOrigin()[2]) / fusion->GetSpacing()[2];\r
+               valueFus = this->GetScalarComponentAsDouble(fusion, Xover, Yover, Zover);\r
+       }\r
+       else if (this->IsInvolvedInFusionSequence()) { \r
+    //if the cursor moves over the 'independent' version of the secondary sequence\r
+    //do not update the panel, just keep it as it is.\r
+               displayFus = 1;\r
+               valueFus = std::numeric_limits<double>::quiet_NaN();\r
+       }\r
+\r
+    emit UpdatePosition(mSlicers[slicer]->GetCursorVisibility(),\r
+                        x,y,z,X,Y,Z,value);\r
+    emit UpdateVector(displayVec,xVec, yVec, zVec, valueVec);\r
+    emit UpdateOverlay(displayOver,valueOver,value);\r
+    emit UpdateFusion(displayFus,valueFus);\r
+  }\r
+#endif\r
 }\r
 //----------------------------------------------------------------------------\r
 \r
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::Activated()\r
-{\r
+{ //out << __func__ << endl;\r
   emit currentImageChanged(mId);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -1154,7 +1309,7 @@ void vvSlicerManager::Activated()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::Picked()\r
-{\r
+{ //out << __func__ << endl;\r
   emit currentPickedImageChanged(mId);\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -1162,7 +1317,7 @@ void vvSlicerManager::Picked()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateWindowLevel()\r
-{\r
+{ //out << __func__ << endl;\r
   emit WindowLevelChanged();\r
 }\r
 //----------------------------------------------------------------------------\r
@@ -1170,12 +1325,11 @@ void vvSlicerManager::UpdateWindowLevel()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateSlice(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   if (mPreviousSlice[slicer] == mSlicers[slicer]->GetSlice()) {\r
     //DD("============= NOTHING");\r
     return;\r
   }\r
-  //std::cout << "vvSlicerManager::UpdateSlice " << slicer << " " << mSlicers[slicer]->GetSlice() << std::endl;\r
   emit UpdateSlice(slicer, mSlicers[slicer]->GetSlice());\r
   mSlicers[slicer]->Render(); // DS <-- I add this, this could/must be the only Render ...\r
   mPreviousSlice[slicer] = mSlicers[slicer]->GetSlice();\r
@@ -1185,7 +1339,7 @@ void vvSlicerManager::UpdateSlice(int slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateTSlice(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   int slice = mSlicers[slicer]->GetSlice();\r
 \r
   int tslice = mSlicers[slicer]->GetMaxCurrentTSlice();\r
@@ -1207,7 +1361,7 @@ void vvSlicerManager::UpdateTSlice(int slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::UpdateSliceRange(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   emit UpdateSliceRange(slicer,\r
                         mSlicers[slicer]->GetSliceRange()[0], mSlicers[slicer]->GetSliceRange()[1],\r
                         0,mSlicers[slicer]->GetTMax());\r
@@ -1216,7 +1370,7 @@ void vvSlicerManager::UpdateSliceRange(int slicer)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetSlicingPreset(SlicingPresetType preset)\r
-{\r
+{ //out << __func__ << endl;\r
   if(mSlicingPreset==preset)\r
     return;\r
 \r
@@ -1238,8 +1392,15 @@ void vvSlicerManager::SetSlicingPreset(SlicingPresetType preset)
       return;\r
     }\r
     s->ForceUpdateDisplayExtent();\r
+#if VTK_MAJOR_VERSION <= 5\r
     s->SetSlice((s->GetInput()->GetWholeExtent()[s->GetSliceOrientation()*2+1]\r
                 +s->GetInput()->GetWholeExtent()[s->GetSliceOrientation()*2])/2.0);\r
+#else\r
+    int extentImageReslice[6];\r
+    s->GetRegisterExtent(extentImageReslice);\r
+    s->SetSlice((extentImageReslice[s->GetSliceOrientation()*2+1]\r
+                +extentImageReslice[s->GetSliceOrientation()*2])/2.0);\r
+#endif\r
     s->ResetCamera();\r
     s->Render();\r
   }\r
@@ -1252,7 +1413,7 @@ void vvSlicerManager::SetSlicingPreset(SlicingPresetType preset)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetPreset(int preset)\r
-{\r
+{ //out << __func__ << endl;\r
 \r
   //vtkLookupTable* LUT = static_cast<vtkLookupTable*>(mSlicers[0]->GetWindowLevel()->GetLookupTable());\r
   double window = mSlicers[0]->GetColorWindow();\r
@@ -1311,7 +1472,7 @@ void vvSlicerManager::SetPreset(int preset)
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlKey)\r
-{\r
+{ //out << __func__ << endl;\r
   double min, max;\r
   if(bCtrlKey && this->mSlicers[slicer]->GetFusion()) {\r
     int t = mSlicers[slicer]->GetFusionTSlice();\r
@@ -1352,7 +1513,7 @@ void vvSlicerManager::SetLocalColorWindowing(const int slicer, const bool bCtrlK
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::SetColorMap(int colormap)\r
-{\r
+{ //out << __func__ << endl;\r
   double range[2];\r
 \r
   range[0] = mSlicers[0]->GetInput()->GetScalarRange()[0];\r
@@ -1451,7 +1612,6 @@ void vvSlicerManager::SetColorMap(int colormap)
 \r
     fusLUT->ForceBuild();\r
     double v[4];\r
-\r
     // set color table transparency\r
     //double alpha_range=(double)mFusionThresOpacity/10;\r
     double range_end = fusRange[0] + (double)mFusionThresOpacity*(fusRange[1] - fusRange[0])/100;\r
@@ -1507,7 +1667,7 @@ void vvSlicerManager::SetColorMap(int colormap)
 \r
 //----------------------------------------------------------------------------\r
 vvLandmarks* vvSlicerManager::GetLandmarks()\r
-{\r
+{ //out << __func__ << endl;\r
   if (mLandmarks == NULL) {\r
     mLandmarks = new vvLandmarks(mSlicers[0]->GetTMax()+1);\r
     for (unsigned int i = 0; i < mSlicers.size(); i++)\r
@@ -1520,10 +1680,11 @@ vvLandmarks* vvSlicerManager::GetLandmarks()
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::AddLandmark(float x,float y,float z,float t)\r
-{\r
+{ //out << __func__ << endl;\r
   double x_index = (x - mSlicers[0]->GetInput()->GetOrigin()[0])/mSlicers[0]->GetInput()->GetSpacing()[0];\r
   double y_index = (y - mSlicers[0]->GetInput()->GetOrigin()[1])/mSlicers[0]->GetInput()->GetSpacing()[1];\r
   double z_index = (z - mSlicers[0]->GetInput()->GetOrigin()[2])/mSlicers[0]->GetInput()->GetSpacing()[2];\r
+#if VTK_MAJOR_VERSION <= 5\r
   if (x_index >= mSlicers[0]->GetInput()->GetWholeExtent()[0]-0.5 &&\r
       x_index <= mSlicers[0]->GetInput()->GetWholeExtent()[1]+0.5 &&\r
       y_index >= mSlicers[0]->GetInput()->GetWholeExtent()[2]-0.5 &&\r
@@ -1534,26 +1695,40 @@ void vvSlicerManager::AddLandmark(float x,float y,float z,float t)
     this->GetLandmarks()->AddLandmark(x,y,z,t,value);\r
     emit LandmarkAdded();\r
   }\r
+#else\r
+  int extentImageReslice[6];\r
+  mSlicers[0]->GetRegisterExtent(extentImageReslice);\r
+  if (x_index >= extentImageReslice[0]-0.5 &&\r
+      x_index <= extentImageReslice[1]+0.5 &&\r
+      y_index >= extentImageReslice[2]-0.5 &&\r
+      y_index <= extentImageReslice[3]+0.5 &&\r
+      z_index >= extentImageReslice[4]-0.5 &&\r
+      z_index <= extentImageReslice[5]+0.5) {\r
+    double value = this->GetScalarComponentAsDouble(mSlicers[0]->GetInput(), x_index, y_index, z_index);\r
+    this->GetLandmarks()->AddLandmark(x,y,z,t,value);\r
+    emit LandmarkAdded();\r
+  }\r
+#endif\r
 }\r
 //----------------------------------------------------------------------------\r
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::PrevImage(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   emit ChangeImageWithIndexOffset(this, slicer, -1);\r
 }\r
 //----------------------------------------------------------------------------\r
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::NextImage(int slicer)\r
-{\r
+{ //out << __func__ << endl;\r
   emit ChangeImageWithIndexOffset(this, slicer,  1);\r
 }\r
 //----------------------------------------------------------------------------\r
 \r
 //----------------------------------------------------------------------------\r
 void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice)\r
-{\r
+{ //out << __func__ << endl;\r
   emit AVerticalSliderHasChanged(slicer, slice);\r
 }\r
 \r
@@ -1561,7 +1736,7 @@ void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice)
 \r
 //----------------------------------------------------------------------------\r
 double vvSlicerManager::GetScalarComponentAsDouble(vtkImageData *image, double X, double Y, double Z, int component)\r
-{\r
+{ //out << __func__ << endl;\r
   int ix, iy, iz;\r
   return mSlicers[0]->GetScalarComponentAsDouble(image, X, Y, Z, ix, iy, iz, component);\r
 }\r
index f5d2b699bd495e881d533abaad7c20a43d511c83..c737eda3b353aec1b80190709a7da66850428bd1 100644 (file)
@@ -38,7 +38,6 @@
 #include "vtkTransform.h"
 
 #include <cmath>
-
 //------------------------------------------------------------------------------
 vvSlicerManagerCommand::vvSlicerManagerCommand()
 {
index 0645ccfa95e8ea3c16d5c959a2cb35d6f7afd5e5..f50cb09ed34845c8d8172b82f227a06cd2917cbb 100644 (file)
@@ -24,7 +24,7 @@
 #include "vtkOBJReader.h"
 #include "vtkInteractorStyle.h"
 
-
+#include <vtkVersion.h>
 #include "vtkPolyDataMapper.h"
 #include "vtkActor.h"
 #include "vtkPolyData.h"
@@ -33,6 +33,7 @@
 #include "vtkRenderer.h"
 
 #include <QMessageBox>
+#include <QFileDialog>
 
 //----------------------------------------------------------------------------
 class vvManagerCallback : public vtkCommand
@@ -110,8 +111,11 @@ void vvSurfaceViewerDialog::LoadSurface()
     reader->Update();
     mReaders.push_back(reader);
   }
-
+#if VTK_MAJOR_VERSION <= 5
   mMapper->SetInput(mReaders[mCurrentTime]->GetOutput());
+#else
+  mMapper->SetInputData(mReaders[mCurrentTime]->GetOutput());
+#endif
 
   if (!mActor) {
     mActor = vtkActor::New();
@@ -140,7 +144,11 @@ void vvSurfaceViewerDialog::NextTime()
   mCurrentTime++;
   if (mCurrentTime >= mReaders.size())
     mCurrentTime = 0;
+#if VTK_MAJOR_VERSION <= 5
   mMapper->SetInput(mReaders[mCurrentTime]->GetOutput());
+#else
+  mMapper->SetInputData(mReaders[mCurrentTime]->GetOutput());
+#endif
   mMapper->Modified();
   renderWidget->GetRenderWindow()->Render();
 }
@@ -150,7 +158,11 @@ void vvSurfaceViewerDialog::PreviousTime()
   mCurrentTime--;
   if (mCurrentTime < 0)
     mCurrentTime = (unsigned int) mReaders.size() - 1;
+#if VTK_MAJOR_VERSION <= 5
   mMapper->SetInput(mReaders[mCurrentTime]->GetOutput());
+#else
+  mMapper->SetInputData(mReaders[mCurrentTime]->GetOutput());
+#endif
   mMapper->Modified();
   renderWidget->GetRenderWindow()->Render();
 }
index 88a75a6924081fd4eca777d21dbed1c311dffac6..fe9848ef77d6f91fab515ee98bf539566a5fdf9e 100644 (file)
@@ -23,7 +23,7 @@ class vtkPolyDataMapper;
 class vtkActor;
 class vtkOBJReader;
 
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QTreeWidget>
 
 //====================================================================
index 9e61e683cd284872456b3d5030fbdbef1987af90..5c47732a06b1905c88e493315d0a018fb212916d 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef VVTOOLBINARIZE_H
 #define VVTOOLBINARIZE_H
 
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 
 #include "vvToolBase.h"
 #include "vvToolWidgetBase.h"
index c3b55709722033a6445b9b3d0fb0c239ec1d5628..539e30ef9ea892727b49348220e9e9e8c2333eae 100644 (file)
@@ -33,6 +33,9 @@
 #include <QSignalMapper>
 
 // vtk
+#include <vtkVersion.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkInformation.h>
 #include <vtkImageClip.h>
 #include <vtkImageTranslateExtent.h>
 #include <vtkImageData.h>
@@ -173,8 +176,11 @@ void vvToolCropImage::InputIsSelected(vvSlicerManager * slicer)
     spin_zmin->setHidden(true);
     spin_zmax->setHidden(true);
   }
-
+#if VTK_MAJOR_VERSION <= 5
   int *a = mCurrentImage->GetFirstVTKImageData()->GetWholeExtent();
+#else
+  int *a = mCurrentImage->GetFirstVTKImageData()->GetInformation()->Get(vtkDataObject::DATA_EXTENT());
+#endif
   for(int i=0; i<6; i++){
     mInitialExtent[i] = a[i];
     mReducedExtent[i] = a[i];
index 27a334c3de83c5b7d4e3db96bc0abeda7261b182..2f2863091c2fe87fadac9b15465cd4e2c9361197 100644 (file)
@@ -19,7 +19,7 @@
 #define VVTOOLCROPIMAGE_H
 
 //qt
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QDialog>
 #include <QSlider>
 // vv
index 81919ceb0dbf8f5b013e19ae141d9c93165bef33..93d79f468924a4d7961ad9cb39c58ef8c88e5e47 100644 (file)
@@ -17,7 +17,7 @@
 ===========================================================================**/
 #ifndef VVTOOLImageArithm_H
 #define VVTOOLImageArithm_H
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 
 #include "vvToolBase.h"
 #include "vvToolWidgetBase.h"
index b33ca5c2c1775f0478bab421cfe551e2c91f54ee..ab0e05b86de559ba8282b61f09fa7a8441f516c5 100644 (file)
@@ -19,7 +19,7 @@
 #define VVTOOLINPUTSELECTORWIDGET_H
 
 // qt
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QDialog>
 
 // vv
index 6975c0e3042e947f7ad44591a11e71efdbda8c6b..4691e2eb98dd713420ccf8d937fa579452898485 100644 (file)
@@ -47,7 +47,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <vvImage.h>
 
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include "vvToolBase.h"
 #include "QWidget"
 #include "vvToolWidgetBase.h"
index 5f66395dff4dd13ea1f72416656fed2c749061fd..ef99df034b616d103958cc27bb9ed072efb9e61c 100644 (file)
@@ -45,7 +45,7 @@
   #ifndef VVTOOLMedianFilter_H
   #define VVTOOLMedianFilter_H
 
-  #include <QtDesigner/QDesignerExportWidget>
+  #include <QtUiPlugin/QDesignerExportWidget>
   #include "vvToolBase.h"
   #include "QWidget"
   #include "vvToolWidgetBase.h"
index ec69e4ee95665914fc9279888f8cca0fc5c591f9..c86b4b2018fa89496b042f7780a5b6948e03039c 100644 (file)
@@ -160,7 +160,7 @@ void  vvToolROIManager::InitializeNewTool(bool ReadStateFlag)
   }
 
   // Display tool in the correct tab
-  QWidget * tab = qFindChild<QWidget*>(mMainWindow->GetTab(), "ROItab");
+  QWidget * tab = mMainWindow->GetTab()->findChild<QWidget*>("ROItab");
   tab->layout()->addWidget(this);
 
   // If not read in a file we start automatically the browser to load
index 8ad4a1c65ece4c5393460804b03715f18248cbae..c69dc363cff92e5cafeb13d49822bb6838a486b9 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef VVTOOLROIMANAGER_H
 #define VVTOOLROIMANAGER_H
 
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QSharedPointer>
 
 #include "vvToolBase.h"
index ec56fda68cfbd40d410ae0b2f1b78c0e76c7a35f..a522e3d53984442a5a43309f59286d746fb9af75 100644 (file)
@@ -31,7 +31,7 @@
 #include "vvToolBase.h"
 
 // qt
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QTreeWidget>
 
 //------------------------------------------------------------------------------
index 29481651e21aad16311963d9557ea74155e107a1..5cc862d5aaf2b34fefac0a35b4a24cef2839f148 100644 (file)
 // vtk
 #include <vtkImageData.h>
 #include <vtkSmartPointer.h>
+#include <vtkInformation.h>
 #include <vtkTransform.h>
+#include <vtkImageActor.h>
+#include <vtkImageMapper3D.h>
+#include <vtkOpenGLImageSliceMapper.h>
 
 // itk
 #include <itkEuler3DTransform.h>
@@ -432,10 +436,116 @@ void vvToolRigidReg::GetSlidersAndSpinBoxes(std::vector<QSlider *>&transSliders,
 //------------------------------------------------------------------------------
 
 //------------------------------------------------------------------------------
-void vvToolRigidReg::Render()
+void vvToolRigidReg::ExtentMax(const double pointExtent[8][4], double maxExtent[2][3])
 {
+    double max, min;
+    for (int i=0; i<3; ++i) {
+        max = pointExtent[0][i];
+        min = pointExtent[0][i];
+        for (int j=1; j<8; ++j) {
+            if (pointExtent[j][i] > max) {
+                max = pointExtent[j][i];
+            }
+            if (pointExtent[j][i] < min) {
+                min = pointExtent[j][i];
+            }
+        }
+        maxExtent[0][i] = min;
+        maxExtent[1][i] = max;
+    }
+}
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+void vvToolRigidReg::Render()
+{ //out << __func__ << endl;
+#if VTK_MAJOR_VERSION > 5
+vtkMatrix4x4* matrix = mCurrentSlicerManager->GetImage()->GetTransform()[0]->GetMatrix();
+vtkMatrix4x4* matrixTranspose = matrix->NewInstance();
+for (int i=0; i<3; ++i) {
+    for (int j=0; j<3; ++j)
+    {
+        matrixTranspose->SetElement(i,j,matrix->GetElement(j,i));
+    }
+}
+for (int i=0; i<4; ++i) {
+   matrixTranspose->SetElement(3,i,matrix->GetElement(3,i));
+}
+for (int i=0; i<4; ++i) {
+   matrixTranspose->SetElement(i,3,matrix->GetElement(i,3));
+}
+#endif
   for (int i=0; i<mCurrentSlicerManager->GetNumberOfSlicers(); i++)
     {
+#if VTK_MAJOR_VERSION > 5 
+    double pointExtent[8][4], pointExtentUpdate[8][4];
+    std::vector<int> w_ext;
+    w_ext=mCurrentSlicerManager->GetImage()->GetSize();
+    pointExtent[0][0] = 0.0;
+       pointExtent[0][1] = 0.0;
+       pointExtent[0][2] = 0.0;
+       pointExtent[0][3] = 1.0;
+    pointExtent[1][0] = w_ext[0]-1;
+       pointExtent[1][1] = w_ext[1]-1;
+       pointExtent[1][2] = w_ext[2]-1;
+       pointExtent[1][3] = 1.0;
+       pointExtent[2][0] = 0.0;
+       pointExtent[2][1] = w_ext[1]-1;
+       pointExtent[2][2] = w_ext[2]-1;
+       pointExtent[2][3] = 1.0;
+       pointExtent[3][0] = w_ext[0]-1;
+       pointExtent[3][1] = 0.0;
+       pointExtent[3][2] = w_ext[2]-1;
+       pointExtent[3][3] = 1.0;
+       pointExtent[4][0] = w_ext[0]-1;
+       pointExtent[4][1] = w_ext[1]-1;
+       pointExtent[4][2] = 0.0;
+       pointExtent[4][3] = 1.0;
+       pointExtent[5][0] = 0.0;
+       pointExtent[5][1] = 0.0;
+       pointExtent[5][2] = w_ext[2]-1;
+       pointExtent[5][3] = 1.0;
+       pointExtent[6][0] = 0.0;
+       pointExtent[6][1] = w_ext[1]-1;
+       pointExtent[6][2] = 0.0;
+       pointExtent[6][3] = 1.0;
+       pointExtent[7][0] = w_ext[0]-1;
+       pointExtent[7][1] = 0.0;
+       pointExtent[7][2] = 0.0;
+       pointExtent[7][3] = 1.0;
+       
+       for (int k=0; k<8; ++k) {
+           for (int j=0; j<3; ++j)
+           {
+               pointExtent[k][j] = mCurrentSlicerManager->GetImage()->GetOrigin()[j] + mCurrentSlicerManager->GetImage()->GetSpacing()[j] * pointExtent[k][j];
+           }
+           matrixTranspose->MultiplyPoint(pointExtent[k], pointExtentUpdate[k]);
+               for (int j=0; j<3; ++j)
+           {
+               pointExtentUpdate[k][j] = (pointExtentUpdate[k][j] - mCurrentSlicerManager->GetImage()->GetOrigin()[j])/mCurrentSlicerManager->GetImage()->GetSpacing()[j];
+           }
+    }
+double extUpdateTemp[2][3];
+int extUpdate[6];
+ExtentMax(pointExtentUpdate, extUpdateTemp);
+for (int j=0; j<3; ++j) {
+    extUpdate[2*j] = 0;
+    extUpdate[2*j+1] = itk::Math::Round<double>(extUpdateTemp[1][j] - extUpdateTemp[0][j]);
+}
+    mCurrentSlicerManager->GetSlicer(i)->SetRegisterExtent(extUpdate);
+    extUpdate[2*mCurrentSlicerManager->GetSlicer(i)->GetOrientation()] = mCurrentSlicerManager->GetSlicer(i)->GetSlice();
+    extUpdate[2*mCurrentSlicerManager->GetSlicer(i)->GetOrientation()+1] = mCurrentSlicerManager->GetSlicer(i)->GetSlice();
+    
+    vtkSmartPointer<vtkOpenGLImageSliceMapper> mapperOpenGL= vtkSmartPointer<vtkOpenGLImageSliceMapper>::New();
+    try {
+        mapperOpenGL = dynamic_cast<vtkOpenGLImageSliceMapper*>(mCurrentSlicerManager->GetSlicer(i)->GetImageActor()->GetMapper());
+    } catch (const std::bad_cast& e) {
+               std::cerr << e.what() << std::endl;
+               std::cerr << "Conversion error" << std::endl;
+               return;
+       }
+       mapperOpenGL->SetCroppingRegion(extUpdate);
+#endif
     mCurrentSlicerManager->GetSlicer(i)->ForceUpdateDisplayExtent();
     mCurrentSlicerManager->GetSlicer(i)->Render();
     }
index 559aca5bfecb83ee3abe41c501d9648d61b9aae1..02d679b41ac033baa89b962c621e92791fc9128b 100644 (file)
@@ -55,6 +55,7 @@ protected:
   Ui::vvToolRigidReg ui;
   vvSlicerManager * mInput;
   vtkSmartPointer<vtkMatrix4x4> mInitialMatrix;
+  void ExtentMax(const double [8][4], double [2][3]);
   void SetTransform(vtkMatrix4x4 * matrix);
   void GetSlidersAndSpinBoxes(std::vector<QSlider *>&transSliders, std::vector<QSlider *>&rotSliders,
                               std::vector<QDoubleSpinBox *>&transSBs, std::vector<QDoubleSpinBox *>&rotSBs);
index 341084df8a4792c316ef0533d6b98a64c45190d1..63ff9b150f6cac958826bb87e83b9473310b9c0a 100644 (file)
@@ -34,6 +34,9 @@
 #include <QMessageBox>
 
 // vtk
+#include <vtkVersion.h>
+#include <vtkStreamingDemandDrivenPipeline.h>
+#include <vtkInformation.h>
 #include "vtkImageContinuousErode3D.h"
 #include "vtkImageContinuousDilate3D.h"
 #include "vtkRenderWindow.h"
@@ -399,10 +402,18 @@ void vvToolSegmentation::Erode()
   vtkImageContinuousErode3D* erode = vtkImageContinuousErode3D::New();
   erode->SetKernelSize(mKernelValue,mKernelValue,mKernelValue);
   vtkImageData* image = mCurrentMaskImage->GetVTKImages()[0];
+#if VTK_MAJOR_VERSION <= 5
   erode->SetInput(image);
+#else
+  erode->SetInputData(image);
+#endif
   erode->Update();
   image->DeepCopy(erode->GetOutput());
+#if VTK_MAJOR_VERSION <= 5
   image->Update();
+#else
+  //image->Update();
+#endif
   UpdateAndRenderNewMask();
   erode->Delete();
   QApplication::restoreOverrideCursor();
@@ -420,10 +431,18 @@ void vvToolSegmentation::Dilate()
   vtkImageContinuousDilate3D* dilate = vtkImageContinuousDilate3D::New();
   dilate->SetKernelSize(mKernelValue,mKernelValue,mKernelValue);
   vtkImageData* image = mCurrentMaskImage->GetVTKImages()[0];
+#if VTK_MAJOR_VERSION <= 5
   dilate->SetInput(image);
+#else
+  dilate->SetInputData(image);
+#endif
   dilate->Update();
   image->DeepCopy(dilate->GetOutput());
+#if VTK_MAJOR_VERSION <= 5
   image->Update();
+#else
+  //image->Update();
+#endif
   UpdateAndRenderNewMask();
   dilate->Delete();
   QApplication::restoreOverrideCursor();
@@ -557,7 +576,7 @@ void vvToolSegmentation::MousePositionChanged(int slicer)
   // mCurrentMousePositionInPixel[1] = Yover;
   // mCurrentMousePositionInPixel[2] = Zover;
   // DDV(mCurrentMousePositionInPixel, 3);
-
+#if VTK_MAJOR_VERSION <= 5
   if (Xover >= image->GetWholeExtent()[0] &&
       Xover <= image->GetWholeExtent()[1] &&
       Yover >= image->GetWholeExtent()[2] &&
@@ -579,6 +598,29 @@ void vvToolSegmentation::MousePositionChanged(int slicer)
     // DD("out of mask");
     mCurrentLabelUnderMousePointer = 0; // BG is always 0 in CCL
   }
+#else
+  if (Xover >= image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[0] &&
+      Xover <= image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[1] &&
+      Yover >= image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[2] &&
+      Yover <= image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[3] &&
+      Zover >= image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[4] &&
+      Zover <= image->GetInformation()->Get(vtkDataObject::DATA_EXTENT())[5]) {
+    if (mCurrentState == State_Default) { // inside the mask
+      mCurrentLabelUnderMousePointer = 1;
+      return; 
+    }
+    else { // inside the label image
+      vtkImageData * image = mCurrentCCLImage->GetFirstVTKImageData();
+      mCurrentLabelUnderMousePointer = 
+        mCurrentSlicerManager->GetSlicer(0)->GetScalarComponentAsDouble(image, Xover, Yover, Zover, ix, iy, iz, 0);
+      return;
+    }
+  }
+  else {
+    // DD("out of mask");
+    mCurrentLabelUnderMousePointer = 0; // BG is always 0 in CCL
+  }
+#endif
 }
 //------------------------------------------------------------------------------
 
index 5cd6e404b81d952b4237bd280b9378459a5b9521..93b9f3f0162f7877452607cdeaaf27169ee3afb1 100644 (file)
@@ -18,7 +18,7 @@
 #ifndef VVTOOLSEGMENTATION_H
 #define VVTOOLSEGMENTATION_H
 
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 
 #include "vvToolBase.h"
 #include "vvToolWidgetBase.h"
index 3cbc63e80de88f3371edcb4262decc042e003da6..d80f5bf911db5e6396483f2e7b7713bdbaaaf1f1 100644 (file)
@@ -17,7 +17,7 @@
 ===========================================================================**/
 #ifndef VVTOOLSIMPLEINPUTSELECTORWIDGET_H
 #define VVTOOLSIMPLEINPUTSELECTORWIDGET_H
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include <QDialog>
 #include "ui_vvToolSimpleInputSelectorWidget.h"
 
index 2f33110aa9f0103712e1645d5031db98595eb6e5..d9bd2f3322e992d202d7318ca39d6d97490bcb15 100644 (file)
@@ -19,7 +19,7 @@
 #ifndef VVTOOLWIDGETBASE_H
 #define VVTOOLWIDGETBASE_H
 
-#include <QtDesigner/QDesignerExportWidget>
+#include <QtUiPlugin/QDesignerExportWidget>
 #include "ui_vvToolWidgetBase.h"
 #include "clitkImageToImageGenericFilter.h"