0.2.2 • Published 7 months ago

@itk-wasm/elastix v0.2.2

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

@itk-wasm/elastix

npm version

A toolbox for rigid and nonrigid registration of images.

👨‍💻 Live API Demo

🕮 Documentation 📚

Installation

npm install @itk-wasm/elastix

Usage

Browser interface

Import:

import {
  defaultParameterMap,
  elastix,
  readParameterFiles,
  writeParameterFiles,
  setPipelinesBaseUrl,
  getPipelinesBaseUrl,
  setPipelineWorkerUrl,
  getPipelineWorkerUrl,
} from "@itk-wasm/elastix"

defaultParameterMap

Returns the default elastix parameter map for a given transform type.

async function defaultParameterMap(
  webWorker: null | Worker,
  transformName: string,
  options: DefaultParameterMapOptions = {}
) : Promise<DefaultParameterMapResult>
ParameterTypeDescription
transformNamestringTransform name. One of: translation, rigid, affine, bspline, spline, groupwise

DefaultParameterMapOptions interface:

PropertyTypeDescription
numberOfResolutionsnumberNumber of multiscale registration resolutions.
finalGridSpacingnumberFinal grid spacing in physical units for bspline transforms.

DefaultParameterMapResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
parameterMapJsonCompatibleElastix parameter map representation

elastix

Rigid and non-rigid registration of images.

async function elastix(
  webWorker: null | Worker,
  parameterObject: JsonCompatible,
  transform: string,
  options: ElastixOptions = {}
) : Promise<ElastixResult>
ParameterTypeDescription
parameterObjectJsonCompatibleElastix parameter object representation
transformstringFixed-to-moving transform file

ElastixOptions interface:

PropertyTypeDescription
fixedImageFixed image
movingImageMoving image
initialTransform*stringFileBinaryFile*Initial transform to apply before registration
initialTransformParameterObjectJsonCompatibleInitial elastix transform parameter object to apply before registration. Only provide this or an initial transform.

ElastixResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
resultImageResampled moving image
transformBinaryFileFixed-to-moving transform file
transformParameterObjectJsonCompatibleElastix optimized transform parameter object representation

readParameterFiles

Read elastix parameter text files into a parameter object.

async function readParameterFiles(
  webWorker: null | Worker,
  options: ReadParameterFilesOptions = { parameterFiles: [] as TextFile[] | File[] | string[], }
) : Promise<ReadParameterFilesResult>
ParameterTypeDescription

ReadParameterFilesOptions interface:

PropertyTypeDescription
parameterFiles*string[]File[]TextFile[]*Elastix parameter files

ReadParameterFilesResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
parameterObjectJsonCompatibleElastix parameter object representation

writeParameterFiles

Write an elastix parameter text file from a parameter object.

async function writeParameterFiles(
  webWorker: null | Worker,
  parameterObject: JsonCompatible,
  parameterFiles: string[]

) : Promise<WriteParameterFilesResult>
ParameterTypeDescription
parameterObjectJsonCompatibleElastix parameter object representation.
parameterFilesstring[]Elastix parameter files, must have the same length as the number of parameter maps in the parameter object.

WriteParameterFilesResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
parameterFilesTextFile[]Elastix parameter files, must have the same length as the number of parameter maps in the parameter object.

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

setPipelineWorkerUrl

Set base URL for the itk-wasm pipeline worker script when vendored.

function setPipelineWorkerUrl(
  baseUrl: string | URL
) : void

getPipelineWorkerUrl

Get base URL for the itk-wasm pipeline worker script when vendored.

function getPipelineWorkerUrl() : string | URL

Node interface

Import:

import {
  defaultParameterMapNode,
  elastixNode,
  readParameterFilesNode,
  writeParameterFilesNode,
  setPipelinesBaseUrl,
  getPipelinesBaseUrl,
  setPipelineWorkerUrl,
  getPipelineWorkerUrl,
} from "@itk-wasm/elastix"

defaultParameterMapNode

Returns the default elastix parameter map for a given transform type.

async function defaultParameterMapNode(
  transformName: string,
  options: DefaultParameterMapOptions = {}
) : Promise<DefaultParameterMapNodeResult>
ParameterTypeDescription
transformNamestringTransform name. One of: translation, rigid, affine, bspline, spline, groupwise

DefaultParameterMapNodeOptions interface:

PropertyTypeDescription
numberOfResolutionsnumberNumber of multiscale registration resolutions.
finalGridSpacingnumberFinal grid spacing in physical units for bspline transforms.

DefaultParameterMapNodeResult interface:

PropertyTypeDescription
parameterMapJsonCompatibleElastix parameter map representation

elastixNode

Rigid and non-rigid registration of images.

async function elastixNode(
  parameterObject: JsonCompatible,
  transform: string,
  options: ElastixOptions = {}
) : Promise<ElastixNodeResult>
ParameterTypeDescription
parameterObjectJsonCompatibleElastix parameter object representation
transformstringFixed-to-moving transform file

ElastixNodeOptions interface:

PropertyTypeDescription
fixedImageFixed image
movingImageMoving image
initialTransform*stringFileBinaryFile*Initial transform to apply before registration
initialTransformParameterObjectJsonCompatibleInitial elastix transform parameter object to apply before registration. Only provide this or an initial transform.

ElastixNodeResult interface:

PropertyTypeDescription
resultImageResampled moving image
transformBinaryFileFixed-to-moving transform file
transformParameterObjectJsonCompatibleElastix optimized transform parameter object representation

readParameterFilesNode

Read elastix parameter text files into a parameter object.

async function readParameterFilesNode(
  options: ReadParameterFilesOptions = { parameterFiles: [] as string[], }
) : Promise<ReadParameterFilesNodeResult>
ParameterTypeDescription

ReadParameterFilesNodeOptions interface:

PropertyTypeDescription
parameterFiles*string[]File[]TextFile[]*Elastix parameter files

ReadParameterFilesNodeResult interface:

PropertyTypeDescription
parameterObjectJsonCompatibleElastix parameter object representation

writeParameterFilesNode

Write an elastix parameter text file from a parameter object.

async function writeParameterFilesNode(
  parameterObject: JsonCompatible,
  parameterFiles: string[]

) : Promise<WriteParameterFilesNodeResult>
ParameterTypeDescription
parameterObjectJsonCompatibleElastix parameter object representation.
parameterFilesstring[]Elastix parameter files, must have the same length as the number of parameter maps in the parameter object.

WriteParameterFilesNodeResult interface:

PropertyTypeDescription
parameterFilesTextFile[]Elastix parameter files, must have the same length as the number of parameter maps in the parameter object.
0.2.2

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.0

10 months ago