ValueError: (7FE0,0010) Pixel Data has an undefined length indicating that it's compressed, but the data isn't encapsulated as required. See pydicom.encaps.encapsulate() for more information
解决办法:
newim_array = sitk.GetArrayFromImage(newimage)
ds.PixelData = newim_array.tobytes()
ds.NumberOfFrames,ds.Rows,ds.Columns = newim_array.shape
ds.file_meta.TransferSyntaxUID = ExplicitVRLittleEndian
save_curvedicom_name = dcmFileName + '.nii.gz'
ds.save_as(save_curvedicom_name)