Skip to content

Commit

Permalink
ENH: Update VTK to version 8.1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Woundorf authored and scalahater committed Mar 5, 2020
1 parent 2a0ac8e commit d543813
Show file tree
Hide file tree
Showing 49 changed files with 5,817 additions and 2,418 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ matrix:
- PATH="$QTDIR/bin:$PATH"
- LDFLAGS=-L$QTDIR/lib
- CPPFLAGS=-I$QTDIR/include
- wget -nv --directory-prefix=$HOME http:https://trueta.udg.edu/apt/macos/devel/0.15/starviewer-sdk-macos-0.15-0.tar.xz
- wget -nv --directory-prefix=$HOME http:https://trueta.udg.edu/apt/macos/devel/0.15/starviewer-sdk-macos-0.15-1.tar.xz
- mkdir ~/sdk-0.15
- tar xf ~/starviewer-sdk-macos-0.15-0.tar.xz -C ~/sdk-0.15
- tar xf ~/starviewer-sdk-macos-0.15-1.tar.xz -C ~/sdk-0.15

script:
- cd starviewer
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ RUN apt-get install -qq software-properties-common
RUN apt-add-repository -y ppa:beineri/opt-qt563-trusty
RUN apt-get update -qq
RUN apt-get install -qq build-essential clang libgl1-mesa-dev libglu1-mesa-dev xvfb wget
RUN apt-get install -qq qt56base qt56declarative qt56tools qt56webengine qt56xmlpatterns
RUN apt-get install -qq qt56base qt56declarative qt56tools qt56webengine qt56xmlpatterns qt56x11extras
RUN apt-get install -qq libwrap0 libwrap0-dev zlib1g zlib1g-dev libssl-dev
RUN rm -rf /var/lib/apt/lists/*
RUN unset DEBIAN_FRONTEND

RUN wget -nv --directory-prefix=/ http:https://trueta.udg.edu/apt/ubuntu/devel/0.15/starviewer-sdk-linux-0.15-0.tar.xz
RUN wget -nv --directory-prefix=/ http:https://trueta.udg.edu/apt/ubuntu/devel/0.15/starviewer-sdk-linux-0.15-1.tar.xz
RUN mkdir /sdk-0.15
RUN tar xf /starviewer-sdk-linux-0.15-0.tar.xz -C /sdk-0.15
RUN tar xf /starviewer-sdk-linux-0.15-1.tar.xz -C /sdk-0.15

ENV SDK_INSTALL_PREFIX /sdk-0.15/usr/local
ENV LD_LIBRARY_PATH /sdk-0.15/usr/local/lib:/sdk-0.15/usr/local/lib/x86_64-linux-gnu
Expand Down
6 changes: 3 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ install:
- ps: |
# Setup precompiled SDK
$source = "http:https://trueta.udg.edu/apt/windows/devel/0.15/starviewer-sdk-win$env:BITS-0.15-0.7z"
$destination = "c:\starviewer-sdk-win$env:BITS-0.15-0.7z"
$source = "http:https://trueta.udg.edu/apt/windows/devel/0.15/starviewer-sdk-win$env:BITS-0.15-1.7z"
$destination = "c:\starviewer-sdk-win$env:BITS-0.15-1.7z"
Invoke-WebRequest $source -OutFile $destination
7z x $destination -oc:\ > 7z-output.txt
$env:PATH = "$env:QTDIR\bin;c:\vtk\7.0.0\bin;c:\gdcm\2.8.6\bin;c:\ThreadWeaver\5.3.0\bin;$env:PATH"
$env:PATH = "$env:QTDIR\bin;c:\vtk\8.1.1\bin;c:\gdcm\2.8.6\bin;c:\ThreadWeaver\5.3.0\bin;$env:PATH"
# Setup jom
Expand Down
2 changes: 1 addition & 1 deletion sdk/library_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Si existeix vol dir que cal aplicar tots els patch que hi hagi en aquest directo
- Qt 5.6.3
- DCMTK 3.6.1-20120515
- ITK 4.10.0
- VTK 7.0.0
- VTK 8.1.1
- gdcm 2.8.6
- ThreadWeaver 5.3.0
43 changes: 43 additions & 0 deletions sdk/patches/gdcm/vtk8.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/Utilities/VTK/vtkGDCMPolyDataWriter.cxx b/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
index e2c661c..290ca4a 100644
--- a/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
+++ b/Utilities/VTK/vtkGDCMPolyDataWriter.cxx
@@ -586,7 +586,7 @@ void vtkGDCMPolyDataWriter::WriteRTSTRUCTData(gdcm::File &file, int pdidx )
if( darray )
{
double tuple[3];
- darray->GetTupleValue( 0, tuple );
+ darray->GetTypedTuple( 0, tuple );
intcolor[0] = (int32_t)(tuple[0] * 255.);
intcolor[1] = (int32_t)(tuple[1] * 255.);
intcolor[2] = (int32_t)(tuple[2] * 255.);
@@ -594,7 +594,7 @@ void vtkGDCMPolyDataWriter::WriteRTSTRUCTData(gdcm::File &file, int pdidx )
else if( farray )
{
float ftuple[3];
- farray->GetTupleValue( 0, ftuple );
+ farray->GetTypedTuple( 0, ftuple );
intcolor[0] = (int32_t)(ftuple[0] * 255.);
intcolor[1] = (int32_t)(ftuple[1] * 255.);
intcolor[2] = (int32_t)(ftuple[2] * 255.);
diff --git a/Utilities/VTK/vtkImageColorViewer.cxx b/Utilities/VTK/vtkImageColorViewer.cxx
index 3d6df39..b7fc7ed 100644
--- a/Utilities/VTK/vtkImageColorViewer.cxx
+++ b/Utilities/VTK/vtkImageColorViewer.cxx
@@ -539,7 +539,15 @@ public:

if (event == vtkCommand::ResetWindowLevelEvent)
{
-#if (VTK_MAJOR_VERSION >= 6)
+#if (VTK_MAJOR_VERSION >= 8)
+ this->IV->GetInputAlgorithm()->UpdateInformation();
+ this->IV->GetInputAlgorithm()->GetOutputInformation(0)->Set(
+ vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
+ this->IV->GetInputAlgorithm()->GetOutputInformation(0)->Get(
+ vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()),
+ 6);
+ this->IV->GetInputAlgorithm()->Update();
+#elif (VTK_MAJOR_VERSION >= 6)
this->IV->GetInputAlgorithm()->UpdateInformation();
vtkStreamingDemandDrivenPipeline::SetUpdateExtent(
this->IV->GetInputInformation(),
2 changes: 1 addition & 1 deletion sdk/patches/vtk/fast_vtkTextMapper_GetSize.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ index 78b9562..a089f0e 100644
+ return;
+ }
+
vtkWindow *win = vp ? vp->GetVTKWindow() : NULL;
vtkWindow *win = vp ? vp->GetVTKWindow() : nullptr;
if (!win)
{
- size[0] = size[1] = 0;
Expand Down
26 changes: 0 additions & 26 deletions sdk/patches/vtk/fix-legacy-remove-7.0.patch

This file was deleted.

55 changes: 0 additions & 55 deletions sdk/patches/vtk/fix_gcc_visibility_check.patch

This file was deleted.

6 changes: 3 additions & 3 deletions sdk/scripts/unix/config/vtk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

SOURCE_DIR="$SOURCE_DIR_BASE/VTK-7.0.0"
SOURCE_DIR="$SOURCE_DIR_BASE/VTK-8.1.1"

if [ $BUILD_TYPE = debug ]
then
Expand All @@ -26,6 +26,6 @@ CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE:STRING=$CMAKE_BUILD_TYPE \
-DModule_vtkViewsQt:BOOL=TRUE \
-DVTK_QT_VERSION:STRING=5"

VTKCMAKEDIR="$SDK_INSTALL_PREFIX/lib/cmake/vtk-7.0"
VTKCMAKEDIR="$SDK_INSTALL_PREFIX/lib/cmake/vtk-8.1"
VTKLIBDIR="$SDK_INSTALL_PREFIX/lib"
VTKINCLUDEDIR="$SDK_INSTALL_PREFIX/include/vtk-7.0"
VTKINCLUDEDIR="$SDK_INSTALL_PREFIX/include/vtk-8.1"
6 changes: 3 additions & 3 deletions sdk/scripts/unix/sdk_download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ do
'https://support.dcmtk.org/redmine/attachments/download/8/dcmtk-3.6.1_20120515.tar.gz'
;;
vtk)
download_and_verify 78a990a15ead79cdc752e86b83cfab7dbf5b7ef51ba409db02570dbdd9ec32c3 \
'VTK-7.0.0.tar.gz' \
'https://www.vtk.org/files/release/7.0/VTK-7.0.0.tar.gz'
download_and_verify 71a09b4340f0a9c58559fe946dc745ab68a866cf20636a41d97b6046cb736324 \
'VTK-8.1.1.tar.gz' \
'https://www.vtk.org/files/release/8.1/VTK-8.1.1.tar.gz'
;;
gdcm)
download_and_verify f4e611c74ea2b16c9aa28d7fdf3a8678ce926909606705b7cd08c9a5b05d34fc \
Expand Down
2 changes: 1 addition & 1 deletion sdk/scripts/unix/sdk_extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ do
tar -C "${SOURCE_DIR_BASE}" -xvf "${DOWNLOAD_PREFIX}/dcmtk-3.6.1_20120515.tar.gz"
;;
vtk)
tar -C "${SOURCE_DIR_BASE}" -xvf "${DOWNLOAD_PREFIX}/VTK-7.0.0.tar.gz"
tar -C "${SOURCE_DIR_BASE}" -xvf "${DOWNLOAD_PREFIX}/VTK-8.1.1.tar.gz"
;;
gdcm)
tar -C "${SOURCE_DIR_BASE}" -xvf "${DOWNLOAD_PREFIX}/GDCM-2.8.6.tar.gz"
Expand Down
10 changes: 5 additions & 5 deletions sdk/scripts/windows/config/vtk.cmd
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
set SourceDir=%SourceDirPrefix%\VTK-7.0.0
set BuildDir=%BuildDirPrefix%\VTK-7.0.0
set SourceDir=%SourceDirPrefix%\VTK-8.1.1
set BuildDir=%BuildDirPrefix%\VTK-8.1.1

if %BuildType% == debug (
set CMakeBuildType=Debug
set BuildDir=%BuildDir%-deb
set InstallPrefix=%SdkInstallPrefix%/VTK/7.0.0d
set InstallPrefix=%SdkInstallPrefix%/VTK/8.1.1d
)
if %BuildType% == release (
set CMakeBuildType=RelWithDebInfo
set BuildDir=%BuildDir%-rel
set InstallPrefix=%SdkInstallPrefix%/VTK/7.0.0
set InstallPrefix=%SdkInstallPrefix%/VTK/8.1.1
)

REM ============== Nothing should need to be changed below this line ==============
Expand All @@ -24,4 +24,4 @@ set CMakeOptions=-DCMAKE_BUILD_TYPE:STRING=%CMakeBuildType% ^
-DModule_vtkViewsQt:BOOL=TRUE ^
-DVTK_QT_VERSION:STRING=5

set VtkDir=%InstallPrefix%/lib/cmake/vtk-7.0
set VtkDir=%InstallPrefix%/lib/cmake/vtk-8.1
12 changes: 0 additions & 12 deletions starviewer/src/core/core.pro
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,9 @@ HEADERS += extensionfactory.h \
hdrcolor.h \
trilinearinterpolator.h \
vector3.h \
vtkVolumeRayCastVoxelShaderCompositeFunction.h \
sphereuniformpointcloudgenerator.h \
obscurancemainthread.h \
obscurancethread.h \
obscurancevoxelshader.h \
vtk4dlinearregressiongradientestimator.h \
combiningvoxelshader.h \
vtkVolumeRayCastSingleVoxelShaderCompositeFunction.h \
obscurance.h \
viewpointgenerator.h \
thumbnailcreator.h \
nonclosedangletool.h \
Expand Down Expand Up @@ -565,15 +559,9 @@ SOURCES += extensionmediator.cpp \
directilluminationvoxelshader.cpp \
voxelshader.cpp \
trilinearinterpolator.cpp \
vtkVolumeRayCastVoxelShaderCompositeFunction.cxx \
sphereuniformpointcloudgenerator.cpp \
obscurancemainthread.cpp \
obscurancethread.cpp \
obscurancevoxelshader.cpp \
vtk4dlinearregressiongradientestimator.cpp \
combiningvoxelshader.cpp \
vtkVolumeRayCastSingleVoxelShaderCompositeFunction.cxx \
obscurance.cpp \
viewpointgenerator.cpp \
thumbnailcreator.cpp \
nonclosedangletool.cpp \
Expand Down
21 changes: 0 additions & 21 deletions starviewer/src/core/coresettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,6 @@ const QString CoreSettings::RegisterStatLogs("LoggingPolicy/registerStatistics")
const QString ToolsBase("Tools/");
const QString CoreSettings::MagnifyingGlassZoomFactor(ToolsBase + "MagnifyingGlassZoomFactor");

// Paràmetres d'obscurances
const QString ObscurancesBase("3DViewer/obscurances/");
const QString LowQualityObscurancesBase(ObscurancesBase + "low/");
const QString MediumQualityObscurancesBase(ObscurancesBase + "medium/");
const QString HighQualityObscurancesBase(ObscurancesBase + "high/");

const QString CoreSettings::NumberOfDirectionsForLowQualityObscurances(LowQualityObscurancesBase + "numberOfDirections");
const QString CoreSettings::FunctionForLowQualityObscurances(LowQualityObscurancesBase + "function");
const QString CoreSettings::VariantForLowQualityObscurances(LowQualityObscurancesBase + "variant");
const QString CoreSettings::GradientRadiusForLowQualityObscurances(LowQualityObscurancesBase + "gradientRadius");

const QString CoreSettings::NumberOfDirectionsForMediumQualityObscurances(MediumQualityObscurancesBase + "numberOfDirections");
const QString CoreSettings::FunctionForMediumQualityObscurances(MediumQualityObscurancesBase + "function");
const QString CoreSettings::VariantForMediumQualityObscurances(MediumQualityObscurancesBase + "variant");
const QString CoreSettings::GradientRadiusForMediumQualityObscurances(MediumQualityObscurancesBase + "gradientRadius");

const QString CoreSettings::NumberOfDirectionsForHighQualityObscurances(HighQualityObscurancesBase + "numberOfDirections");
const QString CoreSettings::FunctionForHighQualityObscurances(HighQualityObscurancesBase + "function");
const QString CoreSettings::VariantForHighQualityObscurances(HighQualityObscurancesBase + "variant");
const QString CoreSettings::GradientRadiusForHighQualityObscurances(HighQualityObscurancesBase + "gradientRadius");

const QString CoreSettings::LanguageLocale("Starviewer-Language/languageLocale");

const QString CoreSettings::ForcedImageReaderLibrary("Input/ForcedImageReaderLibrary");
Expand Down
15 changes: 0 additions & 15 deletions starviewer/src/core/coresettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ class CoreSettings : public DefaultSettings {
static const QString UserCustomWindowLevelsPath;
static const QString RegisterStatLogs;

static const QString NumberOfDirectionsForLowQualityObscurances;
static const QString FunctionForLowQualityObscurances;
static const QString VariantForLowQualityObscurances;
static const QString GradientRadiusForLowQualityObscurances;

static const QString NumberOfDirectionsForMediumQualityObscurances;
static const QString FunctionForMediumQualityObscurances;
static const QString VariantForMediumQualityObscurances;
static const QString GradientRadiusForMediumQualityObscurances;

static const QString NumberOfDirectionsForHighQualityObscurances;
static const QString FunctionForHighQualityObscurances;
static const QString VariantForHighQualityObscurances;
static const QString GradientRadiusForHighQualityObscurances;

static const QString LanguageLocale;

/// Els 3 següents settings són "backdoors" que *només* s'haurien de fer servir en casos molt específics i controlats
Expand Down
Loading

0 comments on commit d543813

Please sign in to comment.