how to replace pixel data on same dicom file using pydicom to read it again with any dicom viewer?
I want to treat some DICOM files, so I'm testing pydicom for my work, which I think is considerably useful. And now I want to load existing DICOM files, replace the pixel data array with another pixel array (e.g. preprocessing or literally another DICOM pixel array) and most of all, I want to treat it again with any DICOM viewer application. For this test, I used the tutorial code below. This code loads a test data file. The size of image is 64*64. The code below does subsampling from the original data. After that, the size of image is 8*8, and the result is saved to "after.dcm". But when I