Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CMakeLists.txt.user*
.vs
CMakeSettings.json

27 changes: 18 additions & 9 deletions cmake/build_opt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,26 @@ option(CLITK_BUILD_REGISTRATION "Build command-line registration tools" OFF)
option(CLITK_BUILD_VV "Build vv the 4D visualizer (requires VTK and QT)" ON)

if(CLITK_BUILD_VV)
if(VTK_VERSION VERSION_LESS 6.0.0)
set(vv_QT_VERSION "4" CACHE INTERNAL "Expected Qt version")
#if(VTK_VERSION VERSION_LESS 6.0.0)
# set(vv_QT_VERSION "4" CACHE INTERNAL "Expected Qt version")
#else()
# if(VTK_QT_VERSION VERSION_LESS 5)
# set(vv_QT_VERSION "4" CACHE INTERNAL "Expected Qt version")
# else()
# set(vv_QT_VERSION "5" CACHE INTERNAL "Expected Qt version")
# endif()
#endif()
# set(vv_QT_VERSION "5" CACHE INTERNAL "Expected Qt version")
#find_package(Qt4)
#find_package(Qt5 COMPONENTS Core)
if(VTK_QT_VERSION VERSION_LESS 5)
set(vv_QT_VERSION "4" CACHE INTERNAL "Expected Qt version")
elseif(VTK_QT_VERSION VERSION_LESS 6)
set(vv_QT_VERSION "5" CACHE INTERNAL "Expected Qt version")
else()
if(VTK_QT_VERSION VERSION_LESS 5)
set(vv_QT_VERSION "4" CACHE INTERNAL "Expected Qt version")
else()
set(vv_QT_VERSION "5" CACHE INTERNAL "Expected Qt version")
endif()
message(FATAL_ERROR "VTK needs to be compiled with Qt4 or Qt5 is needed if you want to build vv.")
endif()
set(vv_QT_VERSION "5" CACHE INTERNAL "Expected Qt version")
add_subdirectory(${CLITK_SOURCE_DIR}/vv ${PROJECT_BINARY_DIR}/vv)
add_subdirectory(${CLITK_SOURCE_DIR}/vv ${PROJECT_BINARY_DIR}/vv)
endif(CLITK_BUILD_VV)

#=========================================================
Expand Down
6 changes: 5 additions & 1 deletion common/rtkEdfImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ void rtk::EdfImageIO::ReadImageInformation()
{ NULL, OrderNotApplicable }
};

