Home util plot cluster

Documentation for CCNY Human Brain Mapping Golang library

import "hbm/cluster"

The index below has links to each function in the current library. Click on one of the links to jump to the documentation for that function/struct/interface.

Overview

Index

Package files

ClusterNode.go cluster.go

func ClusterFromFile

func ClusterFromFile(fulldatafilepat string, MEPcol, NumNodes, numrep int, NodeThresh float32) []*ClusterNode

ClusterFromFile returns an array of nodes based off of a csv file which have been clustered based on either default or inputted values

type ClusterNode

type ClusterNode struct {
    X, Y, Z float32
    Pts     hbmutil.Matrixf
    Curpts  int
    Maxpts  int
}

ClusterNode is a self-updating struct that keeps track of the points belonging to it as well as the centroid.

func MakeNode

func MakeNode(cap int) *ClusterNode

MakeNode is the constructor function for making a new empty clusternode

func NewNodePts

func NewNodePts(x, y, z, v float32, cap int) *ClusterNode

NewNodePts is a constructor function where the first point is initialized

func (*ClusterNode) Add

func (cn *ClusterNode) Add(x, y, z, amp float32)

Add is a constructor function for adding a point to the node, which triggers the recalculation of the centroid

func (*ClusterNode) ToOrigin

func (cn *ClusterNode) ToOrigin() float32

ToOrigin will quickly calculate the distance between the centroid of the node to the origin (0,0,0)

func (*ClusterNode) ToPoint

func (cn *ClusterNode) ToPoint(x, y, z float32) float32

ToPoint will return the distance between the given point and the centroid of the node