npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@itk-wasm/mesh-io

v1.5.0

Published

Input and output for scientific and medical image file formats.

Downloads

391

Readme

@itk-wasm/mesh-io

npm version

Input and output for mesh file formats.

💻 Live API Demo

🕮 Documentation 📚

Installation

npm install @itk-wasm/mesh-io

Usage

Browser interface

Import:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

function setPipelinesBaseUrl(
  baseUrl: string | URL
) : void

getPipelinesBaseUrl

Get base URL for WebAssembly assets when vendored.

function getPipelinesBaseUrl() : string | URL

Node interface

Import:

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

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

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