Skip to content

Commit 820bccc

Browse files
committed
feat(dcmtk): add ITKDCMTK to image-io pipelines
Enable building of ITKDCMTK in ITK-C++ for supporting DCMTK related operations. We do NOT include ITKIODCMTK currently, since it links with dcmjpeg and other libraries that are not essential for structured reports. Additionally, WASI compiler doesn't support C++ header csetjmp which is used in dcmjpeg for calling functions such as setjmp() and longjmp(). Add options to Dockerfile to enable flags for DCMTK. Enable relevant flags for DCMTK building with emscripten and wasi. In particular: DCMTK_WITH_THREADS -> OFF, pthreads are not supported by emscripten/wasi DCMTK_BUILD_APPS -> ON, we need the cmd line apps like dsr2html. DNO_FLOAT_EXCEPTIONS -> ON, newly created flag to tell DCMTK to avoid using floating point exception macros when build with emscripten or wasi. Update git tags for ITK and DCMTK branches. Include fixes for ITK: $ git shortlog 7e35b64..afd7a44 Shreeraj Jadhav (4): COMP: provide option to disable use of float exception macros COMP: wasi doesn't support pthread COMP: enable minimal number of DCMTK libs for dcmsr COMP: enable DCMTK build apps Include fixes for DCMTK: $ git shortlog cba5794f..66fce682 Matt McCormick (2): Support the generation of arith.h with Emscription WIP: Do not use non-type template argument -1 in variadic template Shreeraj Jadhav (9): COMP: Remove floating point exceptions for emscripten COMP: fix missing <csetjmp> header issue COMP: setjmp header required for emscripten COMP: use NO_FLOAT_EXCEPTIONS in place of __EMSCRIPTEN__ COMP: fix WASI compiler errors COMP: disable unneeded tests and apps COMP: Enable dcm2pdf, fix WIN32 build COMP: add fixes for Emscripten linker errors COMP: disable use of log4cplus::tistringstream
1 parent 00f8815 commit 820bccc

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

src/docker/itk-wasm-base/Dockerfile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,23 @@ LABEL org.opencontainers.image.source="https://github.com/InsightSoftwareConsort
77

88
WORKDIR /
99

10-
# 2022-07-02 master branch
11-
ENV ITK_GIT_TAG 7e35b6443f7bec2aa74d439d066881971f5590db
12-
RUN git clone https://github.com/thewtex/ITK.git && \
10+
# 2022-07-02 branch: ITKWASM-2022-07-02-5e7aea9
11+
ENV ITK_GIT_TAG afd7a44bd42cb56edb8fcd67bd0f5ecaa2e0f3db
12+
RUN git clone https://github.com/KitwareMedical/ITK.git && \
1313
cd ITK && \
1414
git checkout ${ITK_GIT_TAG} && \
1515
cd ../ && \
1616
sed -i -e '/^option(OPJ_USE_THREAD/c\option(OPJ_USE_THREAD "use threads" OFF)' \
1717
/ITK/Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmopenjpeg/src/lib/openjp2/CMakeLists.txt
18+
19+
# Modify CMake variable to use patched DCMTK library
20+
# GIT_TAG refers to DCMTK branch: 20220802_DCMTK_PATCHES_FOR_ITK-wasm
21+
RUN sed -i -e '/^set(DCMTK_GIT_REPOSITORY/c\set(DCMTK_GIT_REPOSITORY "https://github.com/InsightSoftwareConsortium/DCMTK.git")' \
22+
/ITK/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake
23+
24+
RUN sed -i -e '/^set(DCMTK_GIT_TAG/c\set(DCMTK_GIT_TAG "66fce6822afb16bcfd926ac8a5f4ed8d7cd10981")' \
25+
/ITK/Modules/ThirdParty/DCMTK/DCMTKGitTag.cmake
26+
1827
ARG CMAKE_BUILD_TYPE=Release
1928

2029
ARG LDFLAGS
@@ -43,6 +52,7 @@ RUN mkdir ITK-build && \
4352
-DModule_IOMeshSWC:BOOL=ON \
4453
-DModule_IOScanco:BOOL=ON \
4554
-DModule_IOFDF:BOOL=ON \
55+
-DModule_ITKDCMTK:BOOL=ON \
4656
-DModule_ITKImageFunction:BOOL=ON \
4757
-DModule_SmoothingRecursiveYvvGaussianFilter:BOOL=ON \
4858
-DModule_MorphologicalContourInterpolation:BOOL=ON \
@@ -52,6 +62,9 @@ RUN mkdir ITK-build && \
5262
-DModule_GenericLabelInterpolator:BOOL=ON \
5363
-DDO_NOT_BUILD_ITK_TEST_DRIVER:BOOL=ON \
5464
-DOPJ_USE_THREAD:BOOL=OFF \
65+
-DDCMTK_WITH_THREADS:BOOL=OFF \
66+
-DDCMTK_BUILD_APPS:BOOL=ON \
67+
-DNO_FLOAT_EXCEPTIONS:BOOL=ON \
5568
../ITK && \
5669
ninja && \
5770
find . -name '*.o' -delete && \

0 commit comments

Comments
 (0)