for s in where:
// Set the random seed with the current seed, the current value of
// seeds per voxel and the global random seed.
s_random_seed = None
if random_seed is not None:
s_random_seed = hash((np.sum(s) + 1) * i + random_seed) \
% (2**32 - 1)
np.random.seed(s_random_seed)
// Generate random triplet
grid = np.random.random(3)
seed = s + grid - .5
seeds.append(seed)
After Change
if random_seed is not None:
s_random_seed = hash((np.sum(s) + 1) * i + random_seed) \
% (2**32 - 1)
np.random.seed(s_random_seed)
// Generate random triplet
grid = np.random.random(3)
seed = s + grid - .5
seeds.append(seed)