From 0b68ed1277809b984461b7d7aa1b58ad690187af Mon Sep 17 00:00:00 2001 From: "Stephen R. Aylward" Date: Thu, 7 Dec 2023 20:38:39 -0500 Subject: [PATCH] ENH: Update CI process to match ITK cookiecutter style, for better coverage of platforms (#152) --- .clang-format | 151 ++ .dockerignore | 208 -- .editorconfig | 19 + .github/workflows/build-test-package.yml | 7 +- .github/workflows/build-test-package.yml.org | 581 ------ .gitignore | 1 + CMake/CTestCustom.cmake.in | 232 --- CMake/CopyFiles.cmake | 2 - .../Dockerfile-cuda-itk-vtk-sem-af | 147 -- .../Dockerfile-tubetk-applications | 47 - CMake/EvaluateIPythonNotebook.py | 96 - CMake/GitSetup/.gitattributes | 9 - CMake/GitSetup/README.md | 5 - CMake/GitSetup/hooks/commit-msg | 102 - CMake/GitSetup/hooks/hooks-config.bash | 66 - CMake/GitSetup/hooks/pre-commit | 334 --- CMake/GitSetup/hooks/prepare-commit-msg | 25 - CMake/GitSetup/setup-hooks | 43 - CMake/GitSetup/setup-user | 39 - CMake/GitSetup/tips | 55 - CMake/SetupForDevelopment.sh | 33 - CMake/TubeTKConfigureLaunchers.cmake | 73 - CMake/TubeTKExternalData.cmake | 93 - CMake/TubeTKLauncher.bat.in | 34 - CMake/TubeTKLauncher.sh.in | 28 - CMake/TubeTKValgrind.supp | 1838 ----------------- CMake/tubetkConfigure.h.in | 28 - CMakeLists.txt | 113 +- CTestConfig.cmake | 33 +- examples/Applications/CMakeLists.txt | 12 +- examples/CMakeLists.txt | 1 + itk-module.cmake | 1 - src/CMakeLists.txt | 4 - src/Filtering/itktubeRidgeFFTFilter.hxx | 2 - src/Python/CMakeLists.txt | 33 - src/Python/README.md | 5 - src/Python/pyfsa/README.md | 109 - src/Python/pyfsa/core/__init__.py | 0 src/Python/pyfsa/core/fsa.py | 501 ----- src/Python/pyfsa/core/utils.py | 332 --- src/Python/pyfsa/dcl.py | 151 -- src/Python/pyfsa/mapcl.py | 137 -- src/Python/tubetk.pth.in | 8 - src/Python/tubetk/CMakeLists.txt | 33 - src/Python/tubetk/__init__.py | 21 - src/Python/tubetk/cvImageFilters.py | 115 -- src/Python/tubetk/spImageFilters.py | 427 ---- test/Baseline/SegmentTubesTest1.mha.sha512 | 2 +- test/Baseline/SegmentTubesTest2.mha.sha512 | 2 +- test/CMakeLists.txt | 4 - test/CompareTools/CMakeLists.txt | 6 + test/CompareTools/CompareTextFiles.cxx | 2 +- test/IO/tubeIOHeaderTest.cxx | 2 - test/IO/tubeIOPrintTest.cxx | 2 - test/MetaIO/tubeMetaIOHeaderTest.cxx | 2 - test/MetaIO/tubeMetaIOPrintTest.cxx | 2 - test/Python/PythonComputeTrainingMaskTest.py | 95 - test/Python/PythonConvertImagesToCSVTest.py | 122 -- ...ythonConvertShrunkenSeedImageToListTest.py | 109 - .../itktubeRidgeSeedFilterTest.cxx | 2 - .../tubeSegmentationHeaderTest.cxx | 2 - .../tubeSegmentationPrintTest.cxx | 2 - 62 files changed, 206 insertions(+), 6484 deletions(-) create mode 100644 .clang-format delete mode 100644 .dockerignore create mode 100644 .editorconfig delete mode 100644 .github/workflows/build-test-package.yml.org delete mode 100644 CMake/CTestCustom.cmake.in delete mode 100644 CMake/CopyFiles.cmake delete mode 100644 CMake/Dockerfiles/Dockerfile-cuda-itk-vtk-sem-af delete mode 100644 CMake/Dockerfiles/Dockerfile-tubetk-applications delete mode 100644 CMake/EvaluateIPythonNotebook.py delete mode 100644 CMake/GitSetup/.gitattributes delete mode 100644 CMake/GitSetup/README.md delete mode 100755 CMake/GitSetup/hooks/commit-msg delete mode 100644 CMake/GitSetup/hooks/hooks-config.bash delete mode 100755 CMake/GitSetup/hooks/pre-commit delete mode 100755 CMake/GitSetup/hooks/prepare-commit-msg delete mode 100755 CMake/GitSetup/setup-hooks delete mode 100755 CMake/GitSetup/setup-user delete mode 100755 CMake/GitSetup/tips delete mode 100755 CMake/SetupForDevelopment.sh delete mode 100644 CMake/TubeTKConfigureLaunchers.cmake delete mode 100644 CMake/TubeTKExternalData.cmake delete mode 100644 CMake/TubeTKLauncher.bat.in delete mode 100644 CMake/TubeTKLauncher.sh.in delete mode 100644 CMake/TubeTKValgrind.supp delete mode 100644 CMake/tubetkConfigure.h.in delete mode 100644 src/Python/CMakeLists.txt delete mode 100644 src/Python/README.md delete mode 100644 src/Python/pyfsa/README.md delete mode 100644 src/Python/pyfsa/core/__init__.py delete mode 100644 src/Python/pyfsa/core/fsa.py delete mode 100644 src/Python/pyfsa/core/utils.py delete mode 100644 src/Python/pyfsa/dcl.py delete mode 100644 src/Python/pyfsa/mapcl.py delete mode 100644 src/Python/tubetk.pth.in delete mode 100644 src/Python/tubetk/CMakeLists.txt delete mode 100644 src/Python/tubetk/__init__.py delete mode 100644 src/Python/tubetk/cvImageFilters.py delete mode 100644 src/Python/tubetk/spImageFilters.py delete mode 100644 test/Python/PythonComputeTrainingMaskTest.py delete mode 100644 test/Python/PythonConvertImagesToCSVTest.py delete mode 100644 test/Python/PythonConvertShrunkenSeedImageToListTest.py diff --git a/.clang-format b/.clang-format new file mode 100644 index 000000000..411b009a3 --- /dev/null +++ b/.clang-format @@ -0,0 +1,151 @@ +## This config file is only relevant for clang-format version 8.0.0 +## +## Examples of each format style can be found on the in the clang-format documentation +## See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html for details of each option +## +## The clang-format binaries can be downloaded as part of the clang binary distributions +## from https://releases.llvm.org/download.html +## +## Use the script Utilities/Maintenance/clang-format.bash to faciliate +## maintaining a consistent code style. +## +## EXAMPLE apply code style enforcement before commit: +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --modified +## EXAMPLE apply code style enforcement after commit: +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --last +--- +# This configuration requires clang-format version 8.0.0 exactly. +BasedOnStyle: Mozilla +Language: Cpp +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: true +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: true +# clang 9.0 AllowAllArgumentsOnNextLine: true +# clang 9.0 AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Inline +# clang 9.0 AllowShortLambdasOnASingleLine: All +# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: All +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BreakBeforeBraces: Custom +BraceWrapping: + # clang 9.0 feature AfterCaseLabel: false + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: true + BeforeElse: true +## This is the big change from historical ITK formatting! +# Historically ITK used a style similar to https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style +# with indented braces, and not indented code. This style is very difficult to automatically +# maintain with code beautification tools. Not indenting braces is more common among +# formatting tools. + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBinaryOperators: None +#clang 6.0 BreakBeforeInheritanceComma: true +BreakInheritanceList: BeforeComma +BreakBeforeTernaryOperators: true +#clang 6.0 BreakConstructorInitializersBeforeComma: true +BreakConstructorInitializers: BeforeComma +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +## The following line allows larger lines in non-documentation code +ColumnLimit: 120 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: true +IndentPPDirectives: AfterHash +IndentWidth: 2 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: false +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +## The following line allows larger lines in non-documentation code +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Middle +ReflowComments: true +# We may want to sort the includes as a separate pass +SortIncludes: false +# We may want to revisit this later +SortUsingDeclarations: false +SpaceAfterCStyleCast: false +# SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 2 +UseTab: Never +... diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 8c6f007aa..000000000 --- a/.dockerignore +++ /dev/null @@ -1,208 +0,0 @@ -**/*.pyc -**/__pycache__/ -**/*# -**/.#* -**/*~ -**/*.egg -**/*.egg-info - -.coverage -.cache -.idea -.git -build* - -### Vagrant template -.vagrant/ -### Linux template -*~ - -# KDE directory preferences -.directory - -# Linux trash folder which might appear on any partition or disk -.Trash-* -### C++ template -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app -### Vim template -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -*.un~ -Session.vim -.netrwhist -*~ -### OSX template -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk -### Emacs template -# -*- mode: gitignore; -*- -*~ -\#*\# -/.emacs.desktop -/.emacs.desktop.lock -*.elc -auto-save-list -tramp -.\#* - -# Org-mode -.org-id-locations -*_archive - -# flymake-mode -*_flymake.* - -# eshell files -/eshell/history -/eshell/lastdir - -# elpa packages -/elpa/ - -# reftex files -*.rel - -# AUCTeX auto folder -/auto/ - -# cask packages -.cask/ -### Windows template -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msm -*.msp - -# Windows shortcuts -*.lnk -### CMake template -CMakeCache.txt -CMakeFiles -CMakeScripts -Makefile -cmake_install.cmake -install_manifest.txt -### Python template -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -web_main - -# Scikit-build -_skbuild/ diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..648b96932 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Apply to all code files +[*] +# A newline ending every file +insert_final_newline = true + +# Set default charset +charset = utf-8 + +# 4 space indentation +indent_style = space +indent_size = 2 + +# Various options +trim_trailing_whitespace = true diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 67c42e0b0..7c93755f3 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -4,13 +4,14 @@ on: [push,pull_request] jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@edd0a4350396f533e9ec3755ed6c5af5ddfedb97 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@3f63de316255a285b0cac4c819d3d45649738999 with: + itk-cmake-options: '-DBUILD_STATIC_LIBS:BOOL=ON' itk-module-deps: 'MinimalPathExtraction@35dd8e83b7df2059876e6835a5741eb3d45973bf' python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@edd0a4350396f533e9ec3755ed6c5af5ddfedb97 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@3f63de316255a285b0cac4c819d3d45649738999 with: - itk-module-deps: 'MinimalPathExtraction@35dd8e83b7df2059876e6835a5741eb3d45973bf' + itk-module-deps: 'InsightSoftwareConsortium/ITKMinimalPathExtraction@35dd8e83b7df2059876e6835a5741eb3d45973bf' secrets: pypi_password: ${{ secrets.pypi_password }} diff --git a/.github/workflows/build-test-package.yml.org b/.github/workflows/build-test-package.yml.org deleted file mode 100644 index 890eedbb1..000000000 --- a/.github/workflows/build-test-package.yml.org +++ /dev/null @@ -1,581 +0,0 @@ -name: Build, test, package - -on: [push,pull_request] - -env: - vtk-git-tag: "v9.2.6" - itk-git-tag: "1fc47c7bec4ee133318c1892b7b745763a17d411" - # v5.3.0 = "1fc47c7bec4ee133318c1892b7b745763a17d411" - itk-wheel-tag: "v5.3.0" - itk-minimalpathextraction-git-tag: "v1.2.6" - itk-python-package-tag: "5ad02309321621cdc7269b9b68a35013c912271c" - itk-python-package-org: "InsightSoftwareConsortium" - -jobs: - build-test-cxx: - runs-on: ${{ matrix.os }} - strategy: - max-parallel: 3 - matrix: - os: [ubuntu-20.04, windows-2022, macos-11] - include: - - os: ubuntu-20.04 - c-compiler: "gcc" - cxx-compiler: "g++" - - os: windows-2022 - c-compiler: "cl.exe" - cxx-compiler: "cl.exe" - - os: macos-11 - c-compiler: "clang" - cxx-compiler: "clang++" - - steps: - - uses: actions/checkout@v3 - - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - - name: Set up OpenGL - if: matrix.os == 'ubuntu-20.04' - run: | - sudo apt-get update - sudo apt-get install -y libglu1-mesa-dev mesa-common-dev libgl1-mesa-glx libglvnd-core-dev freeglut3-dev libtbb-dev zstd - - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - python -m pip install ninja - - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.22.2 - - - name: Cache VTK - id: cache-vtk - uses: actions/cache@v3 - with: - path: | - VTK - VTK-build - key: build-${{ env.vtk-git-tag }}-${{ matrix.os }} - - - name: Download VTK - if: steps.cache-vtk.outputs.cache-hit != 'true' - run: | - git clone https://github.com/Kitware/VTK.git - pushd VTK - git checkout ${{ env.vtk-git-tag }} - - - name: Build VTK (Mac and Linux) - if: matrix.os != 'windows-2022' && steps.cache-vtk.outputs.cache-hit != 'true' - run: | - mkdir VTK-build - pushd VTK-build - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../VTK - ninja - - - name: Build VTK (Windows) - if: matrix.os == 'windows-2022' && steps.cache-vtk.outputs.cache-hit != 'true' - run: | - mkdir VTK-build - pushd VTK-build - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_ioss:BOOL=NO -DVTK_MODULE_ENABLE_VTK_IOIOSS:BOOL=NO -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../VTK - ninja - shell: cmd - - - name: Download ITK - run: | - git clone https://github.com/InsightSoftwareConsortium/ITK.git - pushd ITK - git checkout ${{ env.itk-git-tag }} - - - name: Build ITK (Mac and Linux) - if: matrix.os != 'windows-2022' - run: | - mkdir ITK-build - pushd ITK-build - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DITK_LEGACY_REMOVE:BOOL=ON -DModule_MinimalPathExtraction:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -DBUILD_TESTING:BOOL=ON -GNinja ../ITK - ninja - - - name: Build ITK (Windows) - if: matrix.os == 'windows-2022' - run: | - mkdir ITK-build - pushd ITK-build - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DITK_LEGACY_REMOVE:BOOL=ON -DModule_MinimalPathExtraction:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../ITK - shell: cmd - - - name: Fetch CTest driver script - run: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O - - - name: Configure CTest script - shell: bash - run: | - operating_system="${{ matrix.os }}" - cat > dashboard.cmake << EOF - set(CTEST_SITE "GitHubActions") - file(TO_CMAKE_PATH "${PWD}/.." CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "${PWD}/" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "${PWD}/../build" CTEST_BINARY_DIRECTORY) - set(dashboard_source_name "${GITHUB_REPOSITORY}") - if(ENV{GITHUB_REF} MATCHES "master") - set(branch "-master") - set(dashboard_model "Continuous") - else() - set(branch "-${GITHUB_REF}") - set(dashboard_model "Experimental") - endif() - set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}") - set(CTEST_UPDATE_VERSION_ONLY 1) - set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) - set(CTEST_BUILD_CONFIGURATION "Release") - set(CTEST_CMAKE_GENERATOR "Ninja") - set(CTEST_CUSTOM_WARNING_EXCEPTION - \${CTEST_CUSTOM_WARNING_EXCEPTION} - # macOS Azure VM Warning - "ld: warning: text-based stub file" - ) - set(dashboard_no_clean 1) - set(ENV{CC} ${{ matrix.c-compiler }}) - set(ENV{CXX} ${{ matrix.cxx-compiler }}) - - set(ENV{ITK_DIR} "\${CTEST_SOURCE_DIRECTORY}/ITK-build") - set(ENV{VTK_DIR} "\${CTEST_SOURCE_DIRECTORY}/VTK-build") - - if(WIN32) - set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}") - endif() - set(dashboard_cache " - ITK_LEGACY_REMOVE:BOOL=ON - Module_MinimalPathExtraction:BOOL=ON - BUILD_SHARED_LIBS:BOOL=ON - CMAKE_BUILD_TYPE:STRING="Release" - ITK_DIR:PATH=${PWD}/ITK-build - VTK_DIR:PATH=${PWD}/VTK-build - BUILD_TESTING:BOOL=ON - BUILD_EXAMPLES:BOOL=OFF - TubeTK_BUILD_APPLICATIONS:BOOL=OFF - ") - string(TIMESTAMP build_date "%Y-%m-%d") - message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") - message("CTEST_SITE = \${CTEST_SITE}") - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) - EOF - cat dashboard.cmake - - - name: Build and test (Mac and Linux) - if: matrix.os != 'windows-2022' - run: | - ctest --output-on-failure -j 2 -V -S dashboard.cmake - - - name: Build and test (Windows) - if: matrix.os == 'windows-2022' - run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest --output-on-failure -j 2 -V -S dashboard.cmake - shell: cmd - - build-linux-python-packages: - runs-on: ubuntu-20.04 - timeout-minutes: 500 - strategy: - max-parallel: 1 - matrix: - manylinux-platform: ["_2_28-x64", "2014-x64"] - python-version: ["38", "39", "310", "311"] - include: - - manylinux-platform: _2_28-x64 - target-arch: x64 - - manylinux-platform: 2014-x64 - target-arch: x64 - - python-version: 38 - itk-package: "ITK-cp38-cp38-manylinux" - c-compiler: "gcc" - cxx-compiler: "g++" - - python-version: 39 - itk-package: "ITK-cp39-cp39-manylinux" - c-compiler: "gcc" - cxx-compiler: "g++" - - python-version: 310 - itk-package: "ITK-cp310-cp310-manylinux" - c-compiler: "gcc" - cxx-compiler: "g++" - - python-version: 311 - itk-package: "ITK-cp311-cp311-manylinux" - c-compiler: "gcc" - cxx-compiler: "g++" - - steps: - - uses: actions/checkout@v3 - - - name: 'Free up disk space' - run: | - # Workaround for - # https://github.com/actions/virtual-environments/issues/709 - df -h - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y '^llvm-.*' - sudo apt-get remove -y '^php-.*' - sudo apt-get autoremove -y - sudo apt-get clean - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "/usr/share/dotnet" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - - name: 'Set Swap Space' - uses: pierotofy/set-swap-space@master - with: - swap-size-gb: 10 - - - - name: 'Install dependencies' - run: | - sudo apt-get update - python -m pip install --upgrade pip - python -m pip install ninja - - - name: 'Fetch build script' - run: | - IPP_DOWNLOAD_GIT_TAG=${{ env.itk-python-package-tag }} - IPP_DOWNLOAD_ORG=${{ env.itk-python-package-org }} - curl -L https://raw.githubusercontent.com/${IPP_DOWNLOAD_ORG:=InsightSoftwareConsortium}/ITKPythonPackage/${IPP_DOWNLOAD_GIT_TAG:=master}/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - - - name: 'Git-Configure-Build MinimalPathExtraction' - run: | - rm -rf dist - rm -rf ITKPythonPackage - - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} - export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }} - #export ITK_MODULE_PREQ=${{ env.itk-module-deps }} - - MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} - export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` - export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` - export ITK_MODULE_NO_CLEANUP="true" - - git clone https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction - cp ./dockcross-manylinux-download-cache-and-build-module-wheels.sh ./ITKMinimalPathExtraction - pushd ITKMinimalPathExtraction - git checkout ${{env.itk-minimalpathextraction-git-tag}} - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} - popd - - cp ITKMinimalPathExtraction/include/* include/ - mv ./ITKMinimalPathExtraction/ITKPythonPackage . - mv ./ITKMinimalPathExtraction/tools . - mkdir -p dist - - - name: 'Setup Build Env' - shell: bash - run: | - MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} - export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` - export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` - export ITK_DIR_NAME=${{ matrix.itk-package }}${MANYLINUX_VERSION}_${TARGET_ARCH} - - cat > git-configure-build-env.sh << EOF - #!/bin/sh - ln -s -f -T /ITKPythonPackage/${ITK_DIR_NAME} /work/${ITK_DIR_NAME} - ln -s -f -T /ITKPythonPackage/ITK-source /work/ITK-source - ln -s -f -T /ITKPythonPackage/oneTBB-prefix /work/oneTBB-prefix - EOF - chmod +x ./git-configure-build-env.sh - - source "./ITKPythonPackage/scripts/dockcross-manylinux-set-vars.sh" - docker run -v $(pwd):/work/ -v $PWD/ITKPythonPackage:/ITKPythonPackage --rm ${CONTAINER_SOURCE} /work/git-configure-build-env.sh - - - name: Cache VTK Python Linux - id: cache-vtk-python-linux - uses: actions/cache@v3 - with: - path: | - VTK - VTK-build - key: linux-${{ env.vtk-git-tag }}-${{ matrix.manylinux-platform }}-${{ matrix.python-version }} - - - name: 'Git-Configure-Build VTK' - if: steps.cache-vtk-python-linux.outputs.cache-hit != 'true' - shell: bash - run: | - MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} - export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` - export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` - - cat > git-configure-build-vtk.sh << EOF - #!/bin/sh - sudo apt-get update - sudo apt-get install -y libglu1-mesa-dev mesa-common-dev libgl1-mesa-glx libglvnd-core-dev freeglut3-dev libtbb-dev zstd - python -m pip install --upgrade pip - python -m pip install ninja - git clone https://github.com/Kitware/VTK.git - cd VTK - git checkout ${{ env.vtk-git-tag }} - cd .. - mkdir -p VTK-build - cd VTK-build - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" \ - -DBUILD_TESTING:BOOL=OFF \ - -DBUILD_SHARED_LIBS:BOOL=OFF \ - -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" \ - -DCMAKE_BUILD_TYPE:STRING="Release" \ - -GNinja \ - ../VTK - ninja - EOF - chmod u+x ./git-configure-build-vtk.sh - - source "./ITKPythonPackage/scripts/dockcross-manylinux-set-vars.sh" - docker run -v $(pwd):/work/ --rm ${CONTAINER_SOURCE} /work/git-configure-build-vtk.sh - - - name: 'Build 🐍 Python 📦 package TubeTK' - timeout-minutes: 400 - run: | - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} - export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }} - #export ITK_MODULE_PREQ=${{ env.itk-module-deps }} - - export MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} - export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` - export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` - - ./ITKPythonPackage/scripts/dockcross-manylinux-build-module-wheels.sh cp${{ matrix.python-version }} - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: LinuxWheel${{ matrix.python-version }} - path: dist - - build-macos-python-packages: - runs-on: macos-11 - strategy: - max-parallel: 1 - matrix: - include: - - c-compiler: "clang" - cxx-compiler: "clang++" - - steps: - - uses: actions/checkout@v3 - - - name: 'Specific XCode version' - run: | - sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.22.2 - - - name: 'Fetch build script' - run: | - python -m pip install --upgrade pip - python -m pip install ninja - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/${{ env.itk-wheel-tag }}/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - - - name: Cache VTK Python Mac - id: cache-vtk-python-mac - uses: actions/cache@v3 - with: - path: | - VTK - VTK-build - key: mac-${{ env.vtk-git-tag }} - - - name: 'Git-Configure-Build VTK' - if: steps.cache-vtk-python-mac.outputs.cache-hit != 'true' - run: | - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - export MACOSX_DEPLOYMENT_TARGET=10.9 - git clone https://github.com/Kitware/VTK - pushd VTK - git checkout ${{env.vtk-git-tag}} - popd - mkdir VTK-build - pushd VTK-build - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_ioss:BOOL=NO -DVTK_MODULE_ENABLE_VTK_IOIOSS:BOOL=NO -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../VTK - ninja - - - name: 'Git-Configure-Build MinimalPathExtraction' - run: | - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - export MACOSX_DEPLOYMENT_TARGET=10.9 - git clone https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction - cp ./macpython-download-cache-and-build-module-wheels.sh ITKMinimalPathExtraction/ - pushd ITKMinimalPathExtraction - git checkout ${{env.itk-minimalpathextraction-git-tag}} - ./macpython-download-cache-and-build-module-wheels.sh - popd - cp ITKMinimalPathExtraction/include/* include/ - - - name: 'Git-Configure-Build SEM' - run: | - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - export MACOSX_DEPLOYMENT_TARGET=10.9 - # Can build SEM using any version of python wrapping - export ITK_DIR="/Users/svc-dashboard/D/P/ITKPythonPackage/ITK-3.9-macosx_x86_64/" - git clone https://github.com/Slicer/SlicerExecutionModel - mkdir SlicerExecutionModel-build - pushd SlicerExecutionModel-build - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../SlicerExecutionModel - ninja - - - name: 'Build 🐍 Python 📦 package TubeTK' - run: | - export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - export MACOSX_DEPLOYMENT_TARGET=10.9 - /Users/svc-dashboard/D/P/ITKPythonPackage/scripts/macpython-build-module-wheels.sh - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: MacOSWheels - path: dist - - build-windows-python-packages: - runs-on: windows-2022 - strategy: - max-parallel: 1 - matrix: - python-version-minor: ["8", "9", "10", "11"] - include: - - c-compiler: "cl.exe" - cxx-compiler: "cl.exe" - - steps: - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.22.2 - - - uses: actions/checkout@v3 - with: - path: "im" - - - name: 'Install Python' - run: | - $pythonArch = "64" - $pythonVersion = "3.${{ matrix.python-version-minor }}" - iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - - - name: 'Fetch build dependencies' - shell: bash - run: | - mv im ../../ - pushd ../../im - curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ env.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" - 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r - curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" - 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r - curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" - 7z x grep-win.zip -o/c/P/grep -aoa -r - echo "Updating ITKPythonPackage build scripts to ${{env.itk-python-package-tag}}" - git clone https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction - pushd ITKMinimalPathExtraction - git checkout ${{env.itk-minimalpathextraction-git-tag}} - popd - git clone https://github.com/Slicer/SlicerExecutionModel - - pushd /c/P/IPP - git remote add InsightSoftwareConsortium https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git --tags - git fetch InsightSoftwareConsortium - git checkout ${{env.itk-python-package-tag}} - git status - - - name: Cache VTK Python Windows - id: cache-vtk-python-windows - uses: actions/cache@v3 - with: - path: | - \a\im\VTK - \a\im\VTK-build-3${{ matrix.python-version-minor }} - key: windows-${{ env.vtk-git-tag }}-${{ matrix.python-version-minor }} - - - name: 'Git-Configure-Build VTK' - if: steps.cache-vtk-python-windows.outputs.cache-hit != 'true' - shell: cmd - run: | - pushd \a\im - - git clone https://github.com/Kitware/VTK - pushd VTK - git checkout ${{env.vtk-git-tag}} - popd - - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH=C:\P\grep;%PATH% - set CC=cl.exe - set CXX=cl.exe - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install ninja - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install cmake - - mkdir VTK-build-3${{ matrix.python-version-minor }} - pushd VTK-build-3${{ matrix.python-version-minor }} - C:\Python3${{ matrix.python-version-minor }}-x64\Scripts\cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_ioss:BOOL=NO -DVTK_MODULE_ENABLE_VTK_IOIOSS:BOOL=NO -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ..\VTK - C:\Python3${{ matrix.python-version-minor }}-x64\Scripts\ninja - - - name: 'Build 🐍 Python 📦 package' - shell: cmd - run: | - pushd ..\..\im - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH=C:\P\grep;%PATH% - set CC=cl.exe - set CXX=cl.exe - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install ninja - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install cmake - - pushd ITKMinimalPathExtraction - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" - popd - copy ITKMinimalPathExtraction\include\* include\ - - set ITK_DIR=C:\P\IPP\ITK-win_3${{ matrix.python-version-minor }}-x64 - set VTK_DIR=\a\im\VTK-build-3${{ matrix.python-version-minor }} - mkdir SlicerExecutionModel-build-3${{ matrix.python-version-minor }} - pushd SlicerExecutionModel-build-3${{ matrix.python-version-minor }} - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../SlicerExecutionModel - ninja - popd - - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: WindowsWheel3.${{ matrix.python-version-minor }} - path: ../../im/dist - - publish-python-packages-to-pypi: - needs: - - build-linux-python-packages - - build-macos-python-packages - - build-windows-python-packages - runs-on: ubuntu-20.04 - - steps: - - name: Download Python Packages - uses: actions/download-artifact@v2 - - - name: Prepare packages for upload - run: | - ls -R - for d in */; do - mv ${d}/itk_tubetk*.whl . - done - mkdir dist - mv itk_tubetk*.whl dist/ - ls dist - - - name: Publish 🐍 Python 📦 package to PyPI - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ secrets.pypi_password }} diff --git a/.gitignore b/.gitignore index b9463984b..a9565488c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.swp *.pyc *.a *.app diff --git a/CMake/CTestCustom.cmake.in b/CMake/CTestCustom.cmake.in deleted file mode 100644 index 4f5ac9910..000000000 --- a/CMake/CTestCustom.cmake.in +++ /dev/null @@ -1,232 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright 2010 Kitware Inc. 28 Corporate Drive, -# Clifton Park, NY, 12065, USA. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## - -############################################################################## -# This file is automatically generated during the TubeTK configuration process. -############################################################################## - -set( CTEST_CUSTOM_WARNING_MATCH - ${CTEST_CUSTOM_WARNING_MATCH} - "{standard input}:[0-9][0-9]*: Warning: " - "{standard input}:[0-9][0-9]*: warning: " ) - -set( CTEST_CUSTOM_TESTS_IGNORE -${CTEST_CUSTOM_TESTS_IGNORE} -MinimalPathExtraction_Noise_01_NeighborhoodIterate -MinimalPathExtraction_Noise_01_GradientDescent -MinimalPathExtraction_Noise_01_RegularStepGradientDescent -MinimalPathExtraction_Synthetic_01_NeighborhoodIterate -MinimalPathExtraction_Synthetic_01_GradientDescent -MinimalPathExtraction_Synthetic_01_RegularStepGradientDescent -MinimalPathExtraction_Synthetic_02_NeighborhoodIterate -MinimalPathExtraction_Synthetic_02_GradientDescent -MinimalPathExtraction_Synthetic_02_RegularStepGradientDescent -MinimalPathExtraction_Synthetic_03_NeighborhoodIterate -MinimalPathExtraction_Synthetic_04_NeighborhoodIterate -MinimalPathExtraction_Synthetic_04_GradientDescent -MinimalPathExtraction_Synthetic_04_RegularStepGradientDescent -MinimalPathExtraction_Real_DSA_01_01_NeighborhoodIterate -MinimalPathExtraction_Real_DSA_01_01_RegularStepGradientDescent -MinimalPathExtraction_Real_DSA_01_02_NeighborhoodIterate -MinimalPathExtraction_Real_DSA_01_02_RegularStepGradientDescent ) - -set( CTEST_CUSTOM_COVERAGE_EXCLUDE - # Exclude try_compile sources from coverage results: - "/CMakeFiles/CMakeTmp/" - - # Exclude files generated by the moc pre-compiler - ".*/moc_.*" - - # Exclude files generated by the uic pre-compiler - ".*/ui_.*" - - # Exclude files generated by the resource pre-compiler - ".*/qrc_.*" - - # Exclude files from the Testing directories - ".*/CoverageInfo/.*/Testing/.*" - - # Exclude files from the Testing directories - ".*/KWStyle/.*" - - # Exclude generated python files - ".*Python.cxx" - ".*PythonInit.cxx" - - # Exclude generated cpp files - ".*/generated_cpp/.*" - - ".*CLP.h" - - ${CTEST_CUSTOM_COVERAGE_EXCLUDE} ) - -set( CTEST_CUSTOM_MEMCHECK_IGNORE - # Ignore possible memory leaks in the Python interpreter. - PrintSelf-BaseObjectDocument - PrintSelf-BaseRegistration - PrintSelf-BaseMetaIO - PrintSelf-BaseNumerics - PrintSelf-TubeTKLibCommon - PrintSelf-TubeTKLibFiltering - PrintSelf-TubeTKLibIO - PrintSelf-TubeTKLibNumerics - PrintSelf-TubeTKLibObjectDocuments - PrintSelf-TubeTKLibRegistration - PrintSelf-TubeTKLibSegmentation ) - -# GLOB automatically recurses in subdirectories. -set( CTEST_EXTRA_COVERAGE_GLOB - */*.cxx - */*.txx - */*.hxx ) - -set( CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 2500 ) - -set( CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 2500 ) - -set( CTEST_CUSTOM_ERROR_EXCEPTION - ${CTEST_CUSTOM_ERROR_EXCEPTION} - # Numpy errors - "NUMPY.*Warning" - "NUMPY._configtest.*undefined reference" - "_configtest.*error" - "collect2: ld returned 1 exit status" ) - -set( CTEST_CUSTOM_WARNING_EXCEPTION - ${CTEST_CUSTOM_WARNING_EXCEPTION} - "Microsoft SDKs." - "VC.include." - - # ITK - "itkHexahedronCell.*iteration 2" - "itkHexahedronCell.*within this loop" - - # MacOS - "CoreFoundation are out of sync" - - # Fake library is empty - "itkTubeTK_fake_library_src.*empty" - "itkTubeTK_fake_library_src.*no symbols" - "libitkTubeTK-.*empty" - - # incrTcl - "generic.itk_(option|archetype).*warning" - "generic.itcl_.*warning" - - # gdcm - "gdcm.*warning.*undefined" - - # HDF5 - "H5.*warning.*undefined" - - # jsconcpp - "json.*reader.h.*non dll-interface.*Factor" - - # svm - "LIBSVM.*shadows" - "LIBSVM.*strtok" - "LIBSVM.*strdup" - "LIBSVM.*fscanf" - "LIBSVM.*fopen" - "LIBSVM.*strcpy" - "LIBSVM.*sprintf" - "LIBSVM.*sscanf" - "LIBSVM.*vsprintf" - "LIBSVM.*min.*redefinition" - "LIBSVM.*max.*redefinition" - "LIBSVM.*declaration is here" - - # cppcheck - "[Cc]ppcheck.[Ll]ib" - "[Cc]ppcheck.[Ee]xternals" - "[Cc]ppcheck.[Cc]li" - "[Ll]ib.[Bb]uild.mc_.*cpp.*not used" - "[Ll]ib.[Bb]uild.mc_.*cpp.*Winline" - - # KWStyle - "KWStyle.[Uu]tilities.[Bb]oost.[Xx]pressive" - "KWStyle.kwStyle.cxx.*not used" - "KWStyle.kwsStyle.cxx.*not used" - "KWStyle.[Tt]esting" - "detail.dynamic.sequence.hpp.*xpr.*shadows" - - # numpy - used when TubeTK is wrapped - "Using deprecated NumPy API" - - # SlicerExecutionModel - "GenerateCLP.cxx.*unused" - "[Ss]licer[Ee]xecution[Mm]odel.*Module.*dll-interface" - "[Ss]licer[Ee]xecution[Mm]odel.*Module.*conversion" - "[Ss]licer[Ee]xecution[Mm]odel.*GenerateCLP.*conversion" - - # Slicer - "Slicer.CMake.SlicerMacroConfigureGenericCxxModuleTests.*(if)" - - # STL - Tiger - "include.c.*bits.stl_algo.h.*warning: comparison between signed" - - # Make - "warning: jobserver unavailable" - - # Suppressing warnings about duplicate libraries in Darwin - # At some point this may be addressed by CMake feature request: - # https://public.kitware.com/Bug/view.php?id=10179 - "ld: warning: duplicate dylib" - - # Suppressing warnings about GL_GLEXT_LEGACY, the link reported below - # report a similar problem with GL_GLEXT_PROTOTYPE. - # https://lists.apple.com/archives/mac-opengl/2009/Dec/msg00081.html - # That problem could be solved installing a newer version of X11 SDK - # See https://xquartz.macosforge.org/trac/changeset/343 - ".*warning.*GL_GLEXT_LEGACY.*redefined" - - # ITK suppressions - #"[Uu]tilities.gdcm" - #"[Uu]tilities.vxl" - #"[Uu]tilities.itktiff" - #"[Cc]ore.[Cc]ommon.[Ii]nclude.itkImageRegionConstIteratorWithIndex.hxx.*assuming signed overflow does not occur" - #"SetRotationMatrix.*deprecated" - #"KWSys.*SharedForward.*_snprintf" - #"KWSys.*SharedForward.*strcpy" - #"KWSys.*SharedForward.*strncpy" - #"KWSys.*SharedForward.*strcat" - #"KWSys.*SharedForward.*putenv" - #"KWSys.*SharedForward.*getenv" - #"[Mm]odules.[Ff]iltering.[Ff]ast[Mm]arching" - #"[Mm]odules.[Rr]emote.[Mm]inimal[Pp]ath[Ee]xtraction" - #"[Mm]odules.*unary minus operator applied to unsigned" - #"libpcre.*has no symbols" - #"current project.*configured.*standard version older" - ## MacOS 10.12 deprecations - #"OSMemory.*deprecated" - #"OSAtomic.*deprecated" - - # Visual studio spurious warnings... - "The following environment variables were not found" - - # Git - "HEAD is now" - - # Gcc - "unrecognized command line option.*no-unused-local-typedefs" - ) diff --git a/CMake/CopyFiles.cmake b/CMake/CopyFiles.cmake deleted file mode 100644 index 20cf27a42..000000000 --- a/CMake/CopyFiles.cmake +++ /dev/null @@ -1,2 +0,0 @@ -file( COPY ./ DESTINATION "${CMAKE_ARGV3}" - FILES_MATCHING PATTERN "${CMAKE_ARGV4}" ) diff --git a/CMake/Dockerfiles/Dockerfile-cuda-itk-vtk-sem-af b/CMake/Dockerfiles/Dockerfile-cuda-itk-vtk-sem-af deleted file mode 100644 index 8d832b1f4..000000000 --- a/CMake/Dockerfiles/Dockerfile-cuda-itk-vtk-sem-af +++ /dev/null @@ -1,147 +0,0 @@ -FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04 -MAINTAINER Deepak Roy Chittajallu - -# Install system pre-requisites -RUN apt-get update && \ - apt-get install -y \ - build-essential wget git \ - make cmake cmake-curses-gui ninja-build \ - libxt-dev libgl1-mesa-dev libcupti-dev \ - libboost-all-dev libfftw3-dev liblapack-dev liblapacke-dev libopenblas-dev \ - libfontconfig1-dev libfreeimage-dev xorg-dev \ - ocl-icd-opencl-dev opencl-headers && \ - apt-get autoremove && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ - echo "50.58.123.189 data.kitware.com" >> /etc/hosts && \ - echo "50.58.123.181 midas3.kitware.com" >> /etc/hosts - -# Setting up symlinks for libcuda and OpenCL ICD -RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib/libcuda.so.1 && \ - ln -s /usr/lib/libcuda.so.1 /usr/lib/libcuda.so && \ - mkdir -p /etc/OpenCL/vendors && \ - echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd && \ - echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \ - echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf && \ - ldconfig -ENV PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} - -# Libraries build path -ENV BUILD_PATH /build - -# Install miniconda -RUN mkdir -p $BUILD_PATH && \ - wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh \ - -O $BUILD_PATH/install_miniconda.sh && \ - bash $BUILD_PATH/install_miniconda.sh -b -p $BUILD_PATH/miniconda && \ - rm $BUILD_PATH/install_miniconda.sh && \ - chmod -R +r $BUILD_PATH && \ - chmod +x $BUILD_PATH/miniconda/bin/python -ENV PATH $BUILD_PATH/miniconda/bin:${PATH} - -# Install CMake -ENV CMAKE_ARCHIVE_SHA256 10ca0e25b7159a03da0c1ec627e686562dc2a40aad5985fd2088eb684b08e491 -ENV CMAKE_VERSION_MAJOR 3 -ENV CMAKE_VERSION_MINOR 8 -ENV CMAKE_VERSION_PATCH 1 -ENV CMAKE_VERSION ${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}.${CMAKE_VERSION_PATCH} -RUN cd $BUILD_PATH && \ - wget https://cmake.org/files/v${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz && \ - hash=$(sha256sum ./cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz | awk '{ print $1 }') && \ - [ $hash = "${CMAKE_ARCHIVE_SHA256}" ] && \ - tar -xzvf cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz && \ - rm cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz -ENV PATH $BUILD_PATH/cmake-${CMAKE_VERSION}-Linux-x86_64/bin:${PATH} - -# Disable "You are in 'detached HEAD' state." warning -RUN git config --global advice.detachedHead false - -# Download/configure/build/install ITK -ENV ITK_GIT_TAG v4.11.1 -ENV ITK_BUILD_DIR $BUILD_PATH/ITK-build -RUN cd $BUILD_PATH && \ - git clone --depth 1 -b ${ITK_GIT_TAG} https://github.com/InsightSoftwareConsortium/ITK.git && \ - mkdir ITK-build && \ - cd ITK-build && \ - cmake \ - -G Ninja \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DBUILD_EXAMPLES:BOOL=OFF \ - -DBUILD_TESTING:BOOL=OFF \ - -DITKV3_COMPATIBILITY:BOOL=ON \ - -DITK_BUILD_DEFAULT_MODULES:BOOL=ON \ - -DITK_INSTALL_NO_DEVELOPMENT:BOOL=ON \ - -DITK_LEGACY_REMOVE:BOOL=OFF \ - -DITK_LEGACY_SILENT:BOOL=ON \ - -DITK_WRAP_PYTHON:BOOL=ON \ - -DModule_MinimalPathExtraction:BOOL=ON \ - -DKWSYS_USE_MD5:BOOL=ON \ - -DModule_ITKReview:BOOL=ON \ - ../ITK && \ - ninja && \ - cp Wrapping/Generators/Python/WrapITK.pth $BUILD_PATH/miniconda/lib/python2.7/site-packages && \ - python -c "import itk" && \ - find . -name '*.o' -delete && \ - find ../ITK* -depth -name .git -exec rm -rf '{}' \; - -# Download/configure/build/install SlicerExecutionModel -ENV SEM_GIT_TAG master -ENV SEM_BUILD_DIR $BUILD_PATH/SEM-build -RUN cd $BUILD_PATH && \ - git clone --depth 1 -b ${SEM_GIT_TAG} https://github.com/Slicer/SlicerExecutionModel.git SEM && \ - mkdir SEM-build && cd SEM-build && \ - cmake \ - -G Ninja \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DBUILD_TESTING:BOOL=OFF \ - -DITK_DIR:PATH=$BUILD_PATH/ITK-build \ - ../SEM && \ - ninja && \ - find . -name '*.o' -delete && \ - find ../SEM* -depth -name .git -exec rm -rf '{}' \; - -# Download and install slicer_cli_web -ENV SLICER_CLI_WEB_GIT_TAG master -RUN cd $BUILD_PATH && \ - pip install --upgrade 'git+https://github.com/cdeepakroy/ctk-cli' && \ - git clone --depth 1 -b ${SLICER_CLI_WEB_GIT_TAG} https://github.com/girder/slicer_cli_web.git && \ - cd slicer_cli_web && \ - find . -depth -name .git -exec rm -rf '{}' \; - -# Download/configure/build/install GLFW -ENV GLFW_GIT_TAG 3.2.1 -RUN cd $BUILD_PATH && \ - git clone --depth 1 -b ${GLFW_GIT_TAG} https://github.com/glfw/glfw.git && \ - mkdir glfw-build && cd glfw-build && \ - cmake \ - -G Ninja \ - -DCMAKE_INSTALL_PREFIX=/usr \ - ../glfw && \ - ninja install && \ - cd .. && rm -rf glfw* - -# Download/configure/build/install arrayfire -ENV AF_GIT_TAG devel -ENV AF_PATH=/usr/local/arrayfire AF_DISABLE_GRAPHICS=1 -RUN cd $BUILD_PATH && \ - git clone --recursive --depth 1 -b ${AF_GIT_TAG} https://github.com/arrayfire/arrayfire.git && \ - mkdir arrayfire-build && cd arrayfire-build && \ - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_CPU=ON \ - -DBUILD_CUDA=ON \ - -DBUILD_OPENCL=OFF \ - -DBUILD_UNIFIED=ON \ - -DBUILD_GRAPHICS=OFF \ - -DBUILD_NONFREE=OFF \ - -DBUILD_EXAMPLES=OFF \ - -DBUILD_TEST=OFF \ - -DBUILD_DOCS=OFF \ - -DUSE_FREEIMAGE_STATIC=OFF \ - ../arrayfire && \ - make && make install && \ - echo "${AF_PATH}/lib" >> /etc/ld.so.conf.d/arrayfire.conf && \ - echo "/usr/local/cuda/nvvm/lib64" >> /etc/ld.so.conf.d/arrayfire.conf && \ - ldconfig && \ - cd $BUILD_PATH && rm -rf arrayfire* diff --git a/CMake/Dockerfiles/Dockerfile-tubetk-applications b/CMake/Dockerfiles/Dockerfile-tubetk-applications deleted file mode 100644 index 3c0331269..000000000 --- a/CMake/Dockerfiles/Dockerfile-tubetk-applications +++ /dev/null @@ -1,47 +0,0 @@ -FROM kitwaremedical/cuda-itk-vtk-sem-af -MAINTAINER Deepak Roy Chittajallu - -# Download/configure/build/install TubeTK -ENV TubeTK_SRC_DIR=${BUILD_PATH}/TubeTK -ENV TubeTK_BUILD_DIR=${BUILD_PATH}/TubeTK-build -RUN mkdir -p ${TubeTK_SRC_DIR} && mkdir -p ${TubeTK_BUILD_DIR} -COPY . ${TubeTK_SRC_DIR} -WORKDIR ${TubeTK_BUILD_DIR} - -RUN cmake \ - -G Ninja \ - -DTubeTK_BUILD_APPLICATIONS:BOOL=ON \ - -DTubeTK_USE_PYTHON:BOOL=ON \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DBUILD_TESTING:BOOL=ON \ - -DTubeTK_BUILD_USING_SLICER:BOOL=OFF \ - -DTubeTK_USE_ARRAYFIRE:BOOL=ON \ - -DTubeTK_USE_EXAMPLES_AS_TESTS:BOOL=OFF \ - -DTubeTK_USE_BOOST:BOOL=OFF \ - -DTubeTK_USE_PYQTGRAPH:BOOL=OFF \ - -DTubeTK_USE_NUMPY_STACK:BOOL=OFF \ - -DITK_DIR:PATH=$ITK_BUILD_DIR \ - -DUSE_SYSTEM_SLICER_EXECUTION_MODEL:BOOL=ON \ - -DSlicerExecutionModel_DIR:PATH=$SEM_BUILD_DIR \ - ../TubeTK && \ - ninja - -RUN cd ${TubeTK_BUILD_DIR} && \ - cp TubeTK-build/ITKModules/TubeTKITK-build/Wrapping/Generators/Python/WrapITK.pth $BUILD_PATH/miniconda/lib/python2.7/site-packages/WrapITKTubeTK.pth && \ - cp TubeTK-build/PythonModules/tubetk.pth $BUILD_PATH/miniconda/lib/python2.7/site-packages && \ - find . -name "*.o" -delete && \ - find ../TubeTK* -depth -name .git -exec rm -rf '{}' \; && \ - cd $TubeTK_SRC_DIR && \ - pip install -r requirements-ml.txt && \ - cd $TubeTK_SRC_DIR/Applications && \ - python generate_slicer_cli_list_json.py -ENV PATH="${TubeTK_BUILD_DIR}/TubeTK-build/bin:${PATH}" - -# Set workdir to TubeTK Applications -WORKDIR $TubeTK_SRC_DIR/Applications - -# Test slicer_cli_web entrypoint -RUN python /build/slicer_cli_web/server/cli_list_entrypoint.py --list_cli - -# Set entrypoint -ENTRYPOINT ["/build/miniconda/bin/python", "/build/slicer_cli_web/server/cli_list_entrypoint.py"] diff --git a/CMake/EvaluateIPythonNotebook.py b/CMake/EvaluateIPythonNotebook.py deleted file mode 100644 index f673dea62..000000000 --- a/CMake/EvaluateIPythonNotebook.py +++ /dev/null @@ -1,96 +0,0 @@ -"""EvaluateIPythonNotebook.py - - This is a modified version of minrk's script - - https://gist.github.com/minrk/2620876 - - to quickly evaluate an IPython notebook and check for failures. -""" - -import os -import sys -import time - -from Queue import Empty - -try: - from jupyter_client import KernelManager -except ImportError: - from IPython.zmq.blockingkernelmanager import BlockingKernelManager as KernelManager - -from nbformat import reads, NotebookNode - - -def run_notebook(nb): - """Run IPython Notebook. - - Paramters: - ---------- - nb : IPython Notebook in JSON format. - - Returns: - -------- - ret : int - Return value; 0 in case of no failure, 1 otherwise - """ - - - km = KernelManager() - km.start_kernel(stderr=open(os.devnull, 'w')) - try: - kc = km.client() - except AttributeError: - # 0.13 - kc = km - kc.start_channels() - shell = kc.shell_channel - # simple ping: - try: - send = kc.execute - except AttributeError: - send = kc.shell_channel.execute - send("pass") - reply = shell.get_msg() - - cells = 0 - failures = 0 - for ws in nb.worksheets: - for cell in ws.cells: - if cell.cell_type != 'code': - continue - send(cell.input) - # wait for finish, maximum 20s - reply = shell.get_msg(timeout=20)['content'] - if reply['status'] == 'error': - failures += 1 - print "\nFAILURE:" - print cell.input - print '-----' - print "raised:" - print '\n'.join(reply['traceback']) - cells += 1 - sys.stdout.write('.') - - print - print "ran notebook %s" % nb.metadata.name - print " ran %3i cells" % cells - if failures: - print " %3i cells raised exceptions" % failures - kc.stop_channels() - km.shutdown_kernel() - del km - - if failures: - return 1 - return 0 - - -if __name__ == '__main__': - # opens the IPython notebook - with open(sys.argv[1]) as f: - nb = reads(f.read(), 3 ) #, 'json') - - # since this code is typically used for testing IPython notebooks, the - # TubeTK path is passed along from cmake - os.environ['TubeTK_BINARY_DIR'] = sys.argv[2] - sys.exit(run_notebook(nb)) diff --git a/CMake/GitSetup/.gitattributes b/CMake/GitSetup/.gitattributes deleted file mode 100644 index 3323f94b9..000000000 --- a/CMake/GitSetup/.gitattributes +++ /dev/null @@ -1,9 +0,0 @@ -.git* export-ignore - -# Exclude from source archives files specific to Git work tree. -* export-ignore - -config* eol=lf whitespace=indent-with-non-tab -git-* eol=lf whitespace=indent-with-non-tab -tips eol=lf whitespace=indent-with-non-tab -setup-* eol=lf whitespace=indent-with-non-tab diff --git a/CMake/GitSetup/README.md b/CMake/GitSetup/README.md deleted file mode 100644 index 5fccf3d78..000000000 --- a/CMake/GitSetup/README.md +++ /dev/null @@ -1,5 +0,0 @@ -TubeTK GitSetup Utilities -========================= - ---- -*This file is part of [TubeTK](http://www.tubetk.org). TubeTK is developed by [Kitware, Inc.](https://www.kitware.com) and licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).* diff --git a/CMake/GitSetup/hooks/commit-msg b/CMake/GitSetup/hooks/commit-msg deleted file mode 100755 index 174c9a461..000000000 --- a/CMake/GitSetup/hooks/commit-msg +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env bash -#============================================================================= -# Copyright 2010-2012 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -. "${BASH_SOURCE%/*}/hooks-config.bash" - -# Start with project-specific hook. -hooks_start commit-msg "$@" - -# Prepare a copy of the message: -# - strip comment lines -# - stop at "diff --git" (git commit -v) -commit_msg="$GIT_DIR/COMMIT_MSG" -sed -n -e '/^#/d' -e '/^diff --git/q' -e 'p;d' "$1" > "$commit_msg" - -die_advice=' -To continue editing, run the command - git commit -e -F '"$commit_msg"' -(assuming your working directory is at the top).' - -die() { - echo 'commit-msg hook failure' 1>&2 - echo '-----------------------' 1>&2 - echo '' 1>&2 - echo "$@" 1>&2 - test -n "$die_advice" && echo "$die_advice" 1>&2 - exit 1 -} - -#----------------------------------------------------------------------------- -# Check the commit message layout with a simple state machine. - -msg_is_merge() { - echo "$line" | grep "^Merge " >/dev/null 2>&1 -} - -msg_is_revert() { - echo "$line" | grep "^Revert " >/dev/null 2>&1 -} - -msg_first() { - len=$(echo -n "$line" | wc -c) - if test $len -eq 0; then - # not yet first line - return - elif test $len -lt 8; then - die 'The first line must be at least 8 characters: --------- -'"$line"' ---------' - elif test $len -gt 78 && ! msg_is_merge && ! msg_is_revert; then - die 'The first line may be at most 78 characters: ------------------------------------------------------------------------------- -'"$line"' -------------------------------------------------------------------------------' - elif echo "$line" | grep "^[ ]\|[ ]$" >/dev/null 2>&1; then - die 'The first line may not have leading or trailing space: -['"$line"']' - else - # first line okay - state=second - fi -} - -msg_second() { - if test "x$line" != "x"; then - die 'The second line must be empty: -'"$line" - else - state=rest - fi -} - -msg_rest() { -: -} - -# Pipe commit message into the state machine. -state=first -cat "$commit_msg" | -while IFS='' read line; do - msg_$state || break -done && -rm -f "$commit_msg" || exit 1 -die_advice='' # No more temporary message file. - -#----------------------------------------------------------------------------- -# Chain to project-specific hook. -hooks_chain commit-msg "$@" diff --git a/CMake/GitSetup/hooks/hooks-config.bash b/CMake/GitSetup/hooks/hooks-config.bash deleted file mode 100644 index cb734b3ff..000000000 --- a/CMake/GitSetup/hooks/hooks-config.bash +++ /dev/null @@ -1,66 +0,0 @@ -#============================================================================= -# Copyright 2010-2012 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -# Make sure GIT_DIR is set. -if test -z "$GIT_DIR"; then - export GIT_DIR=$(git rev-parse --git-dir) -fi - -# Load hooks configuration from source tree. -hooks_config=".hooks-config" -if test -r "$hooks_config"; then - hooks_config() { - git config -f "$hooks_config" "$@" - } -else - hooks_config() { - false - } -fi -config=".hooks-config.bash" && test -r "$config" && . "$config" - -# Set up the location for "this" set of hooks. -HOOKS_DIR="${BASH_SOURCE%/*}" - -hooks_chain() { - hook="$1" ; shift - chain=$(git config --get hooks.chain-$hook) || - chain="$(hooks_config --get hooks.chain.$hook)" || - eval chain="\${hooks_chain_${hook//-/_}}" - hooks_child "$chain" "$@" || exit -} - -hooks_start() { - hook="$1" ; shift - start="$(hooks_config --get hooks.start.$hook)" - hooks_child "$start" "$@" || exit -} - -hooks_child() { - child="$1" ; shift - test -n "$child" || return 0 - case "$child" in - '/'*) prefix="" ;; - '[A-Za-z]:/'*) prefix="" ;; - '.'*) prefix="" ;; - *) prefix="./" ;; - esac - if test -x "$prefix$child" ; then - "$prefix$child" "$@" - fi -} - -# vim: set filetype=sh tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab : diff --git a/CMake/GitSetup/hooks/pre-commit b/CMake/GitSetup/hooks/pre-commit deleted file mode 100755 index 4911e6956..000000000 --- a/CMake/GitSetup/hooks/pre-commit +++ /dev/null @@ -1,334 +0,0 @@ -#!/usr/bin/env bash -#============================================================================= -# Copyright 2010-2012 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -. "${BASH_SOURCE%/*}/hooks-config.bash" - -# Start with project-specific hook. -hooks_start pre-commit "$@" - -die() { - echo 'pre-commit hook failure' 1>&2 - echo '-----------------------' 1>&2 - echo '' 1>&2 - echo "$@" 1>&2 - exit 1 -} - -zero='0000000000000000000000000000000000000000' - -#----------------------------------------------------------------------------- -# Check for committer identity. -advice=' -Use the commands - - git config --global user.name '\''Your Name'\'' - git config --global user.email '\''you@yourdomain.com'\'' - -to introduce yourself to Git before committing.' - -# Ensure name and email are available. -git config --get user.name > /dev/null && -git config --get user.email > /dev/null || -die 'Identity not configured!' "$advice" - -# Validate the name and email. -git config --get user.name | grep ' ' > /dev/null || -die 'Set user.name to your Real Name (with a space), not a userid.' "$advice" -git config --get user.email | grep '^[^@]*@[^@]*$' > /dev/null || -die 'Set user.email to an email address (userid@validdomain.com).' "$advice" - -#----------------------------------------------------------------------------- -# Check content that will be added by this commit. - -if git rev-parse --verify -q HEAD > /dev/null; then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 -fi - -# Merge ("git commit" after "git merge" with conflicts or --no-commit) -merge_head=$(git rev-parse -q --verify MERGE_HEAD) || merge_head='' - -# Disallow non-ascii file names. The printable range starts at the -# space character and ends with tilde. -if test "$(git diff --cached --name-only --diff-filter=A -z $against | - LC_ALL=C tr -d '[ -~]\0')"; then - die 'Non-ascii file names may not be added: -'"$(git diff --cached --name-only --diff-filter=A $against)" -fi - -#----------------------------------------------------------------------------- -# Builtin whitespace checks. -bad=$(git diff-index --check --cached $against --) || die "$bad" - -# Approximate whitespace=tab-in-indent check with Git < 1.7.2. -git --version | grep -q " \(1\.[0-6]\|1\.7\.[01]\)" && -approx_tab_in_indent=true || approx_tab_in_indent=false -check_tab() { - lines=$(git diff-index -p --cached $against -- "$1" | - grep '^+ ') && - echo "$lines" | - while read line; do - echo "$1: tab in indent." && - echo "$line" - done -} - -# Reject addition of a line without a newline at end-of-file. -check_no_lf_at_eof() { - lines=$(git diff-index -p --cached $against -- "$1" | tail -2) - if echo "$lines" | head -1 | grep -q '^+' && - echo "$lines" | tail -1 | grep -q '^\\ No newline'; then - echo "$1: No newline at end of file" - fi -} - -# Custom whitespace checks. -check_whitespace() { - ws=$(git check-attr whitespace -- "$file" | - sed 's/^[^:]*: whitespace: //') - if $approx_tab_in_indent; then - case ",$ws," in - *,tab-in-indent,*) check_tab "$1" ;; - esac - fi - case ",$ws," in - *,no-lf-at-eof,*) check_no_lf_at_eof "$1" ;; - esac -} -bad=$(git diff-index --name-only --cached $against -- | -while read file; do - check_whitespace "$file" -done) -test -z "$bad" || die "$bad" - -#----------------------------------------------------------------------------- -# Check file modes and sizes. -mode_looks_exe() { - case "$1" in - *.bat) return 0 ;; - *.cmd) return 0 ;; - *.exe) return 0 ;; - *.com) return 0 ;; - esac - git cat-file blob "$2" | head -1 | grep "^#!/" > /dev/null -} -mode_not_exe () { - echo "The file '$file' has looks executable but does not have an executable mode." -} -mode_bad_exe () { - echo "The file '$file' has executable mode but does not look executable." -} -mode_non_file () { - echo "The path '$file' has a non-file mode." -} -check_mode() { - case "$dst_mode" in - 100755) mode_looks_exe "$file" "$dst_obj" || mode_bad_exe ;; - 100644) mode_looks_exe "$file" "$dst_obj" && mode_not_exe ;; - 160000) ;; - *) mode_non_file ;; - esac -} - -size_max_KiB=$(git config hooks.MaxObjectKiB) -test -n "$size_max_KiB" || size_max_KiB=1024 -size_too_large_once="" -size_too_large_once() { - test -z "$size_too_large_once" || return ; size_too_large_once=done - echo 'At least one file is staged for commit with size larger than its limit. -We prefer to keep large files out of the main source tree, especially -binary files that do not compress well. This hook disallows large files -by default but can be configured. A limit for specific files or patterns -may be set in ".gitattributes" with the "hooks.MaxObjectKiB" attribute. -For example, the line - - *.c hooks.MaxObjectKiB=2048 - -sets a limit of 2048 KiB for C source files. See "git help attributes" -for details on the .gitattributes format. If no attribute has been set -for a given file then its size is limited by the local default. Run - - git config hooks.MaxObjectKiB $KiB - -to set the local default limit (0 to disable). -' -} -size_too_large() { - size_too_large_once - echo "The path '$file' has size $file_KiB KiB, greater than allowed $max_KiB KiB." -} -size_validate_max_KiB() { - test "$max_KiB" -ge "0" 2>/dev/null && return 0 - echo "The path '$file' has invalid attribute \"hooks-MaxObjectKiB=$max_KiB\"." - return 1 -} -check_size() { - test "$dst_obj" != "$zero" || return - max_KiB=$(git check-attr hooks.MaxObjectKiB -- "$file" | - sed 's/^[^:]*: hooks.MaxObjectKiB: //') - case "$max_KiB" in - 'unset') return ;; # No maximum for this object. - 'set') max_KiB="$size_max_KiB" ;; # Use local default. - 'unspecified') max_KiB="$size_max_KiB" ;; # Use local default. - *) size_validate_max_KiB || return ;; - esac - if test "$max_KiB" -gt "0"; then - file_KiB=$(expr '(' $(git cat-file -s "$dst_obj") + 1023 ')' / 1024) - test "$file_KiB" -le "$max_KiB" || size_too_large - fi -} - -short_commit() { - git rev-parse --short "$1" 2>/dev/null || echo "$1" -} - -lookup_config_module_update() { - update=$(git config "hooks.$1.update") - - # Special-case "true" to accept any update. - test "{$update}" = "{true}" && echo '.' && return - - # Format is "aaaaaa..bbbbbb" for update aaaaaa => bbbbbb. - # Convert to regex "^aaaaaa[a-z0-9]* bbbbbb[a-z0-9]*$". - sha1ex='[a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9][a-z0-9]*' - regex='^\('"$sha1ex"'\)\.\.\('"$sha1ex"'\)$' - echo "$update" | - sed -n "/$regex/ {s/$regex/"'^\1[a-z0-9]* \2[a-z0-9]*$/;p;}' | - grep '.' # Return false if result is empty. -} - -check_module() { - enabled=$(git config --get --bool hooks.submodule) || enabled=true - test "$enabled" = "false" && return - - # Allow merged submodule updates. - test -n "$merge_head" && - merge_obj=$(git rev-parse -q --verify "$merge_head:$file") && - test "$merge_obj" = "$dst_obj" && return - - # Allow module-only commits without extra work. - test -z "$diffs_normal" && return - - # Check if module update is allowed with other changes. - allow=$(lookup_config_module_update "$file") || allow='none' - if echo "$src_obj $dst_obj" | grep "$allow" > /dev/null; then - return - fi - src_short=$(short_commit "$src_obj") - dst_short=$(short_commit "$dst_obj") - echo 'A submodule link is staged for commit (among other changes): - - "'"$file"'" '"$src_short => $dst_short"' - -This may occur by accident so we require an extra step to commit. -If you intend to include this change in your commit, run - - git config "hooks.'"$file"'.update" '"$src_short..$dst_short"' - -to explicitly allow the change and try the commit again. Otherwise run - - git reset HEAD -- "'"$file"'" - -to unstage the change. Furthermore, if you did not intend to modify -the submodule at all, also run - - git submodule update -- "'"$file"'" - -to checkout the current version of the submodule in your work tree. -Test your changes again to see if they still work with the module. -Finally, try the commit again. -' - return 1 -} - -check_module_rewind() { - parent_name="$1" - parent_commit="$2" - base=$(GIT_DIR="$file/.git" \ - git merge-base $src_obj $dst_obj 2>/dev/null) || base='' - test "$base" != "$dst_obj" && return - parent_short=$(short_commit "$parent_commit") - src_short=$(GIT_DIR="$file/.git" short_commit "$src_obj") - dst_short=$(GIT_DIR="$file/.git" short_commit "$dst_obj") - echo 'This commit would rewind a submodule link: - - "'"$file"'" '"$src_short => $dst_short"' - -from the newer version in '"$parent_name"' ('"$parent_short"'). Run - - git reset '"$parent_name"' -- "'"$file"'" - git submodule update -- "'"$file"'" - -to checkout the newer version of the submodule in your work tree. -Then try the commit again. -' - return 1 -} - -diffs=$(git diff-index --cached $against -- | - sed -n '/^:[^:]/ {s/^://;p;}') -diffs_normal=$(echo "$diffs" | grep -v '^...... 160000') -diffs_module=$(echo "$diffs" | grep '^...... 160000') -bad=$( -test -n "$diffs_normal" && echo "$diffs_normal" | -while read src_mode dst_mode src_obj dst_obj status file; do - if test "$src_mode" != "$dst_mode" -a "$dst_mode" != "000000"; then - check_mode - fi - if test "$dst_mode" != "160000" -a "$dst_mode" != '000000'; then - check_size - fi -done -test -n "$diffs_module" && echo "$diffs_module" | -while read src_mode dst_mode src_obj dst_obj status file; do - check_module_rewind HEAD "$against" && - check_module || - break -done -) -test -z "$bad" || die "$bad" - -#----------------------------------------------------------------------------- -# Merge checks. -if test -n "$merge_head"; then - merge_diffs=$(git diff-index --cached $merge_head -- | - sed -n '/^:[^:]/ {s/^://;p;}') -else - merge_diffs='' -fi -merge_diffs_normal=$(echo "$merge_diffs" | grep -v '^...... 160000') -merge_diffs_module=$(echo "$merge_diffs" | grep '^...... 160000') -bad=$( -test -n "$merge_diffs_module" && echo "$merge_diffs_module" | -while read src_mode dst_mode src_obj dst_obj status file; do - check_module_rewind MERGE_HEAD "$merge_head" || - break -done -) -test -z "$bad" || die "$bad" - -#----------------------------------------------------------------------------- -# Chain to project-specific hook. -hooks_chain pre-commit "$@" - -#----------------------------------------------------------------------------- -# Style hooks. -. "${BASH_SOURCE%/*}/pre-commit-style.bash" - -# vim: set filetype=sh tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab : diff --git a/CMake/GitSetup/hooks/prepare-commit-msg b/CMake/GitSetup/hooks/prepare-commit-msg deleted file mode 100755 index ab9b6804d..000000000 --- a/CMake/GitSetup/hooks/prepare-commit-msg +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -#============================================================================= -# Copyright 2010-2012 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -. "${BASH_SOURCE%/*}/hooks-config.bash" - -# Start with project-specific hook. -hooks_start prepare-commit-msg "$@" - -#----------------------------------------------------------------------------- -# Chain to project-specific hook. -hooks_chain prepare-commit-msg "$@" diff --git a/CMake/GitSetup/setup-hooks b/CMake/GitSetup/setup-hooks deleted file mode 100755 index cf41f77a6..000000000 --- a/CMake/GitSetup/setup-hooks +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -#============================================================================= -# Copyright 2010-2012 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -# Run this script to set up local Git hooks for this project. - -# Project configuration instructions: -# -# - Publish a "hooks" branch in the project repository such that -# clones will have "refs/remotes/origin/hooks". -# -# - Populate adjacent "config" file with: -# hooks.url = Repository URL publishing "hooks" branch -# hooks.branch = Repository branch instead of "hooks" - -egrep-q() { - egrep "$@" >/dev/null 2>/dev/null -} - -die() { - echo 1>&2 "$@" ; exit 1 -} - -# Make sure we are inside the repository. -cd "${BASH_SOURCE%/*}" && - -# Populate ".git/hooks". -echo 'Setting up git hooks...' && -git_dir=$(git rev-parse --git-dir) && -cp -r hooks "$git_dir" diff --git a/CMake/GitSetup/setup-user b/CMake/GitSetup/setup-user deleted file mode 100755 index 81b8e48fd..000000000 --- a/CMake/GitSetup/setup-user +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -#============================================================================= -# Copyright 2010-2012 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -# Run this script to configure Git user info in this repository. - -# Project configuration instructions: NONE - -for (( ; ; )); do - user_name=$(git config user.name || echo '') && - user_email=$(git config user.email || echo '') && - if test -n "$user_name" -a -n "$user_email"; then - echo 'Your commits will record as Author: - - '"$user_name <$user_email>"' -' && - read -ep 'Is the author name and email address above correct? [Y/n] ' correct && - if test "$correct" != "n" -a "$correct" != "N"; then - break - fi - fi && - read -ep 'Enter your full name e.g. "John Doe": ' name && - read -ep 'Enter your email address e.g. "john@gmail.com": ' email && - git config user.name "$name" && - git config user.email "$email" -done diff --git a/CMake/GitSetup/tips b/CMake/GitSetup/tips deleted file mode 100755 index f7471e039..000000000 --- a/CMake/GitSetup/tips +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env bash -#============================================================================= -# Copyright 2010-2012 Kitware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#============================================================================= - -# This script makes optional suggestions for working with Git. - -# Project configuration instructions: NONE - -egrep-q() { - egrep "$@" >/dev/null 2>/dev/null -} - -# Suggest color configuration. -if test -z "$(git config --get color.ui)"; then - echo ' -One may enable color output from Git commands with - - git config --global color.ui auto -' -fi - -# Suggest bash completion. -if ! bash -i -c 'echo $PS1' | egrep-q '__git_ps1'; then - echo ' -A dynamic, informative Git shell prompt can be obtained by sourcing -the git bash-completion script in your "~/.bashrc". Set the PS1 -environmental variable as suggested in the comments at the top of the -bash-completion script. You may need to install the bash-completion -package from your distribution to obtain it. -' -fi - -# Suggest merge tool. -if test -z "$(git config --get merge.tool)"; then - echo ' -One may configure Git to load a merge tool with - - git config merge.tool - -See "git help mergetool" for more information. -' -fi diff --git a/CMake/SetupForDevelopment.sh b/CMake/SetupForDevelopment.sh deleted file mode 100755 index bcb7e8862..000000000 --- a/CMake/SetupForDevelopment.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -# -# Library: TubeTKLib -# -# Copyright Kitware Inc. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## - -src_dir="${BASH_SOURCE%/*}/.." -cd "${src_dir}" && -CMake/setup-user && echo && -CMake/setup-hooks && echo && -CMake/tips - -# Rebase master by default -git config rebase.stat true -git config branch.master.rebase true diff --git a/CMake/TubeTKConfigureLaunchers.cmake b/CMake/TubeTKConfigureLaunchers.cmake deleted file mode 100644 index bc19e96d2..000000000 --- a/CMake/TubeTKConfigureLaunchers.cmake +++ /dev/null @@ -1,73 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright Kitware Inc. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## - -if( WIN32 ) - set( TubeTK_EXECUTABLE_DIRS CACHE INTERNAL - "Bin and Lib dirs for running apps." FORCE ) - foreach( _build_type "" Debug Release ) - list( APPEND TubeTK_EXECUTABLE_DIRS - ${ITK_DIR}/bin/${_build_type} - ${TubeTK_BINARY_DIR}/bin/${_build_type} - ${TubeTK_BINARY_DIR}/lib/${_build_type} ) - endforeach() -else( WIN32 ) - set( TubeTK_EXECUTABLE_DIRS - ${ITK_DIR}/bin - ${TubeTK_BINARY_DIR}/bin - ${TubeTK_BINARY_DIR}/lib - CACHE INTERNAL "Bin and Lib dirs for running apps." FORCE ) -endif( WIN32 ) - -message( STATUS "Configuring Launcher script" ) -set( TubeTK_LAUNCHER ) -if( WIN32 ) - set( _launcher_platform "windows" ) - foreach( _build_type "" Debug Release ) - configure_file( ${TubeTK_SOURCE_DIR}/CMake/TubeTKLauncher.bat.in - ${TubeTK_BINARY_DIR}/bin/${_build_type}/TubeTKLauncher.bat @ONLY ) - endforeach() - - find_program( CMD_EXECUTABLE "cmd" ) - if( NOT CMD_EXECUTABLE ) - message( FATAL_ERROR - "Could not find 'cmd' executable required to run tests and launcher" ) - endif() - mark_as_advanced( CMD_EXECUTABLE ) - - set( TubeTK_LAUNCHER ${TubeTK_BINARY_DIR}/Release/TubeTKLauncher.bat ) -elseif( UNIX ) - set( _launcher_platform "unix" ) - configure_file( ${TubeTK_SOURCE_DIR}/CMake/TubeTKLauncher.sh.in - ${TubeTK_BINARY_DIR}/bin/TubeTKLauncher.sh @ONLY ) - - find_program( SH_EXECUTABLE "sh" ) - if( NOT SH_EXECUTABLE ) - message( FATAL_ERROR - "Could not find 'sh' executable required to test using the launcher" ) - endif() - set( TubeTK_LAUNCHER ${SH_EXECUTABLE} - ${TubeTK_BINARY_DIR}/bin/TubeTKLauncher.sh ) -elseif( NOT UNIX ) - message( FATAL_ERROR - "Configuring Launcher script - failed [unknown platform]" ) -endif() - message( STATUS "Configuring Launcher script - ok [${_launcher_platform}]" ) diff --git a/CMake/TubeTKExternalData.cmake b/CMake/TubeTKExternalData.cmake deleted file mode 100644 index da7f449e1..000000000 --- a/CMake/TubeTKExternalData.cmake +++ /dev/null @@ -1,93 +0,0 @@ -include(ExternalData) - -if(NOT ExternalData_OBJECT_STORES) - # Use ExternalData_OBJECT_STORES from environment as default. - set(ExternalData_OBJECT_STORES_DEFAULT "") - if(DEFINED "ENV{ExternalData_OBJECT_STORES}") - file(TO_CMAKE_PATH "$ENV{ExternalData_OBJECT_STORES}" - ExternalData_OBJECT_STORES_DEFAULT) - endif() -endif() - -# Select a data store. -if(NOT DEFINED ExternalData_OBJECT_STORES) - if(DEFINED "ENV{ExternalData_OBJECT_STORES}") - file(TO_CMAKE_PATH "$ENV{ExternalData_OBJECT_STORES}" - ExternalData_OBJECT_STORES) - else() - if(DEFINED dashboard_data_name) - set(ExternalData_OBJECT_STORES - ${CTEST_DASHBOARD_ROOT}/${dashboard_data_name}) - else() - set(ExternalData_OBJECT_STORES ${CTEST_DASHBOARD_ROOT}/ExternalData) - endif() - endif() -endif() - -set(ExternalData_OBJECT_STORES "${ExternalData_OBJECT_STORES_DEFAULT}" - CACHE STRING - "Semicolon-separated list of data dirs in the layout %(algo)/%(hash).") -mark_as_advanced(ExternalData_OBJECT_STORES) -if(NOT ExternalData_OBJECT_STORES) - set(ExternalData_OBJECT_STORES "${CMAKE_BINARY_DIR}/ExternalData/Objects") - file(MAKE_DIRECTORY "${ExternalData_OBJECT_STORES}") -endif() -list(APPEND ExternalData_OBJECT_STORES - "${CMAKE_SOURCE_DIR}/.ExternalData" - ) - -set(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/ExternalData) - -# Expands %(algo:lower) -set(ExternalData_URL_TEMPLATES "" CACHE STRING - "Additional URL templates for the ExternalData CMake script to look for testing data. E.g. -file:///var/bigharddrive/%(algo)/%(hash)") -mark_as_advanced(ExternalData_URL_TEMPLATES) -list(APPEND ExternalData_URL_TEMPLATES - # Data published on Girder - "https://data.kitware.com:443/api/v1/file/hashsum/%(algo)/%(hash)/download" - ) - -# Tell ExternalData commands to transform raw files to content links. -# TODO: Condition this feature on presence of our pre-commit hook. -set(ExternalData_LINK_CONTENT SHA512) - -# Emscripten currently has difficulty reading symlinks. -if(EMSCRIPTEN) - set(ExternalData_NO_SYMLINKS 1) -endif() - -# Match series of the form ., .. such that may -# end in a (test) number that is not part of any series numbering. -set(ExternalData_SERIES_PARSE "()(\\.[^./]*)$") -set(ExternalData_SERIES_MATCH "(\\.[0-9]+)?") - -# Sometimes we want to download very large files. -set(ExternalData_TIMEOUT_ABSOLUTE 900) - -# This function accepts 3 arguments: -# - NAME -# - ENVIRONMENT -# - COMMAND -# -# It relies on ExternalData_Add_Test and adds the possibility -# to set environment variables for a test. Environment variables -# should be passed as different arguments of the form "NAME=VALUE" -# -# Example: -# -# ENVIRONMENT ITK_BUILD_DIR=${ITK_DIR} TubeTK_BUILD_DIR=${PROJECT_BINARY_DIR} -# -# Unparsed arguments are passed to ExternalData_Add_Test unchanged. -# -function( ExternalData_Add_Test_With_Env ) - set(options ) - set(oneValueArgs NAME ) - set(multiValueArgs ENVIRONMENT COMMAND) - cmake_parse_arguments(ENV_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) - ExternalData_Add_Test( TubeTKData NAME ${ENV_TEST_NAME} COMMAND ${ENV_TEST_COMMAND} ${ENV_TEST_UNPARSED_ARGUMENTS} ) - foreach(var ${ENV_TEST_ENVIRONMENT}) - list(APPEND env_list ${var}) - endforeach() - set_tests_properties(${ENV_TEST_NAME} PROPERTIES ENVIRONMENT "${env_list}") -endfunction( ExternalData_Add_Test_With_Env ) diff --git a/CMake/TubeTKLauncher.bat.in b/CMake/TubeTKLauncher.bat.in deleted file mode 100644 index 6d2c39728..000000000 --- a/CMake/TubeTKLauncher.bat.in +++ /dev/null @@ -1,34 +0,0 @@ -@ECHO off -REM ########################################################################### -REM -REM Library: TubeTK -REM -REM Copyright Kitware Inc. -REM -REM All rights reserved. -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM https://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM -REM ########################################################################### - -SET PATH="@TubeTK_BINARY_DIR@/bin;%PATH%" -SET TubeTK_DATA_ROOT="@TubeTK_DATA_ROOT@" - -%* -IF %ERRORLEVEL% NEQ 0 ( - EXIT %ERRORLEVEL% -) ELSE ( - EXIT 0 -) - -:: Exit and pass along our exit code. diff --git a/CMake/TubeTKLauncher.sh.in b/CMake/TubeTKLauncher.sh.in deleted file mode 100644 index 756ee5f1d..000000000 --- a/CMake/TubeTKLauncher.sh.in +++ /dev/null @@ -1,28 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright Kitware Inc. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## - -export PATH="@TubeTK_BINARYDIR@/bin;${PATH}" -export TubeTK_DATA_ROOT="@TubeTK_DATA_ROOT@" - -$* -RET=$? -exit $RET diff --git a/CMake/TubeTKValgrind.supp b/CMake/TubeTKValgrind.supp deleted file mode 100644 index a5c697365..000000000 --- a/CMake/TubeTKValgrind.supp +++ /dev/null @@ -1,1838 +0,0 @@ -{ - Nrrd fflush 2.3 - Memcheck:Param - write(buf) - fun:__write_nocancel - fun:_IO_file_write@@GLIBC_2.2.5 - fun:_IO_do_write@@GLIBC_2.2.5 - fun:_IO_file_sync@@GLIBC_2.2.5 - fun:fflush - fun:itk__nrrdEncodingRaw_write - fun:itk__nrrdFormatNRRD_write - fun:itk_nrrdWrite - fun:itk_nrrdSave -} -{ - Some 64 bit suppressions - Memcheck:Param - write(buf) - fun:__write_nocancel - obj:/usr/lib64/libstdc++.so.6.?.? -} -{ - Some more 64 bit suppressions - Memcheck:Param - write(buf) - fun:__write_nocancel - fun:_IO_file_write@@GLIBC_2.2.5 - fun:_IO_do_write@@GLIBC_2.2.5 - fun:_IO_file_sync@@GLIBC_2.2.5 - fun:fflush - fun:itk__nrrdEncodingRaw_write -} -{ - zlib suppression - Memcheck:Cond - fun:longest_match - fun:deflate_slow - fun:itk_zlib_deflate -} -{ - zlib suppression - Memcheck:Cond - fun:inflateReset2 - fun:inflateInit2_ - obj:/lib/x86_64-linux-gnu/libz.so.1.2.3.4 -} -{ - Some dl_relocate_object suppressions - Memcheck:Cond - fun:_dl_relocate_object -} -{ - Some Error from the itk::MultiThreader::DispatchSingleMethodThread - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader26DispatchSingleMethodThreadEPNS0_16ThreadInfoStructE -} -{ - Another Error from the itk::MultiThreader::DispatchSingleMethodThread - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.2.5 -} -{ - Some Error from the itk::MultiThreader::SingleMethodExecute - Memcheck:Leak - fun:calloc - obj:/lib/ld-2.3.?.so - fun:_dl_allocate_tls - fun:allocate_stack - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader26DispatchSingleMethodThreadEPNS0_16ThreadInfoStructE -} -{ - Error2 - Memcheck:Free - fun:calloc - obj:*/ld-2.3.?.so - fun:_dl_allocate_tls - fun:allocate_stack - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader19SingleMethodExecuteEv - fun:_ZN3itk11ImageSourceINS_5ImageIfLj3EEEE12GenerateDataEv -} - -{ - - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader11SpawnThreadEPFPvS1_ES1_ -} - -{ - lib/ld conditional jump errors - Memcheck:Cond - obj:*/ld-2.3.?.so - obj:*/ld-2.3.?.so - obj:*/ld-2.3.?.so -} -{ - CrazyTclError1 - Memcheck:Leak - fun:calloc - obj:/usr/lib/libtcl8.4.so.0 - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_MutexLock - fun:TclInitObjSubsystem - fun:TclInitSubsystems - fun:Tcl_FindExecutable - fun:Tcl_Main -} -{ - CrazyTclError2 - Memcheck:Leak - fun:calloc - obj:/lib/ld-2.3.?.so - fun:_dl_allocate_tls - fun:allocate_stack - fun:pthread_create@@GLIBC_2.1 - fun:TclpThreadCreate - fun:Tcl_InitNotifier - fun:TclInitNotifier - fun:TclInitSubsystems - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} - -{ - CrazyTclError3 - Memcheck:Leak - fun:realloc - fun:TclpRealloc - fun:Tcl_Realloc - fun:Tcl_SetObjLength - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSEvalFile - fun:Tcl_Main -} - -{ - CrazyTclError4 - Memcheck:Leak - fun:malloc - obj:/usr/lib/libtcl8.4.so.0 - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetsObj - fun:Tcl_Gets - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_SetSystemEncoding - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main -} - -{ - CrazyTclError5 - Memcheck:Leak - fun:malloc - obj:/usr/lib/libtcl8.4.so.0 - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_MutexLock - fun:TclInitObjSubsystem - fun:TclInitSubsystems - fun:Tcl_FindExecutable - fun:Tcl_Main -} - -{ - CrazyTclError6 - Memcheck:Leak - fun:malloc - fun:TclThreadAllocObj - fun:Tcl_NewObj - fun:TclpInitLibraryPath - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main -} - -{ - CrazyTclError7 - Memcheck:Leak - fun:realloc - fun:Tcl_AttemptSetObjLength -} - -{ - CrazyTclError8 - Memcheck:Leak - fun:malloc - fun:Tcl_Alloc - fun:TclCreateExecEnv - fun:Tcl_CreateInterp -} - -{ - CrazyTclError9 - Memcheck:Leak - fun:realloc - fun:Tcl_Realloc - fun:Tcl_SetObjLength -} - -{ - CrazyTclError10 - Memcheck:Leak - fun:malloc - fun:Tcl_Alloc - fun:TclAllocateFreeObjects -} - -{ - CrazyTclError11 - Memcheck:Leak - fun:malloc - fun:realloc - fun:Tcl_Realloc - fun:Tcl_Export -} - -{ - CrazyTclError12 - Memcheck:Leak - fun:malloc - ... - fun:getpwuid_r - fun:getpwuid - ... - fun:Tcl_CreateInterp -} - -{ - CrazyTclError13 - Memcheck:Leak - fun:calloc - ... - fun:getpwuid_r - fun:getpwuid - ... - fun:Tcl_CreateInterp -} - -{ - CrazyTclError14 - Memcheck:Leak - fun:realloc - fun:Tcl_Realloc - fun:Tcl_Export -} - -{ - CrazyTclError15 - Memcheck:Leak - fun:malloc - ... - fun:Tcl_ListObjIndex - fun:Tcl_SetEnsembleMappingDict -} - -{ - CrazyTclEroor16 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_GetThreadData - fun:Tcl_InitNotifier - fun:TclInitNotifier - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} - -{ - CrazyTclError17 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCreateExecEnv - fun:Tcl_CreateInterp - fun:Tcl_Main - fun:main -} - -{ - CrazyTclError18 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:TclpRealloc - fun:Tcl_Realloc - fun:Tcl_DStringSetLength - fun:Tcl_ExternalToUtfDString - fun:TclpFindVariable - fun:TclGetEnv - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:TclVarTraceExists - obj:/usr/lib/libtcl8.4.so.0 -} - -{ - CrazyTclError19 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSEvalFile - fun:TclEvalObjvInternal - fun:Tcl_EvalObjv - fun:Tcl_EvalObjEx - fun:Tcl_UplevelObjCmd - fun:TclEvalObjvInternal -} - -{ - CrazyTclError20 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:TclpRealloc - fun:Tcl_Realloc - fun:Tcl_SetObjLength - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSEvalFile - fun:TclEvalObjvInternal - fun:Tcl_EvalObjv - fun:Tcl_EvalObjEx - fun:Tcl_UplevelObjCmd -} - -{ - CrazyTclError21 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompileExpr - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileIfCmd -} - -{ - CrazyTclError22 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_ListObjAppendElement - fun:TclGlob - fun:Tcl_GlobObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 -} - -{ - CrazyTclError23 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileExprWords - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileSetCmd - fun:TclCompileScript - fun:TclCompileIfCmd - fun:TclCompileScript -} - -{ - CrazyTclError24 - Memcheck:Leak - fun:malloc - fun:TclThreadAllocObj - fun:Tcl_NewObj - fun:TclNewFSPathObj - fun:TclpMatchInDirectory - fun:Tcl_FSMatchInDirectory - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob -} - -{ - CrayTclError25 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:TclpRealloc - fun:Tcl_AttemptSetObjLength - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_AppendObjToObj - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetStringFromObj - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetStringFromObj - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj -} - -{ - CrazyTclError26 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_ListObjAppendElement - fun:TclpMatchInDirectory - fun:Tcl_FSMatchInDirectory - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob -} - -{ - CrazyTclError27 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_WriteObj - fun:Tcl_PutsObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc - fun:TclEvalObjvInternal -} - -{ - CrazyTclError28 - Memcheck:Leak - fun:malloc - fun:TclThreadAllocObj - fun:Tcl_NewStringObj - fun:TclNewFSPathObj - fun:TclpMatchInDirectory - fun:Tcl_FSMatchInDirectory - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob - fun:TclDoGlob -} - -{ - CrazyTclError29 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclInitByteCodeObj - fun:TclSetByteCodeFromAny - obj:/usr/lib/libtcl8.4.so.0 - fun:TclObjInterpProc - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc - fun:TclEvalObjvInternal -} - -{ - CrazyTclError30 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetsObj - fun:Tcl_Gets - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_SetSystemEncoding - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 -} - -{ - CrazyTclError31 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileWhileCmd - fun:TclCompileScript - fun:TclCompileIfCmd - fun:TclCompileScript -} - -{ - CrazyTclError32 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclExpandCodeArray - fun:TclCompileIncrCmd - fun:TclCompileScript - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileWhileCmd - fun:TclCompileScript - fun:TclCompileIfCmd - fun:TclCompileScript -} - -{ - CrazyTclError33 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_CreateHashEntry - fun:TclLookupArrayElement - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc -} - -{ - CrazyTclError34 - Memcheck:Leak - fun:malloc - fun:TclThreadAllocObj - fun:Tcl_NewStringObj - fun:TclpNativeSplitPath - fun:Tcl_FSSplitPath - obj:/usr/lib/libtcl8.4.so.0 - fun:TclFSEnsureEpochOk - fun:Tcl_FSGetFileSystemForPath - fun:Tcl_FSAccess - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FileObjCmd -} - -{ - CrazyTclError35 - Memcheck:Leak - fun:malloc - fun:TclThreadAllocObj - fun:Tcl_NewStringObj - fun:TclpNativeSplitPath - fun:Tcl_FSSplitPath - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSGetNormalizedPath - fun:TclFSEnsureEpochOk - fun:Tcl_FSGetFileSystemForPath - fun:Tcl_FSAccess - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FileObjCmd -} - -{ - CrazyTclError36 - Memcheck:Leak - fun:malloc - fun:TclThreadAllocObj - fun:Tcl_NewLongObj - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_ExprObj - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc -} -{ - CrazyTclError37 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_SetSystemEncoding - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - CrazyTclError38 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileExprWords - fun:TclCompileExprCmd - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileSetCmd - fun:TclCompileScript - fun:TclCompileCmdWord -} -{ - CrazyTclError39 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompileExpr - fun:TclCompileExprWords - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileCmdWord - fun:TclCompileIfCmd -} -{ - CrazyTclError40 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_SetSystemEncoding - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - CrazyTclError41 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_SetSystemEncoding - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - CrazyTclError42 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:TclpRealloc - fun:Tcl_AttemptRealloc - fun:Tcl_AttemptSetObjLength - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_AppendObjToObj - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetStringFromObj - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetStringFromObj - obj:/usr/lib/libtcl8.4.so.0 -} -{ - CrayTclError43 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileExprWords - fun:TclCompileExprCmd - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileSetCmd - fun:TclCompileScript - fun:TclCompileCmdWord -} -{ - CrazyTclError44 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompileExpr - fun:TclCompileExprWords - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileCmdWord - fun:TclCompileIfCmd -} -{ - CrazyTclError45 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_SetSystemEncoding - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - CrazyTclError46 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileExprWords - fun:TclCompileExprCmd - fun:TclCompileScript - fun:TclCompileTokens - fun:TclCompileSetCmd - fun:TclCompileScript - fun:TclCompileCmdWord -} -{ - CrazyTclError47 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompileExpr - fun:TclCompileExprWords - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileCmdWord - fun:TclCompileIfCmd -} -{ - CrazyTclError48 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:TclCompileScript - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompileExpr - fun:TclCompileExprWords - fun:TclCompileIfCmd - fun:TclCompileScript - fun:TclCompileCmdWord - fun:TclCompileIfCmd -} -{ - CrazyTclError49 - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_SetSystemEncoding - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:_ZSt18uncaught_exceptionv - fun:_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc - fun:_Z63itkGreyLevelCooccurrenceMatrixTextureCoefficientsCalculatorTestiPPc - fun:main -} -{ - - Memcheck:Leak - fun:calloc - obj:/lib/ld-2.3.?.so - fun:_dl_allocate_tls - fun:allocate_stack - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader19SingleMethodExecuteEv - fun:_ZN3itk11ImageSourceINS_5ImageIdLj6EEEE12GenerateDataEv - fun:_ZN3itk13ProcessObject16UpdateOutputDataEPNS_10DataObjectE -} -{ - - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:_ZSt18uncaught_exceptionv - fun:_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc - fun:_ZN3itk12OutputWindow11DisplayTextEPKc -} -{ - - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:__cxa_throw -} -{ - ostream stuff - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:_ZSt18uncaught_exceptionv - fun:_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc -} -{ - ostream stuff - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:_ZSt18uncaught_exceptionv - fun:_ZNSolsEm - fun:_ZNSolsEj -} -{ - basic_ostream From cumulative gaussian optimizer - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:_ZSt18uncaught_exceptionv - fun:_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc -} -{ - ostream stuff - Memcheck:Value4 - obj:/usr/lib/libstdc++.so.6.0.3 - fun:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES3_S3_RSt8ios_basecT_ - fun:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecm - fun:_ZNSolsEm -} -{ - ostream stuff - Memcheck:Value8 - fun:vfprintf - fun:vsnprintf - fun:snprintf - obj:/usr/lib/libstdc++.so.6.0.3 - fun:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE15_M_insert_floatIdEES3_S3_RSt8ios_baseccT_ -} -{ - itkThreadLoggerTest 1 - Memcheck:Leak - fun:calloc - obj:/lib/ld-2.3.?.so - fun:_dl_allocate_tls - fun:allocate_stack - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader11SpawnThreadEPFPvS1_ES1_ - fun:_ZN3itk12ThreadLoggerC1Ev - fun:_ZN3itk12ThreadLogger3NewEv - fun:_Z19itkThreadLoggerTestiPPc - fun:main -} -{ - itkThreadLoggerTest 1 - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader11SpawnThreadEPFPvS1_ES1_ - fun:_ZN3itk12ThreadLoggerC1Ev - fun:_ZN3itk12ThreadLogger3NewEv -} -{ - itkCommonPrintTest - Memcheck:Cond - obj:/usr/lib/libstdc++.so.6.0.3 - fun:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES3_S3_RSt8ios_basecT_ - fun:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecPKv - fun:_ZNSolsEPKv - fun:_ZNK3itk21KLMSegmentationBorder9PrintSelfERSoNS_6IndentE - fun:_ZNK3itk11LightObject5PrintERSoNS_6IndentE - fun:_ZNK3itk12SmartPointerINS_21KLMSegmentationBorderEE5PrintERSo - fun:_ZN3itklsINS_21KLMSegmentationBorderEEERSoS2_NS_12SmartPointerIT_EE - fun:_Z18itkCommonPrintTestiPPc - fun:main -} -{ - itkCommonPrintTest - Memcheck:Value4 - obj:/usr/lib/libstdc++.so.6.0.3 - fun:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE13_M_insert_intImEES3_S3_RSt8ios_basecT_ - fun:_ZNKSt7num_putIcSt19ostreambuf_iteratorIcSt11char_traitsIcEEE6do_putES3_RSt8ios_basecPKv - fun:_ZNSolsEPKv - fun:_ZNK3itk21KLMSegmentationBorder9PrintSelfERSoNS_6IndentE - fun:_ZNK3itk11LightObject5PrintERSoNS_6IndentE - fun:_ZNK3itk12SmartPointerINS_21KLMSegmentationBorderEE5PrintERSo - fun:_ZN3itklsINS_21KLMSegmentationBorderEEERSoS2_NS_12SmartPointerIT_EE - fun:_Z18itkCommonPrintTestiPPc - fun:main -} -{ - Below block is after changes to Multithreader, Aug 05 - Memcheck:Leak - fun:calloc - obj:/lib/ld-2.3.?.so - fun:_dl_allocate_tls - fun:allocate_stack - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader26DispatchSingleMethodThreadEPNS0_16ThreadInfoStructE -} -{ - - Memcheck:Leak - fun:calloc - obj:/lib/ld-2.3.?.so - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader26DispatchSingleMethodThreadEPNS0_16ThreadInfoStructE - fun:_ZN3itk13MultiThreader19SingleMethodExecuteEv - fun:_ZN3itk11ImageSourceINS_5ImageIfLj2EEEE12GenerateDataEv - fun:_ZN3itk13ProcessObject16UpdateOutputDataEPNS_10DataObjectE - fun:_ZN3itk10DataObject16UpdateOutputDataEv -} -{ - - Memcheck:Leak - fun:calloc - obj:/lib/ld-2.3.?.so - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.1 - fun:_ZN3itk13MultiThreader26DispatchSingleMethodThreadEPNS0_16ThreadInfoStructE - fun:_ZN3itk13MultiThreader19SingleMethodExecuteEv -} -{ - Exception allocation - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:__cxa_allocate_exception -} -{ - Exception allocation - Memcheck:Leak - fun:malloc - fun:__cxa_get_globals - fun:__cxa_allocate_exception -} -{ - index(strchr.S) - Memcheck:Cond - fun:index -} -{ - /lib/libz - Memcheck:Cond - obj:*/libz.so.1.2.3 -} - -{ - dlopen leak1 - Memcheck:Leak - fun:calloc - fun:_dlerror_run - fun:dlopen* -} - -{ - dlopen leak2 - Memcheck:Leak - fun:calloc - obj:/lib/libdl-2.?.?.so - fun:dlopen* -} -{ - dlopen leak3 - Memcheck:Leak - fun:calloc - obj:/lib64/libdl-2.?.so - fun:dlopen -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_GetThreadData - fun:Tcl_InitNotifier - fun:TclInitNotifier - fun:TclInitSubsystems - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_CreateChannel - fun:Tcl_MakeFileChannel - fun:TclpGetDefaultStdChannel - fun:Tcl_GetStdChannel - fun:Tcl_GetChannel - fun:Tcl_PutsObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetStringFromObj - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetsObj - fun:Tcl_GetsObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetsObj - fun:Tcl_GetsObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetsObj - fun:Tcl_GetsObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_MutexLock - fun:TclInitObjSubsystem - fun:TclInitSubsystems - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_CreateHashEntry - fun:Tcl_RegisterObjType - fun:TclInitObjSubsystem - fun:TclInitSubsystems - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetsObj - fun:Tcl_Gets - obj:/usr/lib/libtcl8.4.so.0 - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:TclpSetInitialEncodings - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FindExecutable - fun:Tcl_Main - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSEvalFile - fun:Tcl_SourceObjCmd - fun:TclEvalObjvInternal - fun:Tcl_EvalObjv - fun:Tcl_EvalObjEx - fun:Tcl_UplevelObjCmd -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSEvalFile - fun:Tcl_SourceObjCmd - fun:TclEvalObjvInternal - fun:Tcl_EvalObjv - fun:Tcl_EvalObjEx - fun:Tcl_UplevelObjCmd -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:TclpRealloc - fun:Tcl_Realloc - fun:Tcl_SetObjLength - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSEvalFile - fun:Tcl_SourceObjCmd - fun:TclEvalObjvInternal - fun:Tcl_EvalObjv - fun:Tcl_EvalObjEx -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_NewStringObj - fun:Tcl_EvalTokensStandard - fun:Tcl_EvalEx - fun:Tcl_FSEvalFile - fun:Tcl_SourceObjCmd - fun:TclEvalObjvInternal - fun:Tcl_EvalObjv - fun:Tcl_EvalObjEx - fun:Tcl_UplevelObjCmd -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:TclpRealloc - fun:Tcl_Realloc - fun:Tcl_SetObjLength - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_FSEvalFile - fun:Tcl_Main - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - fun:Tcl_CreateChannel - fun:Tcl_MakeFileChannel - fun:TclpGetDefaultStdChannel - fun:Tcl_GetStdChannel - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetChannel - fun:Tcl_PutsObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:Tcl_Alloc - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_GetsObj - fun:Tcl_GetsObjCmd - fun:TclEvalObjvInternal - obj:/usr/lib/libtcl8.4.so.0 - fun:TclCompEvalObj - fun:TclObjInterpProc -} -{ - - Memcheck:Leak - fun:malloc - fun:TclpAlloc - fun:TclpRealloc - fun:Tcl_AttemptRealloc - fun:Tcl_AttemptSetObjLength - obj:/usr/lib/libtcl8.4.so.0 - fun:Tcl_EvalTokensStandard - fun:Tcl_EvalEx - fun:Tcl_FSEvalFile - fun:Tcl_SourceObjCmd - fun:TclEvalObjvInternal - fun:Tcl_EvalObjv -} -{ - - Memcheck:Cond - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* - obj:* -} -{ - - Memcheck:Cond - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:* - obj:* - obj:* - obj:* -} -{ - - Memcheck:Addr8 - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/libc-2.10.1.so - obj:/lib/ld-2.10.1.so - fun:__libc_dlopen_mode - fun:pthread_cancel_init - fun:_Unwind_ForcedUnwind -} -{ - - Memcheck:Cond - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:* - obj:* - obj:* -} -{ - - Memcheck:Cond - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so - obj:/lib/ld-2.10.1.so -} -{ - ExitFreeLibC brian.jouy.inra.fr - Memcheck:Free - fun:free - obj:/lib64/libc-2.9.so - obj:/lib64/libc-2.9.so - fun:_vgnU_freeres - fun:exit - fun:(below main) -} -{ - ExitFreeLibC brian.jouy.inra.fr - Memcheck:Free - fun:free - obj:/lib64/libc-2.9.so - obj:/lib64/libc-2.9.so - fun:_vgnU_freeres - fun:exit - fun:fhdl - obj:/lib64/libpthread-2.9.so - fun:_Z30itkFloatingPointExceptionsTestiPPc - fun:main -} -{ - itkFloatingPointExceptionsTest leak brian.jouy.inra.fr - Memcheck:Leak - fun:_Znwm - fun:_ZNSs4_Rep9_S_createEmmRKSaIcE - obj:/usr/lib64/libstdc++.so.6.0.10 - fun:_ZNSsC1EPKcRKSaIcE - fun:_Z30itkFloatingPointExceptionsTestiPPc - fun:main -} -{ - CrazyTclError brian.jouy.inra.fr - Memcheck:Leak - fun:realloc - fun:Tcl_Realloc - obj:/usr/lib64/libtcl8.6.so.0 - fun:Tcl_GetUnicodeFromObj - obj:/usr/lib64/libtcl8.6.so.0 - fun:TclNRRunCallbacks - obj:/usr/lib64/libtcl8.6.so.0 - fun:Tcl_FSEvalFileEx - fun:Tcl_Main - fun:main -} -{ - - Memcheck:Leak - fun:malloc - fun:strdup - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:malloc - fun:PyList_New - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:Py_BuildValue - fun:PyImport_Import - fun:PyImport_ImportModule - fun:_PyExc_Init - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:malloc - fun:_dl_new_object - fun:_dl_map_object_from_fd - fun:_dl_map_object - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - obj:/lib64/libdl-2.9.so - fun:_dl_catch_error - obj:/lib64/libdl-2.9.so - fun:dlopen - fun:_PyImport_GetDynLoadFunc - fun:_PyImport_LoadDynamicModule - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyImport_ImportModuleLevel - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - fun:PyEval_CallObjectWithKeywords - fun:PyEval_EvalFrameEx - fun:PyEval_EvalCodeEx - fun:PyEval_EvalCode - obj:/usr/lib64/libpython2.6.so.1.0 -} -{ - - Memcheck:Leak - fun:malloc - fun:expand_dynamic_string_token - fun:_dl_map_object - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - obj:/lib64/libdl-2.9.so - fun:_dl_catch_error - obj:/lib64/libdl-2.9.so - fun:dlopen - fun:_PyImport_GetDynLoadFunc - fun:_PyImport_LoadDynamicModule - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyImport_ImportModuleLevel - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - fun:PyEval_CallObjectWithKeywords - fun:PyEval_EvalFrameEx - fun:PyEval_EvalCodeEx - fun:PyEval_EvalCode - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyRun_FileExFlags -} -{ - - Memcheck:Leak - fun:calloc - fun:_dl_check_map_versions - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - obj:/lib64/libdl-2.9.so - fun:_dl_catch_error - obj:/lib64/libdl-2.9.so - fun:dlopen - fun:_PyImport_GetDynLoadFunc - fun:_PyImport_LoadDynamicModule - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyImport_ImportModuleLevel - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - fun:PyEval_CallObjectWithKeywords - fun:PyEval_EvalFrameEx - fun:PyEval_EvalCodeEx - fun:PyEval_EvalCode - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyRun_FileExFlags - fun:PyRun_SimpleFileExFlags -} -{ - - Memcheck:Leak - fun:malloc - fun:PyThread_allocate_lock - fun:PyInterpreterState_New - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:malloc - fun:_dl_map_object_deps - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - obj:/lib64/libdl-2.9.so - fun:_dl_catch_error - obj:/lib64/libdl-2.9.so - fun:dlopen - fun:_PyImport_GetDynLoadFunc - fun:_PyImport_LoadDynamicModule - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyImport_ImportModuleLevel - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - fun:PyEval_CallObjectWithKeywords - fun:PyEval_EvalFrameEx - fun:PyEval_EvalCodeEx - fun:PyEval_EvalCode - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyRun_FileExFlags - fun:PyRun_SimpleFileExFlags -} -{ - - Memcheck:Leak - fun:malloc - obj:/usr/lib64/libpython2.6.so.1.0 - fun:Py_GetProgramFullPath - fun:_PySys_Init - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:realloc - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyType_Ready - fun:_PyExc_Init - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:malloc - fun:realloc - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyType_Ready - fun:_Py_ReadyTypes - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:calloc - fun:_dl_new_object - fun:_dl_map_object_from_fd - fun:_dl_map_object - fun:dl_open_worker - fun:_dl_catch_error - fun:_dl_open - obj:/lib64/libdl-2.9.so - fun:_dl_catch_error - obj:/lib64/libdl-2.9.so - fun:dlopen - fun:_PyImport_GetDynLoadFunc - fun:_PyImport_LoadDynamicModule - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyImport_ImportModuleLevel - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - fun:PyEval_CallObjectWithKeywords - fun:PyEval_EvalFrameEx - fun:PyEval_EvalCodeEx - fun:PyEval_EvalCode - obj:/usr/lib64/libpython2.6.so.1.0 -} -{ - - Memcheck:Leak - fun:malloc - obj:/usr/lib64/libpython2.6.so.1.0 - fun:_PyInt_Init - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:malloc - fun:PyStructSequence_InitType - fun:_PyFloat_Init - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:malloc - fun:PyObject_Malloc - fun:_PyObject_GC_Malloc - fun:_PyObject_GC_NewVar - fun:PyFrame_New - fun:PyEval_EvalCodeEx - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - fun:PyObject_CallFunctionObjArgs - fun:PyEval_EvalFrameEx - fun:PyEval_EvalCodeEx - fun:PyEval_EvalCode - fun:PyImport_ExecCodeModuleEx - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyImport_ImportModuleLevel - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyObject_Call - fun:PyEval_CallObjectWithKeywords -} -{ - - Memcheck:Leak - fun:malloc - obj:/usr/lib64/libpython2.6.so.1.0 - fun:PyType_Ready - fun:PyType_Ready - fun:_Py_ReadyTypes - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - - Memcheck:Leak - fun:malloc - fun:PyObject_Malloc - fun:_PyObject_GC_Malloc - fun:_PyObject_GC_NewVar - fun:PyTuple_New - fun:PyType_Ready - fun:PyType_Ready - fun:_Py_ReadyTypes - fun:Py_InitializeEx - fun:Py_Main - fun:(below main) -} -{ - NRDD String SSE42 1 - Memcheck:Addr8 - fun:__strspn_sse42 - fun:itk_airStrtok - ... - fun:itk_nrrdRead -} -{ - NRDD String SSE42 2 - Memcheck:Value8 - fun:__strspn_sse42 - fun:itk_airStrtok - ... - fun:itk_nrrdRead -} -{ - NRDD String SSE42 3 - Memcheck:Cond - fun:__strspn_sse42 - fun:itk_airStrtok - ... - fun:itk_nrrdRead -} -{ - NRDD String 1 - Memcheck:Value8 - fun:itk_airStrtok - fun:itk_airStrntok - fun:itk__nrrdSpaceVectorParse - ... - fun:itk_nrrdRead -} -{ - NRDD String 2 - Memcheck:Value8 - fun:strcspn - fun:itk_airStrtok - fun:itk_airStrntok - fun:itk__nrrdSpaceVectorParse - ... - fun:itk_nrrdRead -} -{ - NRDD String 3 - Memcheck:Cond - fun:itk_airStrntok - fun:itk__nrrdSpaceVectorParse - ... - fun:itk_nrrdRead -} -{ - NRDD String 4 - Memcheck:Cond - fun:itk_airStrlen - fun:itk_airStrtok - fun:itk_airStrntok - fun:itk__nrrdSpaceVectorParse - ... - fun:itk_nrrdRead -} -{ - NRDD String 5 - Memcheck:Value8 - fun:strlen - fun:itk_airStrlen - fun:itk_airStrtok - fun:itk_airStrntok - fun:itk__nrrdSpaceVectorParse - ... - fun:itk_nrrdRead -} -{ - NRRD Direction 1 - Memcheck:Cond - ... - fun:_nrrdReadNrrdParse_space_directions - fun:_nrrdFormatNRRD_read - fun:itk__nrrdRead - fun:itk_nrrdRead -} -{ - NRRD Direction 2 - Memcheck:Value8 - ... - fun:_nrrdReadNrrdParse_space_directions - fun:_nrrdFormatNRRD_read - fun:itk__nrrdRead - fun:itk_nrrdRead -} -{ - dlopen - Memcheck:Leak - match-leak-kinds: reachable - fun:calloc - fun:_dlerror_run - fun:dlopen@@GLIBC_2.?.? - fun:_ZN6itksys13DynamicLoader11OpenLibraryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi -} -{ - ioclt - Memcheck:Param - ioctl(generic) - fun:ioctl - fun:_ZN6itksysL16CloneFileContentERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_ -} -{ - zlib_uninitialized - Memcheck:Cond - fun:slide_hash - fun:fill_window - fun:deflate_fast - fun:itkzlib_deflate -} -{ - itk_H5MM_malloc - Memcheck:malloc - fun:itk_H5MM_malloc -} -{ - TCLAP - Memcheck:Leak - match-leak-kinds: reachable - fun:operator - fun:TCLAP::CmdLine::constructor -} diff --git a/CMake/tubetkConfigure.h.in b/CMake/tubetkConfigure.h.in deleted file mode 100644 index 800fe4204..000000000 --- a/CMake/tubetkConfigure.h.in +++ /dev/null @@ -1,28 +0,0 @@ -/*========================================================================= - -Library: TubeTK - -Copyright Kitware Inc. - -All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -=========================================================================*/ - -#ifndef __tubetkConfigure_h -#define __tubetkConfigure_h - -#cmakedefine TubeTK_VERSION - -#endif // __tubetkConfigure_h diff --git a/CMakeLists.txt b/CMakeLists.txt index d7eb2c963..f760f8418 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,10 @@ ############################################################################## cmake_minimum_required(VERSION 3.16.3) +if(POLICY CMP0135) + cmake_policy(SET CMP0135 NEW) +endif() + project( TubeTK ) set( TubeTK_VERSION 1.3.5 ) @@ -30,103 +34,7 @@ set( TubeTK_VERSION 1.3.5 ) #### list( APPEND CMAKE_MODULE_PATH ${TubeTK_SOURCE_DIR}/CMake ) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - # if using Linux gcc in debug mode, enable gcov computation - set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -Wall -fprofile-arcs -ftest-coverage") -endif() - -#### -# Setup External Data Cache -#### -include( TubeTKExternalData ) -if( DEFINED "ENV{ExternalData_OBJECT_STORES}" ) - set( ExternalData_OBJECT_STORES $ENV{ExternalData_OBJECT_STORES} ) -endif() - -#### -# CDash dashboard setup. -#### -include( CTest ) - -set( BUILDNAME "${BUILDNAME}" CACHE STRING - "Name of the build on the CDash dashboard." ) -mark_as_advanced( BUILDNAME ) - -set( BUILD_WARNING_REPORT_LIMIT -1 ) -set( BUILD_ERROR_REPORT_LIMIT -1 ) - -include( CTestConfig.cmake ) - -configure_file( ${TubeTK_SOURCE_DIR}/CMake/CTestCustom.cmake.in - ${TubeTK_BINARY_DIR}/CTestCustom.cmake ) - -include( TubeTKExternalData ) -if( DEFINED "ENV{ExternalData_OBJECT_STORES}" ) - set( ExternalData_OBJECT_STORES $ENV{ExternalData_OBJECT_STORES} ) -endif() - - -#### -# Find Python -#### -if( ITK_WRAP_PYTHON ) - find_package( Python ) - find_package( NumPy REQUIRED ) - mark_as_advanced( NUMPY_INCLUDE_DIR ) -endif() - -#### -# Find ITK and pre-built modules -#### -set( TubeTK_ITK_COMPONENTS - MinimalPathExtraction - ITKAnisotropicSmoothing - ITKBinaryMathematicalMorphology - ITKCommon - ITKDistanceMap - ITKFFT - ITKHDF5 - ITKImageFunction - ITKImageIntensity - ITKImageIO - ITKIOCSV - ITKIOImageBase - ITKIOMeta - ITKIOSpatialObjects - ITKLabelVoting - ITKOptimizers - ITKPDEDeformableRegistration - ITKRegionGrowing - ITKRegistrationCommon - ITKSmoothing - ITKSpatialObjects - ITKTestKernel - ITKTransform - ITKTransformIO - ITKStatistics - ) - -if( NOT ITK_SOURCE_DIR ) - find_package( ITK COMPONENTS ${TubeTK_ITK_COMPONENTS} REQUIRED ) - mark_as_advanced( CLEAR ITK_DIR ) - if( NOT ITK_FOUND ) - find_package( ITK ) - if( ITK_FOUND ) - message( FATAL_ERROR - "TubeTK requires ITK with MinimalPathExtraction module enabled.") - endif() - set( ITK_DIR "NOT_FOUND" CACHE PATH - "Path to ITK installation/build directory." FORCE ) - endif() -endif() - -#### -# Create TubeTK Configuration file (to pass flags) -#### -configure_file( "${TubeTK_SOURCE_DIR}/CMake/tubetkConfigure.h.in" - ${TubeTK_BINARY_DIR}/include/tubetkConfigure.h @ONLY ) +set( TubeTK_LIBRARIES TubeTK ) #### # Setup include directories @@ -142,8 +50,6 @@ set( TubeTK_INCLUDE_DIRS $ $ ) -set( TubeTK_LIBRARIES TubeTK ) - #### # Build base library and optional components #### @@ -165,12 +71,13 @@ include_directories( ${TubeTK_SYSTEM_INCLUDE_DIRS} ) # Build TubeTK module #### if( NOT ITK_SOURCE_DIR ) + find_package( ITK REQUIRED ) list( APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR} ) include( ITKModuleExternal ) - if( WASI OR EMSCRIPTEN ) - set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - add_subdirectory( wasm ) - endif() + #if( WASI OR EMSCRIPTEN ) + #set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) + #add_subdirectory( wasm ) + #endif() else() set(ITK_DIR ${CMAKE_BINARY_DIR}) itk_module_impl() diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 13d3edde8..62f68ac11 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,28 +1,7 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright Kitware Inc. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## +set(CTEST_PROJECT_NAME "ITK") +set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") -set( CTEST_PROJECT_NAME "TubeTK" ) -set( CTEST_NIGHTLY_START_TIME "23:59:00 EDT" ) -set( CTEST_DROP_METHOD "http" ) -set( CTEST_DROP_SITE "open.cdash.org" ) -set( CTEST_DROP_LOCATION "/submit.php?project=TubeTK" ) -set( CTEST_DROP_SITE_CDASH TRUE ) +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "open.cdash.org") +set(CTEST_DROP_LOCATION "/submit.php?project=Insight") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/examples/Applications/CMakeLists.txt b/examples/Applications/CMakeLists.txt index 7fef68974..463b214f9 100644 --- a/examples/Applications/CMakeLists.txt +++ b/examples/Applications/CMakeLists.txt @@ -36,6 +36,10 @@ set( TubeTK_CompareTextFiles_EXE set( TubeTK_CompareImages_EXE "tubeCompareImagesTestDriver" ) +find_package( SlicerExecutionModel REQUIRED ) +include( ${SlicerExecutionModel_USE_FILE} ) +mark_as_advanced( GENERATECLP_EXE ) + set( SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY "${ITK_BINARY_DIR}/bin" ) set( SlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY @@ -43,12 +47,6 @@ set( SlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY set( SlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY "${ITK_BINARY_DIR}/lib" ) -find_package( SlicerExecutionModel REQUIRED - HINTS ./SlicerExecutionModel-build ../SlicerExecutionModel-build - ../../SlicerExecutionModel-build ) -include( ${SlicerExecutionModel_USE_FILE} ) -mark_as_advanced( GENERATECLP_EXE ) - add_subdirectory( AtlasBuilderUsingIntensity ) add_subdirectory( ComputeBinaryImageSimilarityMetrics ) add_subdirectory( ComputeImageSimilarityMetrics ) @@ -72,7 +70,6 @@ add_subdirectory( ConvertTubesToTubeGraph ) add_subdirectory( CropImage ) add_subdirectory( CropTubes ) add_subdirectory( DeblendTomosynthesisSlicesUsingPrior ) -#add_subdirectory( DICOMSeriesConverter ) add_subdirectory( EnhanceCoherenceAndEdgesUsingDiffusion ) add_subdirectory( EnhanceCoherenceUsingDiffusion ) add_subdirectory( EnhanceContrastUsingAHE ) @@ -108,3 +105,4 @@ add_subdirectory( TubeMath ) #add_subdirectory( SegmentUsingQuantileThreshold ) #add_subdirectory( TransferLabelsToRegions ) #add_subdirectory( ComputeTubeGraphSimilarityKernelMatrix ) +#add_subdirectory( DICOMSeriesConverter ) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 69e1e9e96..c1fa3658e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -19,4 +19,5 @@ # limitations under the License. # ############################################################################## + add_subdirectory(Applications) diff --git a/itk-module.cmake b/itk-module.cmake index 91140efe0..8c54f5772 100644 --- a/itk-module.cmake +++ b/itk-module.cmake @@ -37,7 +37,6 @@ itk_module( TubeTK ITKSpatialObjects ITKTransform ITKThresholding - ITKVTK MinimalPathExtraction COMPILE_DEPENDS ITKAnisotropicSmoothing diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c107226d8..2fbeb1c56 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,7 +32,3 @@ include( Registration.cmake ) include( Segmentation.cmake ) itk_module_add_library( TubeTK ${TubeTK_SRCS} ) - -if( ITK_WRAP_PYTHON ) - add_subdirectory( Python ) -endif() diff --git a/src/Filtering/itktubeRidgeFFTFilter.hxx b/src/Filtering/itktubeRidgeFFTFilter.hxx index 7caeec118..1c77839b0 100644 --- a/src/Filtering/itktubeRidgeFFTFilter.hxx +++ b/src/Filtering/itktubeRidgeFFTFilter.hxx @@ -19,8 +19,6 @@ #include -#include "tubetkConfigure.h" - #include "itktubeFFTGaussianDerivativeIFFTFilter.h" #include "tubeMatrixMath.h" diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt deleted file mode 100644 index 577935268..000000000 --- a/src/Python/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright 2010 Kitware Inc. 28 Corporate Drive, -# Clifton Park, NY, 12065, USA. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## -# -# Configure tubetk.pth. -# Add a symlink to this file in the directory that results from:: -# -# python -m site --user-site -# -# to make TubeTK Python packages and modules importable. -# -configure_file( tubetk.pth.in tubetk.pth ) - -add_subdirectory( tubetk ) diff --git a/src/Python/README.md b/src/Python/README.md deleted file mode 100644 index 539f16efe..000000000 --- a/src/Python/README.md +++ /dev/null @@ -1,5 +0,0 @@ -TubeTK Python Module -==================== - ---- -*This file is part of [TubeTK](http://www.tubetk.org). TubeTK is developed by [Kitware, Inc.](https://www.kitware.com) and licensed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).* diff --git a/src/Python/pyfsa/README.md b/src/Python/pyfsa/README.md deleted file mode 100644 index c4a88981a..000000000 --- a/src/Python/pyfsa/README.md +++ /dev/null @@ -1,109 +0,0 @@ -pyfsa -===== - -Overview --------- - -This package implements *Fine-structure analysis (FSA)* for (vertex-labeled) -undirected graphs (with unit edge weights). - -Besides the core functionality of building general graph analysis tools upon -FSA, the package contains two graph-classification examples: 1) a **maximum -a-posteriori (MAP) classifier** that uses Gaussian mixtures to model the -class-conditional distribution(s) of FSA features and 2) a **SVM classifier** -that leverages a **Bag-of-Words (BoW)** representation. Both examples are set -up to *evaluate* the classifier(s) using cross-validation, but it should be -pretty straightforward to adapt those examples to build an actual application. - -Requirements ------------- - -- **networkx**, available at - [https://networkx.github.io](https://networkx.github.io) -- **scikit-learn**, available at - [https://scikit-learn.org/stable/](https://scikit-learn.org/stable/) -- **numpy**, available at [https://www.numpy.org](https://www.numpy.org) - -Fine-Structure Analysis ------------------------ - -The idea of fine-structure analysis is rather simple. While many approaches in -graph analysis compute topological descriptors (e.g., avg. vertex degree, -centrality measures, etc.) from the *whole* graph and thus summarize the graph -in just 1 feature vector, FSA computes topological features for subgraphs -centered at each graph vertex. - -A subgraph, centered at a specific vertex, is built from all neighbors of that -vertex reachable within a certain number of hops. This resembles the idea of -multi-scale analysis. The output of FSA for one graph is a collection of -feature vectors that describe local properties of the graph, very much like -SIFT descriptors in computer vision. - -In the current implementation, varying the number of hops leads to an increase -in dimensionality of the feature vectors (i.e., column-wise concatenation), but -other strategies for combining multiple scales are obviously possible. - -Once features are extracted, we have multiple options on how to build a robust, -yet discriminative representation of the graph (e.g., a BoW histogram). - -Example - Classifying MUTAG graphs ----------------------------------- - -In this example, we show how to use the BoW discriminant classifier to classify -a popular mutagenity dataset (MUTAG, https://www.predictive-toxicology.org) with -188 graphs. The graphs represent chemical compounds that are labeled as either -having a mutagenic effect on the Gram-negative bacterium *Salmonella -typhimurium* or not (125 positive, 63 negative). - -1. **Input data:** Download the MUTAG graphs (already in ```pyfsa``` - compatible format) from MIDAS - [here](http://midas3.kitware.com/midas/folder/1526). - - First, **unpack** the data using - - ```bash - tar xvfz MUTAG.tar.gz - ``` - - The data for each graph is provided in two files: one file that contains - the adjacency information (in the form of a {0,1} matrix), and one file - containing one label for each vertex. - - Additionally, we have three auxiliary files: ```mutag.list```, - ```mutag.labels``` and ```mutag.groups```. ```mutag.list``` contains the - filenames of the files that contain the adjacency information. - ```mutag.labels``` contains a numeric label for each graph that indicates - its class membership (i.e., mutagen or not). Finally, ```mutag.groups``` - contains, for each graph, grouping information, i.e., to which group the - graph belongs to. In our case, this is unused and corresponds to the class - labels. However, in cases where graphs have different attributes, this - grouping can be used to establish group-conditional models for instance - (example coming soon). - -2. **Execution:** For the sake of explanation, we assume that the extracted - MUTAG data resides under ```/tmp/MUTAG```. - - The following command-line arguments to ```dcl.py``` specify that we want - to compute FSA features for two different radii (i.e., the number of hops - that define *reachable* neighbors) and that we want a codebook size of 32 - words for the computation of BoW histograms. Further, we perform 10-fold - cross-validation (default testing size of 20%). The classifier is a SVM - classifier with parameters cross-validated on the training portion of the - current fold. The logging level is set to ```info```. We also specify that - we want to recompute all features (for a detailed explanation of the CLI - arguments, see ```python dcl.py --help```. - - ```bash - python dcl.py \ - --graphList=/tmp/MUTAG/mutag.list \ - --baseDir /tmp/MUTAG \ - --labelPrefix vertexLabel \ - --classInfo /tmp/MUTAG/mutag.labels \ - --codewords 32 \ - --cvRuns 10 \ - --logLevel info \ - --writeAs /tmp/mutag \ - --groupInfo /tmp/MUTAG/mutag.groups \ - --recompute \ - --radii 1,2 - ``` diff --git a/src/Python/pyfsa/core/__init__.py b/src/Python/pyfsa/core/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/Python/pyfsa/core/fsa.py b/src/Python/pyfsa/core/fsa.py deleted file mode 100644 index a76835cb4..000000000 --- a/src/Python/pyfsa/core/fsa.py +++ /dev/null @@ -1,501 +0,0 @@ -"""fsa.py - -This modules implements fine-structure analysis of undirected -graphs with (numeric) vertex attributes. It further contains -functionality to estimate the feature distribution using Gaussian -mixture models, or to build a Bag-of-Words representation from -a collection of feature vectors. - -The idea of fine-structure analysis was recently proposed in - -[1] Macindoe, O. and W. Richards, "Graph Comparison Using Fine - Structure Analysis". In: Social Computing '10 - -Note: We do not implement the LBG features of [1]; Our graph -features include a subset of the features proposed in [2] - -[2] Li. G. et al., "Graph Classification via Topological and Label - Attributes". In: MLG '11 - -as well as some additional generic features available in networkx. -""" - - -__license__ = "Apache License, Version 2.0 (see TubeTK)" -__author__ = "Roland Kwitt, Kitware Inc., 2013" -__email__ = "E-Mail: roland.kwitt@kitware.com" -__status__ = "Development" - - -# Graph handling -import networkx as nx -from networkx.algorithms import bipartite - -# Machine learning -import sklearn.mixture.gmm as gm -from sklearn.cluster import KMeans - -from collections import defaultdict - -# Misc. -import logging -import numpy as np -import scipy.sparse -import time -import sys -import os - - -attr_list = [ #Average degree - lambda g : np.mean([e for e in g.degree().values()]), - # Average eccentricity - lambda g : np.mean([i for i in nx.eccentricity(g).values()]), - # Average closeness centrality - lambda g : np.mean([e for e in nx.closeness_centrality(g).values()]), - # Percentage of isolated points (i.e., degree(v) = 1) - lambda g : float(len(np.where(np.array(nx.degree(g).values())==1)[0]))/g.order(), - # Spectral radius (i.e., largest AM eigenvalue) - lambda g : np.abs(nx.adjacency_spectrum(g))[0], - # Spectral trace (i.e., sum of abs. eigenvalues) - lambda g : np.sum(np.abs(nx.adjacency_spectrum(g))), - # Label entropy, as defined in [2] - lambda g : label_entropy([e[1]['type'] for e in g.nodes(data=True)]), - # Mixing coefficient of attributes - lambda g : np.linalg.det(nx.attribute_mixing_matrix(g,'type')), - # Avg. #vertics with eccentricity == radius (i.e., central points) - lambda g : np.mean(float(len(nx.center(g)))/g.order()), - # Link impurity, as defined in [2] - lambda g : link_impurity(g), - # Diameter := max(eccentricity) - lambda g : nx.diameter(g), - # Radius := min(eccentricity) - lambda g : nx.radius(g)] - - -def link_impurity(g): - """Compute link impurity of vertex-labeled graph. - - Parameters - ---------- - - g : networkx Graph - Input graph with vertex attribute stored as 'type'. - - Returns - ------- - - impurity : float - Link impurity, see [2] - """ - - if len(g.nodes()) == 1: - return 0 - edges = g.edges() - u = np.array([g.node[a]['type'] for (a,b) in edges]) - v = np.array([g.node[b]['type'] for (a,b) in edges]) - return float(len(np.nonzero(u - v)[0]))/len(edges) - - -def label_entropy(labels): - """Compute entropy of label vector. - - Parameters - ---------- - - labels : numpy array, shape (L,) - The input labels. - - Returns - ------- - - entropy : float - Entropy of the label vector, see [2] - """ - - H = np.bincount(labels) - p = H[np.nonzero(H)].astype(float)/np.sum(H) - return np.abs(-np.sum(p * np.log(p))) - - -def graph_from_file(graph_file, label_file=None, n_skip=0): - """Load graph from an ASCII file containing adjacency information. - - Parameters - ---------- - - graph_file : string - Filename of the file containing all the adjaceny information. Format of - the adjaceny matrix file is as follows: - - [Header, optional] - 0 1 1 - 1 0 0 - 0 1 0 - - Interpretation: 3x3 adjaceny matrix, e.g., with an edge between vertices - (0,1) and (0,2), etc. - - label_file : string - Filename of the label information file. Here is an example: - - [Header, optional] - 5 - 2 - 1 - - Interpretation: 3 labels, v_0 label: 5, v_1 label: 2 and v_2 label: 1. - - n_skip : int (default: 0) - Skip n header lines. - - Returns - ------- - G : networkx Graph - """ - - logger = logging.getLogger() - if not os.path.exists(graph_file): - raise Exception("Graph file %s not found!" % graph_file) - - # Load adjacency information and ensure (0,1) weights - adj_info = np.genfromtxt(graph_file, skip_header=n_skip) - adj_info[np.where(adj_info >= 1)] = 1 - G = nx.Graph(adj_info) - - if not label_file is None: - if not os.path.exists(label_file): - raise Exception("Label file %d not found!" % label_file) - labels = np.genfromtxt(label_file, skip_header=n_skip) - logger.debug("Loaded labelfile %s!" % label_file) - - if len(labels) != len(G): - raise Exception("Size mismatch for labels!") - - for idx,l in enumerate(labels): - G.node[idx]['type'] = int(l) - - logger.debug("Built graph from %s with %d vertices." % - (graph_file, len(G))) - return G - - -def compute_graph_features(g, radius=2, sps=None, omit_degenerate=False): - """Compute graph feature vector(s). - - Parameters - ---------- - - g : networkx input graph with N vertices - The input graph on which we need to compute graph features. - - radius: int (default: 2) - Compute graph features from local neighborhoods of vertices, - where the notion of neighborhood is defined by the number of - hops to the neighbor, i.e., the radius. This assumes that the - initial edges weights when computing the shortest-paths are 1. - - sps: numpy matrix, shape (N, N) (default : None) - Matrix of shortest-path information for the graph g. - - omit_degenerate : boolean (default: False) - Currently, degenerate cases are subgraphs with just a single - vertex. If 'omit_degenerate' is 'True', these subgraphs are - not considered. Otherwise, the feature vector for such a sub- - graph is just a vector of zeros. - - Returns - ------- - - v_mat : numpy matrix, shape (N, D) - A D-dimensional feature matrix with one feature vector for - each vertex. Features are computed for the given radius. - """ - - logger = logging.getLogger() - - # Recompute shortest paths if neccessary - if sps is None: - sps = nx.floyd_warshall_numpy(g) - - # Feature matrix representation of graph - v_mat = np.zeros([len(g),len(attr_list)]) - - # Iterate over all nodes - degenerates = [] - for n in g.nodes(): - # Get n-th row of shortest path matrix - nth_row = np.array(sps[n,:]).ravel() - # Find elements within a certain radius - within_radius = np.where(nth_row <= radius) - # Build a subgraph from those nodes - sg = g.subgraph(within_radius[0]) - # Single vertex sg is considered degenerate - if len(sg.nodes()) == 1: - # Keep track of degenerates - degenerates.append(n) - if omit_degenerate: - continue - # Feature vector is 0-vector - v = np.zeros((len(attr_list),)) - else: - v = [attr_fun(sg) for attr_fun in attr_list] - v_mat[n,:] = np.asarray(v) - - logger.info("Found %d generate cases!" % len(degenerates)) - if len(degenerates): - logger.info("Pruning %d degenerate cases ..." % len(degenerates)) - v_mat = np.delete(v_mat, degenerates, axis=0) - logger.debug("Computed (%d x %d) feature matrix." % - (v_mat.shape[0], v_mat.shape[1])) - return v_mat - - -def run_fsa(data, radii=None, recompute=True, out=None, skip=0, - omit_degenerate=False): - """Run (f)ine-(s)tructure (a)nalysis. - - Paramters - --------- - - data : list of N 3-tuple of (graph files,label files, class - indices). We iterate over this list and compute fine-structure - topological features for each graph. - - radii : list of 'int' - The desired neighborhood radii. - - recompute: bool (default : True) - Recompote features, otherwise try to load them from disk. - In case we try to load from disk, filenames are constructed - based on the value of the 'out' parameter. - - out : string (default : None) - Base file name for the generated data files, e.g., - '/tmp/data'. Two files will be written to disk: - - /tmp/data.mat - /tmp/data.idx - - where 'data.mat' contains the feature matrix, i.e., one - feature vector per vertex; 'data.idx' contains the indices - that identify which graph each feature vector belongs to; - - skip : int (default : 0) - Skip N header entries when loading graphs. - - omit_degenerate : boolean (default: False) - Currently, degenerate cases are subgraphs with just a single - vertex. If 'omit_degenerate' is 'True', these subgraphs are - not considered. Otherwise, the feature vector for such a sub- - graph is just a vector of zeros. - - - Returns - ------- - X : numpy matrix, shape (#vertices, len(radii)*D) - Feature matrix, where D is the total number of - features that are computed for one radius setting. - - L : numpy array, shape (#total vertices,) - Identifies to which graph a feature vector belongs - to. - """ - - logger = logging.getLogger() - - if radii is None: - raise Exception("No radii given!") - - if not out is None: - mat_file = "%s.mat" % out - idx_file = "%s.idx" % out - if not recompute: - if (os.path.exists(mat_file) and - os.path.exists(idx_file)): - logger.info("Loading data from file(s).") - data_mat = np.genfromtxt(mat_file) - data_idx = np.genfromtxt(idx_file) - return {'data_mat' : data_mat, - 'data_idx' : data_idx} - - data_mat = [] - data_idx = [] - for idx, (cf, lf, lab) in enumerate(data): - logger.info("Processing %d-th graph ..." % idx) - - T, x = graph_from_file(cf, lf, skip), [] - for r in radii: - x.append(compute_graph_features(T, r, None, omit_degenerate)) - xs = np.hstack(tuple(x)) - data_mat.append(xs) - data_idx.append(np.ones((xs.shape[0], 1))*idx) - - data_mat = np.vstack(tuple(data_mat)) - data_idx = np.vstack(tuple(data_idx)) - - if not out is None: - np.savetxt(mat_file, data_mat, delimiter=' ') - np.savetxt(idx_file, data_idx, delimiter=' ',fmt="%d") - - return {'data_mat' : data_mat, - 'data_idx' : data_idx} - - -def estimate_gm(X,components=3,seed=None): - """Estimate a Gaussian mixture model. - - Note: Uses diagonal covariance matrices. - - Parameters - ---------- - - X : numpy matrix, shape (N,D) - Matrix of data samples (i-th row is i-th sample vector). - - c : int (default : 3) - Number of desired mixture components. - - seed : int (default : None) - Seed for the random number generator. - - Returns - ------- - - gm_obj : sklearn.mixture.gmm object - Estimated GMM. - """ - - logger = logging.getLogger() - - n, d = X.shape - logger.info("Estimating %d-comp. GMM from (%d x %d) ..." % - (components, n, d)) - - gm_obj = gm.GMM (n_components=components, - covariance_type='diag', - random_state=seed) - - gm_obj.fit(X) - return gm_obj - - -def learn_codebook(X, codebook_size=200, seed=None): - """Learn a codebook. - - Run K-Means clustering to compute a codebook. K-Means - is initialized by K-Means++, uses a max. of 500 iter- - ations and 10 times re-initialization. - - Paramters - --------- - - X : numpy matrix, shape (N,D) - Input data. - - codebook_size : int (default : 200) - Desired number of codewords. - - seed : int (default : None) - Seed for random number generator. - - Returns - ------- - - cb : sklearn.cluster.KMeans object - KMeans object after fitting. - """ - - logger = logging.getLogger() - logger.info("Learning codebook with %d words ..." % codebook_size) - - # Run vector-quantization - cb = KMeans(codebook_size, - init="k-means++", - n_init=10, - max_iter=500, - random_state=seed) - cb.fit(X) - return cb - - -def bow(X, cb): - """Compute a (normalized) BoW histogram. - - Parameters - ---------- - - X : numpy matrix, shape (N, D) - Input data. - - cb : sklearn.cluster.KMeans - Already estimated codebook with C codewords. - - Returns - ------- - - H : numpy array, shape (C,) - Normalized (l2-norm) BoW histogram. - """ - - # Get nr. codewords - n,d = cb.cluster_centers_.shape - if d != X.shape[1]: - raise Exception("Dimensionality mismatch!") - # Compute closest cluster centers - assignments = cb.predict(X) - # Compute (normalized) BoW histogram - B = range(0,n+1) - return np.histogram(assignments,bins=B,density=True)[0] - - -def pp_gmm(X, models, argmax=True): - """Compute the posterior probability of X under a set of GMM models. - - Parameters - ---------- - X : numpy matrix, shape (N,D) - Data samples. - - models : list of sklearn.mixture.gmm objects - List of C estimated GMMs. - - argmax : boolean (default : True) - If 'True', the index of the class (represented by - it's model) with the highest a-posteriori probability - is computed. If 'False', the a-posteriori probability - if each class (represented by the model) is computed for - each row in X. Note: We assume equal prior probabilities - for each class. - - Returns - ------- - - maxp : numpy.int64, or np.array with shape (N, C) - Depending on whether 'argmax' is 'True' or - 'False', the index of the class with the highest - a-posteriori probability is returned, or the - a-posteriori probabilities under each model (for - each feature vector in X). - """ - - n,d = X.shape - n_models = len(models) - - ll = np.zeros((n,n_models),dtype="float32") - for i, model in enumerate(models): - ll[:,i] = np.asarray(model.score(X)).ravel() - - if argmax: - # Column-wise sum - sump = np.sum(ll,axis=0) - # LogSumExp to compute MAP - t0 = np.max(sump) - t1 = np.exp(sump - (np.log(np.sum(np.exp(sump - t0))) + t0)) - max_idx = np.argmax(t1) - return max_idx - else: - # LogSumExp to compute row-wise MAP - t0 = np.asmatrix(np.max(ll,axis=1)).transpose() - t1 = np.log(np.sum(np.exp(ll - np.tile(t0,(1,n_models))),axis=1)) + t0 - prob = np.exp(np.asmatrix(ll) - t1) - return prob diff --git a/src/Python/pyfsa/core/utils.py b/src/Python/pyfsa/core/utils.py deleted file mode 100644 index 0069b02b3..000000000 --- a/src/Python/pyfsa/core/utils.py +++ /dev/null @@ -1,332 +0,0 @@ -"""utils.py - -Convenience functions to build applications that use pyfsa. -""" - - -__license__ = "Apache License, Version 2.0 (see TubeTK)" -__author__ = "Roland Kwitt, Kitware Inc., 2013" -__email__ = "E-Mail: roland.kwitt@kitware.com" -__status__ = "Development" - - -import os -import sys -import logging -import numpy as np -from optparse import OptionParser - - -# Define the log levels -LOGGING_LEVELS = { - 'critical': logging.CRITICAL, - 'error': logging.ERROR, - 'warning': logging.WARNING, - 'info': logging.INFO, - 'debug': logging.DEBUG} - - -def _radii_callback(option,opt,value,parser): - radii = [] - for e in value.split(','): - radii.append(int(e)) - parser.values.radii = radii - - -def _globalLabelFile_callback(option,opt,value,parser): - print value - if value is None: - parser.values.globalLabelFile = None - if not os.path.exists(value): - raise Exception("Global label file %s does not exist!" % value) - parser.values.globalLabelFile = value - - -def _classInfo_callback(option,opt,value,parser): - if not os.path.exists(value): - raise Exception("Class info file %s does not exist!" % value) - parser.values.classInfo = value - - -def _groupInfo_callback(option,opt,value,parser): - if not os.path.exists(value): - raise Exception("Group info file %s does not exist!" % value) - parser.values.groupInfo = value - - -def _logLevel_callback(option,opt,value,parser): - if not value in LOGGING_LEVELS: - raise Exception("Level : %s not supported!" % value) - parser.values.logLevel = value - - -def _graphList_callback(option,opt,value,parser): - if not os.path.exists(value): - raise Exception("Graph list file %s does not exist!" % value) - parser.values.graphList = value - - -def _baseDir_callback(options,opt,value,parser): - if not os.path.exists(value): - raise Exception("Directory %s does not exist!" % value) - parser.values.baseDir = value - - -def setup_cli_parsing(): - """Setup CLI parser for common CLI arguments. - - Returns - ------- - - parser : OptionParser object - """ - - parser = OptionParser() - parser.add_option("", - "--labelPrefix", - help="prefix of the label files.") - parser.add_option("", - "--skip", - default=0, - type="int", - help="Skip N header entries.") - parser.add_option("", - "--omitDegenerate", - action="store_true", - default=False, - help="Omit single vertex subgraphs.") - parser.add_option("", - "--writeAs", - default="/tmp/data", - help="feature file base name.") - parser.add_option("", - "--seed", - type="int", - help="Seed for random number generator.") - parser.add_option("", - "--normalize", - action="store_true", - default=False, - help="Enable feature normalization (mean/var).") - parser.add_option("", - "--cvRuns", - default=5, - type="int", - help="number of cross-validations to run.") - parser.add_option("", - "--recompute", - action="store_true", - default=False, - help="Force feature recomputation.") - parser.add_option("", - "--graphList", - type="string", - action="callback", - callback=_graphList_callback, - help="input file with graph adj. file names.") - parser.add_option("", - "--baseDir", - type="string", - action="callback", - callback=_baseDir_callback, - help="base directory of graph adj. file names.") - parser.add_option("", "--logLevel", - type="string", - default="debug", - action="callback", - callback=_logLevel_callback, - help="set logging level.") - parser.add_option("", - "--classInfo", - type="string", - action='callback', - callback=_classInfo_callback, - help="class information file.") - parser.add_option("", - "--groupInfo", - type="string", - action='callback', - callback=_groupInfo_callback, - help="group information file.") - parser.add_option("", - "--logTo", - help="Specify logging file.") - parser.add_option("", - "--globalLabelFile", - type="string", - action="callback", - callback=_globalLabelFile_callback, - help="global label file for all graphs.") - parser.add_option("", "--radii", - type="string", - action='callback', - callback=_radii_callback, - help="list of neighborhood radi(i), e.g., 1,2,3") - return parser - - -def setup_logging(options): - """Configure logger. - - Defines the logging format. - """ - - log_format = '%(asctime)s [%(funcName)s] %(levelname)s: %(message)s' - logging.basicConfig(level=LOGGING_LEVELS.get(options.logLevel, - logging.NOTSET), - filename=options.logTo, - format=log_format, - datefmt='%Y-%m-%d %H:%M:%S') - - -def remap_labels(labels): - """Map labels in {c_1,...,c_C} to {0,...,C-1}. - - Parameters - ---------- - - labels : numpy array, shape (L,) - Input labels (could also be 'chars') - - Returns - ------- - - labels : numpy array, shape (L,) - Labels in {0,...C-1} where C is the number of unique - labels. - """ - - for i,l in enumerate(np.unique(labels)): - labels[labels == l] = i - return labels - - -def read_graph_file_list(options): - """Create a list of graph file names. - - Parameters - ---------- - - options : object returned by parse_args() of OptionParser - CLI options. - - Returns - ------- - - graph_files : list, len=N - List of N graph file names, contained in the file - that was specified as the value to '--graphList'. - In case '--labelPrefix' is provided, the value to - that option is used as a prefix to each graph file - name. - """ - - base = options.baseDir - if not base is None: - return [os.path.join(base, l.strip()) for l in open(options.graphList)] - return [l.split() for l in open(options.graphList)] - - -def read_label_file_list(options, graph_file_list): - """Create a list of vertex label files (one for each graph). - - Paramters - --------- - - options : object returned by parse_args() of OptionParser - CLI options. - - graph_file_list : list - List of N graph files. - - Returns - ------- - - label_files : list len=N - List of label files (graph file name + label prefix). - """ - - if options.labelPrefix is None: - raise Exception("No label prefix given!") - - N = len(graph_file_list) - label_files = [None for i in range(0, N)] - for i in range(0, N): - label_files[i] = "%s.%s" % (graph_file_list[i], options.labelPrefix) - return label_files - - -def read_class_info(options): - """Read class label information from file. - - The class label file needs to follow the convention that - there is only one label per line, e.g., - - 0 - 1 - 0 - 1 - ... - - Parameters - ---------- - - options : object returned by parse_args() of OptionParser - CLI options. - - Returns - ------- - - class_labels : list of 'int', len=N - List of labels (one label per graph). - """ - - return [int(l.strip()) for l in open(options.classInfo)] - - -def read_group_info(options): - """Read grouping info from file (in the form of attribute indicators). - - The format of the group info file is a binary N x G matrix, where a - non-zero entry at the j-th entry of the n-th row signifies that this - the j-th attribute is present. - - Example - ------- - - 0 1 0 0 - 0 0 0 1 - 0 1 0 1 - - Parameters - ---------- - - options : object returned by parse_args() of OptionParser - CLI options. - - Returns - ------- - - attributes : numpy matrix, shape (N, G) - Binary attribute indicator matrix. - """ - - grp_info = np.asmatrix(np.genfromtxt(options.groupInfo, dtype="int")) - if grp_info.shape[0] == 1: - grp_info = grp_info.transpose() - return grp_info - - -def show_summary(scores): - """Print a classification report to stdout. - - Parameters - ---------- - - scores : numpy array, shape (K,) - Classifier scores. - """ - logger = logging.getLogger() - - logger.info("Avg(scores) : %.2f" % (np.mean(scores)*100)) - logger.info("Std(scores) : %.2f" % (np.std(scores)*100)) diff --git a/src/Python/pyfsa/dcl.py b/src/Python/pyfsa/dcl.py deleted file mode 100644 index fc97fb83d..000000000 --- a/src/Python/pyfsa/dcl.py +++ /dev/null @@ -1,151 +0,0 @@ -"""dcl.py - -Demonstrate evaluation of a discriminant SVM graph classifier -using N-Fold cross-validation. -""" - -__license__ = "Apache License, Version 2.0 (see TubeTK)" -__author__ = "Roland Kwitt, Kitware Inc., 2013" -__email__ = "E-Mail: roland.kwitt@kitware.com" -__status__ = "Development" - - -# Graph handling -import networkx as nx - -# Machine learning -from sklearn.metrics import accuracy_score -from sklearn.cross_validation import KFold -from sklearn.cross_validation import ShuffleSplit -from sklearn.linear_model import LogisticRegression -from sklearn.grid_search import GridSearchCV -from sklearn import preprocessing -from sklearn import svm - -# Misc. -from optparse import OptionParser -import logging -import numpy as np -import scipy.sparse -import time -import sys -import os - -# pyfsa imports -import core.fsa as fsa -import core.utils as utils - - -def main(argv=None): - if argv is None: - argv = sys.argv - - # Setup vanilla CLI parsing and add custom arg(s). - parser = utils.setup_cli_parsing() - parser.add_option("", - "--codewords", - help="number of codewords.", - default=50, - type="int") - (options, args) = parser.parse_args() - - # Setup logging - utils.setup_logging(options) - logger = logging.getLogger() - - # Read graph file list and label file list - graph_file_list = utils.read_graph_file_list(options) - if not options.globalLabelFile is None: - label_file_list = [options.globalLabelFile] * len(graph_file_list) - else: - label_file_list = utils.read_label_file_list(options, - graph_file_list) - - # Read class info and grouping info - class_info = utils.read_class_info(options) - group_info = utils.read_group_info(options) - - assert (group_info.shape[0] == - len(class_info) == - len(graph_file_list) == - len(label_file_list)) - - # Zip lists together - data = zip(graph_file_list, - label_file_list, - class_info) - - # Run fine-structure analysis - fsa_res = fsa.run_fsa(data, - options.radii, - options.recompute, - options.writeAs, - options.skip, - options.omitDegenerate) - data_mat = fsa_res['data_mat'] - data_idx = fsa_res['data_idx'] - - # Create cross-validation folds - n_graphs = len(class_info) - cv = ShuffleSplit(n_graphs, - n_iter=options.cvRuns, - test_size=0.2, - random_state=0) - - # Try inplace feature normalization - if options.normalize: - logger.info("Running feature normalization ...") - scaler = preprocessing.StandardScaler(copy=False) - scaler.fit_transform(fsa_res['data_mat']) - - scores = [] - for cv_id, (trn, tst) in enumerate(cv): - - # Compose training data - pos = [] - for i in trn: - tmp = np.where(data_idx==i)[0] - pos.extend(list(tmp)) - np_pos = np.array(pos) - - # Learn a codebook from training data - codebook = fsa.learn_codebook(data_mat[np_pos,:], - options.codewords, - options.seed) - - # Compute BoW histograms for training data - bow_trn_mat = np.zeros((len(trn), options.codewords)) - for cnt, i in enumerate(trn): - np_pos = np.where(data_idx==i)[0] - bow_trn_mat[cnt,:] = np.asarray(fsa.bow(data_mat[np_pos,:], - codebook)) - - # Cross-validate (5-fold) SVM classifier and parameters - param_selection = [{'kernel': ['rbf'], - 'gamma': np.logspace(-6,2,10), - 'C': [1, 10, 100, 1000]}, - {'kernel': ['linear'], - 'C': [1, 10, 100, 1000]}] - clf = GridSearchCV(svm.SVC(C=1), param_selection) - clf.fit(bow_trn_mat, np.asarray(class_info)[trn], cv=5) - - # Compute BoW histograms for testing data - bow_tst_mat = np.zeros((len(tst), options.codewords)) - for cnt,i in enumerate(tst): - pos = np.where(data_idx==i)[0] - bow_tst_mat[cnt,:] = fsa.bow(data_mat[pos,:], codebook) - - print "yhat : ", clf.predict(bow_tst_mat) - print "gold : ", np.asarray(class_info)[tst] - - # Score the classifier - score = clf.score(bow_tst_mat, np.asarray(class_info)[tst]) - scores.append(score) - - logger.info("Score (%.2d): %.2f" % (cv_id,100*score)) - - utils.show_summary(scores) - - -if __name__ == "__main__": - main() diff --git a/src/Python/pyfsa/mapcl.py b/src/Python/pyfsa/mapcl.py deleted file mode 100644 index 2b5e1b12e..000000000 --- a/src/Python/pyfsa/mapcl.py +++ /dev/null @@ -1,137 +0,0 @@ -"""mapcl.py - -Demonstrate how to evaluate a maximum a-posteriori -graph classifier using N-fold cross-validation. -""" - -__license__ = "Apache License, Version 2.0 (see TubeTK)" -__author__ = "Roland Kwitt, Kitware Inc., 2013" -__email__ = "E-Mail: roland.kwitt@kitware.com" -__status__ = "Development" - - -# Graph handling -import networkx as nx - -# Machine learning -from sklearn.metrics import accuracy_score -from sklearn.cross_validation import KFold -from sklearn.cross_validation import ShuffleSplit -from sklearn.linear_model import LogisticRegression -from sklearn.grid_search import GridSearchCV -from sklearn import preprocessing -from sklearn import svm - -# Misc. -from optparse import OptionParser -import logging -import numpy as np -import scipy.sparse -import time -import sys -import os - -# Fine-structure analysis -import core.fsa as fsa -import core.utils as utils - - -def main(argv=None): - if argv is None: - argv = sys.argv - - # Setup vanilla CLI parsing and add custom arg(s). - parser = utils.setup_cli_parsing() - parser.add_option("", - "--mixComp", - help="number of GMM components.", - default=3, - type="int") - (options, args) = parser.parse_args() - - # Setup logging - utils.setup_logging(options) - logger = logging.getLogger() - - # Read graph file list and label file list - graph_file_list = utils.read_graph_file_list(options) - label_file_list = utils.read_label_file_list(options, graph_file_list) - - # Read class info and grouping info - class_info = utils.read_class_info(options) - group_info = utils.read_group_info(options) - - assert (group_info.shape[0] == - len(class_info) == - len(graph_file_list) == - len(label_file_list)) - - # Zip lists together - data = zip(graph_file_list, - label_file_list, - class_info) - - # Run fine-structure analysis - fsa_res = fsa.run_fsa(data, - options.radii, - options.recompute, - options.writeAs, - options.skip, - options.omitDegenerate) - data_mat = fsa_res['data_mat'] - data_idx = fsa_res['data_idx'] - - # Create cross-validation folds (20% testing) - n_graphs = len(class_info) - cv = ShuffleSplit(n_graphs, - n_iter=options.cvRuns, - test_size=0.2, - random_state=0) - - # Our unique class labels - label_set = np.unique(class_info) - - if options.normalize: - logger.info("Running feature normalization ...") - scaler = preprocessing.StandardScaler(copy=False) - scaler.fit_transform(fsa_res['data_mat']) - - scores = [] - for cv_id, (trn, tst) in enumerate(cv): - - models = [] - for l in label_set: - l_idx = np.where(class_info == l)[0] - l_idx = np.asarray(l_idx).ravel() - l_trn = np.intersect1d(l_idx, trn) - - pos = [] - for i in l_trn: - tmp = np.where(fsa_res['data_idx']==i)[0] - pos.extend(list(tmp)) - - np_pos = np.asarray(pos) - gmm_model = fsa.estimate_gm(data_mat[np_pos,:], options.mixComp) - models.append(gmm_model) - - predict = [] - for i in tst: - pos = np.where(data_idx==i)[0] - map_idx = fsa.pp_gmm(data_mat[pos,:], models, argmax=True) - predict.append(label_set[map_idx]) - - # Score the MAP classifier - truth = [class_info[i] for i in tst] - score = accuracy_score(truth, predict) - - print "yhat :", predict - print "gold :", truth - - logger.info("Score (%.2d): %.2f" % (cv_id, 100*score)) - scores.append(score) - - utils.show_summary(scores) - - -if __name__ == "__main__": - main() diff --git a/src/Python/tubetk.pth.in b/src/Python/tubetk.pth.in deleted file mode 100644 index da7f2a01a..000000000 --- a/src/Python/tubetk.pth.in +++ /dev/null @@ -1,8 +0,0 @@ -# tubetk.pth -# Add a symlink to this file in the directory that results from:: -# -# python -m site --user-site -# -# to make TubeTK Python packages and modules importable. - -@TubeTK_C_PYTHON_EXTENSION_DIR@ diff --git a/src/Python/tubetk/CMakeLists.txt b/src/Python/tubetk/CMakeLists.txt deleted file mode 100644 index b60f36ae7..000000000 --- a/src/Python/tubetk/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright Kitware Inc. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## - -add_custom_target( CopyPurePythonTubeTK ALL "${CMAKE_COMMAND}" -P - "${TubeTK_SOURCE_DIR}/CMake/CopyFiles.cmake" - "${CMAKE_CURRENT_BINARY_DIR}" - "*.py" - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" ) - -add_custom_target( CopyPythonLibTubeTK ALL "${CMAKE_COMMAND}" -P - "${TubeTK_SOURCE_DIR}/CMake/CopyFiles.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/../../lib" - "*pyd*" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) diff --git a/src/Python/tubetk/__init__.py b/src/Python/tubetk/__init__.py deleted file mode 100644 index b1097e58e..000000000 --- a/src/Python/tubetk/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright Kitware Inc. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## diff --git a/src/Python/tubetk/cvImageFilters.py b/src/Python/tubetk/cvImageFilters.py deleted file mode 100644 index 53e0271e7..000000000 --- a/src/Python/tubetk/cvImageFilters.py +++ /dev/null @@ -1,115 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright 2010 Kitware Inc. 28 Corporate Drive, -# Clifton Park, NY, 12065, USA. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## -#!/usr/bin/env python - -import Image - -import cv2 -import cv2.cv as cv -import numpy as np - -def cv2array(im): - ''' - Copied from http://opencv.willowgarage.com/wiki/PythonInterface - ''' - depth2dtype = { - cv.IPL_DEPTH_8U: 'uint8', - cv.IPL_DEPTH_8S: 'int8', - cv.IPL_DEPTH_16U: 'uint16', - cv.IPL_DEPTH_16S: 'int16', - cv.IPL_DEPTH_32S: 'int32', - cv.IPL_DEPTH_32F: 'float32', - cv.IPL_DEPTH_64F: 'float64', - } - - arrdtype=im.depth - a = np.fromstring( - im.tostring(), - dtype=depth2dtype[im.depth], - count=im.width*im.height*im.nChannels) - if im.nChannels is not 1: - a.shape = (im.height,im.width,im.nChannels) - else: - a.shape = (im.height,im.width) - return a - -def array2cv(a): - ''' - Copied from http://opencv.willowgarage.com/wiki/PythonInterface - ''' - dtype2depth = { - 'bool': cv.IPL_DEPTH_8U, - 'uint8': cv.IPL_DEPTH_8U, - 'int8': cv.IPL_DEPTH_8S, - 'uint16': cv.IPL_DEPTH_16U, - 'int16': cv.IPL_DEPTH_16S, - 'int32': cv.IPL_DEPTH_32S, - 'float32': cv.IPL_DEPTH_32F, - 'float64': cv.IPL_DEPTH_64F, - } - try: - nChannels = a.shape[2] - except: - nChannels = 1 - cv_im = cv.CreateImageHeader((a.shape[1],a.shape[0]), - dtype2depth[str(a.dtype)], - nChannels) - cv.SetData(cv_im, a.tostring(), - a.dtype.itemsize*nChannels*a.shape[1]) - return cv_im - -def cv2Image(cv_im): - pi = Image.fromstring( "L", cv.GetSize(cv_im), cv_im.tostring() ) - return pi - -def Image2cv(pi): - cv_im = cv.CreateImageHeader( pi.size, cv.IPL_DEPTH_8U, 1 ) - cv.SetData( cv_im, pi.tostring() ) - return cv_im - - -def gaussianFilter( inputImage, filterSize ): - """ - Apply Gaussian filter of OpenCV to a given array - """ - # Convert from numpy array to CvMat - outputImage = cv.CreateImage( cv.GetSize( inputImage ), cv.IPL_DEPTH_32F, 1 ) - - cv.Smooth( inputImage, outputImage, cv.CV_GAUSSIAN, filterSize, filterSize ) - - return outputImage - - -def adaptiveThresholding( inputImage, neighborhoodWidth=71, offsetFromMean=15 ): - """ - Apply adaptive thresholding to a given image. Uses a - neighborhoodWidth x neighborhoodWidth kernel. Threshold is set at - mean intensity within kernel + offsetFromMean. - """ - outputImage = cv.CreateImage( cv.GetSize( inputImage ), cv.IPL_DEPTH_8U, 1 ) - - cv.AdaptiveThreshold( inputImage, outputImage, 255, cv.CV_THRESH_BINARY, - cv.CV_ADAPTIVE_THRESH_MEAN_C, neighborhoodWidth, - offsetFromMean ) - - return outputImage diff --git a/src/Python/tubetk/spImageFilters.py b/src/Python/tubetk/spImageFilters.py deleted file mode 100644 index 53c7f0f19..000000000 --- a/src/Python/tubetk/spImageFilters.py +++ /dev/null @@ -1,427 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright 2010 Kitware Inc. 28 Corporate Drive, -# Clifton Park, NY, 12065, USA. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## -#!/usr/bin/env python - -from ctypes import * -from collections import namedtuple - -import Image - -import numpy as np - -import scipy as sp -import scipy.ndimage -import scipy.stats.mstats - -import math - -class POINTF( Structure ): - _fields_ = [( "x", c_float ), - ( "y", c_float )] - -class POINT( Structure ): - _fields_ = [( "x", c_int ), - ( "y", c_int )] - -class POINT3D( Structure ): - _fields_ = [( "x", c_int ), - ( "y", c_int ), - ( "z", c_int )] - -class LINE( Structure ): - _fields_ = [( "p1", POINT ), - ( "p2", POINT )] - -class LINEF( Structure ): - _fields_ = [( "p1", POINTF ), - ( "p2", POINTF )] - -Point = namedtuple( 'Point', ['x', 'y'] ) -Line = namedtuple( 'Line', ['p1', 'p2'] ) - -def distanceBtwTwoPoints( point1, point2 ): - """ - Find distance between two 2D points - """ - xDistance = point2.x - point1.x - yDistance = point2.y - point1.y - xyDistance = math.sqrt( xDistance * xDistance + yDistance * yDistance ) - return xyDistance, xDistance, yDistance - -def wienerFilter( array1, maskSize ): - """ - Apply wiener filter to a given array - """ - wienerFilteredImage = scipy.signal.wiener( array1, ( maskSize, maskSize ) ) - - return wienerFilteredImage - - -def gaussianFilter( array1, sigma ): - """ - Apply gaussian filter to a given array - """ - gauss_lowpass = sp.ndimage.gaussian_filter( array1, sigma ) - gauss_highpass = array1 - gauss_lowpass - - return gauss_lowpass, gauss_highpass - - -def meanFilter( array1 ): - """ - Apply mean filtering usign a fixed kernel for a given array1 - """ - kernel = np.array( [[1./9.0, 1./9.0, 1./9.0], - [1./9.0, 1./9.0, 1./9.0], - [1./9.0, 1./9.0, 1./9.0]] ) - - lowpass_3x3 = sp.ndimage.convolve( array1, kernel ) - - -def highPassFilter( array1 ): - """ - Apply a high pass filter to a given array - """ - # A slightly "wider", but sill very simple highpass filter - kernel = np.array( [[-1, -1, -1, -1, -1], - [-1, 1, 2, 1, -1], - [-1, 2, 4, 2, -1], - [-1, 1, 2, 1, -1], - [-1, -1, -1, -1, -1]] ) - - highpass_5x5 = sp.ndimage.convolve( array1, kernel ) - - -def threshold( inputImage, edge_threshold, lowVal=0, highVal=255 ): - - thresholdedImage1 = sp.stats.mstats.threshold( inputImage, None, - edge_threshold, highVal ) - - thresholdedImage2 = sp.stats.mstats.threshold( thresholdedImage1, - edge_threshold+0.00000000001, None, lowVal ) - - return thresholdedImage2 - -def thresholdBinary( x, T, delta=1e-3, minval=1, maxval=0 ): - x = np.asarray( x ).copy() - Told = T + 1 - while np.abs( T - Told ) > delta: - Told = T - mask = ( x<=T ) - T = ( x[mask].mean() + x[~mask].mean() )/2. - - x[mask] = minval - x[~mask] = maxval - return x, T - -_4_connected = np.array( [[0, 1, 0], - [1, 1, 1], - [0, 1, 0]], dtype=bool ) - -_8_connected = np.array( [[1, 1, 1], - [1, 1, 1], - [1, 1, 1]], dtype=bool ) - -def removeSmallRegionBlobs( inputImage, regionThreshold ): - - prunedImage1 = removeSmallSizes( inputImage, regionThreshold, - structure=_8_connected ) - - prunedImage2= removeSmallSizes( prunedImage1, regionThreshold, - structure=_4_connected ) - - return prunedImage2 - -def removeSmallSizes( inputImage, minSize, structure=_4_connected ): - - labelImage, num_objects = sp.ndimage.label( inputImage, structure ) - - objectLabels = np.arange( 1, num_objects+1 ) - - if( inputImage.max() == 0 ): - return inputImage - - areas = np.array( sp.ndimage.sum( inputImage / inputImage.max(), labelImage, - objectLabels ) ) - - bigObjects = objectLabels[areas >= minSize] - - bigObjectImage = np.zeros( inputImage.shape, dtype=bool ) - - for bo in bigObjects: - bigObjectImage |= labelImage == bo - - return bigObjectImage - -def getLargestRegionBlob( inputImage ): - - labelImage, num_objects = sp.ndimage.label( inputImage ) - objectLabels = np.arange( 1, num_objects+1 ) - - if( inputImage.max() == 0 ): - return inputImage - - areas = np.array( sp.ndimage.sum( inputImage / inputImage.max(), - labelImage, objectLabels ) ) - max_size = sp.ndimage.maximum( areas ) - - bigObjects = objectLabels[areas == max_size] - - bigObjectImage = np.zeros( inputImage.shape, dtype=bool ) - for bo in bigObjects: - bigObjectImage |= labelImage == bo - - return bigObjectImage - -def findConnectedComponents( inputImage ): - """ - Finds the connected components in an image - """ - objects, num_objects = sp.ndimage.label( inputImage ) - object_slices = sp.ndimage.find_objects( objects ) - return object_slices - -def scale( array1 ): - """ - Scales the values in array to be between 0 and 255 - """ - array2 = normalize( array1 ) - return array2 * 255 - -def scaleUsingFullWidthHalfMax( array1, stdDevScale=10 ): - """ - Scales the values in array to be between 0 and 255 - """ - array2 = normalizeUsingFullWidthHalfMax( array1, False ) - - array2 = (array2 * stdDevScale) + ( 128 * np.ones( array2.shape ) ) - array2 = array2.clip( min=0, max=255 ) - - return array2 - -def getNMax( arr, n ): - """ - - """ - indices = arr.ravel().argsort()[-n:] - return indices - -def normalize( array1 ): - """ - Normalizes the values in an array between 0 and 1 - """ - minimum = float( array1.min() ) - array1 = array1-minimum - maximum = float( array1.max() ) - return array1 / maximum - -def normalizeUsingFullWidthHalfMax( array, isArrayOfInts ): - nBins = 50 - binMin = array.min() - binMax = array.max() - - loop = 0 - while loop < 4: - loop += 1 - meanV = 0 - stdDevV = 1 - - if binMax - binMin < nBins and isArrayOfInts: - binMid = (binMax + binMin ) / 2.0 - binStep = ( nBins - 1 ) / 2.0 - binMin = binMid - binStep - binMax = binMin + (nBins-1) - - bins, binEdges = np.histogram( array, bins=nBins, range=(binMin, binMax) ) - bins = sp.ndimage.gaussian_filter( bins, 0.5 ) - - maxBinV = bins.max() - maxBinList = sp.transpose( ( bins == maxBinV ).nonzero() )[0] - maxBin = maxBinList[ len(maxBinList)/2 ] - - fwhm = maxBinV / 2 - - binFWHMMin = maxBin - while binFWHMMin > 0 and bins[ binFWHMMin ] >= fwhm: - binFWHMMin -= 1 - denom = ( bins[ binFWHMMin+1 ] - bins[ binFWHMMin ] ) - if denom != 0: - binFWHMMin += ( ( fwhm - bins[ binFWHMMin ] ) / denom ) - - binFWHMMax = maxBin - while binFWHMMax < nBins-1 and bins[ binFWHMMax ] >= fwhm: - binFWHMMax += 1 - denom = ( bins[ binFWHMMax-1 ] - bins[ binFWHMMax ] ) - if denom != 0: - binFWHMMax -= ( ( fwhm - bins[ binFWHMMax ] ) / denom ) - - if binFWHMMax <= binFWHMMin: - binFWHMMin = maxBin-1 - binFWHMMax = maxBin+1 - - minV = ( ( ( binFWHMMin + 0.5 ) / ( nBins - 1.0 ) ) - * ( binMax-binMin ) + binMin ) - maxV = ( ( ( binFWHMMax + 0.5 ) / ( nBins - 1.0 ) ) - * ( binMax-binMin ) + binMin ) - - meanV = ( maxV + minV ) / 2.0 - - # FWHM to StdDev relationship from - # https://mathworld.wolfram.com/GaussianFunction.html - stdDevV = ( maxV - minV ) / 2.3548 - - binMin = meanV - 3 * stdDevV - binMax = meanV + 3 * stdDevV - - return ( array.astype(float) - meanV ) / stdDevV - -def extractSubImage( inputImage, center, mask ): - """ - Extracts a sub region around a center point in a given image - Extracted region size is mask by mask - """ - inputImageHeight = inputImage.shape[0] - inputImageWidth = inputImage.shape[1] - corner = np.zeros( ( 4,2 ), dtype =np.int64 ) - # upperleft - corner[0,0] = center.x - mask.x - corner[0,1] = center.y - mask.y - #lowerleft - corner[1,0] = center.x - mask.x - corner[1,1] = center.y + mask.y - #lowerright - corner[2,0] = center.x + mask.x - corner[2,1] = center.y + mask.y - #upperright - corner[3,0] = center.x + mask.x - corner[3,1] = center.y - mask.y - - for i in range( 0,4 ): - for j in range( 0,2 ): - if ( corner[i][j]< 0 ): - corner[i][j] = 0 - if( corner[i][1]>=inputImageHeight ): - corner[i][1] = inputImageHeight-1 - if( corner[i][0]>=inputImageWidth ): - corner[i][0] = inputImageWidth-1 - - return inputImage[corner[0,1]:corner[1,1],corner[1,0]:corner[2,0]], corner - - -def cropLargestBinaryRegion( inputImage ): - - B = np.argwhere( inputImage ) - ( ystart, xstart ), ( ystop, xstop ) = B.min( 0 ), B.max( 0 ) + 1 - Atrim = inputImage[ystart:ystop, xstart:xstop] - - cropMin = POINT( xstart, ystart ) - cropMax = POINT( xstop, ystop ) - - return Atrim, cropMin, cropMax - -def cropImageByRegion( inputImage, minColumn, maxColumn, minRow, maxRow ): - croppedImage = inputImage[minColumn:maxColumn,minRow:maxRow] - return croppedImage - -def floodfill(inputImage, seed, threshMin, threshMax, return_region = False): - """ - Fill bounded region - - "value" should be a value that otherwise does not occur within the image. - """ - - x, y = seed - - mask = np.zeros( inputImage.shape, dtype=bool ) - - if return_region: - roi = [ (x, y) ] - - edge = [ (x, y) ] - while edge: - newedge = [] - for (x, y) in edge: - for (s, t) in ((x + 1, y), (x - 1, y), (x, y + 1), (x, y - 1)): - try: - item = inputImage[s, t] - except IndexError: - pass - else: - itemB = mask[s, t] - if ( item >= threshMin and item <= threshMax and - itemB == False ): - mask[s, t] = True - newedge.append((s, t)) - if return_region and not (s, t) in roi: - roi.append( (s, t) ) - edge = newedge - - if return_region: - return mask, roi - - return mask - -def cropImage( inputImage, roiMinThreshold, roiMaxThreshold ): - ''' - Hack method to find a dark box within a bright boarder - ''' - imageT = (inputImage >= roiMinThreshold) & (inputImage <= roiMaxThreshold) - imageC = getLargestRegionBlob( imageT ) - imageT, cropMin, cropMax = cropLargestBinaryRegion( imageC ) - - minRow = cropMin.y - maxRow = cropMax.y - minColumn = cropMin.x - maxColumn = cropMax.x - - croppedImage = inputImage[ minColumn:maxColumn, minRow:maxRow ] - - minCoord = POINT( minColumn, minRow ) - maxCoord = POINT( maxColumn, maxRow ) - - return croppedImage, minCoord, maxCoord - -def removeNoise( inputImage, noiseSize ): - #opSize = int( noiseSize / 2 ) - #deNoised1 = sp.ndimage.grey_opening( inputImage, - #size=(opSize*2+1, opSize*2+1) ) - #deNoised2 = sp.ndimage.grey_closing( deNoised1, - #size=(opSize*2+1, opSize*2+1) ) - #smoothedImage, tmp = gaussianFilter( deNoised2, noiseSize/3 ) - smoothedImage, tmp = gaussianFilter( inputImage, noiseSize/3 ) - return smoothedImage - -def findBackground( inputImage, backgroundScale ): - background, tmp = gaussianFilter( inputImage, backgroundScale ) - return background - -def divideImages( image1, image2 ): - return np.divide( image1, image2 ) - -def removeBackground( inputImage, backgroundScale, noiseSize=1 ): - smoothedImage = removeNoise( inputImage, noiseSize/2 ).astype( float ) - backgroundImage = findBackground( smoothedImage, - backgroundScale ).astype( float ) - inputImageCleaned = divideImages( smoothedImage, backgroundImage ) - inputImageCleaned = scaleUsingFullWidthHalfMax( inputImageCleaned, 3 ) - return inputImageCleaned diff --git a/test/Baseline/SegmentTubesTest1.mha.sha512 b/test/Baseline/SegmentTubesTest1.mha.sha512 index 5260fd547..b8745e798 100644 --- a/test/Baseline/SegmentTubesTest1.mha.sha512 +++ b/test/Baseline/SegmentTubesTest1.mha.sha512 @@ -1 +1 @@ -6df651d84d9ae05e1d94596398548e70e0d22977a69df60a340caba8c105422cb38b31dc5ccffb9f78d6607aa44d5844f9ad040e027155ef59168fe3ba617359 +d14117c52eb25d9544c3e0e70c9455a0b63777300739de4816ca45e19df763b748f2fbfa7d4d14657954c14f70c676f2f94962b3430812458fdf2508eba66c06 diff --git a/test/Baseline/SegmentTubesTest2.mha.sha512 b/test/Baseline/SegmentTubesTest2.mha.sha512 index 7c1233b61..0e5b3ffc6 100644 --- a/test/Baseline/SegmentTubesTest2.mha.sha512 +++ b/test/Baseline/SegmentTubesTest2.mha.sha512 @@ -1 +1 @@ -0ce5e353b0ffde39cf59464a06c1bfe408bf6032471075c9d51bc61a1d955373e3d19333f24ad2770e1ca74ee2e52672bcce64f6523b1449cf1569fc4c6afc96 +ecbd23ec6c7a1d70f26aee963c668eb77746a0b69bceb17a254510f801954612258e941669b671b87e31a15962d42dd45a8ab928fddc23964f8d3f3798a7a88e diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cc745e6a0..c1bee756a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,7 +16,3 @@ add_subdirectory(Numerics) add_subdirectory(ObjectDocuments) add_subdirectory(Registration) add_subdirectory(Segmentation) - -#if( ITK_WRAP_PYTHON ) - #add_subdirectory(Python) -#endif() diff --git a/test/CompareTools/CMakeLists.txt b/test/CompareTools/CMakeLists.txt index 07c898084..d9471f362 100644 --- a/test/CompareTools/CMakeLists.txt +++ b/test/CompareTools/CMakeLists.txt @@ -24,6 +24,12 @@ CreateTestDriver( tubeCompareImages "${TubeTK-Test_LIBRARIES}" CompareImages.cxx ) +add_dependencies( tubeCompareImagesTestDriver + ${TubeTK_LIBRARIES} ) + CreateTestDriver( tubeCompareTextFiles "${TubeTK-Test_LIBRARIES}" CompareTextFiles.cxx ) + +add_dependencies( tubeCompareTextFilesTestDriver + ${TubeTK_LIBRARIES} ) diff --git a/test/CompareTools/CompareTextFiles.cxx b/test/CompareTools/CompareTextFiles.cxx index 6548bdc2e..c23b7ba45 100644 --- a/test/CompareTools/CompareTextFiles.cxx +++ b/test/CompareTools/CompareTextFiles.cxx @@ -18,9 +18,9 @@ #include #include +#include #include - int RegressionTestFile ( const char *testFilename, const char *baselineFilename, bool reportErrors, bool createDifferenceFile, double valueTolerance, diff --git a/test/IO/tubeIOHeaderTest.cxx b/test/IO/tubeIOHeaderTest.cxx index d54fbe218..e2bbc3a0d 100644 --- a/test/IO/tubeIOHeaderTest.cxx +++ b/test/IO/tubeIOHeaderTest.cxx @@ -20,8 +20,6 @@ limitations under the License. =========================================================================*/ -#include "tubetkConfigure.h" - #include "itktubePDFSegmenterParzenIO.h" #include "itktubeRidgeSeedFilterIO.h" #include "itktubeTubeExtractorIO.h" diff --git a/test/IO/tubeIOPrintTest.cxx b/test/IO/tubeIOPrintTest.cxx index 5ed89f47f..f1f30a90a 100644 --- a/test/IO/tubeIOPrintTest.cxx +++ b/test/IO/tubeIOPrintTest.cxx @@ -20,8 +20,6 @@ limitations under the License. =========================================================================*/ -#include "tubetkConfigure.h" - #include "itktubePDFSegmenterParzenIO.h" #include "itktubeRidgeSeedFilterIO.h" #include "itktubeTubeExtractorIO.h" diff --git a/test/MetaIO/tubeMetaIOHeaderTest.cxx b/test/MetaIO/tubeMetaIOHeaderTest.cxx index 30021042b..205fd688d 100644 --- a/test/MetaIO/tubeMetaIOHeaderTest.cxx +++ b/test/MetaIO/tubeMetaIOHeaderTest.cxx @@ -21,8 +21,6 @@ limitations under the License. =========================================================================*/ -#include "tubetkConfigure.h" - #include "tubeMacro.h" #include "itktubeMetaClassPDF.h" diff --git a/test/MetaIO/tubeMetaIOPrintTest.cxx b/test/MetaIO/tubeMetaIOPrintTest.cxx index fa952c314..3dce0ab23 100644 --- a/test/MetaIO/tubeMetaIOPrintTest.cxx +++ b/test/MetaIO/tubeMetaIOPrintTest.cxx @@ -21,8 +21,6 @@ limitations under the License. =========================================================================*/ -#include "tubetkConfigure.h" - #include "tubeMacro.h" #include "itktubeMetaLDA.h" diff --git a/test/Python/PythonComputeTrainingMaskTest.py b/test/Python/PythonComputeTrainingMaskTest.py deleted file mode 100644 index 090538f71..000000000 --- a/test/Python/PythonComputeTrainingMaskTest.py +++ /dev/null @@ -1,95 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright 2010 Kitware Inc. 28 Corporate Drive, -# Clifton Park, NY, 12065, USA. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## -#!/usr/bin/env python - -import os -import sys - -def GetRequiredEnvironmentVariable( varName ): - if varName in os.environ: - return os.environ[ varName ] - else: - print( '%s not found!' )%varName - print( ' Set environment variable' ) - sys.exit( 1 ) - -def CheckIfPathExists( path, name ): - if not os.path.exists( path ): - print( 'Directory not found!' ) - print( ' %s = %s' )%( name, path ) - sys.exit( 1 ) - -def AppendSysPath( path ): - BUILD_TYPE = GetRequiredEnvironmentVariable( 'BUILD_TYPE' ) - # Append path libs - sys.path.append( os.path.join( os.path.join( path, \ - 'Wrapping/Generators/Python' ), BUILD_TYPE ) ) - # Folder containing *py files (and *a/*so files on Linux) - sys.path.append( os.path.join( path, 'lib') ) - # Folder containing *lib files on Windows - sys.path.append( os.path.join( os.path.join( path, \ - 'lib' ), BUILD_TYPE) ) - # Windows needs this to load the DLL's - os.environ[ 'PATH' ] += os.pathsep \ - + os.path.join( os.path.join( path, 'bin' ),\ - BUILD_TYPE ) - -# Path for ITK -ITK_BUILD_DIR = GetRequiredEnvironmentVariable( 'ITK_BUILD_DIR' ) -CheckIfPathExists( ITK_BUILD_DIR, 'ITK_BUILD_DIR' ) -AppendSysPath( ITK_BUILD_DIR ) -# Path for TubeTK libs -TubeTK_BUILD_DIR = GetRequiredEnvironmentVariable( 'TubeTK_BUILD_DIR' ) -CheckIfPathExists( TubeTK_BUILD_DIR, 'TubeTK_BUILD_DIR' ) -AppendSysPath( TubeTK_BUILD_DIR ) - -import itk -from itk import TubeTKITK - -def main(): - if len( sys.argv ) != 6: - print( "Usage: %s InputImage OutputVesselMask OutputNotVesselMask gap\ - notVesselWidth"%sys.argv[0] ) - return 1 - inputImage = sys.argv[1] - outputVesselMask = sys.argv[2] - outputNotVesselMask = sys.argv[3] - gap=float( sys.argv[4] ) - notVesselWidth=float( sys.argv[5] ) - - reader=itk.ImageFileReader.New( FileName=inputImage ) - reader.Update() - trainingMask=TubeTKITK.ComputeTrainingMask.New( reader ) - trainingMask.SetGap(gap) - trainingMask.SetNotVesselWidth( notVesselWidth ) - trainingMask.Update() - writer=itk.ImageFileWriter.New( trainingMask, FileName=outputVesselMask ) - writer.Update() - - writer=itk.ImageFileWriter.New( trainingMask.GetNotVesselMask(),\ - FileName=outputNotVesselMask ) - writer.Update() - - -if __name__ == "__main__": - sys.exit( main() ) diff --git a/test/Python/PythonConvertImagesToCSVTest.py b/test/Python/PythonConvertImagesToCSVTest.py deleted file mode 100644 index 78c6242fb..000000000 --- a/test/Python/PythonConvertImagesToCSVTest.py +++ /dev/null @@ -1,122 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright 2010 Kitware Inc. 28 Corporate Drive, -# Clifton Park, NY, 12065, USA. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## -#!/usr/bin/env python - -import os -import sys - -def GetRequiredEnvironmentVariable( varName ): - if varName in os.environ: - return os.environ[ varName ] - else: - print( '%s not found!' )%varName - print( ' Set environment variable' ) - sys.exit( 1 ) - -def CheckIfPathExists( path, name ): - if not os.path.exists( path ): - print( 'Directory not found!' ) - print( ' %s = %s' )%( name, path ) - sys.exit( 1 ) - -def AppendSysPath( path ): - BUILD_TYPE = GetRequiredEnvironmentVariable( 'BUILD_TYPE' ) - # Append path libs - sys.path.append( os.path.join( os.path.join( path, \ - 'Wrapping/Generators/Python' ), BUILD_TYPE ) ) - # Folder containing *py files (and *a/*so files on Linux) - sys.path.append( os.path.join( path, 'lib') ) - # Folder containing *lib files on Windows - sys.path.append( os.path.join( os.path.join( path, \ - 'lib' ), BUILD_TYPE) ) - # Windows needs this to load the DLL's - os.environ[ 'PATH' ] += os.pathsep \ - + os.path.join( os.path.join( path, 'bin' ),\ - BUILD_TYPE ) - -# Path for ITK -ITK_BUILD_DIR = GetRequiredEnvironmentVariable( 'ITK_BUILD_DIR' ) -CheckIfPathExists( ITK_BUILD_DIR, 'ITK_BUILD_DIR' ) -AppendSysPath( ITK_BUILD_DIR ) -# Path for TubeTK libs -TubeTK_BUILD_DIR = GetRequiredEnvironmentVariable( 'TubeTK_BUILD_DIR' ) -CheckIfPathExists( TubeTK_BUILD_DIR, 'TubeTK_BUILD_DIR' ) -AppendSysPath( TubeTK_BUILD_DIR ) - -import itk -from itk import TubeTKITK -import numpy - -def main(): - - if len(sys.argv) != 5: - print("Usage: %s InputImage InputImageList OutputCSVFile stride"%sys.argv[0]) - return 1 - inputImage=sys.argv[1] - inputImageFileNameList=sys.argv[2] - outputCSVFile=sys.argv[3] - stride=int(sys.argv[4]) - - readerMask=itk.ImageFileReader.New(FileName=inputImage) - readerMask.Update() - - imageFileNameList = inputImageFileNameList.split(',') - reader1=itk.ImageFileReader.New(FileName=imageFileNameList[1]) - reader1.Update() - - convertFilter=TubeTKITK.ConvertImagesToCSV[reader1.GetOutput(), readerMask.GetOutput()].New() - convertFilter.SetInputMask(readerMask.GetOutput()) - - numImages=0 - for image in imageFileNameList: - reader=itk.ImageFileReader.New(FileName=image) - reader.Update() - # Cast - castFilter = itk.CastImageFilter[reader.GetOutput(),reader1.GetOutput()].New() - castFilter.SetInput(reader) - castFilter.Update() - # Add image - convertFilter.AddImage(castFilter.GetOutput()) - numImages += 1 - - convertFilter.SetStride(stride) - convertFilter.SetNumImages(numImages) - - convertFilter.Update() - numberRows=convertFilter.GetNumberRows() - matrix=convertFilter.GetOutput() - - narray=numpy.zeros((numberRows+1,matrix.cols())) - - for ii in range(0,numberRows): - for jj in range(0,matrix.cols()): - narray[ii,jj]=matrix.get(ii,jj) - - with open(outputCSVFile,'wb') as f : - for jj in range (0,matrix.cols()-1) : - f.write(os.path.basename(imageFileNameList[jj])+',') - f.write('Class\n') - numpy.savetxt(f, narray, fmt='%.6g', delimiter=",") - -if __name__ == "__main__": - sys.exit(main()) diff --git a/test/Python/PythonConvertShrunkenSeedImageToListTest.py b/test/Python/PythonConvertShrunkenSeedImageToListTest.py deleted file mode 100644 index f2aac764f..000000000 --- a/test/Python/PythonConvertShrunkenSeedImageToListTest.py +++ /dev/null @@ -1,109 +0,0 @@ -############################################################################## -# -# Library: TubeTK -# -# Copyright 2010 Kitware Inc. 28 Corporate Drive, -# Clifton Park, NY, 12065, USA. -# -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -############################################################################## -#!/usr/bin/env python - -import os -import sys - -def GetRequiredEnvironmentVariable( varName ): - if varName in os.environ: - return os.environ[ varName ] - else: - print( '%s not found!' )%varName - print( ' Set environment variable' ) - sys.exit( 1 ) - -def CheckIfPathExists( path, name ): - if not os.path.exists( path ): - print( 'Directory not found!' ) - print( ' %s = %s' )%( name, path ) - sys.exit( 1 ) - -def AppendSysPath( path ): - BUILD_TYPE = GetRequiredEnvironmentVariable( 'BUILD_TYPE' ) - # Append path libs - sys.path.append( os.path.join( os.path.join( path, \ - 'Wrapping/Generators/Python' ), BUILD_TYPE ) ) - # Folder containing *py files (and *a/*so files on Linux) - sys.path.append( os.path.join( path, 'lib') ) - # Folder containing *lib files on Windows - sys.path.append( os.path.join( os.path.join( path, \ - 'lib' ), BUILD_TYPE) ) - # Windows needs this to load the DLL's - os.environ[ 'PATH' ] += os.pathsep \ - + os.path.join( os.path.join( path, 'bin' ),\ - BUILD_TYPE ) - -# Path for ITK -ITK_BUILD_DIR = GetRequiredEnvironmentVariable( 'ITK_BUILD_DIR' ) -CheckIfPathExists( ITK_BUILD_DIR, 'ITK_BUILD_DIR' ) -AppendSysPath( ITK_BUILD_DIR ) -# Path for TubeTK libs -TubeTK_BUILD_DIR = GetRequiredEnvironmentVariable( 'TubeTK_BUILD_DIR' ) -CheckIfPathExists( TubeTK_BUILD_DIR, 'TubeTK_BUILD_DIR' ) -AppendSysPath( TubeTK_BUILD_DIR ) - -import itk -from itk import TubeTKITK -import numpy - -def main(): - - if len(sys.argv) != 6: - print("Usage: %s InputImage ScaleImage PointsImage OutputListFile threshold"%sys.argv[0]) - return 1 - inImage=sys.argv[1] - inScale=sys.argv[2] - inPoint=sys.argv[3] - outputList=sys.argv[4] - threshold=float(sys.argv[5]) - - inImageReader=itk.ImageFileReader.New(FileName=inImage) - inScaleReader=itk.ImageFileReader.New(FileName=inScale) - inPointReader=itk.ImageFileReader.New(FileName=inPoint) - - convertFilter=TubeTKITK.ConvertShrunkenSeedImageToList[inScaleReader.GetOutput(), inPointReader.GetOutput()].New() - - castFilter = itk.CastImageFilter[inImageReader.GetOutput(),inScaleReader.GetOutput()].New() - castFilter.SetInput(inImageReader) - - convertFilter.SetInput(castFilter.GetOutput()) - convertFilter.SetScaleImage(inScaleReader.GetOutput()) - - convertFilter.SetPointsImage(inPointReader.GetOutput()) - convertFilter.SetThreshold(threshold) - - convertFilter.Update() - matrix=convertFilter.GetOutput() - - narray=numpy.zeros((matrix.rows(),matrix.cols())) - - for ii in range(0,matrix.rows()): - for jj in range(0,matrix.cols()): - narray[ii,jj]=matrix.get(ii,jj) - - with open(outputList,'wb') as f : - numpy.savetxt(f, narray, fmt='%.6g', delimiter=",") - -if __name__ == "__main__": - sys.exit(main()) diff --git a/test/Segmentation/itktubeRidgeSeedFilterTest.cxx b/test/Segmentation/itktubeRidgeSeedFilterTest.cxx index c142b038a..d8b9ad90b 100644 --- a/test/Segmentation/itktubeRidgeSeedFilterTest.cxx +++ b/test/Segmentation/itktubeRidgeSeedFilterTest.cxx @@ -20,8 +20,6 @@ limitations under the License. =========================================================================*/ -#include "tubetkConfigure.h" - #include "itktubeRidgeSeedFilter.h" int itktubeRidgeSeedFilterTest( int argc, char * argv[] ) diff --git a/test/Segmentation/tubeSegmentationHeaderTest.cxx b/test/Segmentation/tubeSegmentationHeaderTest.cxx index 2fa35334f..e69312a11 100644 --- a/test/Segmentation/tubeSegmentationHeaderTest.cxx +++ b/test/Segmentation/tubeSegmentationHeaderTest.cxx @@ -20,8 +20,6 @@ limitations under the License. =========================================================================*/ -#include "tubetkConfigure.h" - #include "itktubePDFSegmenterBase.h" #include "itktubePDFSegmenterParzen.h" #include "itktubeRadiusExtractor2.h" diff --git a/test/Segmentation/tubeSegmentationPrintTest.cxx b/test/Segmentation/tubeSegmentationPrintTest.cxx index 3e5c83c2f..dd23ec7a3 100644 --- a/test/Segmentation/tubeSegmentationPrintTest.cxx +++ b/test/Segmentation/tubeSegmentationPrintTest.cxx @@ -20,8 +20,6 @@ limitations under the License. =========================================================================*/ -#include "tubetkConfigure.h" - #include "itktubePDFSegmenterParzen.h" #include "itktubeRadiusExtractor2.h" #include "itktubeRidgeExtractor.h"