class_docstr: Copy meta data from one Nifti file to another. Useful for preserving
  meta data after some processing steps.
class_docstr_tok: ["Copy","meta","data","from","one","Nifti","file","to","another",".","Useful","for","preserving","meta","data","after","some","processing","steps","."]
code: def _run_interface(self, runtime):
      src_nii = nb.load(self.inputs.src_file)
      src = NiftiWrapper(src_nii, make_empty=True)
      dest_nii = nb.load(self.inputs.dest_file)
      dest = NiftiWrapper(dest_nii, make_empty=True)
      classes = src.meta_ext.get_valid_classes()
      if self.inputs.include_classes:
          classes = [
              cls
              for cls in classes
              if cls in self.inputs.include_classes
          ]
      if self.inputs.exclude_classes:
          classes = [
              cls
              for cls in classes
              if cls not in self.inputs.exclude_classes
          ]
  
      for cls in classes:
          src_dict = src.meta_ext.get_class_dict(cls)
          dest_dict = dest.meta_ext.get_class_dict(cls)
          dest_dict.update(src_dict)
      # Update the shape and slice dimension to reflect the meta extension
      # update.
      dest.meta_ext.slice_dim = src.meta_ext.slice_dim
      dest.meta_ext.shape = src.meta_ext.shape
  
      self.out_path = op.join(
          os.getcwd(), op.basename(self.inputs.dest_file)
      )
      dest.to_filename(self.out_path)
  
      return runtime
  
imports: import os
  from os import path
  import string
  import errno
  from glob import glob
  import nibabel
  import imghdr
  from .base import TraitedSpec, DynamicTraitedSpec, InputMultiPath, File, Directory, traits, BaseInterface, isdefined, Undefined
label_desc: Use image node_id 1 for calling the CopyMeta obj's underlying member method code with example usage: obj._run_interface(runtime) and returns: runtime