Hi Forrest,
Thanks your suggestion.
I have tryed readImageDICOMFileSeries, this method will requset http://192.168.0.109:8080/itk/WebWorkers/ImageIO.worker.js
, but server not exist this file.
following is code snippet:
const testSeriesDirectory = 'http://192.168.0.109/images/'
const fileNames = ['IM-0001-0001.dcm', 'IM-0001-0002.dcm', 'IM-0001-0003.dcm']
const fetchFiles = fileNames.map(function (file) {
const path = testSeriesDirectory + file;
const axiosget = axios.get(path, { responseType: 'blob' }).catch(error => {console.log('axios get error'); console.log(error)});
return axiosget.then(function (response) {
const jsFile = new window.File([response.data], file)
return jsFile
})
.catch(error => {console.log('axios get then error'); console.log(error)})
})
const promissall = Promise.all(fetchFiles)
.catch(error => {
console.log(error)
});
const promissallthen = promissall.then(function (files) {
return readImageDICOMFileSeries(null, files)
}).catch(error => {console.log('promiss all then error'); console.log(error)});
const promissallthenthen = promissallthen.then(function ({ image, webWorker }) {
webWorker.terminate()
console.log(image.imageType.dimension)
this.imageDownloadCallback(vtkITKHelper.convertItkToVtkImage(image));
})
}
Many thanks!