auto byteorder = LittleEndian;
#if (ITK_VERSION_MAJOR == 5 && ITK_VERSION_MINOR < 1) || ITK_VERSION_MAJOR < 5
itk::ImageIOBase::ByteOrder byteorder = LittleEndian;
#else
itk::ImageIOBase::IOByteOrderEnum byteorder = LittleEndian;
#endif
if ( (p = edf_findInHeader(header, "ByteOrder") ) ) {
k = lookup_table_nth(edf_byteorder_table, p);
if (k >= 0) {
Expand Down
4 changes: 4 additions & 0 deletions common/rtkEdfImageIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ class EdfImageIO : public itk::ImageIOBase
// table key-value structure
struct table {
const char *key;
#if (ITK_VERSION_MAJOR == 5 && ITK_VERSION_MINOR < 1) || ITK_VERSION_MAJOR < 5
itk::ImageIOBase::ByteOrder value;
#else
itk::ImageIOBase::IOByteOrderEnum value;
#endif
};

struct table3 {
Expand Down
1 change: 1 addition & 0 deletions common/vvImage.txx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
===========================================================================*/
#include <itkImageToVTKImageFilter.h>
#include <itkPixelTraits.h>
#include <vtkVersion.h>

//--------------------------------------------------------------------
template<class TItkImageType>
Expand Down
2 changes: 1 addition & 1 deletion itk/clitkAddRelativePositionConstraintToLabelImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace clitk {
#if ITK_VERSION_MAJOR <= 4
virtual void VerifyInputInformation() ITK_OVERRIDE { }
#else
virtual void VerifyInputInformation() const ITK_OVERRIDE { }
virtual void VerifyInputInformation() ITKv5_CONST override { }
#endif

// For debug
Expand Down
2 changes: 1 addition & 1 deletion itk/clitkBooleanOperatorLabelImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ namespace clitk {
#if ITK_VERSION_MAJOR <= 4
virtual void VerifyInputInformation() ITK_OVERRIDE { }
#else
virtual void VerifyInputInformation() const ITK_OVERRIDE { }
virtual void VerifyInputInformation() ITKv5_CONST override { }
#endif

protected:
Expand Down
2 changes: 1 addition & 1 deletion itk/clitkCropLikeImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace clitk {
#if ITK_VERSION_MAJOR <= 4
virtual void VerifyInputInformation() ITK_OVERRIDE { }
#else
virtual void VerifyInputInformation() const ITK_OVERRIDE { }
virtual void VerifyInputInformation() ITKv5_CONST override { }
#endif

protected:
Expand Down
2 changes: 1 addition & 1 deletion itk/clitkLabelImageOverlapMeasureFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ namespace clitk {
#if ITK_VERSION_MAJOR <= 4
virtual void VerifyInputInformation() ITK_OVERRIDE { }
#else
virtual void VerifyInputInformation() const ITK_OVERRIDE { }
virtual void VerifyInputInformation() ITKv5_CONST override { }
#endif

protected:
Expand Down
2 changes: 1 addition & 1 deletion itk/clitkPasteImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace clitk
#if ITK_VERSION_MAJOR <= 4
virtual void VerifyInputInformation() ITK_OVERRIDE { }
#else
virtual void VerifyInputInformation() const ITK_OVERRIDE { }
virtual void VerifyInputInformation() ITKv5_CONST override { }
#endif

/** Standard class typedefs. */
Expand Down
34 changes: 30 additions & 4 deletions vv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,36 @@ endif(COMMAND cmake_policy)
OPTION(CLITK_USE_PACS_CONNECTION "USE PACS CONNECTION" OFF)
#=========================================================

# Look for OpenGL2 version
if (VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
add_definitions(-DVTK_OPENGL2)
endif ()
# Look for VTK OpenGL version
if(VTK_MAJOR_VERSION VERSION_LESS "6")
if(CMAKE_VERSION VERSION_LESS "3.12.0")
add_definitions(-DVTK_OPENGL=1)
else()
add_compile_definitions(VTK_OPENGL=1)
endif()
elseif(VTK_MAJOR_VERSION VERSION_EQUAL "6")
# Look for OpenGL version
if(VTK_RENDERING_BACKEND STREQUAL "OpenGL")
if(CMAKE_VERSION VERSION_LESS "3.12.0")
add_definitions(-DVTK_OPENGL=1)
else()
add_compile_definitions(VTK_OPENGL=1)
endif()
# Look for OpenGL2 version
else()
if(CMAKE_VERSION VERSION_LESS "3.12.0")
add_definitions(-DVTK_OPENGL=2)
else()
add_compile_definitions(VTK_OPENGL=2)
endif()
endif()
else()
if(CMAKE_VERSION VERSION_LESS "3.12.0")
add_definitions(-DVTK_OPENGL=2)
else()
add_compile_definitions(VTK_OPENGL=2)
endif()
endif()

#List of vv tools to compile
set(vv_TOOLS
Expand Down
13 changes: 13 additions & 0 deletions vv/vtkVOXImageWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,20 @@
#define __vtkVOXImageWriter_h
#include "vtkImageWriter.h"
#include <string>
#include <vtkVersion.h>


class vtkVOXImageWriter : public vtkImageWriter
{
public:
vtkTypeMacro(vtkVOXImageWriter,vtkImageWriter);
#if VTK_MAJOR_VERSION >= 8
void PrintSelf(ostream& os, vtkIndent indent) override;
#elif VTK_MAJOR_VERSION >= 7
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
#else
void PrintSelf(ostream& os, vtkIndent indent);
#endif

// Description:
static vtkVOXImageWriter *New();
Expand All @@ -36,7 +43,13 @@ class vtkVOXImageWriter : public vtkImageWriter

// This is called by the superclass.
// This is the method you should override.
#if VTK_MAJOR_VERSION >= 8
virtual void Write() override;
#elif VTK_MAJOR_VERSION >= 7
virtual void Write() VTK_OVERRIDE;
#else
virtual void Write();
#endif

protected:
vtkVOXImageWriter();
Expand Down
10 changes: 8 additions & 2 deletions vv/vv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@
#include "vvReadState.h"
#include "vvToolsList.h"
#include "vvConfiguration.h"
#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 2) || VTK_MAJOR_VERSION >= 9
#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 2) || (VTK_MAJOR_VERSION == 9 && VTK_MINOR_VERSION < 2)
#include <QVTKOpenGLWidget.h>
#endif
#if (VTK_MAJOR_VERSION == 9 && VTK_MINOR_VERSION >= 2)
#include <QVTKOpenGLStereoWidget.h>
#endif

#include <vtkFileOutputWindow.h>
#include <vtkSmartPointer.h>
Expand Down Expand Up @@ -118,8 +121,11 @@ int main( int argc, char** argv )
{
#endif

#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 2) || VTK_MAJOR_VERSION >= 9
#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 2) || (VTK_MAJOR_VERSION == 9 && VTK_MINOR_VERSION < 2)
QSurfaceFormat::setDefaultFormat(QVTKOpenGLWidget::defaultFormat());
#endif
#if (VTK_MAJOR_VERSION == 9 && VTK_MINOR_VERSION >= 2)
QSurfaceFormat::setDefaultFormat(QVTKOpenGLStereoWidget::defaultFormat());
#endif
CLITK_INIT;

Expand Down
17 changes: 17 additions & 0 deletions vv/vvAnimatedGIFWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <vtkGenericMovieWriter.h>
#include <vtkSmartPointer.h>
#include <vtkVersion.h>

class vtkImageAppend;

Expand All @@ -13,14 +14,30 @@ class vvAnimatedGIFWriter : public vtkGenericMovieWriter //test this if link err
public:
static vvAnimatedGIFWriter *New();
vtkTypeMacro(vvAnimatedGIFWriter,vtkGenericMovieWriter);
#if VTK_MAJOR_VERSION >= 8
void PrintSelf(ostream& os, vtkIndent indent) override;
#elif VTK_MAJOR_VERSION >= 7
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
#else
void PrintSelf(ostream& os, vtkIndent indent);
#endif

// Description:
// These methods start writing an Movie file, write a frame to the file
// and then end the writing process.
#if VTK_MAJOR_VERSION >= 8
void Start() override;
void Write() override;
void End() override;
#elif VTK_MAJOR_VERSION >= 7
void Start() VTK_OVERRIDE;
void Write() VTK_OVERRIDE;
void End() VTK_OVERRIDE;
#else
void Start();
void Write();
void End();
#endif

// Description:
// Set/Get the frame rate, in frame/s.
Expand Down
25 changes: 16 additions & 9 deletions vv/vvBlendImageActor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Program: vv http://www.creatis.insa-lyon.fr/rio/vv

Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- L�on B�rard cancer center http://www.centreleonberard.fr
- Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr

This software is distributed WITHOUT ANY WARRANTY; without even
Expand All @@ -17,7 +17,14 @@ It is distributed under dual licence
===========================================================================**/

#include "vvBlendImageActor.h"
#include <vtk_glew.h>
#if VTK_OPENGL == 1
#include <vtkgl.h>
#include <vtkOpenGLExtensionManager.h>
#elif VTK_OPENGL > 1
#include <vtk_glew.h> //VTK_OPENGL2
#else
#error "You need to compile VTK with OpenGL!"
#endif
#include <vtkOpenGLRenderWindow.h>
#include <vtkOpenGLRenderer.h>
#include <vtkOpenGL.h>
Expand All @@ -38,13 +45,7 @@ void vvBlendImageActor::Render(vtkRenderer *ren)
{
//Change blending to maximum per component instead of weighted sum
vtkOpenGLRenderWindow *renwin = dynamic_cast<vtkOpenGLRenderWindow*>(ren->GetRenderWindow());
#ifdef VTK_OPENGL2
const char *extensions = renwin->ReportCapabilities();

//Call normal render
VTK_IMAGE_ACTOR::Render(ren);

#else
#if VTK_OPENGL == 1
vtkOpenGLExtensionManager *extensions = renwin->GetExtensionManager();
if (extensions->ExtensionSupported("GL_EXT_blend_minmax")) {
extensions->LoadExtension("GL_EXT_blend_minmax");
Expand All @@ -58,6 +59,12 @@ void vvBlendImageActor::Render(vtkRenderer *ren)
if (vtkgl::BlendEquationEXT!=0) {
vtkgl::BlendEquationEXT( vtkgl::FUNC_ADD );
}
#else
//VTK_OPENGL>1
const char *extensions = renwin->ReportCapabilities();

//Call normal render
VTK_IMAGE_ACTOR::Render(ren);
#endif
}

Expand Down
15 changes: 14 additions & 1 deletion vv/vvBlendImageActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Authors belong to:
- University of LYON http://www.universite-lyon.fr/
- L�on B�rard cancer center http://www.centreleonberard.fr
- Léon Bérard cancer center http://www.centreleonberard.fr
- CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr

This software is distributed WITHOUT ANY WARRANTY; without even
Expand All @@ -21,6 +21,7 @@

#include <vtkActor.h>
#include <vtkSmartPointer.h>
#include <vtkVersion.h>

#if VTK_MAJOR_VERSION >= 6 || (VTK_MAJOR_VERSION >= 5 && VTK_MINOR_VERSION >= 10)
#define VTK_IMAGE_ACTOR vtkImageActor
Expand All @@ -35,11 +36,23 @@ class vvBlendImageActor : public VTK_IMAGE_ACTOR
public:
static vvBlendImageActor *New();
vtkTypeMacro(vvBlendImageActor, VTK_IMAGE_ACTOR);
#if VTK_MAJOR_VERSION >= 8
virtual void PrintSelf(ostream& os, vtkIndent indent) override;
#elif VTK_MAJOR_VERSION >= 7
virtual void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
#else
virtual void PrintSelf(ostream& os, vtkIndent indent);
#endif

// Description:
// Implement base class method.
#if VTK_MAJOR_VERSION >= 8
void Render(vtkRenderer *ren) override;
#elif VTK_MAJOR_VERSION >= 7
void Render(vtkRenderer *ren) VTK_OVERRIDE;
#else
void Render(vtkRenderer *ren);
#endif

protected:
vvBlendImageActor();
Expand Down
12 changes: 12 additions & 0 deletions vv/vvClipPolyData.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ class vvClipPolyData : public vtkClipPolyData
{
public:
vtkTypeMacro(vvClipPolyData,vtkClipPolyData);
#if VTK_MAJOR_VERSION >= 8
void PrintSelf(ostream& os, vtkIndent indent) override;
#elif VTK_MAJOR_VERSION >= 7
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
#else
void PrintSelf(ostream& os, vtkIndent indent);
#endif

static vvClipPolyData *New();

protected:
vvClipPolyData();
~vvClipPolyData();

#if VTK_MAJOR_VERSION >= 8
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override;
#elif VTK_MAJOR_VERSION >= 7
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) VTK_OVERRIDE;
#else
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
#endif

private:
vvClipPolyData(const vvClipPolyData&); // Not implemented.
Expand Down
Loading