I have an array of byte[]
which contains Dicom Images Pixeldata in memory.
I need to interpolate the images as the Z-Spacing is not proportional (ie: -1;-2;-4;-5;-7;-8;-9)
The Z-spacing needs to be adjusted to be equal between the images (-1;-2;-3;-4;-5;-6;-7;-8;-9)
So I basically need to apply this formula:
PixelValue_n = PixelValue_prior_Image + (Z_n - Z_prior_image)*(PixelValue_img+1 - PixelValue_prior_Image) / (Z_img+1 - Z_prior_image)
Is there a better way to interpolate a byte[]
array to not convert that to pixel values? Reason being is that I have images that are 8bpp, 16bpp, 24bpp and 32bpp (uncompressed) and also compressed pixel values so I rather deal with byte[]
Thanks,
Matias