FractalDimension

Fractal dimension: how much the trace fills the plane, 1 (smooth) to 2 (filling).

FractalDimension py
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

SlotDirectionType
datainputARRAY
dimensionoutputARRAY

Parameters

fractal

NameTypeDefaultRangeDoc
methodstringpetrosianpetrosian | katz | higuchiPetrosian counts turns, Katz measures path length, Higuchi reads several scales.
kmaxint102 … 100Higuchi only: the coarsest scale read.

common

NameTypeDefaultRangeDoc
autotriggerboolfalseRun 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_frequencyfloat00 … 100Rate cap for this node, read through `frequency_mode`. 0 means uncapped — the node runs as often as the scheduler and its inputs allow.
frequency_modestringupdates_per_secondupdates_per_second | seconds_per_updateHow 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.

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)

← All nodes

This reference describes goofi 3.1.0(537cd394), generated from a running instance on 2026-09-06.