npm package: @itk-wasm/mesh-io
Description: Input and output for scientific and medical image file formats.
Latest version: 1.7.1

# @itk-wasm/mesh-io

[![npm version](https://badge.fury.io/js/@itk-wasm%2Fmesh-io.svg)](https://www.npmjs.com/package/@itk-wasm/mesh-io)

> Input and output for mesh file formats.

[💻 **Live API Demo** ✨](https://insightsoftwareconsortium.github.io/ITK-Wasm/mesh-io/ts/app/ ':include :type=iframe width=100% height=800px')

[🕮 **Documentation** 📚](https://insightsoftwareconsortium.github.io/ITK-Wasm/mesh-io/ts/docs/)

## Installation

```sh
npm install @itk-wasm/mesh-io
```

## Usage

### Browser interface

Import:

```js
import {
  readMesh,
  writeMesh,
  readPointSet,
  writePointSet,
  byuReadMesh,
  byuWriteMesh,
  freeSurferAsciiReadMesh,
  freeSurferAsciiWriteMesh,
  freeSurferBinaryReadMesh,
  freeSurferBinaryWriteMesh,
  mz3ReadMesh,
  mz3WriteMesh,
  objReadMesh,
  objWriteMesh,
  offReadMesh,
  offWriteMesh,
  stlReadMesh,
  stlWriteMesh,
  swcReadMesh,
  swcWriteMesh,
  vtkPolyDataReadMesh,
  vtkPolyDataWriteMesh,
  wasmReadMesh,
  wasmWriteMesh,
  wasmZstdReadMesh,
  wasmZstdWriteMesh,
  mz3ReadPointSet,
  mz3WritePointSet,
  objReadPointSet,
  objWritePointSet,
  offReadPointSet,
  offWritePointSet,
  vtkPolyDataReadPointSet,
  vtkPolyDataWritePointSet,
  wasmReadPointSet,
  wasmWritePointSet,
  wasmZstdReadPointSet,
  wasmZstdWritePointSet,
  setPipelinesBaseUrl,
  getPipelinesBaseUrl,
} from "@itk-wasm/mesh-io"
```

#### readMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function readMesh(
  serializedMesh: File | BinaryFile,
  options: ReadMeshOptions = {}
) : Promise<ReadMeshResult>
```

|     Parameter    |             Type            | Description                                                                                                                                                  |
| :--------------: | :-------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `serializedMesh` |     *File | BinaryFile*     | Input mesh serialized in the file format                                                                                                                     |

**`ReadMeshOptions` interface:**

|      Property     |    Type   | Description                                         |
| :---------------: | :-------: | :-------------------------------------------------- |
| `informationOnly` | *boolean* | Only read image metadata -- do not read pixel data. |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.  

**`ReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |

#### writeMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function writeMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: WriteMeshOptions = {}
) : Promise<WriteMeshResult>
```

|     Parameter    |             Type            | Description                                                                                                                                                  |
| :--------------: | :-------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      `mesh`      |            *Mesh*           | Input mesh                                                                                                                                                   |
| `serializedMesh` |           *string*          | Output mesh                                                                                                                                                  |

**`WriteMeshOptions` interface:**

|      Property     |    Type   | Description                                              |
| :---------------: | :-------: | :------------------------------------------------------- |
| `informationOnly` | *boolean* | Only write image metadata -- do not write pixel data.    |
|  `useCompression` | *boolean* | Use compression in the written file, if supported        |
|  `binaryFileType` | *boolean* | Use a binary file type in the written file, if supported |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.  

**`WriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |

#### readPointSet

*Read a pointSet file format and convert it to the itk-wasm file format*

```ts
async function readPointSet(
  serializedPointSet: File | BinaryFile,
  options: ReadPointSetOptions = {}
) : Promise<ReadPointSetResult>
```

|     Parameter    |             Type            | Description                                                                                                                                                  |
| :--------------: | :-------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `serializedPointSet` |     *File | BinaryFile*     | Input pointSet serialized in the file format                                                                                                                     |

**`ReadPointSetOptions` interface:**

|      Property     |    Type   | Description                                         |
| :---------------: | :-------: | :-------------------------------------------------- |
| `informationOnly` | *boolean* | Only read image metadata -- do not read pixel data. |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.  

**`ReadPointSetResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |
|    `pointSet`   |      *PointSet*      | Output pointSet                                                              |

#### writePointSet

*Write an itk-wasm file format converted to an pointSet file format*

```ts
async function writePointSet(
  pointSet: PointSet,
  serializedPointSet: string,
  options: WritePointSetOptions = {}
) : Promise<WritePointSetResult>
```

|     Parameter    |             Type            | Description                                                                                                                                                  |
| :--------------: | :-------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|      `pointSet`      |            *PointSet*           | Input pointSet                                                                                                                                                   |
| `serializedPointSet` |           *string*          | Output pointSet                                                                                                                                                  |

**`WritePointSetOptions` interface:**

|      Property     |    Type   | Description                                              |
| :---------------: | :-------: | :------------------------------------------------------- |
| `informationOnly` | *boolean* | Only write image metadata -- do not write pixel data.    |
|  `useCompression` | *boolean* | Use compression in the written file, if supported        |
|  `binaryFileType` | *boolean* | Use a binary file type in the written file, if supported |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.  

**`WritePointSetResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |
| `serializedPointSet` |   *BinaryFile*   | Output pointSet                                                                 |

#### byuReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function byuReadMesh(
  serializedMesh: File | BinaryFile,
  options: ByuReadMeshOptions = {}
) : Promise<ByuReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`ByuReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`ByuReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### byuWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function byuWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: ByuWriteMeshOptions = {}
) : Promise<ByuWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`ByuWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`ByuWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### freeSurferAsciiReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function freeSurferAsciiReadMesh(
  serializedMesh: File | BinaryFile,
  options: FreeSurferAsciiReadMeshOptions = {}
) : Promise<FreeSurferAsciiReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`FreeSurferAsciiReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`FreeSurferAsciiReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### freeSurferAsciiWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function freeSurferAsciiWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: FreeSurferAsciiWriteMeshOptions = {}
) : Promise<FreeSurferAsciiWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`FreeSurferAsciiWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`FreeSurferAsciiWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### freeSurferBinaryReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function freeSurferBinaryReadMesh(
  serializedMesh: File | BinaryFile,
  options: FreeSurferBinaryReadMeshOptions = {}
) : Promise<FreeSurferBinaryReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`FreeSurferBinaryReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`FreeSurferBinaryReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### freeSurferBinaryWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function freeSurferBinaryWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: FreeSurferBinaryWriteMeshOptions = {}
) : Promise<FreeSurferBinaryWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`FreeSurferBinaryWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`FreeSurferBinaryWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### mz3ReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function mz3ReadMesh(
  serializedMesh: File | BinaryFile,
  options: Mz3ReadMeshOptions = {}
) : Promise<Mz3ReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`Mz3ReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`Mz3ReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### mz3WriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function mz3WriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: Mz3WriteMeshOptions = {}
) : Promise<Mz3WriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`Mz3WriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`Mz3WriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |


#### objReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function objReadMesh(
  serializedMesh: File | BinaryFile,
  options: ObjReadMeshOptions = {}
) : Promise<ObjReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`ObjReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`ObjReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### objWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function objWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: ObjWriteMeshOptions = {}
) : Promise<ObjWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`ObjWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`ObjWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### offReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function offReadMesh(
  serializedMesh: File | BinaryFile,
  options: OffReadMeshOptions = {}
) : Promise<OffReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`OffReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`OffReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### offWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function offWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: OffWriteMeshOptions = {}
) : Promise<OffWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`OffWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`OffWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### stlReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function stlReadMesh(
  serializedMesh: File | BinaryFile,
  options: StlReadMeshOptions = {}
) : Promise<StlReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`StlReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`StlReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### stlWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function stlWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: StlWriteMeshOptions = {}
) : Promise<StlWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`StlWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`StlWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### swcReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function swcReadMesh(
  serializedMesh: File | BinaryFile,
  options: SwcReadMeshOptions = {}
) : Promise<SwcReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`SwcReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`SwcReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### swcWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function swcWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: SwcWriteMeshOptions = {}
) : Promise<SwcWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`SwcWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`SwcWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### vtkPolyDataReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function vtkPolyDataReadMesh(
  serializedMesh: File | BinaryFile,
  options: VtkPolyDataReadMeshOptions = {}
) : Promise<VtkPolyDataReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`VtkPolyDataReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`VtkPolyDataReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### vtkPolyDataWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function vtkPolyDataWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: VtkPolyDataWriteMeshOptions = {}
) : Promise<VtkPolyDataWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`VtkPolyDataWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`VtkPolyDataWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### wasmReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function wasmReadMesh(
  serializedMesh: File | BinaryFile,
  options: WasmReadMeshOptions = {}
) : Promise<WasmReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`WasmReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`WasmReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### wasmWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function wasmWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: WasmWriteMeshOptions = {}
) : Promise<WasmWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`WasmWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`WasmWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### wasmZstdReadMesh

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function wasmZstdReadMesh(
  serializedMesh: File | BinaryFile,
  options: WasmZstdReadMeshOptions = {}
) : Promise<WasmZstdReadMeshResult>
```

|     Parameter    |         Type        | Description                              |
| :--------------: | :-----------------: | :--------------------------------------- |
| `serializedMesh` | *File | BinaryFile* | Input mesh serialized in the file format |

**`WasmZstdReadMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only read image metadata -- do not read pixel data.                                                                                                   |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`WasmZstdReadMeshResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |
| `webWorker` |     *Worker*     | WebWorker used for computation.                                          |

#### wasmZstdWriteMesh

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function wasmZstdWriteMesh(
  mesh: Mesh,
  serializedMesh: string,
  options: WasmZstdWriteMeshOptions = {}
) : Promise<WasmZstdWriteMeshResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`WasmZstdWriteMeshOptions` interface:**

|      Property     |             Type            | Description                                                                                                                                           |
| :---------------: | :-------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `informationOnly` |          *boolean*          | Only write image metadata -- do not write pixel data.                                                                                                 |
|  `useCompression` |          *boolean*          | Use compression in the written file, if supported                                                                                                     |
|  `binaryFileType` |          *boolean*          | Use a binary file type in the written file, if supported                                                                                              |
|    `webWorker`    | *null or Worker or boolean* | WebWorker for computation. Set to null to create a new worker. Or, pass an existing worker. Or, set to `false` to run in the current thread / worker. |
|      `noCopy`     |          *boolean*          | When SharedArrayBuffer's are not available, do not copy inputs.                                                                                       |

**`WasmZstdWriteMeshResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If false, the output mesh is not valid. |
| `serializedMesh` |   *BinaryFile*   | Output mesh                                                                 |
|    `webWorker`   |     *Worker*     | WebWorker used for computation.                                             |

