niftynet.contrib.csv_reader.sampler_csv_rows module¶
-
class
ImageWindowDatasetCSV
(reader, csv_reader=None, window_sizes=None, batch_size=10, windows_per_image=1, shuffle=True, queue_length=10, num_threads=4, epoch=-1, smaller_final_batch_mode='pad', name='random_vector_sampler')[source]¶ Bases:
niftynet.engine.image_window_dataset.ImageWindowDataset
Extending the default sampler to include csv data
-
layer_op
(idx=None)[source]¶ Generating each image as a window. Overriding this function to create new image sampling strategies.
This function should either yield a dictionary (for single window per image):
yield a dictionary { 'image_name': a numpy array, 'image_name_location': (image_id, x_start, y_start, z_start, x_end, y_end, z_end) }
or return a dictionary (for multiple windows per image):
return a dictionary: { 'image_name': a numpy array, 'image_name_location': [n_samples, 7] }
where the 7-element location vector encode the image_id, starting and ending coordinates of the image window.
Following the same notation, the dictionary can be extended to multiple modalities; the keys will be:
{'image_name_1', 'image_name_location_1', 'image_name_2', 'image_name_location_2', ...}
Parameters: idx – image_id used to load the image at the i-th row of the input Returns: a image data dictionary
-
tf_shapes
¶ returns a dictionary of sampler output tensor shapes
-
tf_dtypes
¶ returns a dictionary of sampler output tensorflow dtypes
-