1.1.0 • Published 8 months ago

@itk-wasm/transform-io v1.1.0

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

@itk-wasm/transform-io

npm version

Input and output for scientific and medical coordinate transform file formats.

Installation

npm install @itk-wasm/transform-io

Usage

Browser interface

Import:

import {
  hdf5ReadTransform,
  hdf5WriteTransform,
  matReadTransform,
  matWriteTransform,
  mncReadTransform,
  mncWriteTransform,
  txtReadTransform,
  txtWriteTransform,
  wasmReadTransform,
  wasmWriteTransform,
  wasmZstdReadTransform,
  wasmZstdWriteTransform,
  setPipelinesBaseUrl,
  getPipelinesBaseUrl,
} from "@itk-wasm/transform-io"

hdf5ReadTransform

Read an transform file format and convert it to the ITK-Wasm transform file format

async function hdf5ReadTransform(
  serializedTransform: File | BinaryFile,
  options: Hdf5ReadTransformOptions = {}
) : Promise<Hdf5ReadTransformResult>
ParameterTypeDescription
serializedTransform*FileBinaryFile*Input transform serialized in the file format

Hdf5ReadTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
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.

Hdf5ReadTransformResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform
webWorkerWorkerWebWorker used for computation.

hdf5WriteTransform

Write an ITK-Wasm transform file format converted to a transform file format

async function hdf5WriteTransform(
  transform: Transform,
  serializedTransform: string,
  options: Hdf5WriteTransformOptions = {}
) : Promise<Hdf5WriteTransformResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

Hdf5WriteTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file
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.

Hdf5WriteTransformResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.
webWorkerWorkerWebWorker used for computation.

matReadTransform

Read an transform file format and convert it to the ITK-Wasm transform file format

async function matReadTransform(
  serializedTransform: File | BinaryFile,
  options: MatReadTransformOptions = {}
) : Promise<MatReadTransformResult>
ParameterTypeDescription
serializedTransform*FileBinaryFile*Input transform serialized in the file format

MatReadTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
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.

MatReadTransformResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform
webWorkerWorkerWebWorker used for computation.

matWriteTransform

Write an ITK-Wasm transform file format converted to a transform file format

async function matWriteTransform(
  transform: Transform,
  serializedTransform: string,
  options: MatWriteTransformOptions = {}
) : Promise<MatWriteTransformResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

MatWriteTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file
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.

MatWriteTransformResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.
webWorkerWorkerWebWorker used for computation.

mncReadTransform

Read an transform file format and convert it to the ITK-Wasm transform file format

async function mncReadTransform(
  serializedTransform: File | BinaryFile,
  options: MncReadTransformOptions = {}
) : Promise<MncReadTransformResult>
ParameterTypeDescription
serializedTransform*FileBinaryFile*Input transform serialized in the file format

MncReadTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
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.

MncReadTransformResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform
webWorkerWorkerWebWorker used for computation.

mncWriteTransform

Write an ITK-Wasm transform file format converted to a transform file format

async function mncWriteTransform(
  transform: Transform,
  serializedTransform: string,
  options: MncWriteTransformOptions = {}
) : Promise<MncWriteTransformResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

MncWriteTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file
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.

MncWriteTransformResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.
webWorkerWorkerWebWorker used for computation.

txtReadTransform

Read an transform file format and convert it to the ITK-Wasm transform file format

async function txtReadTransform(
  serializedTransform: File | BinaryFile,
  options: TxtReadTransformOptions = {}
) : Promise<TxtReadTransformResult>
ParameterTypeDescription
serializedTransform*FileBinaryFile*Input transform serialized in the file format

TxtReadTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
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.

TxtReadTransformResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform
webWorkerWorkerWebWorker used for computation.

txtWriteTransform

Write an ITK-Wasm transform file format converted to a transform file format

async function txtWriteTransform(
  transform: Transform,
  serializedTransform: string,
  options: TxtWriteTransformOptions = {}
) : Promise<TxtWriteTransformResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

TxtWriteTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file
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.

TxtWriteTransformResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.
webWorkerWorkerWebWorker used for computation.

wasmReadTransform

Read an transform file format and convert it to the ITK-Wasm transform file format

async function wasmReadTransform(
  serializedTransform: File | BinaryFile,
  options: WasmReadTransformOptions = {}
) : Promise<WasmReadTransformResult>
ParameterTypeDescription
serializedTransform*FileBinaryFile*Input transform serialized in the file format

WasmReadTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
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.

WasmReadTransformResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform
webWorkerWorkerWebWorker used for computation.

wasmWriteTransform

Write an ITK-Wasm transform file format converted to a transform file format

async function wasmWriteTransform(
  transform: Transform,
  serializedTransform: string,
  options: WasmWriteTransformOptions = {}
) : Promise<WasmWriteTransformResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

WasmWriteTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file
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.

WasmWriteTransformResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.
webWorkerWorkerWebWorker used for computation.

wasmZstdReadTransform

Read an transform file format and convert it to the ITK-Wasm transform file format

async function wasmZstdReadTransform(
  serializedTransform: File | BinaryFile,
  options: WasmZstdReadTransformOptions = {}
) : Promise<WasmZstdReadTransformResult>
ParameterTypeDescription
serializedTransform*FileBinaryFile*Input transform serialized in the file format

WasmZstdReadTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
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.

WasmZstdReadTransformResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform
webWorkerWorkerWebWorker used for computation.

wasmZstdWriteTransform

Write an ITK-Wasm transform file format converted to a transform file format

async function wasmZstdWriteTransform(
  transform: Transform,
  serializedTransform: string,
  options: WasmZstdWriteTransformOptions = {}
) : Promise<WasmZstdWriteTransformResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

WasmZstdWriteTransformOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file
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.

WasmZstdWriteTransformResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.
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 {
  hdf5ReadTransformNode,
  hdf5WriteTransformNode,
  matReadTransformNode,
  matWriteTransformNode,
  mncReadTransformNode,
  mncWriteTransformNode,
  txtReadTransformNode,
  txtWriteTransformNode,
  wasmReadTransformNode,
  wasmWriteTransformNode,
  wasmZstdReadTransformNode,
  wasmZstdWriteTransformNode,
} from "@itk-wasm/transform-io"

hdf5ReadTransformNode

Read an transform file format and convert it to the ITK-Wasm transform file format

async function hdf5ReadTransformNode(
  serializedTransform: string,
  options: Hdf5ReadTransformNodeOptions = {}
) : Promise<Hdf5ReadTransformNodeResult>
ParameterTypeDescription
serializedTransformstringInput transform serialized in the file format

Hdf5ReadTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.

Hdf5ReadTransformNodeResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform

hdf5WriteTransformNode

Write an ITK-Wasm transform file format converted to a transform file format

async function hdf5WriteTransformNode(
  transform: Transform,
  serializedTransform: string,
  options: Hdf5WriteTransformNodeOptions = {}
) : Promise<Hdf5WriteTransformNodeResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

Hdf5WriteTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file

Hdf5WriteTransformNodeResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.

matReadTransformNode

Read an transform file format and convert it to the ITK-Wasm transform file format

async function matReadTransformNode(
  serializedTransform: string,
  options: MatReadTransformNodeOptions = {}
) : Promise<MatReadTransformNodeResult>
ParameterTypeDescription
serializedTransformstringInput transform serialized in the file format

MatReadTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.

MatReadTransformNodeResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform

matWriteTransformNode

Write an ITK-Wasm transform file format converted to a transform file format

async function matWriteTransformNode(
  transform: Transform,
  serializedTransform: string,
  options: MatWriteTransformNodeOptions = {}
) : Promise<MatWriteTransformNodeResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

MatWriteTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file

MatWriteTransformNodeResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.

mncReadTransformNode

Read an transform file format and convert it to the ITK-Wasm transform file format

async function mncReadTransformNode(
  serializedTransform: string,
  options: MncReadTransformNodeOptions = {}
) : Promise<MncReadTransformNodeResult>
ParameterTypeDescription
serializedTransformstringInput transform serialized in the file format

MncReadTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.

MncReadTransformNodeResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform

mncWriteTransformNode

Write an ITK-Wasm transform file format converted to a transform file format

async function mncWriteTransformNode(
  transform: Transform,
  serializedTransform: string,
  options: MncWriteTransformNodeOptions = {}
) : Promise<MncWriteTransformNodeResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

MncWriteTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file

MncWriteTransformNodeResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.

txtReadTransformNode

Read an transform file format and convert it to the ITK-Wasm transform file format

async function txtReadTransformNode(
  serializedTransform: string,
  options: TxtReadTransformNodeOptions = {}
) : Promise<TxtReadTransformNodeResult>
ParameterTypeDescription
serializedTransformstringInput transform serialized in the file format

TxtReadTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.

TxtReadTransformNodeResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform

txtWriteTransformNode

Write an ITK-Wasm transform file format converted to a transform file format

async function txtWriteTransformNode(
  transform: Transform,
  serializedTransform: string,
  options: TxtWriteTransformNodeOptions = {}
) : Promise<TxtWriteTransformNodeResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

TxtWriteTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file

TxtWriteTransformNodeResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.

wasmReadTransformNode

Read an transform file format and convert it to the ITK-Wasm transform file format

async function wasmReadTransformNode(
  serializedTransform: string,
  options: WasmReadTransformNodeOptions = {}
) : Promise<WasmReadTransformNodeResult>
ParameterTypeDescription
serializedTransformstringInput transform serialized in the file format

WasmReadTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.

WasmReadTransformNodeResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform

wasmWriteTransformNode

Write an ITK-Wasm transform file format converted to a transform file format

async function wasmWriteTransformNode(
  transform: Transform,
  serializedTransform: string,
  options: WasmWriteTransformNodeOptions = {}
) : Promise<WasmWriteTransformNodeResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

WasmWriteTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file

WasmWriteTransformNodeResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.

wasmZstdReadTransformNode

Read an transform file format and convert it to the ITK-Wasm transform file format

async function wasmZstdReadTransformNode(
  serializedTransform: string,
  options: WasmZstdReadTransformNodeOptions = {}
) : Promise<WasmZstdReadTransformNodeResult>
ParameterTypeDescription
serializedTransformstringInput transform serialized in the file format

WasmZstdReadTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.

WasmZstdReadTransformNodeResult interface:

PropertyTypeDescription
couldReadJsonCompatibleWhether the input could be read. If false, the output transform is not valid.
transformTransformOutput transform

wasmZstdWriteTransformNode

Write an ITK-Wasm transform file format converted to a transform file format

async function wasmZstdWriteTransformNode(
  transform: Transform,
  serializedTransform: string,
  options: WasmZstdWriteTransformNodeOptions = {}
) : Promise<WasmZstdWriteTransformNodeResult>
ParameterTypeDescription
transformTransformInput transform
serializedTransformstringOutput transform serialized in the file format.

WasmZstdWriteTransformNodeOptions interface:

PropertyTypeDescription
floatParametersbooleanUse float for the parameter value type. The default is double.
useCompressionbooleanUse compression in the written file

WasmZstdWriteTransformNodeResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input could be written. If false, the output transform is not valid.
serializedTransformBinaryFileOutput transform serialized in the file format.
1.1.0

8 months ago

1.0.0

10 months ago

0.1.1

11 months ago