From e97ed5092629a64cb017250b5f76eae290f22a4a Mon Sep 17 00:00:00 2001 From: malaterre Date: Thu, 13 Jan 2005 19:13:42 +0000 Subject: [PATCH] ENH: Adding a new supp file for valgrind --- CMakeLists.txt | 13 ++++- gdcmValgrind.supp | 129 ++++++++++++++++++++++++++++++++++++++++++ vtk/vtkgdcmViewer.cxx | 21 ++++--- 3 files changed, 154 insertions(+), 9 deletions(-) create mode 100644 gdcmValgrind.supp diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ff95b1b..85d46474 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,15 @@ PROJECT(GDCM) -CMAKE_MINIMUM_REQUIRED(VERSION 1.8) +CMAKE_MINIMUM_REQUIRED(VERSION 2.0) + +#MESSAGE("MATHIEU: ${CMAKE_VERSION_RELEASE}") +#MESSAGE("MATHIEU: ${CMAKE_VERSION}") +#MESSAGE("MATHIEU: ${CMAKE_CACHE_RELEASE_VERSION}") +#IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 2.0) +# IF(${CMAKE_CACHE_RELEASE_VERSION} EQUAL "patch 5") +# MESSAGE("MAHTIEU FOO") +# ENDIF(${CMAKE_CACHE_RELEASE_VERSION} EQUAL "patch 5") +#ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 2.0) + #----------------------------------------------------------------------------- # GDCM version number, usefull for packaging and doxygen doc: @@ -51,6 +61,7 @@ IF("GDCM_COMPILER_HAS_FUNCTION" MATCHES "^GDCM_COMPILER_HAS_FUNCTION$") "${OUTPUT}\n" APPEND) ENDIF(GDCM_COMPILER_HAS_FUNCTION) ENDIF("GDCM_COMPILER_HAS_FUNCTION" MATCHES "^GDCM_COMPILER_HAS_FUNCTION$") + #----------------------------------------------------------------------------- # Build directory on which many applications depend SUBDIRS( diff --git a/gdcmValgrind.supp b/gdcmValgrind.supp new file mode 100644 index 00000000..f152efeb --- /dev/null +++ b/gdcmValgrind.supp @@ -0,0 +1,129 @@ +{ + + Memcheck:Param + write(buf) + fun:__write_nocancel + obj:/usr/X11R6/lib/libX11.so.6.2 + fun:_X11TransWrite + obj:/usr/X11R6/lib/libX11.so.6.2 +} +{ + + Memcheck:Free + fun:free + fun:__GI__dl_deallocate_tls + fun:vgArch_thread_exit + fun:thread_exit_wrapper +} +{ + + Memcheck:Leak + fun:malloc + fun:__cxa_get_globals + fun:_ZSt18uncaught_exceptionv + fun:_ZNSo6sentryD1Ev +} +{ + + Memcheck:Leak + fun:malloc + fun:XextCreateExtension + fun:__glXInitialize + fun:glXGetConfig +} +{ + + Memcheck:Leak + fun:calloc + fun:_dlerror_run + fun:dlsym + fun:__errno_location +} +{ + + Memcheck:Leak + fun:malloc + fun:OpenDriver + fun:__glXRegisterExtensions + fun:__glXNewIndirectAPI +} +{ + + Memcheck:Leak + fun:malloc + fun:_dl_map_object_internal + fun:openaux + fun:_dl_catch_error_internal +} +{ + + Memcheck:Leak + fun:malloc + fun:_dl_map_object_deps_internal + fun:dl_open_worker + fun:_dl_catch_error_internal +} +{ + + Memcheck:Leak + fun:malloc + fun:__glXstrdup + fun:OpenDriver + fun:__glXRegisterExtensions +} +{ + + Memcheck:Leak + fun:malloc + fun:_dl_map_object_internal + fun:dl_open_worker + fun:_dl_catch_error_internal +} +{ + + Memcheck:Leak + fun:malloc + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object_internal +} +{ + + Memcheck:Leak + fun:malloc + fun:dl_open_worker + fun:_dl_catch_error_internal + fun:__GI__dl_open +} +{ + + Memcheck:Leak + fun:calloc + fun:_dl_check_map_versions_internal + fun:dl_open_worker + fun:_dl_catch_error_internal +} +{ + + Memcheck:Leak + fun:calloc + fun:_dl_new_object + fun:_dl_map_object_from_fd + fun:_dl_map_object_internal +} +{ + + Memcheck:Leak + fun:malloc + fun:__glXNewIndirectAPI + fun:glXMakeCurrent + fun:_ZN22vtkXOpenGLRenderWindow11MakeCurrentEv +} +{ + + Memcheck:Leak + fun:malloc + fun:__fgl_glapi_add_entrypoint + fun:__driRegisterExtensions + fun:__glXRegisterExtensions +} diff --git a/vtk/vtkgdcmViewer.cxx b/vtk/vtkgdcmViewer.cxx index d70d4944..c5bb70d7 100644 --- a/vtk/vtkgdcmViewer.cxx +++ b/vtk/vtkgdcmViewer.cxx @@ -12,18 +12,20 @@ // * the produced vtk file is named "foo.vtk" (in the invocation directory). // //---------------------------------------------------------------------------- -#include - #include -#include +#include #include #include +#include #include #include #include #include #include "vtkGdcmReader.h" +#include "gdcmDebug.h" + +#include #ifndef vtkFloatingPointType #define vtkFloatingPointType float @@ -60,7 +62,7 @@ public: } } } - vtkImageViewer2 *ImageViewer; + vtkImageViewer *ImageViewer; }; @@ -69,6 +71,7 @@ int main(int argc, char *argv[]) if( argc < 2 ) return 0; + gdcm::Debug::SetDebugOff(); vtkGdcmReader *reader = vtkGdcmReader::New(); reader->AllowLookupTableOff(); @@ -85,7 +88,7 @@ int main(int argc, char *argv[]) vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); - vtkImageViewer2 *viewer = vtkImageViewer2::New(); + vtkImageViewer *viewer = vtkImageViewer::New(); if( reader->GetLookupTable() ) { @@ -121,12 +124,14 @@ int main(int argc, char *argv[]) iren->Start(); //if you wish you can export dicom to a vtk file - vtkStructuredPointsWriter *writer = vtkStructuredPointsWriter::New(); + //vtkStructuredPointsWriter *writer = vtkStructuredPointsWriter::New(); + vtkPNGWriter *writer = vtkPNGWriter::New(); writer->SetInput( reader->GetOutput()); - writer->SetFileName( "foo.vtk" ); - writer->SetFileTypeToBinary(); + writer->SetFileName( "foo.png" ); + //writer->SetFileTypeToBinary(); writer->Write(); + reader->Delete(); iren->Delete(); viewer->Delete(); -- 2.45.1