Expand DICOM decoding and Enhanced CT support
This commit is contained in:
1 parent
c7f9af8025
commit
6b95fbb1fc
9 files changed
+508
-96
No files matched your search
+14
-2
@@ -10,6 +10,8 @@ build_for_arch() {
|
||||
swift build -c release --arch "$arch" --scratch-path "$scratch_path" --show-bin-path
|
||||
}
|
||||
|
||||
decoder="$(./scripts/build-dicom-decoder.sh)"
|
||||
|
||||
arm64_bin="$(build_for_arch arm64)"
|
||||
x86_64_bin="$(build_for_arch x86_64)"
|
||||
|
||||
@@ -19,12 +21,22 @@ trap 'rm -rf "$stage"' EXIT
|
||||
app="$stage/EzDent.app"
|
||||
executable="$app/Contents/MacOS/EzDent"
|
||||
|
||||
mkdir -p "$app/Contents/MacOS"
|
||||
mkdir -p "$app/Contents/MacOS" "$app/Contents/Helpers"
|
||||
cp "$decoder" "$app/Contents/Helpers/gdcmconv"
|
||||
licenses="$app/Contents/Resources/Licenses"
|
||||
mkdir -p "$licenses"
|
||||
gdcm_source=".build/dicom-tools/gdcm"
|
||||
cp "$gdcm_source/Copyright.txt" "$licenses/GDCM.txt"
|
||||
cp "$gdcm_source/Utilities/gdcmjpeg/COPYRIGHT.dcmtk" "$licenses/DCMTK.txt"
|
||||
cp "$gdcm_source/Utilities/gdcmcharls/License.txt" "$licenses/CharLS.txt"
|
||||
cp "$gdcm_source/Utilities/gdcmopenjpeg/LICENSE" "$licenses/OpenJPEG.txt"
|
||||
cp "$gdcm_source/Utilities/gdcmzlib/LICENSE" "$licenses/zlib.txt"
|
||||
codesign --force --sign - "$app/Contents/Helpers/gdcmconv"
|
||||
cp Packaging/Info.plist "$app/Contents/Info.plist"
|
||||
xcrun lipo -create "$arm64_bin/EzDent" "$x86_64_bin/EzDent" -output "$executable"
|
||||
xcrun lipo "$executable" -verify_arch arm64 x86_64
|
||||
codesign --force --sign - "$app"
|
||||
codesign --verify --strict "$app"
|
||||
codesign --verify --deep --strict "$app"
|
||||
|
||||
rm -rf dist/EzDent.app
|
||||
mv "$app" dist/EzDent.app
|
||||
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")/.."
|
||||
cache="$PWD/.build/dicom-tools"
|
||||
source="$cache/gdcm"
|
||||
build="$cache/gdcm-universal"
|
||||
revision="54d8fbc814b01e493c82666716460799c1a1e76b"
|
||||
cmake="${EZDENT_CMAKE:-cmake}"
|
||||
|
||||
if ! command -v "$cmake" >/dev/null; then
|
||||
printf '%s\n' 'CMake is required to build the bundled DICOM decoder. Set EZDENT_CMAKE to its path.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$cache"
|
||||
if [[ ! -d "$source/.git" ]]; then
|
||||
checkout="$(mktemp -d "$cache/.gdcm.XXXXXX")"
|
||||
trap 'rm -rf "$checkout"' EXIT
|
||||
git clone --depth 1 --branch v3.2.3 https://github.com/malaterre/GDCM.git "$checkout" >&2
|
||||
mv "$checkout" "$source"
|
||||
fi
|
||||
if [[ "$(git -C "$source" rev-parse HEAD)" != "$revision" ]]; then
|
||||
printf '%s\n' 'Unexpected revision in the cached GDCM checkout.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
"$cmake" -S "$source" -B "$build" -DCMAKE_BUILD_TYPE=Release \
|
||||
"-DEXECUTABLE_OUTPUT_PATH=$build/bin" "-DLIBRARY_OUTPUT_PATH=$build/bin" \
|
||||
'-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 \
|
||||
-DGDCM_BUILD_APPLICATIONS=ON -DGDCM_BUILD_TESTING=OFF -DGDCM_BUILD_SHARED_LIBS=OFF >&2
|
||||
"$cmake" --build "$build" --target gdcmconv --parallel "${EZDENT_BUILD_JOBS:-4}" >&2
|
||||
xcrun lipo "$build/bin/gdcmconv" -verify_arch arm64 x86_64
|
||||
printf '%s\n' "$build/bin/gdcmconv"
|
||||
Reference in new issue
Block a user