1.1.1 • Published 2 months ago

@itk-wasm/image-io v1.1.1

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

@itk-wasm/image-io

npm version

Input and output for scientific and medical image file formats.

💻 Live API Demo

🕮 Documentation 📚

Installation

npm install @itk-wasm/image-io

Usage

Browser interface

Import:

import {
  readImage,
  writeImage,
  bioRadReadImage,
  bioRadWriteImage,
  bmpReadImage,
  bmpWriteImage,
  fdfReadImage,
  fdfWriteImage,
  gdcmReadImage,
  gdcmWriteImage,
  geAdwReadImage,
  geAdwWriteImage,
  ge4ReadImage,
  ge4WriteImage,
  ge5ReadImage,
  ge5WriteImage,
  giplReadImage,
  giplWriteImage,
  hdf5ReadImage,
  hdf5WriteImage,
  jpegReadImage,
  jpegWriteImage,
  lsmReadImage,
  lsmWriteImage,
  metaReadImage,
  metaWriteImage,
  mghReadImage,
  mghWriteImage,
  mincReadImage,
  mincWriteImage,
  mrcReadImage,
  mrcWriteImage,
  niftiReadImage,
  niftiWriteImage,
  nrrdReadImage,
  nrrdWriteImage,
  pngReadImage,
  pngWriteImage,
  scancoReadImage,
  scancoWriteImage,
  tiffReadImage,
  tiffWriteImage,
  vtkReadImage,
  vtkWriteImage,
  wasmReadImage,
  wasmWriteImage,
  wasmZstdReadImage,
  wasmZstdWriteImage,
  setPipelinesBaseUrl,
  getPipelinesBaseUrl,
} from "@itk-wasm/image-io"

readImage

Read an image file format and convert it to an itk-wasm Image.

async function readImage(
  serializedImage: File | BinaryFile,
  options: ReadImageOptions = {}
) : Promise<ReadImageResult>
ParameterTypeDescription
serializedImageFile or BinaryFileInput image serialized in the file format.

ReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
componentTypetypeof IntTypes or typeof FloatTypesComponent type, from itk-wasm IntTypes, FloatTypes, for the output pixel components. Defaults to the input component type.
pixelTypetypeof PixelTypesPixel type, from itk-wasm PixelTypes, for the output pixels. Defaults to the input pixel type.
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.

ReadImageResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
imageImageOutput image

writeImage

Write an itk-wasm Image converted to an image file format

async function writeImage(
  image: Image,
  serializedImage: string,
  options: WriteImageOptions = {}
) : Promise<WriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

WriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
useCompressionbooleanUse compression in the written file
mimeTypestringMime type of the output image file.
componentTypetypeof IntTypes or typeof FloatTypesComponent type, from itk-wasm IntTypes, FloatTypes, for the output pixel components. Defaults to the input component type.
pixelTypetypeof PixelTypesPixel type, from itk-wasm PixelTypes, for the output pixels. Defaults to the input pixel type.
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.

WriteImageResult interface:

PropertyTypeDescription
webWorkerWorkerWebWorker used for computation
serializedImageBinaryFileOutput image serialized in the file format.

bioRadReadImage

Read an image file format and convert it to the itk-wasm file format

async function bioRadReadImage(
  serializedImage: File | BinaryFile,
  options: BioRadReadImageOptions = {}
) : Promise<BioRadReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

BioRadReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

BioRadReadImageResult interface:

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

bioRadWriteImage

Write an itk-wasm file format converted to an image file format

async function bioRadWriteImage(
  image: Image,
  serializedImage: string,
  options: BioRadWriteImageOptions = {}
) : Promise<BioRadWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

BioRadWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

BioRadWriteImageResult interface:

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

bmpReadImage

Read an image file format and convert it to the itk-wasm file format

async function bmpReadImage(
  serializedImage: File | BinaryFile,
  options: BmpReadImageOptions = {}
) : Promise<BmpReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

BmpReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

BmpReadImageResult interface:

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

bmpWriteImage

Write an itk-wasm file format converted to an image file format

async function bmpWriteImage(
  image: Image,
  serializedImage: string,
  options: BmpWriteImageOptions = {}
) : Promise<BmpWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

BmpWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

BmpWriteImageResult interface:

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

fdfReadImage

Read an image file format and convert it to the itk-wasm file format

async function fdfReadImage(
  serializedImage: File | BinaryFile,
  options: FdfReadImageOptions = {}
) : Promise<FdfReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

FdfReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

FdfReadImageResult interface:

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

fdfWriteImage

Write an itk-wasm file format converted to an image file format

async function fdfWriteImage(
  image: Image,
  serializedImage: string,
  options: FdfWriteImageOptions = {}
) : Promise<FdfWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

FdfWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

FdfWriteImageResult interface:

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

gdcmReadImage

Read an image file format and convert it to the itk-wasm file format

async function gdcmReadImage(
  serializedImage: File | BinaryFile,
  options: GdcmReadImageOptions = {}
) : Promise<GdcmReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

GdcmReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

GdcmReadImageResult interface:

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

gdcmWriteImage

Write an itk-wasm file format converted to an image file format

async function gdcmWriteImage(
  image: Image,
  serializedImage: string,
  options: GdcmWriteImageOptions = {}
) : Promise<GdcmWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

GdcmWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

GdcmWriteImageResult interface:

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

geAdwReadImage

Read an image file format and convert it to the itk-wasm file format

async function geAdwReadImage(
  serializedImage: File | BinaryFile,
  options: GeAdwReadImageOptions = {}
) : Promise<GeAdwReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

GeAdwReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

