Skip to content

Commit

Permalink
Merge pull request #1102 from thewtex/compress-stringify-interface
Browse files Browse the repository at this point in the history
compress stringify interface
  • Loading branch information
thewtex authored Apr 13, 2024
2 parents 07323cc + 60ef2a4 commit d792345
Show file tree
Hide file tree
Showing 88 changed files with 7,482 additions and 211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
if-no-files-found: ignore

- name: Test with Firefox
if: ${{ matrix.package != 'dicom' && matrix.package != 'mesh-io' && matrix.package != 'image-io' && matrix.package != 'downsample' }}
if: ${{ matrix.package != 'compress-stringify' && matrix.package != 'dicom' && matrix.package != 'mesh-io' && matrix.package != 'image-io' && matrix.package != 'downsample' }}
uses: cypress-io/github-action@v6
with:
browser: firefox
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/javascript-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,9 @@ jobs:
run: |
pnpm run --aggregate-output --filter itk-wasm build
- name: Build build:gen:typescript for @itk-wasm/image-io, @itk-wasm/compare-images
if: ${{ matrix.package == 'downsample' }}
run: |
pnpm run --aggregate-output --filter "@itk-wasm/image-io-build..." build:gen:typescript
pnpm run --aggregate-output --filter "@itk-wasm/compare-images-build..." build:gen:typescript
- name: Build build:gen:typescript
run: |
pnpm run --aggregate-output --filter "@itk-wasm/${{ matrix.package }}-build..." build:gen:typescript
pnpm run --aggregate-output build:gen:typescript
- name: Build typescript
run: |
Expand Down
2 changes: 1 addition & 1 deletion packages/compare-images/compare-double-images.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ CompareImages(itk::wasm::Pipeline & pipeline, const TImage * testImage)

using InputImageType = itk::wasm::InputImage<ImageType>;
std::vector<InputImageType> baselineImages;
pipeline.add_option("-b,--baseline-images", baselineImages, "Baseline images compare against")->required()->expected(1,-1)->type_name("INPUT_IMAGE");
pipeline.add_option("-b,--baseline-images", baselineImages, "Baseline images to compare against")->required()->expected(1,-1)->type_name("INPUT_IMAGE");

