src/grids.jl

MEDYAN.CubicGrid

CubicGrid(num_voxels::SVector{3,Int}, compartmentsize::Float64)
  • n::StaticArraysCore.SVector{3, Int64}
  • compartmentsize::Float64

Base.length

Base.length(grid::CubicGrid)

Total number of compartments in the grid

MEDYAN.grididat

grididat(grid::CubicGrid, location)

Return the grid id of location The origin is in the center. Returns a close by voxel if out of the grid

MEDYAN.filter_grididat

filter_grididat(f, grid::CubicGrid, location)

Return the nearest grid id of location where f(id) evaluates to true. The origin is in the center. errors if there is no id that evaluates to true. Returns a close by voxel if out of the grid.

MEDYAN.centerof

centerof(grid::CubicGrid, cid)

Return the location of the center of a grid id The origin is in the center.

centerof(grid::CubicGrid)

Return the location of the center the grid The origin is in the center.

MEDYAN.randompoint

randompoint(grid::CubicGrid,cid)::SVector{3,Float64}

Return a random point in a voxel Note, due to floating point rounding, there is a small chance the returned point may be in a nearby voxel.

randompoint(grid::CubicGrid)::SVector{3,Float64}

Return a random point in the grid