Hi Andrew,
As a first step, try to use the itk.js UMD module.
<script src="https://unpkg.com/itk@9.6.1/umd/itk.js"></script>
<script>
export default {
name: "Test",
methods: {
click() {
var file = document.getElementById("fileItem").files[0];
itk.readImageFile(null, file)
.then(function({ image, webWorker }) {
console.log(image);
})
.catch(error => {
console.error(error);
});
}
}
};
</script>
For an interactive example, see
Note that for a single file, use the readImageFile
API.
To support both a single-file DICOM volume and a DICOM series, see this example:
Eventually, you may want to incorporate itk.js into your Webpack build. An overview and example of this is here:
You can also use the Unpkg.com-published web workers with Webpack: