Skip to content

Commit

Permalink
Miscellaneous cleanup (#518)
Browse files Browse the repository at this point in the history
* Fix SVL compilation warnings

* Remove ITK v4 legacy dependent code

* Get rid of ITK v5 crutches

* Remove c++ standard requirement Elastix build

* Remove non-required OpenEXR from OpenCV build

* IBIS would otherwise not link against OpenCV on platforms where a more recent version of OpenEXR was present
  • Loading branch information
errollgarner committed May 30, 2024
1 parent 48d23a9 commit dd72ce7
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 46 deletions.
2 changes: 1 addition & 1 deletion IbisLib/filereader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ int FileReader::GetNumberOfComponents( QString filename )
else
return 0;
}
IOBasePointer io = itk::ImageIOFactory::CreateImageIO( fileToRead.toUtf8().data(), itk::ImageIOFactory::ReadMode );
IOBasePointer io = itk::ImageIOFactory::CreateImageIO( fileToRead.toUtf8().data(), itk::CommonEnums::IOFileMode::ReadMode );

if( !io ) throw itk::ExceptionObject( "Unsupported image file type" );

Expand Down
20 changes: 9 additions & 11 deletions IbisSuperBuild/IbisDeps/External_Elastix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ if( SUPERBUILD_BUILD_MINIMAL_ELASTIX )
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_FLAGS=-std=c++11
-DBUILD_TESTING:BOOL=FALSE
-DBUILD_TESTING:BOOL=OFF
-DITK_DIR:PATH=${IBIS_ITK_DIR}
-DELASTIX_BUILD_EXECUTABLE:BOOL=FALSE
-DELASTIX_BUILD_EXECUTABLE:BOOL=OFF
# Set what we want:
-DUSE_CMAEvolutionStrategy:BOOL=TRUE
-DUSE_FullSampler:BOOL=TRUE
-DUSE_GridSampler:BOOL=TRUE
-DUSE_RandomSampler:BOOL=TRUE
-DUSE_CMAEvolutionStrategy:BOOL=ON
-DUSE_FullSampler:BOOL=ON
-DUSE_GridSampler:BOOL=ON
-DUSE_RandomSampler:BOOL=ON
# Turn everything else off:
-DUSE_AdaptiveStochasticGradientDescent:BOOL=OFF
-DUSE_AdvancedAffineTransformElastix:BOOL=OFF
Expand Down Expand Up @@ -120,10 +119,9 @@ else()
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DCMAKE_CXX_FLAGS=-std=c++11
-DBUILD_TESTING:BOOL=FALSE
-DBUILD_TESTING:BOOL=OFF
-DITK_DIR:PATH=${IBIS_ITK_DIR}
-DELASTIX_BUILD_EXECUTABLE:BOOL=FALSE
-DUSE_CMAEvolutionStrategy:BOOL=TRUE
-DELASTIX_BUILD_EXECUTABLE:BOOL=OFF
-DUSE_CMAEvolutionStrategy:BOOL=ON
DEPENDS ${itk_name} )
endif()
18 changes: 9 additions & 9 deletions IbisSuperBuild/IbisDeps/External_ITK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ ExternalProject_Add( ${itk_name}
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DITK_BUILD_DEFAULT_MODULES:BOOL=FALSE
-DITKGroup_IO:BOOL=TRUE
-DBUILD_TESTING:BOOL=FALSE
-DBUILD_EXAMPLES:BOOL=FALSE
-DITK_USE_GPU:BOOL=TRUE
-DITKV4_COMPATIBILITY:BOOL=TRUE
-DITK_LEGACY_REMOVE=FALSE
-DModule_ITKIOMINC=ON
-DModule_ITKReview=ON )
-DITK_BUILD_DEFAULT_MODULES:BOOL=OFF
-DITKGroup_IO:BOOL=ON
-DBUILD_TESTING:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=OFF
-DITK_USE_GPU:BOOL=ON
-DITKV4_COMPATIBILITY:BOOL=OFF
-DITK_LEGACY_REMOVE:BOOL=ON
-DModule_ITKIOMINC:BOOL=ON
-DModule_ITKReview:BOOL=ON )
35 changes: 18 additions & 17 deletions IbisSuperBuild/IbisDeps/External_OpenCV.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,28 @@ ExternalProject_Add( ${opencv_name}
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DBUILD_PERF_TESTS:BOOL=FALSE
-DBUILD_SHARED_LIBS:BOOL=FALSE
-DBUILD_WITH_STATIC_CRT:BOOL=FALSE
-DBUILD_TESTS:BOOL=FALSE
-DWITH_TIFF:BOOL=FALSE
-DWITH_JASPER:BOOL=FALSE
-DBUILD_DOCS:BOOL=FALSE
-DBUILD_FAT_JAVA_LIB:BOOL=FALSE
-DWITH_CUDA:BOOL=FALSE
-DWITH_VTK:BOOL=FALSE
-DBUILD_PERF_TESTS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=OFF
-DBUILD_WITH_STATIC_CRT:BOOL=OFF
-DBUILD_TESTS:BOOL=OFF
-DWITH_TIFF:BOOL=OFF
-DWITH_JASPER:BOOL=OFF
-DWITH_OPENEXR:BOOL=OFF
-DBUILD_DOCS:BOOL=OFF
-DBUILD_FAT_JAVA_LIB:BOOL=OFF
-DWITH_CUDA:BOOL=OFF
-DWITH_VTK:BOOL=OFF
-DWITH_EIGEN:BOOL=OFF
-DWITH_1394:BOOL=OFF
-DWITH_GSTREAMER:BOOL=OFF
-DWITH_GTK:BOOL=OFF
-DWITH_ITT:BOOL=OFF
-DBUILD_opencv_python2:BOOL=FALSE
-DBUILD_opencv_python3:BOOL=FALSE
-DBUILD_opencv_python_bindings_generator:BOOL=FALSE
-DBUILD_opencv_python_tests:BOOL=FALSE
-DBUILD_opencv_python2:BOOL=OFF
-DBUILD_opencv_python3:BOOL=OFF
-DBUILD_opencv_python_bindings_generator:BOOL=OFF
-DBUILD_opencv_python_tests:BOOL=OFF
-DOPENCV_PYTHON_SKIP_DETECTION=ON
-DBUILD_opencv_apps:BOOL=FALSE
-DBUILD_JAVA:BOOL=FALSE
-DBUILD_PACKAGE:BOOL=FALSE
-DBUILD_opencv_apps:BOOL=OFF
-DBUILD_JAVA:BOOL=OFF
-DBUILD_PACKAGE:BOOL=OFF
)
3 changes: 2 additions & 1 deletion svl/Mat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ Mat oprod(const Vec &a, const Vec &b)

