Menu

Helper Module for Deep Learning.

Common functions to display images.

pynet.plotting.image.plot_data(data, slice_axis=2, nb_samples=5, channel=0, labels=None, random=True, rgb=False, title=None)[source]

Plot an image associated data.

Currently support 2D or 3D dataset of the form (samples, channels, dim).

Parameters

data: array (samples, channels, dim)

the data to be displayed.

slice_axis: int, default 2

the slice axis for 3D data.

nb_samples: int, default 5

the number of samples to be displayed.

channel: int, default 0

will select slices with data using the provided channel.

labels: list of str, default None

the data labels to be displayed.

random: bool, default True

select randomly ‘nb_samples’ data, otherwise the ‘nb_samples’ firsts.

rgb: bool, default False

if set expect three RGB channels.

title: str, default None

the figure title.

pynet.plotting.image.plot_segmentation_data(data, mask, slice_axis=2, nb_samples=5)[source]

Display ‘nb_samples’ images and segmentation masks stored in data and mask.

Currently support 2D or 3D dataset of the form (samples, channels, dim).

Parameters

data: array (samples, channels, dim)

the data to be displayed.

mask: array (samples, channels, dim)

the mask data to be overlayed.

slice_axis: int, default 2

the slice axis for 3D data.

nb_samples: int, default 5

the number of samples to be displayed.

pynet.plotting.image.rescale_intensity(arr, in_range, out_range)[source]

Return arr after stretching or shrinking its intensity levels.

Parameters

arr: array

input array.

in_range, out_range: 2-tuple

min and max intensity values of input and output arr.

Returns

out: array

array after rescaling its intensity.

Follow us

© 2019, pynet developers .
Inspired by AZMIND template.