niftynet.contrib.csv_reader.sampler_resize_v2_csv module

Resize input image as output window.

class ResizeSamplerCSV(reader, csv_reader=None, window_sizes=None, batch_size=1, spatial_window_size=None, windows_per_image=1, shuffle=True, queue_length=10, num_threads=4, smaller_final_batch_mode='pad', name='resize_sampler_v2')[source]

Bases: niftynet.contrib.csv_reader.sampler_csv_rows.ImageWindowDatasetCSV

This class generates samples by rescaling the whole image to the desired size Assuming the reader’s output is 5d: Height x Width x Depth x time x Modality


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)

Returns:output data dictionary {'image_modality': data_array}
zoom_3d(image, ratio, interp_order)[source]

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