From db06bdbd278982a3f9532a4530b8cba6e870a248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 1 Dec 2026 11:01:14 -0500 Subject: [PATCH 1/4] COMP: Remove zlib.def exports of gz functions not built The zlib 1.3.1 update dropped the gz*.c sources, so linking itkzlib as a Windows DLL failed with unresolved externals for these exports. --- itkzlib/zlib.def | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/itkzlib/zlib.def b/itkzlib/zlib.def index 24271f8b..5cd49035 100644 --- a/itkzlib/zlib.def +++ b/itkzlib/zlib.def @@ -15,13 +15,6 @@ EXPORTS itk_zlib_deflateParams @9 itk_zlib_deflateReset @10 itk_zlib_deflateSetDictionary @11 - itk_zlib_gzclose @12 - itk_zlib_gzdopen @13 - itk_zlib_gzerror @14 - itk_zlib_gzflush @15 - itk_zlib_gzopen @16 - itk_zlib_gzread @17 - itk_zlib_gzwrite @18 itk_zlib_inflate @19 itk_zlib_inflateEnd @20 itk_zlib_inflateInit2_ @21 @@ -31,17 +24,7 @@ EXPORTS itk_zlib_inflateSync @25 itk_zlib_uncompress @26 itk_zlib_zlibVersion @27 - itk_zlib_gzprintf @28 - itk_zlib_gzputc @29 - itk_zlib_gzgetc @30 - itk_zlib_gzseek @31 - itk_zlib_gzrewind @32 - itk_zlib_gztell @33 - itk_zlib_gzeof @34 - itk_zlib_gzsetparams @35 itk_zlib_zError @36 itk_zlib_inflateSyncPoint @37 itk_zlib_get_crc_table @38 itk_zlib_compress2 @39 - itk_zlib_gzputs @40 - itk_zlib_gzgets @41 From ed994d95f606be00c79e61ffffde8711f6325870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 1 Dec 2026 11:01:14 -0500 Subject: [PATCH 2/4] COMP: Export symbols from the standalone MetaIO Windows DLL localMetaConfiguration.h selects dllexport on metaio_EXPORTS, but only the VTK build defined it. CMake's default symbol for the MetaIO target is MetaIO_EXPORTS, so the library compiled its own definitions as dllimport and failed. --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6a5cd2fc..3ef61803 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -132,6 +132,7 @@ else () ${sources} ${headers} ) + set_target_properties(${METAIO_TARGET} PROPERTIES DEFINE_SYMBOL metaio_EXPORTS) if (METAIO_FOR_ITK) target_link_libraries(${METAIO_TARGET} PUBLIC itksys From cf439c93fce80f96056d277843d0979340cbc417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 1 Dec 2026 11:01:14 -0500 Subject: [PATCH 3/4] ENH: Build and test on Linux, macOS, and Windows with GitHub Actions Travis CI, AppVeyor, and CircleCI no longer run. The matrix covers GCC, Clang, AppleClang, and MSVC with shared and static libraries plus the system zlib. A second job builds ITK's MetaIO consumers against this checkout, replacing the Docker image the CircleCI job used. Closes #143. --- .circleci/config.yml | 9 --- .github/workflows/ci.yml | 155 +++++++++++++++++++++++++++++++-------- .travis.yml | 21 ------ README.rst | 10 +-- appveyor.yml | 32 -------- test/ci/.gitattributes | 2 - test/ci/Dockerfile | 52 ------------- test/ci/build.sh | 5 -- test/ci/run.sh | 9 --- test/ci/test.sh | 24 ------ 10 files changed, 128 insertions(+), 191 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 test/ci/.gitattributes delete mode 100644 test/ci/Dockerfile delete mode 100755 test/ci/build.sh delete mode 100755 test/ci/run.sh delete mode 100755 test/ci/test.sh diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index cfcd8a27..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: insighttoolkit/metaio-test:latest - steps: - - checkout: - path: /usr/src/MetaIO - - run: /usr/src/MetaIO/test/ci/test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76544b31..a8fcc90e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,46 +11,143 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu-24-04: - name: Build (Ubuntu 24.04) - runs-on: ubuntu-24.04 + standalone: + name: ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: Ubuntu GCC (shared) + os: ubuntu-24.04 + cc: gcc + cxx: g++ + shared: ON + system-zlib: OFF + cxx-flags: >- + -Wall -Wextra -Wpedantic -Werror=return-type -Wshadow -Wformat=2 + -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast + -Wuseless-cast -Wcast-qual -Wswitch-enum -Wnull-dereference -Wvla + -Wmissing-field-initializers -Wdouble-promotion -Wnoexcept + - name: Ubuntu Clang (static, system zlib) + os: ubuntu-24.04 + cc: clang + cxx: clang++ + shared: OFF + system-zlib: ON + cxx-flags: -Wall -Wextra -Wpedantic -Wshadow + - name: macOS AppleClang (shared) + os: macos-15 + cc: clang + cxx: clang++ + shared: ON + system-zlib: OFF + cxx-flags: -Wall -Wextra -Wpedantic -Wshadow + - name: Windows MSVC (shared) + os: windows-2025 + shared: ON + system-zlib: OFF + cxx-flags: -EHsc -W4 + - name: Windows MSVC (static) + os: windows-2025 + shared: OFF + system-zlib: OFF + cxx-flags: -EHsc -W4 steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - - name: Set up dependencies + - name: Install dependencies (Linux) + if: runner.os == 'Linux' run: | sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - build-essential \ - cmake \ - ninja-build + sudo apt-get install -y --no-install-recommends ninja-build clang zlib1g-dev + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: brew install ninja - - name: Configure (CMake, Release) + - name: Select compiler + if: runner.os != 'Windows' run: | - cmake -S ${{ github.workspace }} \ - -B ${{ github.workspace }}/cmake-build-hidden \ - -G Ninja \ - -DCMAKE_CXX_FLAGS=" -Wall -Wextra -Wpedantic -Werror=return-type -Wshadow -Wformat=2 -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast -Wuseless-cast -Wcast-qual -Wswitch-enum -Wnull-dereference -Wvla -Wmissing-field-initializers -Wdouble-promotion -Wnoexcept" \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/cmake-build-install \ + echo "CC=${{ matrix.cc }}" >> "$GITHUB_ENV" + echo "CXX=${{ matrix.cxx }}" >> "$GITHUB_ENV" + echo "CMAKE_GENERATOR=Ninja" >> "$GITHUB_ENV" + + # A shared runtime output directory lets tests find the DLLs on Windows. + - name: Configure + shell: bash + run: | + cmake -S . -B build \ -DCMAKE_BUILD_TYPE=Release \ - -DBUILD_TESTING=ON \ - -DCMAKE_C_VISIBILITY_PRESET=hidden \ - -DCMAKE_CXX_VISIBILITY_PRESET=hidden \ - -DCMAKE_VISIBILITY_INLINES_HIDDEN=YES \ - -DCMAKE_MODULE_LINKER_FLAGS="" \ - -DBUILD_SHARED_LIBS=ON + -DCMAKE_CXX_FLAGS="${{ matrix.cxx-flags }}" \ + -DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install" \ + -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="${{ github.workspace }}/build/bin" \ + -DBUILD_SHARED_LIBS=${{ matrix.shared }} \ + -DITK_USE_SYSTEM_ZLIB=${{ matrix.system-zlib }} \ + -DBUILD_TESTING=ON - - name: Build targets + - name: Build + run: cmake --build build --config Release --parallel + + - name: Test + run: ctest --test-dir build --build-config Release --output-on-failure + + - name: Install + run: cmake --install build --config Release + + itk: + name: ITK MetaIO consumers (Ubuntu) + runs-on: ubuntu-24.04 + steps: + - name: Checkout MetaIO + uses: actions/checkout@v5 + with: + path: MetaIO + + - name: Checkout ITK + uses: actions/checkout@v5 + with: + repository: InsightSoftwareConsortium/ITK + ref: main + path: ITK + + - name: Install dependencies run: | - cmake --build ${{ github.workspace }}/cmake-build-hidden --target itkzlib MetaIO -j$(nproc) + sudo apt-get update + sudo apt-get install -y --no-install-recommends ninja-build ccache - - name: Install targets + # Same paths as ITK's Modules/ThirdParty/MetaIO/UpdateFromUpstream.sh + - name: Replace ITK's MetaIO with this checkout run: | - cmake --build ${{ github.workspace }}/cmake-build-hidden --target install + dest=ITK/Modules/ThirdParty/MetaIO/src/MetaIO + rm -rf "$dest/src" + cp -r MetaIO/src "$dest/src" + cp MetaIO/License.txt "$dest/" + + - name: Restore ccache + uses: actions/cache@v4 + with: + path: ~/.cache/ccache + key: ccache-itk-${{ github.sha }} + restore-keys: ccache-itk- + + - name: Configure ITK + run: | + cmake -S ITK -B ITK-build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=ON \ + -DBUILD_EXAMPLES=OFF \ + -DITK_BUILD_DEFAULT_MODULES=OFF \ + -DModule_ITKIOMeta=ON \ + -DModule_ITKIOSpatialObjects=ON + + - name: Build ITK + run: cmake --build ITK-build --parallel - # Uncomment if/when tests are available - - name: Run tests - working-directory: ${{ github.workspace }}/cmake-build-hidden - run: ctest --output-on-failure \ No newline at end of file + - name: Test + run: ctest --test-dir ITK-build --output-on-failure --parallel 4 -L "^(ITKIOMeta|ITKIOSpatialObjects)$" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 36317259..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: cpp - -matrix: - include: - - os: linux - dist: bionic - sudo: required - compiler: gcc - - os: linux - dist: bionic - sudo: required - compiler: clang - - os: osx - osx_image: xcode11.6 - -before_script: - - cmake --version - - env - -script: - - mkdir build && cd build && cmake .. && cmake --build . && ctest diff --git a/README.rst b/README.rst index 3fea879d..95d6dc30 100644 --- a/README.rst +++ b/README.rst @@ -1,14 +1,8 @@ MetaIO ====== -.. table:: - - +-----------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+ - | Linux | macOS | Windows | - +=========================================================================================+=========================================================================================+=======================================================================================+ - | .. image:: https://circleci.com/gh/Kitware/MetaIO.svg?style=shield | .. image:: https://travis-ci.org/Kitware/MetaIO.svg?branch=master | .. image:: https://img.shields.io/appveyor/ci/thewtex/metaio.svg | - | :target: https://circleci.com/gh/Kitware/MetaIO | :target: https://travis-ci.org/Kitware/MetaIO | :target: https://ci.appveyor.com/project/thewtex/metaio | - +-----------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------+ +.. image:: https://github.com/Kitware/MetaIO/actions/workflows/ci.yml/badge.svg?branch=master + :target: https://github.com/Kitware/MetaIO/actions/workflows/ci.yml MetaImage is a text-based tagged file format for medical images. It also supports a variety of objects that occur in medicine such a tubes (for diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index b23e2f99..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -branches: - only: - - master - - /^ci.*$/ - -# Build worker image (VM template) -image: Visual Studio 2017 - -platform: - - x86 - -configuration: - - Release - -cache: - - '%USERPROFILE%\ExternalData' - -environment: - global: - CYG_ROOT: C:\cygwin - - matrix: - - GENERATOR: "Visual Studio 14 2015" - - GENERATOR: "Visual Studio 15 2017" - - -build_script: - - mkdir build & cd build & cmake -G "%GENERATOR%" -A x64 .. & cmake --build . - -test: off - -deploy: off diff --git a/test/ci/.gitattributes b/test/ci/.gitattributes deleted file mode 100644 index 4282322a..00000000 --- a/test/ci/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Set the default behavior, in case people don't have core.autocrlf set. -* text eol=lf diff --git a/test/ci/Dockerfile b/test/ci/Dockerfile deleted file mode 100644 index 213a5180..00000000 --- a/test/ci/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM debian:9 -MAINTAINER Insight Software Consortium - -RUN REPO=http://cdn-fastly.deb.debian.org && \ - echo "deb $REPO/debian stretch main\ndeb $REPO/debian stretch-updates main\ndeb $REPO/debian-security stretch/updates main" > /etc/apt/sources.list - -RUN apt-get update && apt-get install -y \ - build-essential \ - cmake \ - git \ - libexpat1-dev \ - libhdf5-dev \ - libjpeg-dev \ - libpng-dev \ - libtiff5-dev \ - libeigen3-dev \ - python \ - ninja-build \ - python-pip \ - zlib1g-dev \ - && apt-get clean - -RUN pip install cmake - -RUN mkdir -p /usr/src/MetaIO-build -WORKDIR /usr/src - -# v5.4.4 2025-06-11 -ENV ITK_GIT_TAG f98d5fac5e1d5ef694f3010f12bbbc2c792994c6 -RUN git clone https://github.com/InsightSoftwareConsortium/ITK.git && \ - cd ITK && \ - git checkout ${ITK_GIT_TAG} && \ - cd ../ && \ - mkdir ITK-build - -WORKDIR /usr/src/ITK-build -RUN cmake \ - -G Ninja \ - -DCMAKE_INSTALL_PREFIX:PATH=/usr \ - -DCMAKE_BUILD_TYPE:STRING=MinSizeRel \ - -DBUILD_EXAMPLES:BOOL=OFF \ - -DBUILD_TESTING:BOOL=ON \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DITK_LEGACY_REMOVE:BOOL=ON \ - -DITK_BUILD_DEFAULT_MODULES:BOOL=OFF \ - -DITKGroup_Core:BOOL=OFF \ - -DITK_USE_SYSTEM_LIBRARIES:BOOL=ON \ - -DModule_ITKIOMeta:BOOL=ON \ - -DITK_USE_EIGEN_MPL2_ONLY:BOOL=ON \ - ../ITK -RUN ninja && \ - find . -name '*.o' -delete diff --git a/test/ci/build.sh b/test/ci/build.sh deleted file mode 100755 index b09c051c..00000000 --- a/test/ci/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -script_dir="`cd $(dirname $0); pwd`" - -docker build -t insighttoolkit/metaio-test:latest $script_dir diff --git a/test/ci/run.sh b/test/ci/run.sh deleted file mode 100755 index ab9517d8..00000000 --- a/test/ci/run.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -script_dir="`cd $(dirname $0); pwd`" - -docker run \ - --rm \ - -v $script_dir/../..:/usr/src/MetaIO \ - insighttoolkit/metaio-test \ - /usr/src/MetaIO/test/ci/test.sh diff --git a/test/ci/test.sh b/test/ci/test.sh deleted file mode 100755 index dc4dab61..00000000 --- a/test/ci/test.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# This is a script to build the modules and run the test suite in the base -# Docker container. - -set -x -set -o - -cd /usr/src/MetaIO -branch=$(git rev-parse --abbrev-ref HEAD) -date=$(date +%F_%H_%M_%S) -sha=$(git rev-parse --short HEAD) - -cd /usr/src/ITK -# Dummy values required to make git commits in the update script -git config user.name ci-testing -git config user.email ci@testing -./Modules/ThirdParty/MetaIO/UpdateFromUpstream.sh /usr/src/MetaIO $branch -cd /usr/src/ITK-build -cmake \ - -DBUILDNAME:STRING=External-MetaIO-${branch}-${date}-${sha} \ - . -ninja -ctest -VV -D Experimental -L ITKIOMeta From 9e3f064147d93c0864004265fc45fa5d859c17b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 1 Dec 2026 11:22:31 -0500 Subject: [PATCH 4/4] DOC: Convert README from reStructuredText to Markdown --- README.md | 11 +++++++++++ README.rst | 13 ------------- 2 files changed, 11 insertions(+), 13 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 00000000..36463b21 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# MetaIO + +[![CI](https://github.com/Kitware/MetaIO/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Kitware/MetaIO/actions/workflows/ci.yml) + +MetaImage is a text-based tagged file format for medical images. It also +supports a variety of objects that occur in medicine such a tubes (for +vessels, needles, etc.), blobs (for arbitrary shaped objects), cubes, spheres, +etc. The complete library is known as MetaIO. + +For more information, see the +[MetaIO documentation](https://docs.itk.org/en/latest/learn/metaio.html). diff --git a/README.rst b/README.rst deleted file mode 100644 index 95d6dc30..00000000 --- a/README.rst +++ /dev/null @@ -1,13 +0,0 @@ -MetaIO -====== - -.. image:: https://github.com/Kitware/MetaIO/actions/workflows/ci.yml/badge.svg?branch=master - :target: https://github.com/Kitware/MetaIO/actions/workflows/ci.yml - -MetaImage is a text-based tagged file format for medical images. It also -supports a variety of objects that occur in medicine such a tubes (for -vessels, needles, etc.), blobs (for arbitrary shaped objects), cubes, spheres, -etc. The complete library is known as MetaIO. - -For more information, see the `MetaIO documentation -`_.