def get_value(x, y, z, center_prob):
  """ Calculates the probability for the box at x, y, z (within a 3x3x3 box)"""
  center_count = (x % 2) + (y % 2) + (z % 2) # counting the number of "1" in our coordinates (centers)
  prob_unit = (1-center_prob)/14 # the probability per voxel/cube around center cube
  values = [(prob_unit/4), (prob_unit/2), prob_unit, center_prob] # corner, edge, major axis, center
  # indexes in values list correspond to the number of centers of each box type (center_count)

  return values[center_count]