Load bad dicom tag spacing when uses in a server
I have a simple code to load only one dcm file. The main issue is that it perfectly works locally, but when it's deployed on a server, then the spacing is not the correct one. Instead of loading dicom tag PixelSpacing (0028, 0030), it loads ImagePixelSpacer (0018, 1164). The code is exactly the same. I compiled a bundle.js locally and then, use it in the server. vtk.js/itk.js version are same:
- vtk.js: 14.15.7
- itk.js: 13.1.3 (same issue when I upgrade to the latest version)
import readImageFile from 'itk/readImageFile';
import vtkITKHelper from 'vtk.js/Sources/Common/DataModel/ITKHelper'
static LoadImageFile(path) {
return new Promise((resolve, reject)=> {
var xhr = new XMLHttpRequest();
xhr.open("GET", path);
xhr.responseType = "blob";
xhr.addEventListener('load', function() {
const file = xhr.response;
file.lastModifiedDate = new Date();
file.name = 'file';
readImageFile(null, file)
.then(({ image: itkImage, webWorker }) => {
webWorker.terminate()
const imageData = vtkITKHelper.convertItkToVtkImage(itkImage)
// Here, the spacing of the imageData is not correct
resolve(itkImage)
})
.catch(error => {
reject(error)
})
});
xhr.send();
});
}
Thanks for your help. @finetjul
Please try the latest itk-wasm :-)
@thewtex Sorry but how can we try it when there is no documentation
@stounej There is documentation. If there is something missing, then create a helpful issue with specifics.