def copy_mhd_and_raw(src, dst):
<EOL>if not op.exists(src):<EOL><INDENT>raise IOError('<STR_LIT>'.format(src))<EOL><DEDENT>ext = get_extension(src)<EOL>if ext != '<STR_LIT>':<EOL><INDENT>msg = '<STR_LIT>'.format(src)<EOL>raise ValueError(msg)<EOL><DEDENT>meta_src = _read_meta_header(src)<EOL>src_raw = meta_src['<STR_LIT>']<EOL>if not op.isabs(src_raw):<EOL><INDENT>src_raw = op.join(op.dirname(src), src_raw)<EOL><DEDENT>if op.isdir(dst):<EOL><INDENT>shutil.copyfile(src, dst)<EOL>shutil.copyfile(src_raw, dst)<EOL>return dst<EOL><DEDENT>dst_raw = op.join(op.dirname(dst), remove_ext(op.basename(dst))) + '<STR_LIT>'<EOL>if get_extension(dst) != '<STR_LIT>':<EOL><INDENT>dst += '<STR_LIT>'<EOL><DEDENT>log.debug('<STR_LIT>'.format(src,     dst))<EOL>log.debug('<STR_LIT>'.format(src_raw, dst_raw))<EOL>shutil.copyfile(src, dst)<EOL>shutil.copyfile(src_raw, dst_raw)<EOL>if op.basename(dst) != op.basename(src):<EOL><INDENT>log.debug('<STR_LIT>'.format(dst, src_raw,<EOL>op.basename(dst_raw)))<EOL>meta_dst = _read_meta_header(dst)<EOL>meta_dst['<STR_LIT>'] = op.basename(dst_raw)<EOL>write_meta_header(dst, meta_dst)<EOL><DEDENT>return dst<EOL>
Copy .mhd and .raw files to dst.

    If dst is a folder, won't change the file, but if dst is another filepath,
    will modify the ElementDataFile field in the .mhd to point to the
    new renamed .raw file.

    Parameters
    ----------
    src: str
        Path to the .mhd file to be copied

    dst: str
        Path to the destination of the .mhd and .raw files.
        If a new file name is given, the extension will be ignored.

    Returns
    -------
    dst: str