Skip to content

Commit 269d582

Browse files
authored
Merge pull request #1023 from thewtex/deprecate
Deprecate
2 parents 4f58b5a + a02d709 commit 269d582

File tree

203 files changed

+447
-7046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

203 files changed

+447
-7046
lines changed

BREAKING_CHANGES.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,28 @@ For a log and guide when transitioning from itk.js to itk-wasm,
1010
please see [the migration
1111
guide](doc/content/docs/itk_js_to_itk_wasm_migration_guide.md).
1212

13+
## From 1.0.0-b.158 to 1.0.0-b.159
14+
15+
- itkConfig.js as been replaced by run-time configuration via setPipelineWorkerUrl, setPipelinesBaseUrl
16+
- readDICOMTags has been migrated to @itk-wasm/dicom and as readDicomTags
17+
- readDICOMTagsArrayBuffer has been migrated to @itk-wasm/dicom and as readDicomTags
18+
- readDICOMTagsLocalFile has been migrated to @itk-wasm/dicom and as readDicomTagsNode
19+
- readImageDICOMFileSeries has been migrated to @itk-wasm/dicom as readImageDicomFileSeries
20+
- readImageDICOMArrayBufferSeries has been migrated to @itk-wasm/dicom as readImageDicomFileSeries
21+
- readImageLocalDICOMFileSeries has been migrated to @itk-wasm/dicom as readImageDicomFileSeriesNode
22+
- meshToPolyData, meshToPolyDataNode, polyDataToMesh, polyDataToMeshNode have been migrated to @itk-wasm/mesh-to-poly-data
23+
- High level IO function have been removed: readArrayBuffer, readBlob, readFile, readLocalFile, writeLocalFile
24+
- readImageArrayBuffer has been migrated to @itk-wasm/image-io as readImageFile
25+
- readImageBlob has been migrated to @itk-wasm/image-io as readImageFile
26+
- readImageFile has been migrated to @itk-wasm/image-io as readImageFile
27+
- readImageFileSeries has been migrated to @itk-wasm/image-io readImageFileSeries
28+
- readImageLocalFile has been migrated to @itk-wasm/image-io readImageFileNode
29+
- readMeshArrayBuffer has been migrated to @itk-wasm/mesh-io readMeshFile
30+
- readMeshFile has been migrated to @itk-wasm/mesh-io readMeshFile
31+
- readMeshLocalFile has been migrated to @itk-wasm/mesh-io readMeshFileNode
32+
- writeImageArrayBuffer has been migrated to @itk-wasm/image-io writeImageFile
33+
- writeImageLocalFile has been migrated from @itk-wasm/image-io writeImageFileNode
34+
1335
## From 1.0.0-b.101 to 1.0.0-b.102
1436

1537
- apply-presentation-state-to-dicom-image does not take dicom image out flag: was not supported

dist/polydata-io/index.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

dist/umd/index.html

Lines changed: 0 additions & 40 deletions
This file was deleted.

docs/development/itk_js_to_itk_wasm_migration_guide.md

Lines changed: 77 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Migration Guide: From itk.js to itk-wasm
1+
# Migration Guide: From itk.js to ITK-Wasm
22

3-
*Note: itk-wasm is currently in the beta development stage. The interface is relatively stable while functionality is currently being fleshed out. Updates for the rest of the documentation for changes from itk.js to itk-wasm is in progress. Last updated August 5th, 2023.*
3+
*Note: ITK-Wasm is currently in the beta development stage. The interface is relatively stable while functionality is currently being fleshed out. Updates for the rest of the documentation for changes from itk.js to ITK-Wasm is in progress. Last updated December 14th, 2023.*
44

