perimeter

perimeter_weighed(rasterData: DomainPoint -> DomainInt)

results in

DomainInt->RasterCellEdgeCount

where RasterCellEdgeCount = UInt32

for each occurring partition, count the number of edges that cells of that partition have with other cells or the raster border