0.2.0 • Published 10 months ago

@itk-wasm/cuberille v0.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
10 months ago

@itk-wasm/cuberille

npm version

Cuberille implicit surface polygonization to generate meshes from images.

Installation

npm install @itk-wasm/cuberille

Usage

Browser interface

Import:

import {
  cuberille,
  setPipelinesBaseUrl,
  getPipelinesBaseUrl,
} from "@itk-wasm/cuberille"

cuberille

Create a mesh from an image via cuberille implicit surface polygonization.

async function cuberille(
  image: Image,
  options: CuberilleOptions = {}
) : Promise<CuberilleResult>
ParameterTypeDescription
imageImageInput image

CuberilleOptions interface:

PropertyTypeDescription
quadrilateralFacesbooleanGenerate quadrilateral faces instead of triangle faces.
verticesNotProjectedToIsoSurfacebooleanDo not project the vertices to the iso-surface.
imagePixelToCellDatabooleanWhether the adjacent input pixel value should be saved as cell data in the output mesh.
projectVertexSurfaceDistanceThresholdnumberThreshold for the distance from the iso-surface during vertex projection in pixel units. Smaller is smoother but takes longer.
projectVertexStepLengthnumberInitial step length for vertex projection in physical units. Default is max spacing * 0.25.
projectVertexStepLengthRelaxationFactornumberThe step length relaxation factor during vertex projection. The step length is multiplied by this factor each iteration to allow convergence, 0.0, 1.0.
projectVertexMaximumNumberOfStepsnumberThe maximum number of steps used during vertex projection.
generateQuadrilateralFacesbooleanGenerate quadrilateral faces instead of triangle faces.
webWorkernull or Worker or booleanWebWorker 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.
noCopybooleanWhen SharedArrayBuffer's are not available, do not copy inputs.

CuberilleResult interface:

PropertyTypeDescription
meshMeshOutput mesh.
webWorkerWorkerWebWorker 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 {
  cuberilleNode,
} from "@itk-wasm/cuberille"

cuberilleNode

Create a mesh from an image via cuberille implicit surface polygonization.

async function cuberilleNode(
  image: Image,
  options: CuberilleNodeOptions = {}
) : Promise<CuberilleNodeResult>
ParameterTypeDescription
imageImageInput image

CuberilleNodeOptions interface:

PropertyTypeDescription
quadrilateralFacesbooleanGenerate quadrilateral faces instead of triangle faces.
verticesNotProjectedToIsoSurfacebooleanDo not project the vertices to the iso-surface.
imagePixelToCellDatabooleanWhether the adjacent input pixel value should be saved as cell data in the output mesh.
projectVertexSurfaceDistanceThresholdnumberThreshold for the distance from the iso-surface during vertex projection in pixel units. Smaller is smoother but takes longer.
projectVertexStepLengthnumberInitial step length for vertex projection in physical units. Default is max spacing * 0.25.
projectVertexStepLengthRelaxationFactornumberThe step length relaxation factor during vertex projection. The step length is multiplied by this factor each iteration to allow convergence, 0.0, 1.0.
projectVertexMaximumNumberOfStepsnumberThe maximum number of steps used during vertex projection.
generateQuadrilateralFacesbooleanGenerate quadrilateral faces instead of triangle faces.

CuberilleNodeResult interface:

PropertyTypeDescription
meshMeshOutput mesh.
0.2.0

10 months ago

0.1.0

11 months ago