def METHOD_NAME(
    slice_number,
    anat_file,
    rh_pial_surf,
    lh_pial_surf,
    rh_wm_surf,
    lh_wm_surf,
    scene_template,
):
    """Create modified .scene text file to be used for creating brainsprite PNGs later.
    NOTE: This is a Node function.
    """
    import gzip
    import os
    paths = {
        "TX_IMG": anat_file,
        "RPIAL": rh_pial_surf,
        "LPIAL": lh_pial_surf,
        "RWHITE": rh_wm_surf,
        "LWHITE": lh_wm_surf,
    }
    out_file = os.path.abspath("modified_scene.scene")
    if scene_template.endswith(".gz"):
        with gzip.open(scene_template, mode="rt") as fo:
            data = fo.read()
    else:
        with open(scene_template, "r") as fo:
            data = fo.read()
    data = data.replace("XAXIS_COORDINATE", str(slice_number))
    for template, path in paths.items():
        filename = os.path.basename(path)
        # Replace templated pathnames and filenames in local copy.
        data = data.replace(f"{template}_PATH", path)
        data = data.replace(f"{template}_NAME", filename)
    with open(out_file, "w") as fo:
        fo.write(data)
    return out_file