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]

Function used to save multiple outputs listed in the window dictionary. For the fields that have the keyword ‘window’ in the dictionary key, it will be saved as image. The rest will be saved as csv. CSV files will contain at saving a first line of 0 (to be changed into the header by the user), the first column being the index of the window, followed by the list of output and the location array for each considered window

Parameters:
  • window – dictionary of output
  • location – location of the input
Returns: