In [1]:
import pynsn as nsn
from pynsn.image import pil_image

dot_array = nsn.DotArray(target_area_radius=100)
dot_array.add( [nsn.Dot(xy=(-65, 50), diameter=20, attribute="green"),
                nsn.Dot(xy=(25, 35), diameter=25, attribute="blue"),
                nsn.Dot(xy=(60, -50), diameter=12, attribute="darkmagenta"),
                nsn.Dot(xy=(-40, -20), diameter=37, attribute="orange"),
                nsn.Dot(xy=(-10, -5), diameter=14, attribute="black")])
PyNSN 0.13.0

Making a picture of stimulus

In [2]:
pil_image.create(dot_array)
Out[2]:

Inspect properties of the nsn stimulus

In [3]:
print(dot_array)
- DotArray
  Hash: a2c3d4c0a2dbe2c1e0111225945ce237
  Numerosity............         5.00
  Average dot diameter..        21.60
  Average perimeter.....        67.86
  Average surface area..       429.46
  Total perimeter.......       339.29
  Total surface area....      2147.28
  Field area............      9952.63
  Sparsity..............      1990.53
  Coverage..............         0.22
  Log Size..............        19.81
  Log Spacing...........        24.24

Changing some colours

In [4]:
my_colours = nsn.ImageColours(target_area="#EEEEEE")
pil_image.create(dot_array, colours=my_colours)
Out[4]: