Add DICOM file truncation function