Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mz3 mesh io #1284

Merged
merged 20 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion itk_wasm_env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export ITK_WASM_DCMTK_REPOSITORY=${ITK_WASM_DCMTK_REPOSITORY:-"https://github.co
export ITK_WASM_DCMTK_GIT_TAG=${ITK_WASM_DCMTK_GIT_TAG:-"93e6d1b20b476c388f0379245c8c6e96af7f16f4"}

export ITK_WASM_ITK_REPOSITORY=${ITK_WASM_ITK_REPOSITORY:-"https://github.com/KitwareMedical/ITK"}
export ITK_WASM_ITK_BRANCH=${ITK_WASM_ITK_BRANCH:-"itkwasm-2024-05-20-5db055d7ad3b-4"}
export ITK_WASM_ITK_BRANCH=${ITK_WASM_ITK_BRANCH:-"itkwasm-2024-05-20-5db055d7ad3b-5"}

export ITK_WASM_NATIVE_WORKSPACE=${ITK_WASM_NATIVE_WORKSPACE:-$(pwd)/native}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/python/itkwasm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ license = {file = "LICENSE"}
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const defaultImageTag = '20241111-d4fcf16c'
const defaultImageTag = '20241205-b5c57616'
export default defaultImageTag
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion packages/dicom/python/itkwasm-dicom-wasi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion packages/dicom/python/itkwasm-dicom/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
2 changes: 1 addition & 1 deletion packages/image-io/python/itkwasm-image-io/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ classifiers = [
"Environment :: WebAssembly",
"Environment :: WebAssembly :: Emscripten",
"Environment :: WebAssembly :: WASI",
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
Expand Down
33 changes: 33 additions & 0 deletions packages/mesh-io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(WebAssemblyInterface_MeshIOModules
"IOMeshSWC"
"ITKIOMeshBYU"
"ITKIOMeshFreeSurfer"
"IOMeshMZ3"
CACHE STRING
"String delimited list of ITK mesh IO modules to support.")

Expand Down Expand Up @@ -58,6 +59,10 @@ set(meshio_kebab_itkWasmMeshIO "wasm")
set(meshio_id_itkWasmZstdMeshIO 9)
set(meshio_kebab_itkWasmZstdMeshIO "wasm-zstd")

set(meshios_IOMeshMZ3 itkMZ3MeshIO)
set(meshio_id_itkMZ3MeshIO 10)
set(meshio_kebab_itkMZ3MeshIO "mz3")

set(ITK_NO_MESHIO_FACTORY_REGISTER_MANAGER 1)
set(MeshIOIndex_ARRAY "")
foreach(io_module ${WebAssemblyInterface_MeshIOModules} WebAssemblyInterface)
Expand Down Expand Up @@ -132,13 +137,25 @@ add_test(NAME byu-write-mesh-test
${output_dir}/byu-write-mesh-test.could-write.json
${output_dir}/byu-write-mesh-test.byu)

add_test(NAME mz3-read-mesh-test
COMMAND mz3-read-mesh
${input_dir}/11ScalarMesh.mz3
${output_dir}/mz3-read-mesh-test.could-read.json
${output_dir}/mz3-read-mesh-test.iwm.cbor)

add_test(NAME mz3-write-mesh-test
COMMAND mz3-write-mesh
${baseline_dir}/mz3-read-mesh-test.iwm.cbor
${output_dir}/mz3-write-mesh-test.could-write.json
${output_dir}/mz3-write-mesh-test.mz3)

# This list should be ordered from approximately most commonly to least
# commonly used modules.
set(WebAssemblyInterface_PointSetIOModules
"ITKIOMeshVTK"
"ITKIOMeshOBJ"
"ITKIOMeshOFF"
"IOMeshMZ3"
CACHE STRING
"String delimited list of ITK point set IO modules to support.")

Expand All @@ -160,6 +177,10 @@ set(pointsetio_kebab_itkWasmMeshIO "wasm")
set(pointsetio_id_itkWasmZstdMeshIO 4)
set(pointsetio_kebab_itkWasmZstdMeshIO "wasm-zstd")

set(pointsetios_IOMeshMZ3 itkMZ3MeshIO)
set(pointsetio_id_itkMZ3MeshIO 5)
set(pointsetio_kebab_itkMZ3MeshIO "mz3")

set(ITK_NO_MESHIO_FACTORY_REGISTER_MANAGER 1)
set(PointSetIOIndex_ARRAY "")
foreach(io_module ${WebAssemblyInterface_PointSetIOModules} WebAssemblyInterface)
Expand Down Expand Up @@ -227,3 +248,15 @@ add_test(NAME obj-write-point-set-test
${baseline_dir}/obj-read-point-set-test.iwm.cbor
${output_dir}/obj-write-point-set-test.could-write.json
${output_dir}/obj-write-point-set-test.obj)

add_test(NAME mz3-read-point-set-test
COMMAND mz3-read-point-set
${input_dir}/11ScalarMesh.mz3
${output_dir}/mz3-read-point-set-test.could-read.json
${output_dir}/mz3-read-point-set-test.iwm.cbor)

add_test(NAME mz3-write-point-set-test
COMMAND mz3-write-point-set
${baseline_dir}/mz3-read-point-set-test.iwm.cbor
${output_dir}/mz3-write-point-set-test.could-write.json
${output_dir}/mz3-write-point-set-test.mz3)
8 changes: 4 additions & 4 deletions packages/mesh-io/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@itk-wasm/mesh-io-build",
"version": "1.4.2",
"version": "1.5.0",
"private": true,
"description": "scripts to generate @itk-wasm/compare-stringify itk-wasm artifacts.",
"type": "module",
"itk-wasm": {
"test-data-hash": "bafkreiahocrgb3p4xrjozr7cg5wdpdt6wp77kolnqyupae6awkplb5p4he",
"test-data-hash": "bafkreiey5fjpunmy6lkmfa5a4mc4ghyfxogfuwcixm7jdtf65pjxmwhaim",
"test-data-urls": [
"https://bafybeian677gvnngces3pbcv6zpzauf3yn5bedxdis4smwzwh5xeewazuq.ipfs.w3s.link/ipfs/bafybeian677gvnngces3pbcv6zpzauf3yn5bedxdis4smwzwh5xeewazuq/data.tar.gz"
"https://bafybeibc5xkdxpu2vwpcmbmu34jfdnr4grnpcrhnnjoeq546zovvfeuixu.ipfs.w3s.link/ipfs/bafybeibc5xkdxpu2vwpcmbmu34jfdnr4grnpcrhnnjoeq546zovvfeuixu/data.tar.gz"
],
"emscripten-docker-image": "quay.io/itkwasm/emscripten:latest",
"wasi-docker-image": "quay.io/itkwasm/wasi:latest",
Expand All @@ -28,7 +28,7 @@
"build:gen:typescript": "itk-wasm pnpm-script build:gen:typescript",
"build:gen:python": "pnpm build:wasi && pnpm bindgen:python",
"test": "pnpm test:data:download && pnpm build:gen:python && pnpm test:python",
"test:data:download": "dam download test/data test/data.tar.gz bafkreiahocrgb3p4xrjozr7cg5wdpdt6wp77kolnqyupae6awkplb5p4he https://bafybeian677gvnngces3pbcv6zpzauf3yn5bedxdis4smwzwh5xeewazuq.ipfs.w3s.link/ipfs/bafybeian677gvnngces3pbcv6zpzauf3yn5bedxdis4smwzwh5xeewazuq/data.tar.gz",
"test:data:download": "dam download test/data test/data.tar.gz bafkreiey5fjpunmy6lkmfa5a4mc4ghyfxogfuwcixm7jdtf65pjxmwhaim https://bafybeibc5xkdxpu2vwpcmbmu34jfdnr4grnpcrhnnjoeq546zovvfeuixu.ipfs.w3s.link/ipfs/bafybeibc5xkdxpu2vwpcmbmu34jfdnr4grnpcrhnnjoeq546zovvfeuixu/data.tar.gz",
"test:data:pack": "dam pack test/data test/data.tar.gz",
"test:python:wasi": "pnpm test:data:download && pixi run --manifest-path=./pixi.toml test-wasi",
"test:python:emscripten": "pnpm test:data:download && pixi run --manifest-path=./pixi.toml test-emscripten",
Expand Down
2 changes: 1 addition & 1 deletion packages/mesh-io/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ cwd = "python/itkwasm-mesh-io"

[tasks.publish]
depends-on = ["publish-typescript", "publish-python-wasi", "publish-python-emscripten", "publish-python-dispatch"]
description = "Synchronize package versions"
description = "Publish packages"

[feature.python.dependencies]
pytest = ">=8.3.3,<9"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
from .free_surfer_ascii_write_mesh_async import free_surfer_ascii_write_mesh_async
from .free_surfer_binary_read_mesh_async import free_surfer_binary_read_mesh_async
from .free_surfer_binary_write_mesh_async import free_surfer_binary_write_mesh_async
from .mz3_read_mesh_async import mz3_read_mesh_async
from .mz3_write_mesh_async import mz3_write_mesh_async
from .obj_read_mesh_async import obj_read_mesh_async
from .obj_write_mesh_async import obj_write_mesh_async
from .off_read_mesh_async import off_read_mesh_async
Expand All @@ -27,6 +29,8 @@
from .wasm_zstd_read_mesh_async import wasm_zstd_read_mesh_async
from .wasm_zstd_write_mesh_async import wasm_zstd_write_mesh_async

from .mz3_read_point_set_async import mz3_read_point_set_async
from .mz3_write_point_set_async import mz3_write_point_set_async
from .obj_read_point_set_async import obj_read_point_set_async
from .obj_write_point_set_async import obj_write_point_set_async
from .off_read_point_set_async import off_read_point_set_async
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.4.2"
__version__ = "1.5.0"
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
('.byu', 'byu'),
('.fsa', 'freeSurferAscii'),
('.fsb', 'freeSurferBinary'),
('.mz3', 'mz3'),
('.obj', 'obj'),
('.off', 'off'),
('.stl', 'stl'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

extension_to_point_set_io = OrderedDict([
('.vtk', 'vtkPolyData'),
('.mz3', 'mz3'),
('.obj', 'obj'),
('.off', 'off'),
('.iwm', 'wasm'),
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
'byu',
'free_surfer_ascii',
'free_surfer_binary',
'mz3',
'obj',
'off',
'stl',
Expand Down
Loading
Loading