niftynet.engine.sampler_resize module

Resize input image as output window

class niftynet.engine.sampler_resize.ResizeSampler(reader, data_param, batch_size, spatial_window_size=(), windows_per_image=1, shuffle_buffer=True, queue_length=10)

Bases: niftynet.layer.base_layer.Layer, niftynet.engine.image_window_buffer.InputBatchQueueRunner

This class generates samples by rescaling the whole image to the desired size currently 5D input is supported: Height x Width x Depth x time x Modality

layer_op(*args, **kwargs)

This function generates sampling windows to the input buffer image data are from self.reader() it first completes window shapes based on image data, then resize each image as window and output a dictionary (required by input buffer) :return: output data dictionary {placeholders: data_array}

niftynet.engine.sampler_resize.dummy_coordinates(image_id, image_sizes)

This function returns a set of image window coordinates which are just from 0 to image_shapes

niftynet.engine.sampler_resize.zoom_3d(image, ratio, interp_order)

Taking 5D image as input, and zoom each 3D slice independently