def remove_extension(self):
        hdr = self.nii_img.get_header()
        target_idx = None
        for idx, ext in enumerate(hdr.extensions):
            if id(ext) == id(self.meta_ext):
                target_idx = idx
                break
        else:
            raise IndexError('Extension not found in header')
        del hdr.extensions[target_idx]
        # Nifti1Image.update_header will increase this if necessary
        hdr['vox_offset'] = 0
Remove the DcmMetaExtension from the header of nii_img. The
dataset/ETHPy150Open moloney/dcmstack/src/dcmstack/dcmmeta.py/NiftiWrapper.remove_extension