niftynet.engine.sampler_linear_interpolate_v2 module

Generating samples by linearly combining two input images.

class LinearInterpolateSampler(reader, window_sizes, batch_size=10, n_interpolations=10, queue_length=10, name='linear_interpolation_sampler')[source]

Bases: niftynet.engine.image_window_dataset.ImageWindowDataset

This class reads two feature vectors from files (often generated by running feature extractors on images in advance) and returns n linear combinations of the vectors. The coefficients are generated by:

np.linspace(0, 1, n_interpolations)
layer_op(*_unused_args, **_unused_kwargs)[source]

This function first reads two vectors, and interpolates them with self.n_interpolations mixing coefficients.

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