Hello,
I have been trying to export the pixel data of the dcm images i read into my script to png with no success.
My goal is to be able to split a multiframe dicom in multiple png files but when i try to save the data by creating a new blob the
png files generated claims that the format is not supported.
This is the function i use in order to get the pixel data:
const calculateImages = async imageId => {
let imageArrayData = [];
const imageFrames = await cornerstone.loadImage(imageId).then(image => {
return image.data.string("x00280008");
});
for (let i = 0; i < imageFrames; i++) {
const imageData = await cornerstone.loadImage(imageId + `?frame=${i}`).then(image => {
let blob = new Blob([image.getPixelData()], { type: "image/png"});
imageArrayData[i] = blob;
});
}
return imageArrayData;
};
I do not know if the methodology is wrong but i cannot seems to find a workaround.
Hello, I have been trying to export the pixel data of the dcm images i read into my script to png with no success.
My goal is to be able to split a multiframe dicom in multiple png files but when i try to save the data by creating a new blob the png files generated claims that the format is not supported.
This is the function i use in order to get the pixel data:
I do not know if the methodology is wrong but i cannot seems to find a workaround.