Skip to content

Commit

Permalink
Merge pull request #1005 from thewtex/image-io-node-doc
Browse files Browse the repository at this point in the history
docs(image-io): Add readImageNode, writeImageNode to README
  • Loading branch information
thewtex authored Nov 19, 2023
2 parents bbf6f3c + 83969b2 commit bd85277
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions packages/image-io/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,8 @@ Import:

```js
import {
readImageNode,
writeImageNode,
bioRadReadImageNode,
bioRadWriteImageNode,
bmpReadImageNode,
Expand Down Expand Up @@ -1709,6 +1711,48 @@ import {
} from "@itk-wasm/image-io"
```

#### readImageNode


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

```ts
async function readImageNode(
serializedImage: string,
options: ReadImageOptions = {}
) : Promise<Image>
```

| Parameter | Type | Description |
| :---------------: | :-----------------: | :---------------------------------------- |
| `serializedImage` | *string* | Input image serialized in the file format. |

**`ReadImageOptions` interface:**

| Property | Type | Description |
| :---------------: | :-------: | :-------------------------------------------------- |
| `informationOnly` | *boolean* | Only read image metadata -- do not read pixel data. |
| `componentType` | *typeof IntTypes or typeof FloatTypes* | Component type, from itk-wasm IntTypes, FloatTypes, for the output pixel components. Defaults to the input component type. |
| `pixelType` | *typeof PixelTypes* | Pixel type, from itk-wasm PixelTypes, for the output pixels. Defaults to the input pixel type. |

#### writeImageNode

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

```ts
async function writeImageNode(
image: Image,
serializedImage: string,
options: WriteImageOptions = {}
) : void
```

| Parameter | Type | Description |
| :---------------: | :------: | :------------------------------------------ |
| `image` | *Image* | Input image |
| `serializedImage` | *string* | Output image serialized in the file format. |


#### bioRadReadImageNode

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

0 comments on commit bd85277

Please sign in to comment.