How to convert DICOM file series to nrrd

Hello guys. I am a beginner. I use itk.js in front-end(JavaScript).
I can read DICOM files in my program the problem is that i don’t know how to convert it to nrrd.
Currently It’s an array that i made with readImageDICOMFileSeries function.
Thank you for your help.

Does this post help you? If not, @matt.mccormick might want to pitch in.

I read the article already, unfortunately It’s not enough because I have to do the conversion and anonymization fully on the frontend.

Hi @nyuszi ,

You can convert to a NRRD with writeImageArrayBuffer. Use the .nrrd extension in the fileName.

Thanks for your answer @matt.mccormick!

I got some new problems,
when i try to use the following line:
nrrdFile = writeImageArrayBuffer(null, false,image,“filename.nrrd”,“nrrd”);

I got this error:
“WorkerGlobalScope.importScripts: Failed to load worker script at …/ImageIOs/itkNrrdImageIOJSBindingWasm.js (nsresult = 0x804b001d)”

My second question is how can i parse a dicom series? If I interpret this correctly writeImageArrayBuffer only parses a slice of that image.