#### setPipelinesBaseUrl

*Set base URL for WebAssembly assets when vendored.*

```ts
function setPipelinesBaseUrl(
  baseUrl: string | URL
) : void
```

#### getPipelinesBaseUrl

*Get base URL for WebAssembly assets when vendored.*

```ts
function getPipelinesBaseUrl() : string | URL
```


### Node interface

Import:

```js
import {
  readMeshNode,
  writeMeshNode,
  readPointSetNode,
  writePointSetNode,
  byuReadMeshNode,
  byuWriteMeshNode,
  freeSurferAsciiReadMeshNode,
  freeSurferAsciiWriteMeshNode,
  freeSurferBinaryReadMeshNode,
  freeSurferBinaryWriteMeshNode,
  mz3ReadMeshNode,
  mz3WriteMeshNode,
  objReadMeshNode,
  objWriteMeshNode,
  offReadMeshNode,
  offWriteMeshNode,
  stlReadMeshNode,
  stlWriteMeshNode,
  swcReadMeshNode,
  swcWriteMeshNode,
  vtkPolyDataReadMeshNode,
  vtkPolyDataWriteMeshNode,
  wasmReadMeshNode,
  wasmWriteMeshNode,
  wasmZstdReadMeshNode,
  wasmZstdWriteMeshNode,
  mz3ReadPointSetNode,
  mz3WritePointSetNode,
  objReadPointSetNode,
  objWritePointSetNode,
  offReadPointSetNode,
  offWritePointSetNode,
  vtkPolyDataReadPointSetNode,
  vtkPolyDataWritePointSetNode,
  wasmReadPointSetNode,
  wasmWritePointSetNode,
  wasmZstdReadPointSetNode,
  wasmZstdWritePointSetNode,
} from "@itk-wasm/mesh-io"
```

#### byuReadMeshNode

*Read a mesh file format and convert it to the itk-wasm file format*

```ts
async function byuReadMeshNode(
  serializedMesh: string,
  options: ByuReadMeshNodeOptions = {}
) : Promise<ByuReadMeshNodeResult>
```

|     Parameter    |   Type   | Description                              |
| :--------------: | :------: | :--------------------------------------- |
| `serializedMesh` | *string* | Input mesh serialized in the file format |

**`ByuReadMeshNodeOptions` interface:**

|      Property     |    Type   | Description                                         |
| :---------------: | :-------: | :-------------------------------------------------- |
| `informationOnly` | *boolean* | Only read image metadata -- do not read pixel data. |

**`ByuReadMeshNodeResult` interface:**

|   Property  |       Type       | Description                                                              |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| `couldRead` | *JsonCompatible* | Whether the input could be read. If false, the output mesh is not valid. |
|    `mesh`   |      *Mesh*      | Output mesh                                                              |

#### byuWriteMeshNode

*Write an itk-wasm file format converted to an mesh file format*

```ts
async function byuWriteMeshNode(
  mesh: Mesh,
  serializedMesh: string,
  options: ByuWriteMeshNodeOptions = {}
) : Promise<ByuWriteMeshNodeResult>
```

|     Parameter    |   Type   | Description |
| :--------------: | :------: | :---------- |
|      `mesh`      |  *Mesh*  | Input mesh  |
| `serializedMesh` | *string* | Output mesh |

**`ByuWriteMeshNodeOptions` interface:**

|      Property     |    Type   | Description                                              |
| :---------------: | :-------: | :------------------------------------------------------- |
| `informationOnly` | *boolean* | Only write image metadata -- do not write pixel data.    |
|  `useCompression` | *boolean* | Use compression in the written file, if supported        |
|  `binaryFileType` | *boolean* | Use a binary file type in the written file, if supported |

**`ByuWriteMeshNodeResult` interface:**

|     Property     |       Type       | Description                                                                 |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
|   `couldWrite`   | *JsonCompatible* | Whether the input could be written. If f