atomai icon indicating copy to clipboard operation
atomai copied to clipboard

Gaussian of coordinates close an edge can extend past the image boundary and cause an error.

Open darianSmalley opened this issue 1 year ago • 1 comments

Function: create_lattice_mask File: imgen.py Issue: XY coordinates close an edge can cause an error if their gaussian extends past the boundary.

Potential Solution: This can be avoided by including cases for the edges to remove the sections of the mask which extend beyond the image boundary and limit the indices to within the image width and height.

Additionally, the previous values of the mask are added to the new mask to allow smoother transitions between overlapping gaussians.

This sort of a solution can be seen in the image below.

image

darianSmalley avatar Aug 03 '22 23:08 darianSmalley

@darianSmalley, thanks for noticing it. I think your solution makes sense - would you like to submit a pull request?

ziatdinovmax avatar Aug 04 '22 19:08 ziatdinovmax