GeAdwReadImageResult interface:

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

geAdwWriteImage

Write an itk-wasm file format converted to an image file format

async function geAdwWriteImage(
  image: Image,
  serializedImage: string,
  options: GeAdwWriteImageOptions = {}
) : Promise<GeAdwWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

GeAdwWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

GeAdwWriteImageResult interface:

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

ge4ReadImage

Read an image file format and convert it to the itk-wasm file format

async function ge4ReadImage(
  serializedImage: File | BinaryFile,
  options: Ge4ReadImageOptions = {}
) : Promise<Ge4ReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

Ge4ReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

Ge4ReadImageResult interface:

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

ge4WriteImage

Write an itk-wasm file format converted to an image file format

async function ge4WriteImage(
  image: Image,
  serializedImage: string,
  options: Ge4WriteImageOptions = {}
) : Promise<Ge4WriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

Ge4WriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

Ge4WriteImageResult interface:

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

ge5ReadImage

Read an image file format and convert it to the itk-wasm file format

async function ge5ReadImage(
  serializedImage: File | BinaryFile,
  options: Ge5ReadImageOptions = {}
) : Promise<Ge5ReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

Ge5ReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

Ge5ReadImageResult interface:

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

ge5WriteImage

Write an itk-wasm file format converted to an image file format

async function ge5WriteImage(
  image: Image,
  serializedImage: string,
  options: Ge5WriteImageOptions = {}
) : Promise<Ge5WriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

Ge5WriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

Ge5WriteImageResult interface:

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

giplReadImage

Read an image file format and convert it to the itk-wasm file format

async function giplReadImage(
  serializedImage: File | BinaryFile,
  options: GiplReadImageOptions = {}
) : Promise<GiplReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

GiplReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

GiplReadImageResult interface:

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

giplWriteImage

Write an itk-wasm file format converted to an image file format

async function giplWriteImage(
  image: Image,
  serializedImage: string,
  options: GiplWriteImageOptions = {}
) : Promise<GiplWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

GiplWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

GiplWriteImageResult interface:

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

hdf5ReadImage

Read an image file format and convert it to the itk-wasm file format

async function hdf5ReadImage(
  serializedImage: File | BinaryFile,
  options: Hdf5ReadImageOptions = {}
) : Promise<Hdf5ReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

Hdf5ReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

Hdf5ReadImageResult interface:

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

hdf5WriteImage

Write an itk-wasm file format converted to an image file format

async function hdf5WriteImage(
  image: Image,
  serializedImage: string,
  options: Hdf5WriteImageOptions = {}
) : Promise<Hdf5WriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

Hdf5WriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

Hdf5WriteImageResult interface:

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

jpegReadImage

Read an image file format and convert it to the itk-wasm file format

async function jpegReadImage(
  serializedImage: File | BinaryFile,
  options: JpegReadImageOptions = {}
) : Promise<JpegReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

JpegReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

JpegReadImageResult interface:

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

jpegWriteImage

Write an itk-wasm file format converted to an image file format

async function jpegWriteImage(
  image: Image,
  serializedImage: string,
  options: JpegWriteImageOptions = {}
) : Promise<JpegWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

JpegWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

JpegWriteImageResult interface:

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

lsmReadImage

Read an image file format and convert it to the itk-wasm file format

async function lsmReadImage(
  serializedImage: File | BinaryFile,
  options: LsmReadImageOptions = {}
) : Promise<LsmReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

LsmReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

LsmReadImageResult interface:

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

lsmWriteImage

Write an itk-wasm file format converted to an image file format

async function lsmWriteImage(
  image: Image,
  serializedImage: string,
  options: LsmWriteImageOptions = {}
) : Promise<LsmWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

LsmWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

LsmWriteImageResult interface:

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

metaReadImage

Read an image file format and convert it to the itk-wasm file format

async function metaReadImage(
  serializedImage: File | BinaryFile,
  options: MetaReadImageOptions = {}
) : Promise<MetaReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

MetaReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

MetaReadImageResult interface:

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

metaWriteImage

Write an itk-wasm file format converted to an image file format

async function metaWriteImage(
  image: Image,
  serializedImage: string,
  options: MetaWriteImageOptions = {}
) : Promise<MetaWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

MetaWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

MetaWriteImageResult interface:

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

mghReadImage

Read an image file format and convert it to the itk-wasm file format

async function mghReadImage(
  serializedImage: File | BinaryFile,
  options: MghReadImageOptions = {}
) : Promise<MghReadImageResult>
ParameterTypeDescription
serializedImage*FileBinaryFile*Input image serialized in the file format

MghReadImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly read image metadata -- do not read pixel data.
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.

MghReadImageResult interface:

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

mghWriteImage

Write an itk-wasm file format converted to an image file format

async function mghWriteImage(
  image: Image,
  serializedImage: string,
  options: MghWriteImageOptions = {}
) : Promise<MghWriteImageResult>
ParameterTypeDescription
imageImageInput image
serializedImagestringOutput image serialized in the file format.

MghWriteImageOptions interface:

PropertyTypeDescription
informationOnlybooleanOnly write image metadata -- do not write pixel data.
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.

MghWriteImageResult interface:

PropertyTypeDescription
couldWriteJsonCompatibleWhether the input
1.1.1

2 months ago

1.1.0

4 months ago

1.0.1

4 months ago

1.0.0

4 months ago

0.5.2

5 months ago

0.5.1

5 months ago

0.5.0

6 months ago

0.4.0

6 months ago

0.3.0

7 months ago

0.2.1

7 months ago

0.2.0

7 months ago

0.1.0

7 months ago