smooth_hrf_assignments: Smooth HRF Assignments

View source: R/find_hrf.R

smooth_hrf_assignmentsR Documentation

Smooth HRF Assignments

Description

This function tries to smooth out a voxel-wise label map of HRF assignments by iterating over each voxel, checking its neighbors, picking the "most common" neighbor label if that reduces cost, etc.

Usage

smooth_hrf_assignments(
  reassigned_hrfs,
  L_best_hrfs,
  voxel_coords,
  lambda = 0.1,
  n_iterations = 5,
  k = 6
)

Arguments

reassigned_hrfs

An integer vector of length n_voxels

L_best_hrfs

A matrix of reference HRFs for each label

voxel_coords

A matrix of voxel coordinates (n_voxels x 3), or similar

lambda

Not actually used, but left here as a param

n_iterations

Number of smoothing passes

k

Number of neighbors

Value

A vector of the same length as reassigned_hrfs, updated (smoothed)


bbuchsbaum/fmrireg documentation built on March 1, 2025, 11:20 a.m.