nirspipe.qc.figures.common.circle_map#

The circle the inter-brain connectogram is drawn on.

Where a node sits, how a chord between two of them bows, and how a node’s label is set against the ring. The geometry is kept apart from the figure that fills it.

Groups are separated by blank circle rather than by a drawn rule. A dyad circle has two groups, the two members. Nodes are NODE_INK unless the caller passes a colour.

Module Contents#

Functions#

ring_angles

Where each node sits, in degrees, counterclockwise from start.

bezier

A chord from p0 to p2 bowed toward the middle of the circle.

node_arc

One node, as a thick arc segment of the ring rather than a dot.

radial_label

A label set along the radius, flipped on the left half so it is never upside down.

Data#

API#

nirspipe.qc.figures.common.circle_map.DYAD_GAP = 12.0#
nirspipe.qc.figures.common.circle_map.NODE_INK = '#8d9aa6'#
nirspipe.qc.figures.common.circle_map.LABEL_INK = '#2c3e50'#
nirspipe.qc.figures.common.circle_map.ring_angles(counts, gap: float = DYAD_GAP, start: float = 90.0) → numpy.ndarray#

Where each node sits, in degrees, counterclockwise from start.

counts is the size of each group in order:

ring_angles([3, 3], gap=12)  ->  the first group over the left semicircle,
                                 the second coming back up the right

Counterclockwise from the top, so with two groups the first runs down the left side and the second comes back up the right, which puts the two homologous ends of a montage facing each other across the split.

nirspipe.qc.figures.common.circle_map.bezier(p0, p2, n: int = 40) → tuple[np.ndarray, np.ndarray]#

A chord from p0 to p2 bowed toward the middle of the circle.

Quadratic, with the centre as the control point, which is what makes a pairing between two nodes that face each other read as a straight line across and one between two neighbours as a shallow arc: how far a chord bows is then how far apart its ends are.

nirspipe.qc.figures.common.circle_map.node_arc(fig, theta: float, half_width: float, hover: str, row: int, col: int, colour: str = NODE_INK, radius: float = 1.0, width: float = 9) → None#

One node, as a thick arc segment of the ring rather than a dot.

An arc spans the share of the circle the node owns, so a group of them reads as a block.

nirspipe.qc.figures.common.circle_map.radial_label(fig, theta: float, radius: float, text: str, row: int, col: int, size: float = 9, colour: str = LABEL_INK) → None#

A label set along the radius, flipped on the left half so it is never upside down.