Skip to content

Commit 2528874

Browse files
authored
Merge pull request #42 from InsightSoftwareConsortium/bump-itk
ENH: Bump to ITK v5.3.0 with reusable workflow
2 parents 70f0111 + b75d39c commit 2528874

File tree

7 files changed

+14
-283
lines changed

7 files changed

+14
-283
lines changed

.github/workflows/build-test-package.yml

Lines changed: 6 additions & 275 deletions
Original file line numberDiff line numberDiff line change
@@ -3,279 +3,10 @@ name: Build, test, package
33
on: [push,pull_request]
44

55
jobs:
6-
build-test-cxx:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
max-parallel: 3
10-
matrix:
11-
os: [ubuntu-18.04, windows-2019, macos-10.15]
12-
include:
13-
- os: ubuntu-18.04
14-
c-compiler: "gcc"
15-
cxx-compiler: "g++"
16-
itk-git-tag: "c693dbc830859ea10d573301f075e121a4c6c581"
17-
cmake-build-type: "MinSizeRel"
18-
- os: windows-2019
19-
c-compiler: "cl.exe"
20-
cxx-compiler: "cl.exe"
21-
itk-git-tag: "c693dbc830859ea10d573301f075e121a4c6c581"
22-
cmake-build-type: "Release"
23-
- os: macos-10.15
24-
c-compiler: "clang"
25-
cxx-compiler: "clang++"
26-
itk-git-tag: "c693dbc830859ea10d573301f075e121a4c6c581"
27-
cmake-build-type: "MinSizeRel"
6+
cxx-build-workflow:
7+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@36e33ec40332bb8fd85bfcd3ee899f82aa108e79
288

