@itk-wasm/mesh-io
v1.4.2
Published
Input and output for scientific and medical image file formats.
Downloads
596
Readme
@itk-wasm/mesh-io
Input and output for mesh file formats.
Installation
npm install @itk-wasm/mesh-io
Usage
Browser interface
Import:
import {
readMesh,
writeMesh,
readPointSet,
writePointSet,
byuReadMesh,
byuWriteMesh,
freeSurferAsciiReadMesh,
freeSurferAsciiWriteMesh,
freeSurferBinaryReadMesh,
freeSurferBinaryWriteMesh,
objReadMesh,
objWriteMesh,
offReadMesh,
offWriteMesh,
stlReadMesh,
stlWriteMesh,
swcReadMesh,
swcWriteMesh,
vtkPolyDataReadMesh,
vtkPolyDataWriteMesh,
wasmReadMesh,
wasmWriteMesh,
wasmZstdReadMesh,
wasmZstdWriteMesh,
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. |
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,
objReadMeshNode,
objWriteMeshNode,
offReadMeshNode,
offWriteMeshNode,
stlReadMeshNode,
stlWriteMeshNode,
swcReadMeshNode,
swcWriteMeshNode,
vtkPolyDataReadMeshNode,
vtkPolyDataWriteMeshNode,
wasmReadMeshNode,
wasmWriteMeshNode,
wasmZstdReadMeshNode,
wasmZstdWriteMeshNode,
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 false, the output mesh is not valid. |
| serializedMesh
| BinaryFile | Output mesh |
freeSurferAsciiReadMeshNode
Read a mesh file format and convert it to the itk-wasm file format
async function freeSurferAsciiReadMeshNode(
serializedMesh: string,
options: FreeSurferAsciiReadMeshNodeOptions = {}
) : Promise<FreeSurferAsciiReadMeshNodeResult>
| Parameter | Type | Description |
| :--------------: | :------: | :--------------------------------------- |
| serializedMesh
| string | Input mesh serialized in the file format |
FreeSurferAsciiReadMeshNodeOptions
interface:
| Property | Type | Description |
| :---------------: | :-------: | :-------------------------------------------------- |
| informationOnly
| boolean | Only read image metadata -- do not read pixel data. |
FreeSurferAsciiReadMeshNodeResult
interface:
| Property | Type | Description |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| couldRead
| JsonCompatible | Whether the input could be read. If false, the output mesh is not valid. |
| mesh
| Mesh | Output mesh |
freeSurferAsciiWriteMeshNode
Write an itk-wasm file format converted to an mesh file format
async function freeSurferAsciiWriteMeshNode(
mesh: Mesh,
serializedMesh: string,
options: FreeSurferAsciiWriteMeshNodeOptions = {}
) : Promise<FreeSurferAsciiWriteMeshNodeResult>
| Parameter | Type | Description |
| :--------------: | :------: | :---------- |
| mesh
| Mesh | Input mesh |
| serializedMesh
| string | Output mesh |
FreeSurferAsciiWriteMeshNodeOptions
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 |
FreeSurferAsciiWriteMeshNodeResult
interface:
| Property | Type | Description |
| :--------------: | :--------------: | :-------------------------------------------------------------------------- |
| couldWrite
| JsonCompatible | Whether the input could be written. If false, the output mesh is not valid. |
| serializedMesh
| BinaryFile | Output mesh |
freeSurferBinaryReadMeshNode
Read a mesh file format and convert it to the itk-wasm file format
async function freeSurferBinaryReadMeshNode(
serializedMesh: string,
options: FreeSurferBinaryReadMeshNodeOptions = {}
) : Promise<FreeSurferBinaryReadMeshNodeResult>
| Parameter | Type | Description |
| :--------------: | :------: | :--------------------------------------- |
| serializedMesh
| string | Input mesh serialized in the file format |
FreeSurferBinaryReadMeshNodeOptions
interface:
| Property | Type | Description |
| :---------------: | :-------: | :-------------------------------------------------- |
| informationOnly
| boolean | Only read image metadata -- do not read pixel data. |
FreeSurferBinaryReadMeshNodeResult
interface:
| Property | Type | Description |
| :---------: | :--------------: | :----------------------------------------------------------------------- |
| couldRead
| JsonCompatible | Whether the input could be read. If false, the output mesh is not valid. |
| mesh
| Mesh | Output mesh |
freeSurferBinaryWriteMeshNode
Write an itk-wasm file format converted to an mesh file format
async function freeSurferBinaryWriteMeshNode(
mesh: Mesh,
serializedMesh: string,
options: FreeSurferBinaryWriteMeshNodeOptions = {}
) : Promise<FreeSurferBinaryWriteMeshNodeResult>
| Parameter | Type | Description |
| :--------------: | :------: | :---------- |
| mesh
| Mesh | Input mesh |
| serializedMesh
| string |