ostream &operator << (ostream &s, const Mat &m)
{
Int i, w = s.width();
Int i;
std::streamsize w = s.width();

s << '[';
for (i = 0; i < m.Rows() - 1; i++)
Expand Down
2 changes: 1 addition & 1 deletion svl/Mat2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Mat2 oprod(const Vec2 &a, const Vec2 &b)

ostream &operator << (ostream &s, const Mat2 &m)
{
Int w = s.width();
std::streamsize w = s.width();

return(s << '[' << m[0] << endl << setw(w) << m[1] << ']' << endl);
}
Expand Down
2 changes: 1 addition & 1 deletion svl/Mat3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ Void Mat3::MakeBlock(Real k)

ostream &operator << (ostream &s, const Mat3 &m)
{
Int w = s.width();
std::streamsize w = s.width();

return(s << '[' << m[0] << endl << setw(w) << m[1] << endl << setw(w)
<< m[2] << ']' << endl);
Expand Down
2 changes: 1 addition & 1 deletion svl/Mat4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ Void Mat4::MakeBlock(Real k)

ostream &operator << (ostream &s, const Mat4 &m)
{
Int w = s.width();
std::streamsize w = s.width();

return(s << '[' << m[0] << endl << setw(w) << m[1] << endl
<< setw(w) << m[2] << endl << setw(w) << m[3] << ']' << endl);
Expand Down
3 changes: 2 additions & 1 deletion svl/Vec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ Vec clamped(const Vec &v)

ostream &operator << (ostream &s, const Vec &v)
{
Int i, w;
Int i;
std::streamsize w;

s << '[';

Expand Down
2 changes: 1 addition & 1 deletion svl/Vec2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

ostream &operator << (ostream &s, const Vec2 &v)
{
Int w = s.width();
std::streamsize w = s.width();

return(s << '[' << v[0] << ' ' << setw(w) << v[1] << ']');
}
Expand Down
2 changes: 1 addition & 1 deletion svl/Vec3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

ostream &operator << (ostream &s, const Vec3 &v)
{
Int w = s.width();
std::streamsize w = s.width();

return(s << '[' << v[0] << ' ' << setw(w) << v[1] << ' ' << setw(w) << v[2] << ']');
}
Expand Down
2 changes: 1 addition & 1 deletion svl/Vec4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Vec3 proj(const Vec4 &v)

ostream &operator << (ostream &s, const Vec4 &v)
{
Int w = s.width();
std::streamsize w = s.width();

return(s << '[' << v[0] << ' ' << setw(w) << v[1] << ' '
<< setw(w) << v[2] << ' ' << setw(w) << v[3] << ']');
Expand Down

0 comments on commit dd72ce7

Please sign in to comment.