Skip to content

Commit e759853

Browse files
Merge pull request #4 from KitwareMedical/wheel-size
2 parents 9640bf1 + 0e2dc82 commit e759853

6 files changed

Lines changed: 85 additions & 7 deletions

File tree

.github/workflows/cd.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ jobs:
9494
generate_release_notes: true
9595
# Attach all the downloaded wheels to the GitHub Release page
9696
files: ./wheelhouse/*.whl
97-
9897

9998
upload-pypi:
10099
name: Push SlicerCore on PyPi
@@ -126,3 +125,34 @@ jobs:
126125
uses: pypa/gh-action-pypi-publish@release/v1
127126
with:
128127
packages-dir: ./wheelhouse
128+
129+
upload-pypi-sdk:
130+
name: Push SlicerCoreSDK on PyPi
131+
needs: [release-first, release-all]
132+
runs-on: ubuntu-latest
133+
environment:
134+
name: pypi
135+
url: https://pypi.org/p/slicer-core-sdk
136+
permissions:
137+
id-token: write # IMPORTANT: mandatory for trusted publishing
138+
contents: write # IMPORTANT: mandatory for making GitHub Releases
139+
140+
steps:
141+
- name: Checkout
142+
uses: actions/checkout@v4
143+
144+
- name: Download all wheel artifacts
145+
uses: actions/download-artifact@v4
146+
with:
147+
path: ./wheelhouse
148+
pattern: slicer_core_sdk-*
149+
merge-multiple: true # Flattens them into one directory
150+
151+
- name: Show downloaded wheels
152+
run: ls ./wheelhouse
153+
154+
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
155+
- name: Publish package distributions to PyPI
156+
uses: pypa/gh-action-pypi-publish@release/v1
157+
with:
158+
packages-dir: ./wheelhouse

patch/Libs/vtkITK/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ set(classes
6464
vtkITKImageThresholdCalculator
6565
vtkITKImageWriter
6666
vtkITKGradientAnisotropicDiffusionImageFilter
67-
#vtkITKGrowCut # Currently excluded due to being a 50Mio large object that takes 10 minutes to build
67+
#vtkITKGrowCut # Currently excluded due to being a 50Mio large object that takes 10 minutes to build and consumes 10Gio of RAM
6868
vtkITKDistanceTransform
6969
vtkITKLabelShapeStatistics
7070
vtkITKLevelTracingImageFilter

patch/SlicerCore/CMake/SlicerCoreSuperbuild.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ set(CMAKE_CXX_STANDARD "17")
2727
set(CMAKE_CXX_STANDARD_REQUIRED "ON")
2828
set(CMAKE_CXX_EXTENSIONS "OFF")
2929
set(CMAKE_POSITION_INDEPENDENT_CODE "TRUE")
30+
set(CMAKE_PLATFORM_NO_VERSIONED_SONAME "TRUE")
3031

3132
# All deps are install in a single prefix for easier finds
3233
set(EP_DEPENDENCIES_INSTALL_DIR "${CMAKE_BINARY_DIR}/deps-install")
@@ -51,6 +52,7 @@ mark_as_superbuild(
5152
CMAKE_CXX_STANDARD_REQUIRED
5253
CMAKE_CXX_EXTENSIONS
5354
CMAKE_POSITION_INDEPENDENT_CODE
55+
CMAKE_PLATFORM_NO_VERSIONED_SONAME
5456
# forward VTK and helper prefixes
5557
CMAKE_PREFIX_PATH
5658
CMAKE_MODULE_PATH

patch/SlicerCore/README.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,58 @@
11
# Slicer Core
22

3-
SlicerCore, formally known as "VTK MRML", is an alternative build-system for the 3DSlicer project.
3+
SlicerCore is an alternative build-system for the 3DSlicer project.
44
It is intended to build a Python Package (wheel) from the core libraries and loadables modules of 3DSlicer.
55

6+
## About Slicer
7+
8+
Slicer, or 3D Slicer, is a free, open source software package for visualization and image analysis.
9+
10+
3D Slicer is natively designed to be available on multiple platforms, including Windows, Linux and macOS.
11+
12+
For 3DSlicer community announcements and support, visit:
13+
14+
https://discourse.slicer.org
15+
16+
For documentation, tutorials, and more information, please see:
17+
18+
https://www.slicer.org
19+
20+
For 3DSlicer source code, please see:
21+
22+
https://github.com/Slicer/Slicer
23+
24+
25+
## About Slicer Core
26+
27+
Slicer Core in a single sentence:
28+
***Slicer Core is the Python package consisting of all 3DSlicer modules that do not depend on Qt.***
29+
30+
Slicer Core contains the following libraries of 3DSlicer:
31+
- `Base/Logic`
32+
- `Libs/*`
33+
- `Modules/Loadables/[MRML|MRMLDM|Logic|VTKWidgets]`
34+
35+
This enables using 3DSlicer powerful MRML nodes system and associated medical-oriented algorithms in pure Python.
36+
37+
## Using Slicer Core
38+
39+
SlicerCore provides access to the main Slicer libraries through the slicer package namespace :
40+
41+
```py
42+
from slicer import vtkMRMLScalarVolumeNode
43+
volume_node = vtkMRMLScalarVolumeNode()
44+
```
45+
46+
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.
47+
48+
For more examples, please visit the **[trame-slicer](https://github.com/KitwareMedical/trame-slicer)** project.
49+
650
## Documentation and Examples
751

8-
- **[3DSlicer API documentation](https://apidocs.slicer.org/main/index.html)**
9-
- **[trame-slicer](https://github.com/KitwareMedical/trame-slicer)**: slicer-core usage example.
52+
- **[3DSlicer Developper Guide](https://slicer.readthedocs.io/en/latest/developer_guide/index.html)**
53+
- Note that only some parts of the developper guide applies to Slicer Core as some modules and classes are not available.
54+
- **[3DSlicer API Documentation](https://apidocs.slicer.org/main/index.html)**
55+
- **[Trame Slicer](https://github.com/KitwareMedical/trame-slicer)**
1056

1157
## Acknowledgments
1258

patch/SlicerCore/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cmake.args = ["-GNinja", "-DCMAKE_BUILD_TYPE=Release", "-DBUILD_SDK=OFF"]
1313

1414
[project]
1515
name = "slicer-core"
16-
version = "5.11.0.3"
16+
version = "5.11.0.4"
1717
dependencies = ["vtk==9.6.0"]
1818
requires-python = ">=3.10"
1919
readme = "README.md"

patch/SlicerCoreSDK/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cmake.args = ["-GNinja", "-DCMAKE_BUILD_TYPE=Release", "-DBUILD_SDK=ON"]
1313

1414
[project]
1515
name = "slicer-core-sdk"
16-
version = "5.11.0.3"
16+
version = "5.11.0.4"
1717
dependencies = ["vtk==9.6.0"]
1818
requires-python = ">=3.10"
1919
description = "3DSlicer Core libraries as a python standalone project"

0 commit comments

Comments
 (0)