InsightSoftwareConsortium / InsightSoftwareConsortium/ITK-Wasm
Load bad dicom tag spacing when uses in a server
- Dominant language
- Python
- Stars
- 235
- Forks
- 61
- Avg merge
- 4d 19h
- Merged PRs (30d)
- 4
Description
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
Contributor guide
Assessment
This issue has not been assessed yet.