[med-svn] [mia] 01/03: Imported Upstream version 2.2.2

Gert Wollny gert-guest at moszumanska.debian.org
Wed Oct 22 13:46:29 UTC 2014


This is an automated email from the git hooks/post-receive script.

gert-guest pushed a commit to branch master
in repository mia.

commit d1353bb612f9f6c52988a8756b683e89f63806cd
Author: Gert Wollny <gw.fossdev at gmail.com>
Date:   Thu Oct 9 14:05:53 2014 +0200

    Imported Upstream version 2.2.2
---
 CMakeLists.txt                 |  6 +++---
 ChangeLog                      | 10 ++++++++++
 addons/dicom/dicom4mia.cc      | 24 +++++++++++++++++++++---
 addons/openexr/CMakeLists.txt  |  1 -
 addons/tiff/tiff.cc            |  6 ++----
 addons/vistaio/CMakeLists.txt  |  1 -
 addons/vtk/CMakeLists.txt      | 10 ++++++----
 addons/vtk/vtkmesh.cc          |  4 +++-
 mia/core/CMakeLists.txt        |  1 -
 mia/core/filetools.cc          |  2 +-
 mia/core/filetools.hh          |  8 +++++++-
 mia/core/test_cmdlineparser.cc |  2 --
 miacore.pc.cmake               |  2 +-
 13 files changed, 54 insertions(+), 23 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b44245a..a05f081 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,9 +41,9 @@ SET(VENDOR "Gert Wollny")
 SET(PACKAGE_NAME "mia")
 SET(MAJOR_VERSION 2)
 SET(MINOR_VERSION 2)
-SET(MICRO_VERSION 1)
-SET(INTERFACE_AGE 1)
-SET(BINARY_AGE    1)
+SET(MICRO_VERSION 2)
+SET(INTERFACE_AGE 2)
+SET(BINARY_AGE    2)
 
 SET(PACKAGE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}")
 SET(VERSION "${MAJOR_VERSION}.${MINOR_VERSION}")
diff --git a/ChangeLog b/ChangeLog
index e0f606f..42b669b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2.2.2
+
+  Fixes:
+
+  * #165 throw exception where "exit" was used before
+  * Add boost_system to required link libraries in *.pc files
+  * Reduce the number of explicitely libraries used from VTK
+  * vtkmash.cc: Add explicit cast to make it compile with clang++
+  * test_cmdlineparser: Correct failing test if NDEBUG is defined
+
 2.2.1
 
   * fixes for potential bugs discovered by Coverity
diff --git a/addons/dicom/dicom4mia.cc b/addons/dicom/dicom4mia.cc
index 19c5f0c..7f69eb2 100644
--- a/addons/dicom/dicom4mia.cc
+++ b/addons/dicom/dicom4mia.cc
@@ -44,6 +44,10 @@
 #include <dcmtk/dcmnet/diutil.h>
 #include <dcmtk/dcmjpeg/djdecode.h>
 
+#include <dcmtk/dcmdata/dcostrmf.h>
+#include <dcmtk/dcmdata/dcistrmf.h>
+
+#include <mia/core/file.hh>
 #include <mia/2d/imageio.hh>
 
 NS_MIA_BEGIN
@@ -157,7 +161,11 @@ CDicomReader::CDicomReader(const char *filename):
 	impl(new CDicomReaderData()),
 	m_filename(filename)
 {
-	impl->status = impl->dcm.loadFile( filename );
+	// here one should be able t open the file and pass the handle like in 
+	// the file writer, but for some reason this is not available. 
+
+	DcmInputFileStream is(filename); 
+	impl->status = impl->dcm.read(is); 
 }
 
 CDicomReader::~CDicomReader()
