diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 74fce78..e99fdb8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -94,7 +94,6 @@ jobs: generate_release_notes: true # Attach all the downloaded wheels to the GitHub Release page files: ./wheelhouse/*.whl - upload-pypi: name: Push SlicerCore on PyPi @@ -126,3 +125,34 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: ./wheelhouse + + upload-pypi-sdk: + name: Push SlicerCoreSDK on PyPi + needs: [release-first, release-all] + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/slicer-core-sdk + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + contents: write # IMPORTANT: mandatory for making GitHub Releases + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download all wheel artifacts + uses: actions/download-artifact@v4 + with: + path: ./wheelhouse + pattern: slicer_core_sdk-* + merge-multiple: true # Flattens them into one directory + + - name: Show downloaded wheels + run: ls ./wheelhouse + + # https://docs.pypi.org/trusted-publishers/using-a-publisher/ + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: ./wheelhouse diff --git a/patch/Libs/vtkITK/CMakeLists.txt b/patch/Libs/vtkITK/CMakeLists.txt index 20b7d61..4da4b53 100644 --- a/patch/Libs/vtkITK/CMakeLists.txt +++ b/patch/Libs/vtkITK/CMakeLists.txt @@ -64,7 +64,7 @@ set(classes vtkITKImageThresholdCalculator vtkITKImageWriter vtkITKGradientAnisotropicDiffusionImageFilter - #vtkITKGrowCut # Currently excluded due to being a 50Mio large object that takes 10 minutes to build + #vtkITKGrowCut # Currently excluded due to being a 50Mio large object that takes 10 minutes to build and consumes 10Gio of RAM vtkITKDistanceTransform vtkITKLabelShapeStatistics vtkITKLevelTracingImageFilter diff --git a/patch/SlicerCore/CMake/SlicerCoreSuperbuild.cmake b/patch/SlicerCore/CMake/SlicerCoreSuperbuild.cmake index 72f5766..8328e89 100644 --- a/patch/SlicerCore/CMake/SlicerCoreSuperbuild.cmake +++ b/patch/SlicerCore/CMake/SlicerCoreSuperbuild.cmake @@ -27,6 +27,7 @@ set(CMAKE_CXX_STANDARD "17") set(CMAKE_CXX_STANDARD_REQUIRED "ON") set(CMAKE_CXX_EXTENSIONS "OFF") set(CMAKE_POSITION_INDEPENDENT_CODE "TRUE") +set(CMAKE_PLATFORM_NO_VERSIONED_SONAME "TRUE") # All deps are install in a single prefix for easier finds set(EP_DEPENDENCIES_INSTALL_DIR "${CMAKE_BINARY_DIR}/deps-install") @@ -51,6 +52,7 @@ mark_as_superbuild( CMAKE_CXX_STANDARD_REQUIRED CMAKE_CXX_EXTENSIONS CMAKE_POSITION_INDEPENDENT_CODE + CMAKE_PLATFORM_NO_VERSIONED_SONAME # forward VTK and helper prefixes CMAKE_PREFIX_PATH CMAKE_MODULE_PATH diff --git a/patch/SlicerCore/README.md b/patch/SlicerCore/README.md index 293c2d6..08afa6f 100644 --- a/patch/SlicerCore/README.md +++ b/patch/SlicerCore/README.md @@ -1,12 +1,58 @@ # Slicer Core -SlicerCore, formally known as "VTK MRML", is an alternative build-system for the 3DSlicer project. +SlicerCore is an alternative build-system for the 3DSlicer project. It is intended to build a Python Package (wheel) from the core libraries and loadables modules of 3DSlicer. +## About Slicer + +Slicer, or 3D Slicer, is a free, open source software package for visualization and image analysis. + +3D Slicer is natively designed to be available on multiple platforms, including Windows, Linux and macOS. + +For 3DSlicer community announcements and support, visit: + + https://discourse.slicer.org + +For documentation, tutorials, and more information, please see: + + https://www.slicer.org + +For 3DSlicer source code, please see: + + https://github.com/Slicer/Slicer + + +## About Slicer Core + +Slicer Core in a single sentence: +***Slicer Core is the Python package consisting of all 3DSlicer modules that do not depend on Qt.*** + +Slicer Core contains the following libraries of 3DSlicer: +- `Base/Logic` +- `Libs/*` +- `Modules/Loadables/[MRML|MRMLDM|Logic|VTKWidgets]` + +This enables using 3DSlicer powerful MRML nodes system and associated medical-oriented algorithms in pure Python. + +## Using Slicer Core + +SlicerCore provides access to the main Slicer libraries through the slicer package namespace : + +```py +from slicer import vtkMRMLScalarVolumeNode +volume_node = vtkMRMLScalarVolumeNode() +``` + +Although the library can be used as is, additional convenience classes are provided in the trame-slicer Python package to initialize application logic and scene, wrap 2D and 3D views, provide applications on the web and more. + +For more examples, please visit the **[trame-slicer](https://github.com/KitwareMedical/trame-slicer)** project. + ## Documentation and Examples -- **[3DSlicer API documentation](https://apidocs.slicer.org/main/index.html)** -- **[trame-slicer](https://github.com/KitwareMedical/trame-slicer)**: slicer-core usage example. +- **[3DSlicer Developper Guide](https://slicer.readthedocs.io/en/latest/developer_guide/index.html)** + - Note that only some parts of the developper guide applies to Slicer Core as some modules and classes are not available. +- **[3DSlicer API Documentation](https://apidocs.slicer.org/main/index.html)** +- **[Trame Slicer](https://github.com/KitwareMedical/trame-slicer)** ## Acknowledgments diff --git a/patch/SlicerCore/pyproject.toml b/patch/SlicerCore/pyproject.toml index 1e513c1..9f506d8 100644 --- a/patch/SlicerCore/pyproject.toml +++ b/patch/SlicerCore/pyproject.toml @@ -13,7 +13,7 @@ cmake.args = ["-GNinja", "-DCMAKE_BUILD_TYPE=Release", "-DBUILD_SDK=OFF"] [project] name = "slicer-core" -version = "5.11.0.3" +version = "5.11.0.4" dependencies = ["vtk==9.6.0"] requires-python = ">=3.10" readme = "README.md" diff --git a/patch/SlicerCoreSDK/pyproject.toml b/patch/SlicerCoreSDK/pyproject.toml index 1bb45f0..ee0ad55 100644 --- a/patch/SlicerCoreSDK/pyproject.toml +++ b/patch/SlicerCoreSDK/pyproject.toml @@ -13,7 +13,7 @@ cmake.args = ["-GNinja", "-DCMAKE_BUILD_TYPE=Release", "-DBUILD_SDK=ON"] [project] name = "slicer-core-sdk" -version = "5.11.0.3" +version = "5.11.0.4" dependencies = ["vtk==9.6.0"] requires-python = ">=3.10" description = "3DSlicer Core libraries as a python standalone project"