def _prepare_subject_output_path(output_root, subject_id):
    """Builds the path to the desired output .nwb file.

    Creates parent directories if needed.
    """
    output_dir = output_root / subject_id
    output_dir.mkdir(parents=True, exist_ok=True)
    return output_dir / f"{subject_id}_task-tapping_nirs.nwb"