Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion patch/Libs/vtkITK/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions patch/SlicerCore/CMake/SlicerCoreSuperbuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down
52 changes: 49 additions & 3 deletions patch/SlicerCore/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion patch/SlicerCore/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion patch/SlicerCoreSDK/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading