# Hierarchical stimuli

Hi everyone! I am new to both coding and Psychopy so I would appreciate any help. We would like to create some hierarchical stimuli (letters made out of other letters) but we don’t know how to do it. Has anyone done this before or have an insight on how to do it? Thank you in advance.

Hi @ar2, the Navon task is available on Pavlovia. You can download the task and see how that works:

Thank you for your response. Still, the question of how to create those letters using PsychoPy remains.

If you look at the built-in Navon demo that is packaged with PsychoPy, you’ll see that it just uses four fixed (and presumably manually-crafted) image files:

Are you asking how those images could actually be generated algorithmically?

If so, I think that would be really challenging to specify geometrically, as it requires knowing the shape of the font glyphs involved and then somehow distributing the smaller letters across those paths in an even way.

A cheat’s way of doing it would be to draw a grid of smaller letters and then simply draw a large letter as a mask on top of it. That would make it straight-forward to generate many stimuli, but they would inevitably have some of the smaller letters truncated by the outlines of the larger letter, leading to visual pollution that is not present if you manually-craft your stimuli.

Hi Michael,

Thank you for the reply.
Yes, I am interested in how to genarate them algorithmicaly. So far I am designing them using power point or Adobe photoshop. Until now I have created the simultaneous lightness contrast illusion using python, but it was quite easy using the Psychopy library.

The current study is about the difference of orientation of the global or local fixation of attention between the general population and the psychotic population. So I would like my stimuli to be as “clean” as they can get.

Sorry, then, beyond the cheating method using drawing masks (which would inevitably mean cutting off the boundaries of some small letters), a proper algorithmic approach would be beyond my high-school level geometry skills.

Thank you again for your insights. I will try what you suggested and see if I can work with that.

You may be interested in my new online demo which creates Navon figures programmatically.

# Navon Figures code | try it

Letters of the alphabet arranged in code into the shapes of larger letters. In the demo each figure has the same local and global letter, but changing the local letter is trivial, as is changing the number of local letters in each global letter – currently set to 9 high. The grey rectangle is to check that the global letters are all the same size.