Comments (5)
Re: Question 1: that looks OK to me.
Re: Question 2: the executable will run synchronously and it should not return until your .cxx calls return
from main
.
I recently added a synchronous API for running in Node. Once it has been released, I will ping you so we can see if that fixed your problem.
from itk-wasm.
Hi @yh3ds ,
I think we are running into Node behavior where the process is exiting before the promises have resolved.
from itk-wasm.
Hi @thewtex ,
maybe but I m not sure. At least, it looks strange when I write logs to follow the process.
Indeed I get :
DEBUG - Script runned - Before read image
DEBUG - Script runned - Image read, before run pipeline
Inside js coming from cxx - START
Inside js coming from cxx - END
DEBUG - Script runned - Pipeline runned, before write output on disk
Which looks like expected.
Nonetheless, there is one last log missing (I put on when writing output on disk is over. I tested when I just read and write directly and it is printed correctly)
I can imagine two possibilities for the problem :
Question 1
Would it be possible that image coming from run node is corrupted or different than expected ?
Indeed if I log what I m going to write in case of working case (just read / write), I got :
DEBUG - Write output on disk - image : Image {
imageType:
ImageType {
dimension: 2,
componentType: 'uint8_t',
pixelType: 2,
components: 3 },
name: 'Image',
origin: [ 0, 0 ],
spacing: [ 1, 1 ],
direction: Matrix { rows: 2, columns: 2, data: [ 1, 0, 0, 1 ] },
size: [ 256, 256 ],
data:
Uint8Array [
0,
0,
0,
0,
...
But with the 'failing' pipeline, I got :
DEBUG - Write output on disk - outputs[0].data : { imageType:
{ dimension: 2,
componentType: 'uint8_t',
pixelType: 1,
components: 1 },
origin: [ 1.5, 1.5 ],
spacing: [ 4, 4 ],
direction: [ 1, 0, 0, 1 ],
size: [ 64, 64 ],
data: ArrayBuffer { byteLength: 4096 } }
But this second image looks strange isn t it ?
So maybe it is a problem with the cxx ?
Question 2
In the .cxx converted in js, we finish the script with writer->Update(); I guess we don't wait for this Update method to be finished and then we return.
So maybe the problem is just coming from this ?
We need (in a way or another) to force or cxx (converted in js) to wait the end of this Update before exiting ?
Thanks a lot,
Yves
from itk-wasm.
@yh3ds itk.js 9.2.0 has been released. Could you please try the synchronous API? i.e.
const image = readImageLocalFileSync(testInputFilePath)
const result = runPipelineNodeSync(pipelinePath, args, outputs, inputs)
[....]
from itk-wasm.
@yh3ds I assume the *Sync
functions solved your issue. If there are still problems, please re-open.
from itk-wasm.
Related Issues (20)
- Add `create-itk-wasm` package HOT 1
- support shape by 3 for output mesh, polydata points
- Direction array different with image-io round trip HOT 1
- image-io writeImage API suggetions HOT 3
- Update developer documentation for pnpm workspace
- Update examples for build configuration updates
- Improve podman support
- Bump pyodide testing version to 0.24 HOT 1
- Remove wasmtime version constraint and bump minimum supported version to Python 3.8
- Add zstd decoding support to loadEmscriptenModuleMainThread HOT 1
- Generate minified bundle for typescript package HOT 1
- Add "Why ITK-Wasm" documentation page
- Add "Getting Started" documentation page
- GPU based Image registration with itk-wasm HOT 2
- Add esbuild build example
- Add bufferedRegion property to Image
- Add rollup build example HOT 1
- Migrate vite.config.js to the top level of the bindgen typescript output
- Update vite deployment example. HOT 1
- readImageDicomFileSeries doesn't read segmentation dicom correctly HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itk-wasm.