@@ -881,8 +889,18 @@ void CDicomWriterData::setValueStringIfKeyExists(const CAttributeMap::value_type
 
 bool CDicomWriterData::write(const char *filename)
 {
-	OFCondition status = dcm.saveFile(filename, EXS_LittleEndianImplicit,
-					  EET_UndefinedLength,EGL_withoutGL);
+	// Should use COutputFile, but the DcmOutputFileStream also takes ownership of 
+	// the file handle
+	FILE *out_file = fopen(filename, "wb");
+	if (!out_file)  { 
+		throw create_exception<runtime_error>("DICOM: unable to open '", 
+						      filename, "' for writing: ", 
+						      strerror(errno));
+	}
+
+	DcmOutputFileStream os(out_file);
+	OFCondition status = dcm.write (os, EXS_LittleEndianImplicit, EET_UndefinedLength, NULL); 
+
 	return status.good();
 }
 
diff --git a/addons/openexr/CMakeLists.txt b/addons/openexr/CMakeLists.txt
index 42d8341..e4e1408 100644
--- a/addons/openexr/CMakeLists.txt
+++ b/addons/openexr/CMakeLists.txt
@@ -46,7 +46,6 @@ IF(WITH_OpenEXR)
     
     # test programs 
     ADD_EXECUTABLE(test-openexr test_openexr.cc)
-    ADD_DEPENDENCIES(test-openexr 2dimage-io-openexr 2dvf-io-openexr)
     
     SET(DEPLIBS mia2dtest mia2d ${BASELIBS})
     TARGET_LINK_LIBRARIES(test-openexr ${DEPLIBS} ${BOOST_UNITTEST})
diff --git a/addons/tiff/tiff.cc b/addons/tiff/tiff.cc
index 0a43b03..9ba1957 100644
--- a/addons/tiff/tiff.cc
+++ b/addons/tiff/tiff.cc
@@ -98,12 +98,9 @@ void MyErrorHandler(const char *module, const char *fmt,  va_list ap)
 {
 	char buf[16384];
 	snprintf(buf,16384, fmt, ap);
-
-	cverr() << module << ":" << buf << "\n";
-	exit(1);
+	throw create_exception<runtime_error>(module, ":", buf);
 }
 
-
 struct CErrorHandlerReplacer {
 	CErrorHandlerReplacer():
 		m_old_handler(TIFFSetErrorHandler(MyErrorHandler))
@@ -245,6 +242,7 @@ P2DImage read_strip_pixels(CTiffFile& tif, unsigned int width,
 
 CTiff2DImageIO::PData CTiff2DImageIO::do_load(string const& filename)const
 {
+	CErrorHandlerReplacer error_handing;
 	CTiffFile tif(filename.c_str(), "r");
 	if (!tif)
 		return PData();
diff --git a/addons/vistaio/CMakeLists.txt b/addons/vistaio/CMakeLists.txt
index fa964a4..ae9c655 100644
--- a/addons/vistaio/CMakeLists.txt
+++ b/addons/vistaio/CMakeLists.txt
@@ -51,7 +51,6 @@ IF (USE_VISTAIO)
     
   
     ADD_EXECUTABLE(test-vista4mia  test_vista4mia.cc)
-    ADD_DEPENDENCIES(test-vista4mia  2dvistaio 3dvistaio 3dvfvistaio)
     
     SET(VISTADEPLIBS vista4mia mia3dtest mia2dtest mia3d mia2d)
     
diff --git a/addons/vtk/CMakeLists.txt b/addons/vtk/CMakeLists.txt
index a11c159..0fa0176 100644
--- a/addons/vtk/CMakeLists.txt
+++ b/addons/vtk/CMakeLists.txt
@@ -20,9 +20,9 @@ OPTION(WITH_VTKIO "enable support for VTK files" ${SEARCH_LIBS_DEFAULT})
 
 IF(WITH_VTKIO)
   if (STRICT_DEPENDECIES)
-    FIND_PACKAGE(VTK REQUIRED)
+    FIND_PACKAGE(VTK REQUIRED COMPONENTS  vtkIOImage  vtkIOXML vtkIOLegacy)
   else (STRICT_DEPENDECIES)
-    FIND_PACKAGE(VTK QUIET)
+    FIND_PACKAGE(VTK COMPONENTS vtkIOImage vtkIOXML vtkIOLegacy)
   endif (STRICT_DEPENDECIES)
   IF(VTK_FOUND)
     DEFINE_PROPERTY(GLOBAL PROPERTY HAVE_VTK_PROP BRIEF_DOCS "yeah" FULL_DOCS "yeah")
@@ -31,8 +31,10 @@ IF(WITH_VTKIO)
     SET(vfio_path "${PLUGIN_INSTALL_PATH}/3dvf/io")
     SET(imageio_path "${PLUGIN_INSTALL_PATH}/3dimage/io")
     
-    SET(VTK_LINK_LIBS_MESH ${VTK_LIBRARIES} miamesh)
-    SET(VTK_LINK_LIBS_3D ${VTK_LIBRARIES} mia3d)
+
+    SET(SELECTED_VTK_LIBS ${VTK_MODULES_REQUESTED})
+    SET(VTK_LINK_LIBS_MESH ${SELECTED_VTK_LIBS} miamesh)
+    SET(VTK_LINK_LIBS_3D ${SELECTED_VTK_LIBS} mia3d)
 
     PLUGIN_WITH_TEST_AND_PREFIX2("mesh" "io" vtkmesh "${VTK_LINK_LIBS_MESH}")
     PLUGIN_WITH_TEST_AND_PREFIX2("3dvf" "io" vtkvf "${VTK_LINK_LIBS_3D}")
diff --git a/addons/vtk/vtkmesh.cc b/addons/vtk/vtkmesh.cc
index df01403..9f7695c 100644
--- a/addons/vtk/vtkmesh.cc
+++ b/addons/vtk/vtkmesh.cc
@@ -248,7 +248,9 @@ bool CVtkMeshIO::do_save(string const &  filename, const CTriangleMesh& mesh) co
 	auto triangles = vtkSmartPointer<vtkCellArray>::New();
 	for_each(mesh.triangles_begin(), mesh.triangles_end(),  
 		 [&triangles](const CTriangleMesh::triangle_type& x)->void {
-			 vtkIdType p[] = {x.x, x.y, x.z}; 
+			 vtkIdType p[] = {static_cast<int>(x.x), 
+					  static_cast<int>(x.y), 
+					  static_cast<int>(x.z)}; 
 			 triangles->InsertNextCell(3, p); 
 		 });
 
diff --git a/mia/core/CMakeLists.txt b/mia/core/CMakeLists.txt
index ea13993..3c42ab2 100644
--- a/mia/core/CMakeLists.txt
+++ b/mia/core/CMakeLists.txt
@@ -239,7 +239,6 @@ SET(MIACORE_HEADER ${MIACORE_HEADER_BASE} ${ITPP_HEADER} ${FFTWF_HEADER} ${PWPDF
 
 SET(miacore_deps miagsl ${BASELIBS} ${TBB_LIBRARIES} ${FFTWF_LIBRARIES} ${XMLPP_LIBRARIES})
 MIA_ADD_LIBRARY(miacore "${MIACORE_SRC}" "${miacore_deps}")
-ADD_DEPENDENCIES(miacore revision.hh)
 
 IF(PWPDF_FOUND AND FFTWD_FOUND)
   TARGET_LINK_LIBRARIES(miacore ${PWPDF_LIBRARIES})
diff --git a/mia/core/filetools.cc b/mia/core/filetools.cc
index 812a03b..369ca2f 100644
--- a/mia/core/filetools.cc
+++ b/mia/core/filetools.cc
@@ -22,7 +22,7 @@
 #include <cstring>
 #include <climits>
 
-
+#include <boost/filesystem/path.hpp>
 #include <boost/filesystem/operations.hpp> // includes boost/filesystem/path.hpp
 #include <boost/filesystem/fstream.hpp>    // ditto
 #include <mia/core/bfsv23dispatch.hh>
diff --git a/mia/core/filetools.hh b/mia/core/filetools.hh
index c4a2138..ec8b306 100644
--- a/mia/core/filetools.hh
+++ b/mia/core/filetools.hh
@@ -25,10 +25,16 @@
 #include <vector>
 
 #include <mia/core/defines.hh>
-#include <boost/filesystem/path.hpp>
+
+namespace boost {
+namespace filesystem {
+class path; 
+}
+}
 
 NS_MIA_BEGIN
 
+
 typedef std::vector<boost::filesystem::path> CPathNameArray; 
 
 CPathNameArray find_files(const CPathNameArray& searchpath, const std::string& pattern); 
diff --git a/mia/core/test_cmdlineparser.cc b/mia/core/test_cmdlineparser.cc
index 3d1dda1..ea8cf46 100644
--- a/mia/core/test_cmdlineparser.cc
+++ b/mia/core/test_cmdlineparser.cc
@@ -425,10 +425,8 @@ BOOST_FIXTURE_TEST_CASE( test_parser_help_output, CmdlineParserFixture )
 			  "                        verbosity of output, print messages of given \n"
 			  "                        level and higher priorities. Supported \n"
 			  "                        priorities starting at lowest level are: \n"
-#ifndef NDEBUG 
 			  "                          trace: Function call trace\n"
 			  "                          debug: Debug output\n"
-#endif 
 			  "                          info: Low level messages\n"
 			  "                          message: Normal messages\n"
 			  "                          warning: Warnings\n"
diff --git a/miacore.pc.cmake b/miacore.pc.cmake
index 36acef1..d2c9fda 100644
--- a/miacore.pc.cmake
+++ b/miacore.pc.cmake
@@ -13,5 +13,5 @@ Description: A library for 2D/3D grayscale image processing
 Version: @PACKAGE_VERSION@
 Conflicts:
 Requires.private: @PKG_CONFIG_DEPS@ 
-Libs: -lmiacore- at VERSION@  -L${prefix}/@LIBRARY_INSTALL_PATH@
+Libs: -lmiacore- at VERSION@  -L${prefix}/@LIBRARY_INSTALL_PATH@ -lboost_system 
 Cflags: -I${prefix}/@INCLUDE_INSTALL_PATH@ -I at LIB_INCLUDE_INSTALL_PATH@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/mia.git



More information about the debian-med-commit mailing list