29-
steps:
30-
- uses: actions/checkout@v1
31-
32-
- name: Set up Python 3.7
33-
uses: actions/setup-python@v1
34-
with:
35-
python-version: "3.7"
36-
37-
- name: Install build dependencies
38-
run: |
39-
python -m pip install --upgrade pip
40-
python -m pip install ninja
41-
42-
- name: Get specific version of CMake, Ninja
43-
uses: lukka/[email protected]
44-
45-
- name: Download ITK
46-
run: |
47-
cd ..
48-
git clone https://github.com/InsightSoftwareConsortium/ITK.git
49-
cd ITK
50-
git checkout ${{ matrix.itk-git-tag }}
51-
52-
- name: Build ITK
53-
if: matrix.os != 'windows-2019'
54-
run: |
55-
cd ..
56-
mkdir ITK-build
57-
cd ITK-build
58-
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK
59-
ninja
60-
61-
- name: Build ITK
62-
if: matrix.os == 'windows-2019'
63-
run: |
64-
cd ..
65-
mkdir ITK-build
66-
cd ITK-build
67-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
68-
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK
69-
ninja
70-
shell: cmd
71-
72-
- name: Fetch CTest driver script
73-
run: |
74-
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O
75-
76-
- name: Configure CTest script
77-
shell: bash
78-
run: |
79-
operating_system="${{ matrix.os }}"
80-
cat > dashboard.cmake << EOF
81-
set(CTEST_SITE "GitHubActions")
82-
file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT)
83-
file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY)
84-
file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY)
85-
set(dashboard_source_name "${GITHUB_REPOSITORY}")
86-
if(ENV{GITHUB_REF} MATCHES "master")
87-
set(branch "-master")
88-
set(dashboard_model "Continuous")
89-
else()
90-
set(branch "-${GITHUB_REF}")
91-
set(dashboard_model "Experimental")
92-
endif()
93-
set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}")
94-
set(CTEST_UPDATE_VERSION_ONLY 1)
95-
set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL})
96-
set(CTEST_BUILD_CONFIGURATION "Release")
97-
set(CTEST_CMAKE_GENERATOR "Ninja")
98-
set(CTEST_CUSTOM_WARNING_EXCEPTION
99-
\${CTEST_CUSTOM_WARNING_EXCEPTION}
100-
# macOS Azure VM Warning
101-
"ld: warning: text-based stub file"
102-
)
103-
set(dashboard_no_clean 1)
104-
set(ENV{CC} ${{ matrix.c-compiler }})
105-
set(ENV{CXX} ${{ matrix.cxx-compiler }})
106-
if(WIN32)
107-
set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}")
108-
endif()
109-
set(dashboard_cache "
110-
ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build
111-
BUILD_TESTING:BOOL=ON
112-
")
113-
string(TIMESTAMP build_date "%Y-%m-%d")
114-
message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}")
115-
message("CTEST_SITE = \${CTEST_SITE}")
116-
include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake)
117-
EOF
118-
cat dashboard.cmake
119-
120-
- name: Build and test
121-
if: matrix.os != 'windows-2019'
122-
run: |
123-
ctest --output-on-failure -j 2 -V -S dashboard.cmake
124-
125-
- name: Build and test
126-
if: matrix.os == 'windows-2019'
127-
run: |
128-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
129-
ctest --output-on-failure -j 2 -V -S dashboard.cmake
130-
shell: cmd
131-
132-
build-linux-python-packages:
133-
runs-on: ubuntu-18.04
134-
strategy:
135-
max-parallel: 2
136-
matrix:
137-
python-version: ["36", "37", "38", "39"]
138-
include:
139-
- itk-python-git-tag: "v5.2.1"
140-
141-
steps:
142-
- uses: actions/checkout@v2
143-
144-
- name: 'Free up disk space'
145-
run: |
146-
# Workaround for https://github.com/actions/virtual-environments/issues/709
147-
df -h
148-
sudo apt-get clean
149-
sudo rm -rf "/usr/local/share/boost"
150-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
151-
df -h
152-
153-
- name: 'Fetch build script'
154-
run: |
155-
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
156-
chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh
157-
158-
- name: 'Build 🐍 Python 📦 package'
159-
run: |
160-
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
161-
./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }}
162-
163-
- name: Publish Python package as GitHub Artifact
164-
uses: actions/upload-artifact@v1
165-
with:
166-
name: LinuxWheel${{ matrix.python-version }}
167-
path: dist
168-
169-
build-macos-python-packages:
170-
runs-on: macos-10.15
171-
strategy:
172-
max-parallel: 2
173-
matrix:
174-
include:
175-
- itk-python-git-tag: "v5.2.1"
176-
177-
steps:
178-
- uses: actions/checkout@v2
179-
180-
- name: 'Specific XCode version'
181-
run: |
182-
sudo xcode-select -s "/Applications/Xcode_11.7.app"
183-
184-
- name: Get specific version of CMake, Ninja
185-
uses: lukka/[email protected]
186-
187-
- name: 'Fetch build script'
188-
run: |
189-
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
190-
chmod u+x macpython-download-cache-and-build-module-wheels.sh
191-
192-
- name: 'Build 🐍 Python 📦 package'
193-
run: |
194-
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
195-
export MACOSX_DEPLOYMENT_TARGET=10.9
196-
./macpython-download-cache-and-build-module-wheels.sh
197-
198-
- name: Publish Python package as GitHub Artifact
199-
uses: actions/upload-artifact@v1
200-
with:
201-
name: MacOSWheels
202-
path: dist
203-
204-
build-windows-python-packages:
205-
runs-on: windows-2019
206-
strategy:
207-
max-parallel: 2
208-
matrix:
209-
python-version-minor: ["6", "7", "8", "9"]
210-
include:
211-
- itk-python-git-tag: "v5.2.1"
212-
213-
steps:
214-
- name: Get specific version of CMake, Ninja
215-
uses: lukka/[email protected]
216-
217-
- uses: actions/checkout@v2
218-
with:
219-
path: "im"
220-
221-
- name: 'Install Python'
222-
run: |
223-
$pythonArch = "64"
224-
$pythonVersion = "3.${{ matrix.python-version-minor }}"
225-
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1'))
226-
227-
- name: 'Fetch build dependencies'
228-
shell: bash
229-
run: |
230-
mv im ../../
231-
cd ../../
232-
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
233-
7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r
234-
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
235-
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
236-
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
237-
7z x grep-win.zip -o/c/P/grep -aoa -r
238-
239-
- name: 'Build 🐍 Python 📦 package'
240-
shell: cmd
241-
run: |
242-
cd ../../im
243-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
244-
set PATH="C:\P\grep;%PATH%"
245-
set CC=cl.exe
246-
set CXX=cl.exe
247-
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" --no-cleanup
248-
249-
- name: Publish Python package as GitHub Artifact
250-
uses: actions/upload-artifact@v1
251-
with:
252-
name: WindowsWheel3.${{ matrix.python-version-minor }}
253-
path: ../../im/dist
254-
255-
publish-python-packages-to-pypi:
256-
needs:
257-
- build-linux-python-packages
258-
- build-macos-python-packages
259-
- build-windows-python-packages
260-
runs-on: ubuntu-18.04
261-
262-
steps:
263-
- name: Download Python Packages
264-
uses: actions/download-artifact@v2
265-
266-
- name: Prepare packages for upload
267-
run: |
268-
ls -R
269-
for d in */; do
270-
mv ${d}/*.whl .
271-
done
272-
mkdir dist
273-
mv *.whl dist/
274-
ls dist
275-
276-
- name: Publish 🐍 Python 📦 package to PyPI
277-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
278-
uses: pypa/gh-action-pypi-publish@master
279-
with:
280-
user: __token__
281-
password: ${{ secrets.pypi_password }}
9+
python-build-workflow:
10+
uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@36e33ec40332bb8fd85bfcd3ee899f82aa108e79
11+
secrets:
12+
pypi_password: ${{ secrets.pypi_password }}

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Apache License
33
Version 2.0, January 2004
4-
http://www.apache.org/licenses/
4+
https://www.apache.org/licenses/
55

66
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
77

@@ -193,7 +193,7 @@
193193
you may not use this file except in compliance with the License.
194194
You may obtain a copy of the License at
195195

196-
http://www.apache.org/licenses/LICENSE-2.0
196+
https://www.apache.org/licenses/LICENSE-2.0
197197

198198
Unless required by applicable law or agreed to in writing, software
199199
distributed under the License is distributed on an "AS IS" BASIS,

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ H & E ([hematoxylin](https://en.wikipedia.org/wiki/Haematoxylin) and [eosin](htt
1010

1111
Structure Preserving Color Normalization is a technique described in [Vahadane et al., 2016](https://doi.org/10.1109/TMI.2016.2529665) and modified in [Ramakrishnan et al., 2019](https://arxiv.org/abs/1901.03088). The idea is to model the color of an image pixel as something close to pure white, which is reduced in intensity in a color-specific way via an optical absorption model that depends upon the amounts of hematoxylin and eosin that are present. [Non-negative matrix factorization](https://en.wikipedia.org/wiki/Non-negative_matrix_factorization) is used on each analyzed image to simultaneously derive the amount of hematoxylin and eosin stain at each pixel and the image-wide effective colors of each stain.
1212

13-
The implementation in ITK accelerates the non-negative matrix factorization by choosing the initial estimate for the color absorption characteristics using a technique mimicking that presented in [Arora et al., 2013](http://proceedings.mlr.press/v28/arora13.html) and modified in [Newberg et al., 2018](https://doi.org/10.1371/journal.pone.0193067). This approach finds a good solution for a non-negative matrix factorization by first transforming it to the problem of finding a convex hull for a set of points in a cloud.
13+
The implementation in ITK accelerates the non-negative matrix factorization by choosing the initial estimate for the color absorption characteristics using a technique mimicking that presented in [Arora et al., 2013](https://proceedings.mlr.press/v28/arora13.html) and modified in [Newberg et al., 2018](https://doi.org/10.1371/journal.pone.0193067). This approach finds a good solution for a non-negative matrix factorization by first transforming it to the problem of finding a convex hull for a set of points in a cloud.
1414

1515
The lead developer of InsightSoftwareConsortium/ITKColorNormalization is [Lee Newberg](https://github.com/Leengit/).
1616

include/itkStructurePreservingColorNormalizationFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0.txt
9+
* https://www.apache.org/licenses/LICENSE-2.0.txt
1010
*
1111
* Unless required by applicable law or agreed to in writing, software
1212
* distributed under the License is distributed on an "AS IS" BASIS,

include/itkStructurePreservingColorNormalizationFilter.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0.txt
9+
* https://www.apache.org/licenses/LICENSE-2.0.txt
1010
*
1111
* Unless required by applicable law or agreed to in writing, software
1212
* distributed under the License is distributed on an "AS IS" BASIS,

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
setup(
1818
name="itk-spcn",
19-
version="0.1.8",
19+
version="0.2.0",
2020
author="Lee Newberg",
2121
author_email="[email protected]",
2222
packages=["itk"],
@@ -46,5 +46,5 @@
4646
license="Apache",
4747
keywords="ITK InsightToolkit",
4848
url=r"https://github.com/InsightSoftwareConsortium/ITKColorNormalization/",
49-
install_requires=[r"itk>=5.2.1.post1"],
49+
install_requires=[r"itk>=5.3.0"],
5050
)

test/itkStructurePreservingColorNormalizationFilterTest.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* you may not use this file except in compliance with the License.
77
* You may obtain a copy of the License at
88
*
9-
* http://www.apache.org/licenses/LICENSE-2.0.txt
9+
* https://www.apache.org/licenses/LICENSE-2.0.txt
1010
*
1111
* Unless required by applicable law or agreed to in writing, software
1212
* distributed under the License is distributed on an "AS IS" BASIS,

0 commit comments

Comments
 (0)