diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 1915e3ea3..ec4884646 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -64,6 +64,12 @@ jobs: large-packages: false tool-cache: true + - uses: nick-fields/retry@v3 + with: + max_attempts: 5 + timeout_minutes: 10 + command: ./src/docker/pull.sh --no-debug + - name: Install uses: pnpm/action-setup@v4 with: diff --git a/docs/introduction/file_formats/images.md b/docs/introduction/file_formats/images.md index efc71e7a4..5e13fb2ef 100644 --- a/docs/introduction/file_formats/images.md +++ b/docs/introduction/file_formats/images.md @@ -1,6 +1,6 @@ # Supported Image File Formats -Read and write to and from [`Image`](/typescript/interface_types/Image.html) is supported. For visualization with [vtk.js](https://kitware.github.io/vtk-js/index.html), use [`convertItkToVtkImage`](https://kitware.github.io/vtk-js/api/Common_DataModel_ITKHelper.html). +Read and write to and from an [`Image`](../../typescript/interface_types/Image). - [AIM,ISQ](https://www.scanco.ch/en/support/customer-login/faq-customers/faq-customers-import-export.html) - [BioRad](https://www.bio-rad.com/) @@ -18,6 +18,4 @@ Read and write to and from [`Image`](/typescript/interface_types/Image.html) is - [NIfTI](https://nifti.nimh.nih.gov/nifti-1) - [NRRD](http://teem.sourceforge.net/nrrd/format.html) - [VTK legacy file format for images](https://www.vtk.org/VTK/img/file-formats.pdf) -- [Varian FDF](https://github.com/InsightSoftwareConsortium/ITKIOFDF) - -For visualization with [vtk.js](https://kitware.github.io/vtk-js/index.html), use [`vtkITKHelper.convertItkToVtkImage`](https://kitware.github.io/vtk-js/api/Common_DataModel_ITKHelper.html) ([example](https://kitware.github.io/vtk-js/examples/ItkWasmVolume.html)). +- [Varian FDF](https://github.com/InsightSoftwareConsortium/ITKIOFDF) \ No newline at end of file diff --git a/docs/introduction/file_formats/index.md b/docs/introduction/file_formats/index.md index 2f096f296..82d1c46a0 100644 --- a/docs/introduction/file_formats/index.md +++ b/docs/introduction/file_formats/index.md @@ -2,7 +2,7 @@ Support for data serialized in file formats are a critical bridge that facilitate comprehensive analysis with a suite of diverse software tools. -ITK-Wasm provides IO modules to work with a number of open standard [scientific image](./images) and [mesh](./meshes) file formats, These IO modules can be used to load data into language-native [interfaces types](/typescript/interface_types/index) in with bindings such as TypeScript and Python. +ITK-Wasm provides IO modules to work with a number of open standard [scientific image](./images), [mesh](./meshes), and [transform](./transforms) file formats, These IO modules can be used to load data into language-native [interfaces types](/typescript/interface_types/index) in with bindings such as TypeScript and Python. ## ITK-Wasm file formats @@ -17,6 +17,7 @@ ITK-Wasm file formats are available in ITK-Wasm IO functions but also in C++ via
ITK-Wasm Image (.iwi, .iwi.cbor, .iwi.cbor.zst)
Serialization of an Image.
ITK-Wasm Mesh (.iwm, .iwm.cbor, .iwm.cbor.zst)
Serialization of a Mesh, or PolyData.
+
ITK-Wasm Transform (.iwt, .iwt.cbor, .iwt.cbor.zst)
Serialization of an TransformList.
@@ -26,5 +27,6 @@ ITK-Wasm file formats are available in ITK-Wasm IO functions but also in C++ via images.md meshes.md +transforms.md dicom.md ``` diff --git a/docs/introduction/file_formats/meshes.md b/docs/introduction/file_formats/meshes.md index 4f954d9d9..3c3c7daba 100644 --- a/docs/introduction/file_formats/meshes.md +++ b/docs/introduction/file_formats/meshes.md @@ -1,6 +1,6 @@ # Supported Mesh and Point Set File Formats -Read and write to and from [`Mesh`](/typescript/interface_types/Mesh.html) is supported. +Read and write to and from [`Mesh`](../../typescript/interface_types/Mesh) is supported. - [BYU](http://www.eg-models.de/formats/Format_Byu.html) - [FreeSurfer surface, binary and ASCII](http://www.grahamwideman.com/gw/brain/fs/surfacefileformats.htm) @@ -9,5 +9,3 @@ Read and write to and from [`Mesh`](/typescript/interface_types/Mesh.html) is su - [SWC Neuron Morphology](https://swc-specification.readthedocs.io/en/latest/) - [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file) - [VTK legacy file format for vtkPolyData](https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf) - -For visualization with [vtk.js](https://kitware.github.io/vtk-js/index.html), use itk-wasm `meshToPolyData` and [`vtkITKHelper.convertItkToVtkPolyData`](https://kitware.github.io/vtk-js/api/Common_DataModel_ITKHelper.html) ([example](https://kitware.github.io/vtk-js/examples/ItkWasmGeometry.html)). diff --git a/docs/introduction/file_formats/transforms.md b/docs/introduction/file_formats/transforms.md new file mode 100644 index 000000000..59086da81 --- /dev/null +++ b/docs/introduction/file_formats/transforms.md @@ -0,0 +1,8 @@ +# Supported Transform File Formats + +Read and write to and from a spatial [`TransformList`](../../typescript/interface_types/TransformList). + +- [ITK-HDF5](https://support.hdfgroup.org/HDF5/) - ITK HDF5 transform file format. +- [ITK-TXT](https://docs.itk.org) - ITK Legacy text transform file format. +- [MAT](https://www.mathworks.com/help/matlab/ref/matfile.html) - ITK MAT file format. +- [XFM](https://github.com/BIC-MNI/minc-tools) - MNI XFM file format. \ No newline at end of file diff --git a/docs/typescript/interface_types/Image.md b/docs/typescript/interface_types/Image.md index 5ae5e70fb..0fff96bfe 100644 --- a/docs/typescript/interface_types/Image.md +++ b/docs/typescript/interface_types/Image.md @@ -1,6 +1,6 @@ # Image -An `Image` is the N-dimensional image data structure for *itk-wasm*. +An `Image` is the N-dimensional image data structure for *ITK-Wasm*. `Image` is a JavaScript object with the following properties: @@ -19,6 +19,4 @@ Note that the `origin`, `spacing`, `direction`, and `size` are indexed with an ` ``` const tensor = tf.tensor(image.data, image.size.reverse()) -``` - -To visualize an `Image` with [vtk.js](https://kitware.github.io/vtk-js) use `convertItkToVtkImage` from [`vtk.js/Sources/Common/DataModel/ITKHelper`](https://kitware.github.io/vtk-js/api/Common_DataModel_ITKHelper.html). +``` \ No newline at end of file diff --git a/docs/typescript/interface_types/Transform.md b/docs/typescript/interface_types/Transform.md new file mode 100644 index 000000000..b2a429566 --- /dev/null +++ b/docs/typescript/interface_types/Transform.md @@ -0,0 +1,12 @@ +# Transform + +A `Transform` specifies a spatial transformation that maps points from one coordinate system to another. The `Transform` interface is a JavaScript object with the following properties: + +- `transformType`: The [TransformType](./TransformType) for this transform. +- `numberOfFixedParameters`: The number of fixed parameters for the transform. Fixed parameters are not optimized during registration. +- `numberOfParameters`: The number of parameters for the transform. +- `name`: An optional name string that describes this transform. +- `inputSpaceName`: An optional name string that describes the input space. +- `outputSpaceName`: An optional name string that describes the output space. +- `parameters`: A [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) containing the transform parameters. +- `fixedParameters`: A [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) containing the fixed transform parameters. diff --git a/docs/typescript/interface_types/TransformList.md b/docs/typescript/interface_types/TransformList.md new file mode 100644 index 000000000..53f6512cb --- /dev/null +++ b/docs/typescript/interface_types/TransformList.md @@ -0,0 +1,5 @@ +# TransformList + +A `TransformList` is an ordered sequence of spatial [`Transform`](./Transform) objects. + +`TransformList` is a JavaScript array of `Transform` objects. \ No newline at end of file diff --git a/docs/typescript/interface_types/TransformParameterizations.md b/docs/typescript/interface_types/TransformParameterizations.md new file mode 100644 index 000000000..82a9fd1ea --- /dev/null +++ b/docs/typescript/interface_types/TransformParameterizations.md @@ -0,0 +1,34 @@ +# TransformParameterizations + +The enumeration of transform parameterization values is: + +- `Composite` +- `Identity` +- `Translation` +- `Euler2D` +- `Euler3D` +- `Rigid2D` +- `Rigid3D` +- `Rigid3DPerspective` +- `Versor` +- `VersorRigid3D` +- `Scale` +- `ScaleLogarithmic` +- `ScaleSkewVersor3D` +- `Similarity2D` +- `Similarity3D` +- `QuaternionRigid` +- `Affine` +- `ScalableAffine` +- `AzimuthElevationToCartesian` +- `BSpline` +- `BSplineSmoothingOnUpdateDisplacementField` +- `ConstantVelocityField` +- `DisplacementField` +- `GaussianSmoothingOnUpdateDisplacementField` +- `GaussianExponentialDiffeomorphic` +- `VelocityField` +- `TimeVaryingVelocityField` +- `GaussianSmoothingOnUpdateTimeVaryingVelocityField` + +The definition of these transform and the meaning of their parameters is described in detail in the [ITK Software Guide, Book 2, Section 3.9](https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/releases). \ No newline at end of file diff --git a/docs/typescript/interface_types/TransformType.md b/docs/typescript/interface_types/TransformType.md new file mode 100644 index 000000000..8a6d0f47c --- /dev/null +++ b/docs/typescript/interface_types/TransformType.md @@ -0,0 +1,8 @@ +# TransformType + +An `TransformType` describes parameterization, parameter value type, and input and output dimensions of the transform. It is a JavaScript object with the following properties: + +- `transformParameterization`: The [TransformParameterization](./TransformParameterizations) for this transform. +- `parametersValueType`: Whether the transform parameters are `float32` or `float64`. +- `inputDimension`: The number of dimensions of the input space. +- `outputDimension`: The number of dimensions of the output space. diff --git a/docs/typescript/interface_types/index.md b/docs/typescript/interface_types/index.md index 6f063c57c..e6cdacc83 100644 --- a/docs/typescript/interface_types/index.md +++ b/docs/typescript/interface_types/index.md @@ -15,6 +15,10 @@ ImageType.md Mesh.md MeshType.md PolyData.md +TransformList.md +Transform.md +TransformType.md +TransformParameterizations.md JsonCompatible.md ``` diff --git a/package.json b/package.json index c1beeddb3..709688544 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@shoelace-style/shoelace": "^2.12.0", "start-server-and-test": "^2.0.4", "ava": "^6.1.3", - "cypress": "^14.1.0" + "cypress": "^14.2.0" } }, "commitlint": { diff --git a/packages/core/typescript/itk-wasm/src/interface-types/poly-data.ts b/packages/core/typescript/itk-wasm/src/interface-types/poly-data.ts index 8a4529848..4b2b28a35 100644 --- a/packages/core/typescript/itk-wasm/src/interface-types/poly-data.ts +++ b/packages/core/typescript/itk-wasm/src/interface-types/poly-data.ts @@ -28,7 +28,7 @@ class PolyData { metadata: Metadata - constructor(public readonly polyDataType = new PolyDataType()) { + constructor (public readonly polyDataType = new PolyDataType()) { this.polyDataType = polyDataType this.name = 'PolyData' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 22d7f612d..2c1eff2a2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,7 +8,7 @@ overrides: '@shoelace-style/shoelace': ^2.12.0 start-server-and-test: ^2.0.4 ava: ^6.1.3 - cypress: ^14.1.0 + cypress: ^14.2.0 importers: @@ -49,8 +49,8 @@ importers: version: link:../../packages/core/typescript/itk-wasm devDependencies: cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 http-server: specifier: ^14.1.1 version: 14.1.1 @@ -199,8 +199,8 @@ importers: specifier: ^6.1.3 version: 6.1.3 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -318,8 +318,8 @@ importers: specifier: ^6.1.3 version: 6.1.3 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -468,8 +468,8 @@ importers: specifier: ^6.1.3 version: 6.1.3 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -572,8 +572,8 @@ importers: specifier: ^6.1.3 version: 6.1.3 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -642,8 +642,8 @@ importers: specifier: ^6.1.3 version: 6.1.3 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -703,8 +703,8 @@ importers: specifier: ^8.2.2 version: 8.2.2 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -816,8 +816,8 @@ importers: specifier: ^6.1.3 version: 6.1.3 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -871,8 +871,8 @@ importers: specifier: ^6.1.3 version: 6.1.3 cypress: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^14.2.0 + version: 14.2.0 esbuild: specifier: ^0.25.0 version: 0.25.0 @@ -2908,8 +2908,8 @@ packages: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} - cli-table3@0.6.4: - resolution: {integrity: sha512-Lm3L0p+/npIQWNIiyF/nAn7T5dnOwR3xNTHXYEBFBFVPXzCVNZ5lqEC/1eo/EVfpDsQ1I+TX4ORPQgp+UI0CRw==} + cli-table3@0.6.5: + resolution: {integrity: sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==} engines: {node: 10.* || >= 12.*} cli-truncate@2.1.0: @@ -3094,8 +3094,8 @@ packages: resolution: {integrity: sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==} engines: {node: '>=0.10.0'} - cypress@14.1.0: - resolution: {integrity: sha512-pPPj8Uu9NwjaaiXAEcjYZZmgsq6v9Zs1Nw6a+zRF+ANgYSNhH4S32SjFRsvMcuOHR/8dp4GBJhBPqIPSs+TxaA==} + cypress@14.2.0: + resolution: {integrity: sha512-u7fuc9JEpSYLOdu8mzZDZ/JWsHUzR5pc8i1TeSqMz/bafXp+6IweMAeyphsEJ6/13qbB6nwTEY1m+GUAp6GqCQ==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true @@ -3745,10 +3745,6 @@ packages: resolution: {integrity: sha512-XHIrMD0NpDrNM/Ckf7XJiBbLl57KEhT3+i3yY+eWm+cqYZJQTZrKo8Y8AWKnuV5GT4scfuUGt9LzNoIx3dU1nQ==} engines: {node: '>= 0.12'} - form-data@4.0.0: - resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} - engines: {node: '>= 6'} - form-data@4.0.2: resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} engines: {node: '>= 6'} @@ -7303,7 +7299,7 @@ snapshots: combined-stream: 1.0.8 extend: 3.0.2 forever-agent: 0.6.1 - form-data: 4.0.0 + form-data: 4.0.2 http-signature: 1.4.0 is-typedarray: 1.0.0 isstream: 0.1.2 @@ -8693,7 +8689,7 @@ snapshots: cli-spinners@2.9.2: {} - cli-table3@0.6.4: + cli-table3@0.6.5: dependencies: string-width: 4.2.3 optionalDependencies: @@ -8877,7 +8873,7 @@ snapshots: dependencies: array-find-index: 1.0.2 - cypress@14.1.0: + cypress@14.2.0: dependencies: '@cypress/request': 3.0.7 '@cypress/xvfb': 1.2.4(supports-color@8.1.1) @@ -8892,7 +8888,7 @@ snapshots: check-more-types: 2.24.0 ci-info: 4.1.0 cli-cursor: 3.1.0 - cli-table3: 0.6.4 + cli-table3: 0.6.5 commander: 6.2.1 common-tags: 1.8.2 dayjs: 1.11.11 @@ -9732,12 +9728,6 @@ snapshots: mime-types: 2.1.35 safe-buffer: 5.2.1 - form-data@4.0.0: - dependencies: - asynckit: 0.4.0 - combined-stream: 1.0.8 - mime-types: 2.1.35 - form-data@4.0.2: dependencies: asynckit: 0.4.0