Skip to content

Commit

Permalink
fix(runPipelineEmscripten): robust behavior when image.metadata is no…
Browse files Browse the repository at this point in the history
…t a Map
  • Loading branch information
thewtex committed Aug 22, 2023
1 parent 9d220ba commit 1219a1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pipeline/internal/runPipelineEmscripten.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ function runPipelineEmscripten (pipelineModule: PipelineEmscriptenModule, args:
const image = input.data as Image
const dataPtr = setPipelineModuleInputArray(pipelineModule, image.data, index, 0)
const directionPtr = setPipelineModuleInputArray(pipelineModule, image.direction, index, 1)
const metadata = typeof image.metadata?.entries !== 'undefined' ? JSON.stringify(Array.from(image.metadata.entries())) : '[]'
const imageJSON = {
imageType: image.imageType,
name: image.name,
Expand All @@ -132,7 +133,7 @@ function runPipelineEmscripten (pipelineModule: PipelineEmscriptenModule, args:
direction: `data:application/vnd.itk.address,0:${directionPtr}`,
size: image.size,
data: `data:application/vnd.itk.address,0:${dataPtr}`,
metadata: JSON.stringify(Array.from(image.metadata.entries()))
metadata
}
setPipelineModuleInputJSON(pipelineModule, imageJSON, index)
break
Expand Down

0 comments on commit 1219a1a

Please sign in to comment.