diff --git a/.github/workflows/bench_pr.yml b/.github/workflows/bench_pr.yml index 440a5f79..961f3520 100644 --- a/.github/workflows/bench_pr.yml +++ b/.github/workflows/bench_pr.yml @@ -13,13 +13,15 @@ jobs: go-version: 1.22 id: go - - name: Check out code + - name: Check out code uses: actions/checkout@v1 - name: Get dependencies - run: | + run: | + sudo apt-get update + sudo apt-get install -y pkg-config swig libcharls-dev libdcmtk-dev libopenjp2-7-dev go mod download - + - name: Benchmark against GITHUB_BASE_REF run: | go install golang.org/x/perf/cmd/benchstat@latest @@ -32,4 +34,4 @@ jobs: git log -1 --format="%H" go test -bench=. -benchmem -benchtime=10x -count=7 > $HOME/old.txt $GOBIN/benchstat $HOME/old.txt $HOME/new.txt - + diff --git a/.github/workflows/bench_push.yml b/.github/workflows/bench_push.yml index f3cc605f..a037a65c 100644 --- a/.github/workflows/bench_push.yml +++ b/.github/workflows/bench_push.yml @@ -13,13 +13,15 @@ jobs: go-version: 1.22 id: go - - name: Check out code + - name: Check out code uses: actions/checkout@v1 - name: Get dependencies - run: | + run: | + sudo apt-get update + sudo apt-get install -y pkg-config swig libcharls-dev libdcmtk-dev libopenjp2-7-dev go mod download - + - name: Benchmark (against HEAD~1) run: | go install golang.org/x/perf/cmd/benchstat@latest diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index bdd3fe4d..65d16df2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,20 +13,22 @@ jobs: go-version: 1.22 id: go - - name: Check out code + - name: Check out code uses: actions/checkout@v1 - name: Get dependencies run: | + sudo apt-get update + sudo apt-get install -y pkg-config swig libcharls-dev libdcmtk-dev libopenjp2-7-dev go mod download - name: Build run: | make build-fast - + - name: Test run: | make test - + diff --git a/pkg/codec/README.md b/pkg/codec/README.md index 7ab23ec3..dd3f3143 100644 --- a/pkg/codec/README.md +++ b/pkg/codec/README.md @@ -30,10 +30,10 @@ import ( ) func main() { - dataset, err := dicom.ParseFile("testdata/1.dcm", nil) - pixelDataElem, err := dataset.FindElementByTag(tag.PixelData) - pixelData := dicom.MustGetPixelDataInfo(pixelDataElem.Value) - encapsulatedFrame, err := pixelData.Frames[0].GetEncapsulatedFrame() + dataset, err := dicom.ParseFile("testdata/1.dcm", nil) + pixelDataElem, err := dataset.FindElementByTag(tag.PixelData) + pixelData := dicom.MustGetPixelDataInfo(pixelDataElem.Value) + encapsulatedFrame, err := pixelData.Frames[0].GetEncapsulatedFrame() image, err = encapsulatedFrame.GetImage() ... } diff --git a/pkg/codec/lib.go b/pkg/codec/lib.go index af7bd2b5..7d99714b 100644 --- a/pkg/codec/lib.go +++ b/pkg/codec/lib.go @@ -2,5 +2,7 @@ // Copyright (c) 2023 Segmed Inc. package codec -// #cgo pkg-config: libopenjp2 dcmtk charls +// #cgo pkg-config: libopenjp2 charls +// #cgo darwin pkg-config: dcmtk +// #cgo linux LDFLAGS: -ldcmjpeg import "C" diff --git a/pkg/codec/testdata/data_details.md b/pkg/codec/testdata/data_details.md index a7e54155..c38b86f5 100644 --- a/pkg/codec/testdata/data_details.md +++ b/pkg/codec/testdata/data_details.md @@ -28,5 +28,5 @@ be mentioned in one of them for brevity. dcmdump --write-pixel ../pkg/codec/testdata/ 3_jpeg.dcm ``` -#### Files a1_mono.jls and a1_mono.ppm +#### Files a1_mono.j2c and a1_mono.ppm These files were sourced from [openjpeg-data](https://github.com/uclouvain/openjpeg-data)