NF: Apertures can be defined using image files with transparency #923
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello again!
When trying to define more complicated apertures to use with (e.g.) ElementArrayStims I ran into frustrations. Here, I added a feature to Aperture allowing to use an image with transparency (I tested with a PNG file) as the basis for the aperture shape.
I tried to change the parameters as little as possible so that I reused the shape parameter. I hope that this does not break anything (I check whether the filename string leads to a real file on disk like in SimpleImage).
One open question would be whether these calls during the _reset need to be disabled again after the draw():
Any comments on that?
Also I hope that was not too bold to include my name in the author list of the file... :)
This is a very slightly modified demo code to test the new feature, including an image with transparency: