diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index acb12e6..03b6a95 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,10 +3,9 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "v5.4.0" - itk-wheel-tag: "v5.4.0" - # v5.4.0 + fixes - itk-python-package-tag: "c9bb40bcb9f99938d071435e46f44d3d2b389482" + itk-git-tag: "v5.4.7" + itk-wheel-tag: "v5.4.7" + itk-python-package-tag: "v5.4.7" itk-python-package-org: "InsightSoftwareConsortium" ctest-options: "" @@ -16,7 +15,7 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-22.04, windows-2022, macos-13, macos-14] + os: [ubuntu-22.04, windows-2022, macos-15-intel, macos-15] include: - os: ubuntu-22.04 c-compiler: "gcc" @@ -26,17 +25,17 @@ jobs: c-compiler: "cl.exe" cxx-compiler: "cl.exe" cmake-build-type: "Release" - - os: macos-13 + - os: macos-15-intel c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" - - os: macos-14 + - os: macos-15 c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Free Disk Space (Ubuntu) if: matrix.os == 'ubuntu-22.04' @@ -45,7 +44,7 @@ jobs: large-packages: false - name: Set up Python 3.11 - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" @@ -53,17 +52,12 @@ jobs: - uses: ilammy/setup-nasm@v1 - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.6 + uses: lukka/get-cmake@v4.4.2 - name: 'Specific XCode version' - if: matrix.os == 'macos-13' + if: startsWith(matrix.os, 'macos') run: | - sudo xcode-select -s "/Applications/Xcode_14.3.1.app" - - - name: 'Specific XCode version' - if: matrix.os == 'macos-14' - run: | - sudo xcode-select -s "/Applications/Xcode_15.0.1.app" + sudo xcode-select -s "/Applications/Xcode_16.2.app" - name: Download ITK run: | @@ -126,6 +120,8 @@ jobs: "ld: warning: text-based stub file" "Wunused-result" "file: .+ has no symbols" + "ranlib: archive library: .+ the table of contents is empty" + "ld: warning: no platform load command found in" "Wpointer-bool-conversion" "note: prefix with the address-of operator to silence this warning" "warning C4722: 'riegeli::internal::UnreachableStream::~UnreachableStream': destructor never returns, potential memory leak" @@ -175,14 +171,14 @@ jobs: strategy: max-parallel: 2 matrix: - python3-minor-version: ["8", "9", "10", "11"] + python3-minor-version: ["9", "10", "11"] manylinux-platform: ["_2_28-x64"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.6 + uses: lukka/get-cmake@v4.4.2 - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@v1.3.1 @@ -220,7 +216,7 @@ jobs: ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp3${{ matrix.python3-minor-version }} $CMAKE_OPTIONS - name: Set up Python 3.11 for Validation - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" @@ -242,39 +238,38 @@ jobs: python -m twine check ${WHEEL_PATTERN} - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: LinuxWheel3${{ matrix.python3-minor-version }}${{ matrix.manylinux-platform }} path: dist/*.whl - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: MacOSWheel3${{ matrix.python3-minor-version }} path: dist/*.whl build-macos-arm-py: - runs-on: macos-14 + runs-on: macos-15 strategy: max-parallel: 2 matrix: python3-minor-version: ["9", "10", "11"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: 'Specific XCode version' run: | - sudo xcode-select -s "/Applications/Xcode_15.0.1.app" + sudo xcode-select -s "/Applications/Xcode_16.2.app" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.6 + uses: lukka/get-cmake@v4.4.2 - uses: shogo82148/actions-setup-perl@v1 - uses: ilammy/setup-nasm@v1 - name: 'Fetch build script' - if: matrix.python3-minor-version != '8' run: | IPP_DOWNLOAD_GIT_TAG=${{ env.itk-python-package-tag }} IPP_DOWNLOAD_ORG=${{ env.itk-python-package-org }} @@ -282,7 +277,6 @@ jobs: chmod u+x macpython-download-cache-and-build-module-wheels.sh - name: 'Build 🐍 Python 📦 package' - if: matrix.python3-minor-version != '8' shell: bash run: | rm -rf dist @@ -296,12 +290,11 @@ jobs: ./macpython-download-cache-and-build-module-wheels.sh $CMAKE_OPTIONS "3.${{ matrix.python3-minor-version }}" - name: Set up Python 3.11 for Validation - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" - name: Validate build output - if: matrix.python3-minor-version != '8' shell: bash run: | python -m pip install twine @@ -319,8 +312,7 @@ jobs: python -m twine check ${WHEEL_PATTERN} - name: Publish Python package as GitHub Artifact - if: matrix.python3-minor-version != '8' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: MacOSArmWheel3${{ matrix.python3-minor-version }} path: dist/*.whl @@ -330,13 +322,13 @@ jobs: strategy: max-parallel: 2 matrix: - python3-minor-version: ["8", "9", "10", "11"] + python3-minor-version: ["9", "10", "11"] steps: - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.6 + uses: lukka/get-cmake@v4.4.2 - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: path: "im" @@ -379,7 +371,7 @@ jobs: cp 'dist\*.whl' '${{ github.workspace }}\dist' - name: Set up Python 3.11 for Validation - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" @@ -395,7 +387,7 @@ jobs: python -m twine check ${WHEEL_PATTERN} - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: WindowsWheel3${{ matrix.python3-minor-version }} path: dist/*.whl @@ -409,7 +401,7 @@ jobs: steps: - name: Download Python Packages - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v7 - name: Prepare packages for upload run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 56351dd..d48ab5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,11 +8,10 @@ set(CMAKE_CXX_STANDARD 17) set_property(GLOBAL PROPERTY USE_FOLDERS ON) project(IOOMEZarrNGFF CXX C ASM_NASM ASM) - set(IOOMEZarrNGFF_LIBRARIES IOOMEZarrNGFF) if(NOT ITK_SOURCE_DIR) - find_package(ITK 5.0 REQUIRED) + find_package(ITK 5.4 REQUIRED) list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) include(ITKModuleExternal) diff --git a/include/itkOMEZarrNGFFCommon.h b/include/itkOMEZarrNGFFCommon.h new file mode 100644 index 0000000..8342851 --- /dev/null +++ b/include/itkOMEZarrNGFFCommon.h @@ -0,0 +1,45 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * 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.txt + * + * 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 itkOMEZarrNGFFCommon_h +#define itkOMEZarrNGFFCommon_h +#include "IOOMEZarrNGFFExport.h" + +#include + +namespace itk +{ +/** \class OMEZarrAxis + * + * \brief Represent an OME-Zarr axis + * + * Open Microscopy Environment Zarr Next Generation File Format + * specification can be found at https://github.com/ome/ngff + * + * \ingroup IOOMEZarrNGFF + */ +struct IOOMEZarrNGFF_EXPORT OMEZarrAxis +{ + std::string name; + std::string type; + std::string unit; +}; + +} // end namespace itk + +#endif // itkOMEZarrNGFFCommon_h diff --git a/include/itkOMEZarrNGFFImageIO.h b/include/itkOMEZarrNGFFImageIO.h index 4e1e475..ba48246 100644 --- a/include/itkOMEZarrNGFFImageIO.h +++ b/include/itkOMEZarrNGFFImageIO.h @@ -25,25 +25,13 @@ #include // For unique_ptr. #include #include + #include "itkImageIOBase.h" +#include "itkOMEZarrNGFFCommon.h" + namespace itk { -/** \class OMEZarrNGFFAxis - * - * \brief Represent an OME-Zarr NGFF axis - * - * Open Microscopy Environment Zarr Next Generation File Format - * specification can be found at https://github.com/ome/ngff - * - * \ingroup IOOMEZarrNGFF - */ -struct IOOMEZarrNGFF_EXPORT OMEZarrNGFFAxis -{ - std::string name; - std::string type; - std::string unit; -}; /** \class OMEZarrNGFFImageIO * @@ -74,7 +62,7 @@ class IOOMEZarrNGFF_EXPORT OMEZarrNGFFImageIO : public ImageIOBase static constexpr unsigned MaximumDimension = 5; // OME-NGFF specifies up to 5D data static constexpr int INVALID_INDEX = -1; // for specifying enumerated axis slice indices - using AxesCollectionType = std::vector; + using AxesCollectionType = std::vector; /** The different types of ImageIO's can support data of varying * dimensionality. For example, some file formats are strictly 2D diff --git a/pyproject.toml b/pyproject.toml index 9e4fc8e..273a838 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Medical Science Apps.", "Topic :: Software Development :: Libraries", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "itk == 5.4.*", ] diff --git a/src/itkOMEZarrNGFFImageIO.cxx b/src/itkOMEZarrNGFFImageIO.cxx index 4062bdb..89c2d5f 100644 --- a/src/itkOMEZarrNGFFImageIO.cxx +++ b/src/itkOMEZarrNGFFImageIO.cxx @@ -686,7 +686,7 @@ OMEZarrNGFFImageIO::ReadImageInformation() auto targetIt = m_StoreAxes.rbegin(); for (const auto & axis : json.at("axes")) { - *targetIt = (OMEZarrNGFFAxis{ axis.at("name"), axis.at("type"), (axis.contains("unit") ? axis.at("unit") : "") }); + *targetIt = (OMEZarrAxis{ axis.at("name"), axis.at("type"), (axis.contains("unit") ? axis.at("unit") : "") }); ++targetIt; } itkAssertOrThrowMacro(targetIt == m_StoreAxes.rend(), diff --git a/wrapping/CMakeLists.txt b/wrapping/CMakeLists.txt index b3eaae0..750e02b 100644 --- a/wrapping/CMakeLists.txt +++ b/wrapping/CMakeLists.txt @@ -1,3 +1,6 @@ itk_wrap_module(IOOMEZarrNGFF) +set(WRAPPER_SUBMODULE_ORDER + itkOMEZarrNGFFCommon +) itk_auto_load_submodules() itk_end_wrap_module() diff --git a/wrapping/itkOMEZarrNGFFCommon.wrap b/wrapping/itkOMEZarrNGFFCommon.wrap new file mode 100644 index 0000000..fd35ac9 --- /dev/null +++ b/wrapping/itkOMEZarrNGFFCommon.wrap @@ -0,0 +1,4 @@ +set(WRAPPER_AUTO_INCLUDE_HEADERS OFF) +itk_wrap_include("itkOMEZarrNGFFCommon.h") +itk_wrap_simple_class("itk::OMEZarrAxis") +set(WRAPPER_AUTO_INCLUDE_HEADERS ON) \ No newline at end of file