niftynet.engine.sampler_random_vector_v2 module

Generating sample arrays from random distributions.

class RandomVectorSampler(names=('vector', ), vector_size=(100, ), batch_size=10, n_interpolations=10, mean=0.0, stddev=1.0, repeat=1, queue_length=10, name='random_vector_sampler')[source]

Bases: niftynet.engine.image_window_dataset.ImageWindowDataset

This class generates two samples from the standard normal distribution. These two samples are mixed with n mixing coefficients. The coefficients are generated by np.linspace(0, 1, n_interpolations)

layer_op()[source]

This function first draws two samples, and interpolates them with self.n_interpolations mixing coefficients.

Location coordinates are set to np.ones for all the vectors.