Grid Generation

These function provides help in generating scanning patterns

MicroscopyTools.regular_patternFunction
regular_pattern(sz; offset=0, step=1)

Returns a generator with tuples that point to a regular grid pattern.

Arguments:

  • sz: size of the underlaying array for which to generate the regular pattern
  • offset: offset of the first position. Can be tuple or scalar.
  • step: step between the indices. Can be tuple or scalar.

Examples

julia> MicroscopyTools.regular_pattern((3,3))
Base.Generator{CartesianIndices{2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, MicroscopyTools.var"#21#22"{Int64, Int64}}(MicroscopyTools.var"#21#22"{Int64, Int64}(1, 1), CartesianIndices((3, 3)))

julia> collect(MicroscopyTools.regular_pattern((3,3)))
3×3 Matrix{Tuple{Int64, Int64}}:
 (1, 1)  (1, 2)  (1, 3)
 (2, 1)  (2, 2)  (2, 3)
 (3, 1)  (3, 2)  (3, 3)

julia> collect(MicroscopyTools.regular_pattern((3,3), step=2))
2×2 Matrix{Tuple{Int64, Int64}}:
 (1, 1)  (1, 3)
 (3, 1)  (3, 3)

julia> collect(MicroscopyTools.regular_pattern((3,3), step=2, offset=-1))
2×2 Matrix{Tuple{Int64, Int64}}:
 (-1, -1)  (-1, 1)
 (1, -1)   (1, 1)
source