Open yangsongtao1 opened 1 month ago
readImageDicomFileSeries.then() 、catch or finally not inter
code: `import { imageNames } from "@/constant/testFileList" import { readImageDicomFileSeries } from "@itk-wasm/dicom"; import axios from 'axios'
const BASE_URL = 'http://192.168.1.112:8086'
const assembleDcmUrl = (dcmUrl: string) => { return ${BASE_URL}/${dcmUrl} }
${BASE_URL}/${dcmUrl}
const getImageIds = (dcmUrlList: Array) => { return dcmUrlList.map((item) => { return assembleDcmUrl(item) }) }
Promise.all(getImageIds(imageNames).map((imageUrl: string) => { return axios.get(imageUrl, { responseType: 'arraybuffer' }) })).then(result => { const fileList = result.map((resultItem, index) => { return new File([resultItem.data], ${index}.dcm) }) readImageDicomFileSeries({ inputImages: fileList }).then(result => { console.log(result) }).catch(error => { console.log(error) }).finally(() => { console.log('finally') }) })`
${index}.dcm
I am not sure what the error being received is here.
readImageDicomFileSeries.then() 、catch or finally not inter
code: `import { imageNames } from "@/constant/testFileList" import { readImageDicomFileSeries } from "@itk-wasm/dicom"; import axios from 'axios'
const BASE_URL = 'http://192.168.1.112:8086'
const assembleDcmUrl = (dcmUrl: string) => { return
${BASE_URL}/${dcmUrl}
}const getImageIds = (dcmUrlList: Array) => {
return dcmUrlList.map((item) => {
return assembleDcmUrl(item)
})
}
Promise.all(getImageIds(imageNames).map((imageUrl: string) => { return axios.get(imageUrl, { responseType: 'arraybuffer' }) })).then(result => { const fileList = result.map((resultItem, index) => { return new File([resultItem.data],
${index}.dcm
) }) readImageDicomFileSeries({ inputImages: fileList }).then(result => { console.log(result) }).catch(error => { console.log(error) }).finally(() => { console.log('finally') }) })`