niftynet.contrib.csv_reader.sampler_linear_interpolate_v2_csv module

Generating samples by linearly combining two input images.

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

Bases: niftynet.contrib.csv_reader.sampler_csv_rows.ImageWindowDatasetCSV

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.