Skip to content

Commit

Permalink
test(itk-wasm): add transform-io for test pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Nov 13, 2024
1 parent e75fff5 commit 9fa2924
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const haveSharedArrayBuffer = typeof globalThis.SharedArrayBuffer === 'function'
const encoder = new TextEncoder()
const decoder = new TextDecoder('utf-8')

function readFileSharedArray(
function readFileSharedArray (
emscriptenModule: PipelineEmscriptenModule,
path: string
): Uint8Array {
Expand All @@ -42,7 +42,7 @@ function readFileSharedArray(
return array
}

function memoryUint8SharedArray(
function memoryUint8SharedArray (
emscriptenModule: PipelineEmscriptenModule,
byteOffset: number,
length: number
Expand All @@ -63,7 +63,7 @@ function memoryUint8SharedArray(
return array
}

function setPipelineModuleInputArray(
function setPipelineModuleInputArray (
emscriptenModule: PipelineEmscriptenModule,
dataArray: TypedArray | null,
inputIndex: number,
Expand All @@ -82,7 +82,7 @@ function setPipelineModuleInputArray(
return dataPtr
}

function setPipelineModuleInputJSON(
function setPipelineModuleInputJSON (
emscriptenModule: PipelineEmscriptenModule,
dataObject: object,
inputIndex: number
Expand All @@ -98,13 +98,13 @@ function setPipelineModuleInputJSON(
emscriptenModule.stringToUTF8(dataJSON, jsonPtr, length)
}

function getPipelineModuleOutputArray(
function getPipelineModuleOutputArray (
emscriptenModule: PipelineEmscriptenModule,
outputIndex: number,
subIndex: number,
componentType:
| (typeof IntTypes)[keyof typeof IntTypes]
| (typeof FloatTypes)[keyof typeof FloatTypes]
| (typeof IntTypes)[keyof typeof IntTypes]
| (typeof FloatTypes)[keyof typeof FloatTypes]
): TypedArray | Float32Array | Uint32Array | null {
const dataPtr = emscriptenModule.ccall(
'itk_wasm_output_array_address',
Expand All @@ -123,7 +123,7 @@ function getPipelineModuleOutputArray(
return data
}

function getPipelineModuleOutputJSON(
function getPipelineModuleOutputJSON (
emscriptenModule: PipelineEmscriptenModule,
outputIndex: number
): object {
Expand All @@ -138,7 +138,7 @@ function getPipelineModuleOutputJSON(
return dataObject
}

function runPipelineEmscripten(
function runPipelineEmscripten (
pipelineModule: PipelineEmscriptenModule,
args: string[],
outputs: PipelineOutput[] | null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"devDependencies": {
"@itk-wasm/image-io": "workspace:*",
"@itk-wasm/mesh-io": "workspace:*",
"@itk-wasm/transform-io": "workspace:*",
"@itk-wasm/demo-app": "workspace:*",
"@types/node": "^20.2.5",
"esbuild": "^0.19.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineConfig({
format: 'es'
},
optimizeDeps: {
exclude: ['itk-wasm', '@itk-wasm/image-io', '@itk-wasm/mesh-io', '@thewtex/zstddec']
exclude: ['itk-wasm', '@itk-wasm/image-io', '@itk-wasm/mesh-io', '@itk-wasm/transform-io', '@thewtex/zstddec']
},
plugins: [
// put lazy loaded JavaScript and Wasm bundles in dist directory
Expand All @@ -27,6 +27,7 @@ export default defineConfig({
{ src: '../../../dist/pipelines/*', dest: 'pipelines' },
{ src: '../../../node_modules/@itk-wasm/image-io/dist/pipelines/*.{js,wasm,wasm.zst}', dest: 'pipelines' },
{ src: '../../../node_modules/@itk-wasm/mesh-io/dist/pipelines/*.{js,wasm,wasm.zst}', dest: 'pipelines' },
{ src: '../../../node_modules/@itk-wasm/transform-io/dist/pipelines/*.{js,wasm,wasm.zst}', dest: 'pipelines' },
],
})
],
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9fa2924

Please sign in to comment.