FractalDimension
Fractal dimension: how much the trace fills the plane, 1 (smooth) to 2 (filling).
data
dimension
- Type name
signal:FractalDimension- Plane
signal- Tags
analysis- Language
python- Tier
in-process- Bundle
complexity- Source
node-bundles/complexity/fractal_dimension.py- Availability
- available
Slots
| Slot | Direction | Type | |
|---|---|---|---|
data | input | ARRAY | |
dimension | output | ARRAY |
Parameters
fractal
| Name | Type | Default | Range | Doc |
|---|---|---|---|---|
method | string | petrosian | petrosian | katz | higuchi | Petrosian counts turns, Katz measures path length, Higuchi reads several scales. |
kmax | int | 10 | 2 … 100 | Higuchi only: the coarsest scale read. |
common
| Name | Type | Default | Range | Doc |
|---|---|---|---|---|
autotrigger | bool | false | Run on the node's own schedule, instead of waiting for an input frame. Turn this on for sources; leave it off for transforms driven by their input. | |
max_frequency | float | 0 | 0 … 100 | Rate cap for this node, read through `frequency_mode`. 0 means uncapped — the node runs as often as the scheduler and its inputs allow. |
frequency_mode | string | updates_per_second | updates_per_second | seconds_per_update | How to read `max_frequency`: as a rate in Hz (updates per second), or as a period in seconds between updates — convenient for very slow nodes. |
Source
The current source of this node, as it stands in the goofi repository at node-bundles/complexity/fractal_dimension.py.
"""FractalDimension — how much a signal's trace fills the plane, from antropy.
A smooth curve scores near 1 and a trace that fills its box approaches 2. Three estimators
under one `method`: Petrosian counts turns, Katz measures path length, Higuchi reads the length
at several scales and is the slowest. The last axis is time and is consumed; every axis before
it survives.
"""
import antropy
import numpy as np
import goofi
class FractalDimension(goofi.Node):
"""Fractal dimension: how much the trace fills the plane, 1 (smooth) to 2 (filling)."""
TAGS = ["analysis"]
INPUTS = {"data": goofi.InputSlot(goofi.DataType.ARRAY, required=True)}
OUTPUTS = {"dimension": goofi.DataType.ARRAY}
PARAMS = {
"fractal": {
"method": goofi.StringParam(
"petrosian",
["petrosian", "katz", "higuchi"],
doc="Petrosian counts turns, Katz measures path length, Higuchi reads several scales.",
),
"kmax": goofi.IntParam(10, 2, 100, doc="Higuchi only: the coarsest scale read."),
}
}
def process(self, data):
p = self.params.fractal
x = np.asarray(data.data, dtype=np.float64)
if p.method == "higuchi":
return np.apply_along_axis(antropy.higuchi_fd, -1, x, kmax=p.kmax).astype(np.float32)
measure = antropy.katz_fd if p.method == "katz" else antropy.petrosian_fd
return np.asarray(measure(x, axis=-1), dtype=np.float32)This reference describes goofi 3.1.0(537cd394), generated from a running instance on 2026-09-06.