itk::wasm::OutputTextStream metrics;
pipeline.add_option("metrics", metrics, "Metrics for the baseline with the fewest number of pixels outside the tolerances.")->type_name("OUTPUT_JSON");
Expand Down
11 changes: 8 additions & 3 deletions packages/compare-images/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@
"build:micromamba": "itk-wasm pnpm-script build:micromamba",
"build:python:versionSync": "itk-wasm pnpm-script build:python:versionSync",
"publish:python": "itk-wasm pnpm-script publish:python",
"test": "pnpm test:data:download",
"test:data:download": "dam download test/data test/data.tar.gz bafybeigcvvf3ol3phmpevbin6ufumqfx65uxxthchqacxftxqpn67uxlxa https://github.com/InsightSoftwareConsortium/itk-wasm/releases/download/itk-wasm-v1.0.0-b.157/data.tar.gz https://bafybeiefbfd6kxcmwq6osnwu72gv6srzsnv6ys5omoodjlmaazx47mdhsq.ipfs.w3s.link/ipfs/bafybeiefbfd6kxcmwq6osnwu72gv6srzsnv6ys5omoodjlmaazx47mdhsq/data.tar.gz",
"test:data:pack": "dam pack test/data test/data.tar.gz"
"test": "pnpm test:data:download && pnpm build:gen:python && pnpm test:python",
"test:data:download": "dam download test/data test/data.tar.gz bafybeiafli6egtmkcgany65po64w67hpqnmgwr5utqo6ycbbz7k5l33llu https://github.com/InsightSoftwareConsortium/itk-wasm/releases/download/itk-wasm-v1.0.0-b.171/compare-images-test-data.tar.gz",
"test:data:pack": "dam pack test/data test/data.tar.gz",
"test:python:wasi": "itk-wasm pnpm-script test:python:wasi",
"test:python:emscripten": "itk-wasm pnpm-script test:python:emscripten",
"test:python:dispatch": "itk-wasm pnpm-script test:python:emscripten",
"test:python": "itk-wasm pnpm-script test:python",
"test:wasi": "itk-wasm pnpm-script test:wasi -- -V"
},
"license": "Apache-2.0",
"devDependencies": {
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ keywords = [

requires-python = ">=3.8"
dependencies = [
"itkwasm >= 1.0.b145",
"itkwasm >= 1.0.b171",
]

[tool.hatch.version]
Expand All @@ -43,7 +43,7 @@ dependencies = [
"pytest",
"pytest-pyodide",
"itk-webassemblyinterface >= 1.0.b127",
"itkwasm >= 1.0.b145",
"itkwasm >= 1.0.b171",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords = [
"itkwasm",
Expand All @@ -31,7 +32,7 @@ keywords = [

requires-python = ">=3.8"
dependencies = [
"itkwasm >= 1.0.b131",
"itkwasm >= 1.0.b171",
"importlib_resources",

]
Expand All @@ -42,7 +43,7 @@ path = "itkwasm_compare_images_wasi/_version.py"
[tool.hatch.envs.default]
dependencies = [
"pytest",
"itk-webassemblyinterface >= 1.0.b127"
"itk-webassemblyinterface >= 1.0.b171"
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def compare_double_images(
:param test_image: The input test image
:type test_image: Image
:param baseline_images: Baseline images compare against
:param baseline_images: Baseline images to compare against
:type baseline_images: Image
:param difference_threshold: Intensity difference for pixels to be considered different.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def compare_double_images_async(
:param test_image: The input test image
:type test_image: Image
:param baseline_images: Baseline images compare against
:param baseline_images: Baseline images to compare against
:type baseline_images: Image
:param difference_threshold: Intensity difference for pixels to be considered different.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ keywords = [

requires-python = ">=3.8"
dependencies = [
"itkwasm >= 1.0.b131",
"itkwasm >= 1.0.b171",
"itkwasm-compare-images-wasi >= 1.0.1; sys_platform != \"emscripten\"",
"itkwasm-compare-images-emscripten >= 1.0.1; sys_platform == \"emscripten\"",

Expand All @@ -47,7 +47,7 @@ dependencies = [
"pytest",
"pytest-pyodide",
"itk-webassemblyinterface >= 1.0.b127",
"itkwasm >= 1.0.b131",
"itkwasm >= 1.0.b171",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Image } from 'itk-wasm'

interface CompareDoubleImagesNodeOptions {
/** Baseline images compare against */
/** Baseline images to compare against */
baselineImages: Image[]

/** Intensity difference for pixels to be considered different. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Image, WorkerPoolFunctionOption } from 'itk-wasm'

interface CompareDoubleImagesOptions extends WorkerPoolFunctionOption {
/** Baseline images compare against */
/** Baseline images to compare against */
baselineImages: Image[]

/** Intensity difference for pixels to be considered different. */
Expand Down
9 changes: 9 additions & 0 deletions packages/compare-meshes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
emscripten-build
micromamba
wasi-build

python
test
typescript/version.ts
typescript/dist
typescript/demo-app
15 changes: 15 additions & 0 deletions packages/compare-meshes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.16)
project(compare-meshes LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)

find_package(ITK REQUIRED COMPONENTS
WebAssemblyInterface
)
include(${ITK_USE_FILE})

enable_testing()

# Begin create-itk-wasm added pipelines.
add_subdirectory(compare-meshes)
# End create-itk-wasm added pipelines.
3 changes: 3 additions & 0 deletions packages/compare-meshes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# compare-meshes

Compare meshes and polydata for regression testing.
14 changes: 14 additions & 0 deletions packages/compare-meshes/compare-meshes/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_executable(compare-meshes compare-meshes.cxx)
target_link_libraries(compare-meshes PUBLIC ${ITK_LIBRARIES})

add_test(NAME compare-meshes-help COMMAND compare-meshes --help)

add_test(NAME compare-meshes-same
COMMAND compare-meshes
${CMAKE_CURRENT_SOURCE_DIR}/../test/data/input/cow.iwm.cbor
same-metrics.json
same-points-difference.iwm.cbor
same-point-data-difference.iwm.cbor
same-cell-data-difference.iwm.cbor
--baseline-meshes ${CMAKE_CURRENT_SOURCE_DIR}/../test/data/input/cow.iwm.cbor
)
Loading

0 comments on commit d792345

Please sign in to comment.