5-
**itk-wasm** is a major upgrade with a focus on universal, performant computing in WebAssembly. The itk.js to itk-wasm transition also brings improvements, including modern, elegant programming interfaces, accelerated performance, and execution beyond JavaScript thanks to [WASI](https://wasi.dev).
5+
**ITK-Wasm** is a major upgrade with a focus on universal, performant computing in WebAssembly. The itk.js to ITK-Wasm transition also brings improvements, including modern, elegant programming interfaces, accelerated performance, and execution beyond JavaScript thanks to [WASI](https://wasi.dev).
66

7-
Most itk.js client code will simply need to update its import statements to leverage itk-wasm. However, there are also other more advanced changes. A description of the changes, their motivation, and example migration code can be found below.
7+
Most itk.js client code will simply need to update its import statements to leverage ITK-Wasm. However, there are also other more advanced changes. A description of the changes, their motivation, and example migration code can be found below.
88

99
## Module import statements
1010

@@ -37,57 +37,103 @@ import { IntTypes } from 'itk-wasm'
3737

3838
## TypeScript support
3939

40-
Typescript support was added, but, of course, you can still just use JavaScript if you wish. In itk-wasm, adoption of modern JavaScript constructs was extended, e.g. classes.
40+
Typescript support was added, but, of course, you can still just use JavaScript if you wish. In ITK-Wasm, adoption of modern JavaScript constructs was extended, e.g. classes.
4141

4242
## Bundlers
4343

44-
ECMAScript Module (ESM) support was improved.
44+
ECMAScript Module (ESM) support is now standard.
4545

4646
There is now an improved approach for web workers for bundlers, CORS constraints.
4747

48+
## itkConfig.js removed
49+
50+
The `itkConfig.js` module in itk-js and initial versions of ITK-Wasm specified where to look for the io webassembly modules and an optional default base URL for pipeline modules.
51+
52+
This build-time approach has been replaced by a run-time configuration approach, which is much easier to specify and works transparently in a nested dependency situation.
53+
54+
There are now only two configuration settings.
55+
56+
1. The location of the web worker module.
57+
2. The location of wasm module assets.
58+
59+
### Specification of the web worker module location
60+
61+
By default, the web worker module will be picked up by modern bundlers like Vite or WebPack without additional configuration, and the bundler will manage the location of and deployment of the bundle in a application build.
62+
63+
ITK-Wasm packages also contain module bundle that embed the web workers.
64+
65+
Finally, on an individual ITK-Wasm package scope or bundle scope via the `itk-wasm` package, the web worker can be vendored and its location at specified at runtime via `setPipelineWorkerUrl`.
66+
67+
### Specification of the wasm asset location
68+
69+
Previously, separate wasm asset locations were configured for io modules and general pipelines. Now, there is a single wasm asset configuration. It can be set on a per-package level or a common configuration for a bundle can be set.
70+
71+
By default, the wasm asset location is configured to use the [JsDelivr](https://www.jsdelivr.com/) CDN for a package.
72+
73+
On an individual ITK-Wasm package scope or bundle scope via the `itk-wasm` package, wasm assets can be vendored and their location specified at runtime via `setPipelinesBaseUrl`.
74+
4875
## IO modules are available in separate packages.
4976

5077
IO modules are now installed in separate npm packages to limit the `itk-wasm` package size. You can install only the packages that you need.
5178

52-
The version of these packages follow the `itk-wasm` package version and should be kept in sync. The io packages are:
79+
The io packages are:
5380

54-
1. `itk-image-io`
55-
2. `itk-mesh-io`
81+
1. `@itk-wasm/image-io`
82+
2. `@itk-wasm/mesh-io`
5683
3. `@itk-wasm/dicom`
5784

58-
An example that vendors these package's webassembly assets into an application for deployment can be found in the [Webpack Example](https://github.com/InsightSoftwareConsortium/itk-wasm/tree/main/examples/Webpack).
85+
An example that vendors these package's webassembly assets into an application for deployment can be found in the [Vite-based test applcation configuration](https://github.com/InsightSoftwareConsortium/itk-wasm/blob/main/packages/mesh-io/typescript/vite.config.js).
5986

6087
### DICOM image IO functions
6188

6289
The following DICOM image IO functions have been migrated to the `@itk-wasm/dicom` package. Their interface changed in some cases.
6390

6491
1. `readImageLocalDICOMFileSeries` -> `readImageDicomFileSeriesNode`
65-
1. `readImageDICOMFileSeries` -> `readImageDicomFileSeries`
66-
1. `readImageDICOMArrayBufferSeries` -> `readImageDicomFileSeries`
67-
1. `readDICOMTags` -> `readDicomTags`
68-
1. `readDICOMTagsArrayBuffer` -> `readDicomTags`
69-
1. `readDICOMTagsLocalFile` -> `readDicomTagsNode`
92+
2. `readImageDICOMFileSeries` -> `readImageDicomFileSeries`
93+
3. `readImageDICOMArrayBufferSeries` -> `readImageDicomFileSeries`
94+
4. `readDICOMTags` -> `readDicomTags`
95+
5. `readDICOMTagsArrayBuffer` -> `readDicomTags`
96+
6. `readDICOMTagsLocalFile` -> `readDicomTagsNode`
7097

71-
## itkConfig.js content and usage
98+
### Migrated image-io and mesh-io functions
7299

73-
The `itkConfig.js` specifies where to look for the io webassembly modules and an optional default base URL for pipeline modules.
100+
The following image and mesh IO functions have been migrated to the `@itk-wasm/image-io`
101+
and `@itk-wasm/mesh-io` package. Their interface changed in some cases.
74102

75-
The default `itkConfig.js` is configured to use the [JsDelivr](https://www.jsdelivr.com/) CDN, but you may want to override this default.
103+
1. `readImageArrayBuffer` -> `readImageFile`
104+
2. `readImageBlob` -> `readImageFile`
105+
3. `readImageFileSeries` -> `readImageFileSeries`
106+
4. `readImageHTTP` -> `readImageHttp`
107+
5. `readImageLocalFile` -> `readImageNode`
108+
6. `readMeshArrayBuffer` -> `readMeshFile`
109+
7. `readMeshBlob` -> `readMeshFile`
110+
8. `readMeshLocalFile` -> `readMeshNode`
111+
9. `writeImageArrayBuffer` -> `writeImageFile`
112+
10. `writeImageLocalFile` -> `writeImageFileNode`
113+
11. `writeMeshArrayBuffer` -> `writeMeshFile`
114+
12. `writeMeshLocalFile` -> `writeMeshNode`
76115

77-
In the [Webpack Example](https://github.com/InsightSoftwareConsortium/itk-wasm/tree/main/examples/Webpack) the io webassembly module assets are vendored into `/itk` directories, this module looks like:
116+
### MeshToPolyData
78117

79-
```js
80-
const itkConfig = {
81-
pipelineWorkerUrl: '/itk/web-workers/bundles/pipeline-worker.js',
82-
imageIOUrl: '/itk/image-io',
83-
meshIOUrl: '/itk/mesh-io',
84-
pipelinesUrl: '/itk/pipelines',
85-
}
86-
87-
export default itkConfig
88-
```
118+
The following mesh to polydata conversion functions have been migrated to the `@itk-wasm/mesh-to-poly-data` package.
119+
120+
1. `meshToPolyData`
121+
2. `meshToPolyDataNode`
122+
3. `polyDataToMesh`
123+
4. `polyDataToMeshNode`
124+
125+
### Removed high level IO functions
126+
127+
The high level IO functions, that dealt with both images and meshes have been removed.
128+
129+
These are:
89130

90-
And it can be injected into an application bundle by setting defining `alias`'s to the configuration module for `../itkConfig.js` and `../../itkConfig.js`. For other override configuration options, see the [Webpack](https://github.com/InsightSoftwareConsortium/itk-wasm/tree/main/examples/Webpack) and Rollup (todo) examples.
131+
1. readArrayBuffer
132+
2. readBlob
133+
3. readFile
134+
4. readLocalFile
135+
5. writeArrayBuffer
136+
5. writeLocalFile
91137

92138
## CLI options
93139

@@ -135,7 +181,7 @@ Support for the legacy GE image file formats, i.e. GE4, GE5, GEAdw, is no longer
135181

136182
## IOTypes
137183

138-
The use of `IOTypes` in pipelines is deprecated and not expected to work in the future. These have been replaced by `InterfaceTypes`.
184+
The use of `IOTypes` in pipelines is deprecated has been removed. These have been replaced by `InterfaceTypes`.
139185

140186
## Argument order when writing image, mesh binaries
141187

karma.conf.cjs

Lines changed: 0 additions & 110 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// Common deprecated modules across browser and node.js
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import readDICOMTagsLocalFile from "./read-dicom-tags-local-file.js"
2+
export { readDICOMTagsLocalFile }
3+
4+
import readImageLocalDICOMFileSeries from "./read-image-local-dicom-file-series.js"
5+
export { readImageLocalDICOMFileSeries }
6+
7+
import meshToPolyDataNode from "./mesh-to-poly-data-node.js"
8+
export { meshToPolyDataNode }
9+
10+
import polyDataToMeshNode from "./poly-data-to-mesh-node.js"
11+
export { polyDataToMeshNode }
12+
13+
import readMeshLocalFile from "./read-mesh-local-file.js"
14+
export { readMeshLocalFile }
15+
16+
import writeImageLocalFile from "./write-image-local-file.js"
17+
export { writeImageLocalFile }
18+
19+
import readImageLocalFile from "./read-image-local-file.js"
20+
export { readImageLocalFile }

0 commit comments

Comments
 (0)