[nifti2dicom/f20] Apply upstream patch to fix build against VTK 6

Daniel Vrátil dvratil at fedoraproject.org
Thu Apr 10 21:22:38 UTC 2014


commit 6921d26f9603f6c1fd834779967c701a8289216b
Author: Dan Vrátil <dvratil at redhat.com>
Date:   Thu Apr 10 20:35:19 2014 +0200

    Apply upstream patch to fix build against VTK 6

 nifti2dicom-vtk6-support.patch |   48 ++++++++++++++++++++++++++++++++++++++++
 nifti2dicom.spec               |   13 ++++++++++-
 2 files changed, 60 insertions(+), 1 deletions(-)
---
diff --git a/nifti2dicom-vtk6-support.patch b/nifti2dicom-vtk6-support.patch
new file mode 100644
index 0000000..bd3290b
--- /dev/null
+++ b/nifti2dicom-vtk6-support.patch
@@ -0,0 +1,48 @@
+commit 70ca78cb12bbe6daad90dfe3bcdb74536baa04d0
+Author: Daniele E. Domenichelli <daniele.domenichelli at iit.it>
+Date:   Thu Apr 10 19:05:56 2014 +0200
+
+    Fix build with VTK 6
+
+diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
+index 5ba0c2e..4d7171e 100644
+--- a/src/gui/CMakeLists.txt
++++ b/src/gui/CMakeLists.txt
+@@ -130,18 +130,10 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}
+ #endif( APPLE )
+ 
+ # nifti2dicom target
+-target_link_libraries(qnifti2dicom ${ITK_LIBRARIES} 
++target_link_libraries(qnifti2dicom ${ITK_LIBRARIES}
++                                   ${VTK_LIBRARIES}
+                                    ${QT_QTCORE_LIBRARY}
+-                                   ${QT_QTGUI_LIBRARY}
+-                                   QVTK
+-                                   vtkGraphics
+-                                   vtkHybrid
+-                                   vtkImaging
+-                                   vtkFiltering
+-                                   vtkCommon
+-                                   vtkRendering
+-                                   vtkIO
+-)
++                                   ${QT_QTGUI_LIBRARY})
+ 
+ #if(NOT APPLE)
+     install(TARGETS qnifti2dicom RUNTIME DESTINATION bin)
+diff --git a/src/gui/init.cpp b/src/gui/init.cpp
+index 0872c87..4ec81b5 100644
+--- a/src/gui/init.cpp
++++ b/src/gui/init.cpp
+@@ -207,7 +207,11 @@ bool init::loadInImage()
+     lookupTable->SetRange(range);
+     lookupTable->Build();
+     m_imageviewer->GetWindowLevel()->SetLookupTable(lookupTable);
++#if (VTK_MAJOR_VERSION < 6)
+     m_imageviewer->GetWindowLevel()->SetInput(m_localVTKImage->GetVTKImage());
++#else
++    m_imageviewer->GetWindowLevel()->SetInputData(m_localVTKImage->GetVTKImage());
++#endif
+ 
+     m_imageviewer->GetRenderer()->ResetCamera();
+     m_renderPreview->GetRenderWindow()->Render();
diff --git a/nifti2dicom.spec b/nifti2dicom.spec
index 3dd098d..2045fba 100644
--- a/nifti2dicom.spec
+++ b/nifti2dicom.spec
@@ -1,12 +1,14 @@
 Name:           nifti2dicom
 Version:        0.4.6
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Converts 3D medical images to DICOM 2D series
 
 License:        GPLv3+
 URL:            https://github.com/biolab-unige/nifti2dicom
 Source0:        https://github.com/biolab-unige/nifti2dicom/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 
+Patch0:         nifti2dicom-vtk6-support.patch
+
 ExcludeArch:    ppc ppc64
 
 BuildRequires:  cmake
@@ -19,7 +21,11 @@ BuildRequires:  vxl-devel
 BuildRequires:  hdf5-devel
 BuildRequires:  InsightToolkit-devel
 BuildRequires:  tclap-devel
+BuildRequires:  libxml2-devel
 BuildRequires:  doxygen
+BuildRequires:  jsoncpp-devel
+BuildRequires:  python-devel
+BuildRequires:  netcdf-cxx-devel
 
 %description
 Nifti2Dicom is a conversion tool that converts 3D NIfTI files (and other
@@ -35,6 +41,8 @@ that can be imported in a PACS.
 %prep
 %setup -q
 
+%patch0 -p1 -b .vtk6
+
 %build
 mkdir -p %{_target_platform}
 pushd %{_target_platform}
@@ -70,6 +78,9 @@ fi
 
 
 %changelog
+* Thu Apr 10 2014 Daniel Vrátil <dvratli at redhat.com> 0.4.6-5
+- Apply upstream patch to fix build against VTK 6
+
 * Mon Aug 05 2013 Daniel Vrátil <dvratil at redhat.com> 0.4.6-4
  - Rebuild against VTK
 


More information about the scm-commits mailing list