Skip to content

Commit b0c154f

Browse files
committed
docs(transform): document Typescript interface types, supported file formats
Also add docker pull retry to hello-world. Apply linter to ploy-data.ts
1 parent b7afc2d commit b0c154f

File tree

12 files changed

+86
-13
lines changed

12 files changed

+86
-13
lines changed

.github/workflows/examples.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ jobs:
6464
large-packages: false
6565
tool-cache: true
6666

67+
- uses: nick-fields/retry@v3
68+
with:
69+
max_attempts: 5
70+
timeout_minutes: 10
71+
command: ./src/docker/pull.sh --no-debug
72+
6773
- name: Install
6874
uses: pnpm/action-setup@v4
6975
with:

docs/introduction/file_formats/images.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Supported Image File Formats
22

3-
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).
3+
Read and write to and from an [`Image`](../../typescript/interface_types/Image).
44

55
- [AIM,ISQ](https://www.scanco.ch/en/support/customer-login/faq-customers/faq-customers-import-export.html)
66
- [BioRad](https://www.bio-rad.com/)
@@ -18,6 +18,4 @@ Read and write to and from [`Image`](/typescript/interface_types/Image.html) is
1818
- [NIfTI](https://nifti.nimh.nih.gov/nifti-1)
1919
- [NRRD](http://teem.sourceforge.net/nrrd/format.html)
2020
- [VTK legacy file format for images](https://www.vtk.org/VTK/img/file-formats.pdf)
21-
- [Varian FDF](https://github.com/InsightSoftwareConsortium/ITKIOFDF)
22-
23-
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)).
21+
- [Varian FDF](https://github.com/InsightSoftwareConsortium/ITKIOFDF)

docs/introduction/file_formats/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Support for data serialized in file formats are a critical bridge that facilitate comprehensive analysis with a suite of diverse software tools.
44

5-
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.
5+
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.
66

77
## ITK-Wasm file formats
88

@@ -17,6 +17,7 @@ ITK-Wasm file formats are available in ITK-Wasm IO functions but also in C++ via
1717
<dl>
1818
<dt><b>ITK-Wasm Image (.iwi, .iwi.cbor, .iwi.cbor.zst)</b><dt><dd>Serialization of an <a href="../../typescript/interface_types/Image.html"><code>Image</code></a>.</dd>
1919
<dt><b>ITK-Wasm Mesh (.iwm, .iwm.cbor, .iwm.cbor.zst)</b><dt><dd>Serialization of a <a href="../../typescript/interface_types/Mesh.html"><code>Mesh</code></a>, or <a href="../../typescript/interface_types/PolyData.html"><code>PolyData</code></a>.</dd>
20+
<dt><b>ITK-Wasm Transform (.iwt, .iwt.cbor, .iwt.cbor.zst)</b><dt><dd>Serialization of an <a href="../../typescript/interface_types/TransformList.html"><code>TransformList</code></a>.</dd>
2021
</dl>
2122

2223

@@ -26,5 +27,6 @@ ITK-Wasm file formats are available in ITK-Wasm IO functions but also in C++ via
2627
2728
images.md
2829
meshes.md
30+
transforms.md
2931
dicom.md
3032
```
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Supported Mesh and Point Set File Formats
22

3-
Read and write to and from [`Mesh`](/typescript/interface_types/Mesh.html) is supported.
3+
Read and write to and from [`Mesh`](../../typescript/interface_types/Mesh) is supported.
44

55
- [BYU](http://www.eg-models.de/formats/Format_Byu.html)
66
- [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
99
- [SWC Neuron Morphology](https://swc-specification.readthedocs.io/en/latest/)
1010
- [OBJ](https://en.wikipedia.org/wiki/Wavefront_.obj_file)
1111
- [VTK legacy file format for vtkPolyData](https://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf)
12-
13-
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)).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Supported Transform File Formats
2+
3+
Read and write to and from a spatial [`TransformList`](../../typescript/interface_types/TransformList).
4+
5+
- [ITK-HDF5](https://support.hdfgroup.org/HDF5/) - ITK HDF5 transform file format.
6+
- [ITK-TXT](https://docs.itk.org) - ITK Legacy text transform file format.
7+
- [MAT](https://www.mathworks.com/help/matlab/ref/matfile.html) - ITK MAT file format.
8+
- [XFM](https://github.com/BIC-MNI/minc-tools) - MNI XFM file format.

docs/typescript/interface_types/Image.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Image
22

3-
An `Image` is the N-dimensional image data structure for *itk-wasm*.
3+
An `Image` is the N-dimensional image data structure for *ITK-Wasm*.
44

55
`Image` is a JavaScript object with the following properties:
66

@@ -19,6 +19,4 @@ Note that the `origin`, `spacing`, `direction`, and `size` are indexed with an `
1919

2020
```
2121
const tensor = tf.tensor(image.data, image.size.reverse())
22-
```
23-
24-
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).
22+
```
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Transform
2+
3+
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:
4+
5+
- `transformType`: The [TransformType](./TransformType) for this transform.
6+
- `numberOfFixedParameters`: The number of fixed parameters for the transform. Fixed parameters are not optimized during registration.
7+
- `numberOfParameters`: The number of parameters for the transform.
8+
- `name`: An optional name string that describes this transform.
9+
- `inputSpaceName`: An optional name string that describes the input space.
10+
- `outputSpaceName`: An optional name string that describes the output space.
11+
- `parameters`: A [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) containing the transform parameters.
12+
- `fixedParameters`: A [`TypedArray`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) containing the fixed transform parameters.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# TransformList
2+
3+
A `TransformList` is an ordered sequence of spatial [`Transform`](./Transform) objects.
4+
5+
`TransformList` is a JavaScript array of `Transform` objects.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# TransformParameterizations
2+
3+
The enumeration of transform parameterization values is:
4+
5+
- `Composite`
6+
- `Identity`
7+
- `Translation`
8+
- `Euler2D`
9+
- `Euler3D`
10+
- `Rigid2D`
11+
- `Rigid3D`
12+
- `Rigid3DPerspective`
13+
- `Versor`
14+
- `VersorRigid3D`
15+
- `Scale`
16+
- `ScaleLogarithmic`
17+
- `ScaleSkewVersor3D`
18+
- `Similarity2D`
19+
- `Similarity3D`
20+
- `QuaternionRigid`
21+
- `Affine`
22+
- `ScalableAffine`
23+
- `AzimuthElevationToCartesian`
24+
- `BSpline`
25+
- `BSplineSmoothingOnUpdateDisplacementField`
26+
- `ConstantVelocityField`
27+
- `DisplacementField`
28+
- `GaussianSmoothingOnUpdateDisplacementField`
29+
- `GaussianExponentialDiffeomorphic`
30+
- `VelocityField`
31+
- `TimeVaryingVelocityField`
32+
- `GaussianSmoothingOnUpdateTimeVaryingVelocityField`
33+
34+
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).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# TransformType
2+
3+
An `TransformType` describes parameterization, parameter value type, and input and output dimensions of the transform. It is a JavaScript object with the following properties:
4+
5+
- `transformParameterization`: The [TransformParameterization](./TransformParameterizations) for this transform.
6+
- `parametersValueType`: Whether the transform parameters are `float32` or `float64`.
7+
- `inputDimension`: The number of dimensions of the input space.
8+
- `outputDimension`: The number of dimensions of the output space.

0 commit comments

Comments
 (0)