niftynet.engine.windows_aggregator_grid module

windows aggregator decode sampling grid coordinates and image id from batch data, forms image level output and write to hard drive.

class GridSamplesAggregator(image_reader, name='image', output_path='./output', window_border=(), interp_order=0, postfix='_niftynet_out', fill_constant=0.0)[source]

Bases: niftynet.engine.windows_aggregator_base.ImageWindowsAggregator

This class keeps record of the currently cached image, initialised as all zeros, and the values are replaced by image window data decoded from batch.

decode_batch(window, location)[source]

The implementation of caching and writing batch output goes here. This function should return False when the location vector is stopping signal, to notify the inference loop to terminate.

Parameters:
  • args
  • kwargs
Returns:

True if more batch data are expected, False otherwise