Skip to content

Commit bd85277

Browse files
authored
Merge pull request #1005 from thewtex/image-io-node-doc
docs(image-io): Add readImageNode, writeImageNode to README
2 parents bbf6f3c + 83969b2 commit bd85277

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

packages/image-io/typescript/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,6 +1660,8 @@ Import:
16601660

16611661
```js
16621662
import {
1663+
readImageNode,
1664+
writeImageNode,
16631665
bioRadReadImageNode,
16641666
bioRadWriteImageNode,
16651667
bmpReadImageNode,
@@ -1709,6 +1711,48 @@ import {
17091711
} from "@itk-wasm/image-io"
17101712
```
17111713

1714+
#### readImageNode
1715+
1716+
1717+
*Read an image file format and convert it to an itk-wasm Image.*
1718+
1719+
```ts
1720+
async function readImageNode(
1721+
serializedImage: string,
1722+
options: ReadImageOptions = {}
1723+
) : Promise<Image>
1724+
```
1725+
1726+
| Parameter | Type | Description |
1727+
| :---------------: | :-----------------: | :---------------------------------------- |
1728+
| `serializedImage` | *string* | Input image serialized in the file format. |
1729+
1730+
**`ReadImageOptions` interface:**
1731+
1732+
| Property | Type | Description |
1733+
| :---------------: | :-------: | :-------------------------------------------------- |
1734+
| `informationOnly` | *boolean* | Only read image metadata -- do not read pixel data. |
1735+
| `componentType` | *typeof IntTypes or typeof FloatTypes* | Component type, from itk-wasm IntTypes, FloatTypes, for the output pixel components. Defaults to the input component type. |
1736+
| `pixelType` | *typeof PixelTypes* | Pixel type, from itk-wasm PixelTypes, for the output pixels. Defaults to the input pixel type. |
1737+
1738+
#### writeImageNode
1739+
1740+
*Write an itk-wasm Image converted to an image file format*
1741+
1742+
```ts
1743+
async function writeImageNode(
1744+
image: Image,
1745+
serializedImage: string,
1746+
options: WriteImageOptions = {}
1747+
) : void
1748+
```
1749+
1750+
| Parameter | Type | Description |
1751+
| :---------------: | :------: | :------------------------------------------ |
1752+
| `image` | *Image* | Input image |
1753+
| `serializedImage` | *string* | Output image serialized in the file format. |
1754+
1755+
17121756
#### bioRadReadImageNode
17131757

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

0 commit comments

Comments
 (0)