def draw_image_mask_segments(source, clusters, hide_axes = True):
if (len(clusters) == <NUM_LIT:0>):<EOL><INDENT>print("<STR_LIT>")<EOL>return;<EOL><DEDENT>image_source = Image.open(source);<EOL>image_size = image_source.size;<EOL>number_clusters = len(clusters) + <NUM_LIT:1>; <EOL>number_cols = int(numpy.ceil(number_clusters ** <NUM_LIT:0.5>));<EOL>number_rows = int(numpy.ceil(number_clusters / number_cols));<EOL>real_index = <NUM_LIT:0>, <NUM_LIT:0>;<EOL>double_indexer = True;<EOL>if ( (number_cols == <NUM_LIT:1>) or (number_rows == <NUM_LIT:1>) ):<EOL><INDENT>real_index = <NUM_LIT:0>;<EOL>double_indexer = False;<EOL><DEDENT>(fig, axarr) = plt.subplots(number_rows, number_cols);<EOL>plt.setp([ax for ax in axarr], visible = False);<EOL>axarr[real_index].imshow(image_source, interpolation = '<STR_LIT:none>');<EOL>plt.setp(axarr[real_index], visible = True);<EOL>if (hide_axes is True):<EOL><INDENT>axarr[real_index].xaxis.set_ticklabels([]);<EOL>axarr[real_index].yaxis.set_ticklabels([]);<EOL>axarr[real_index].xaxis.set_ticks_position('<STR_LIT:none>');<EOL>axarr[real_index].yaxis.set_ticks_position('<STR_LIT:none>');<EOL><DEDENT>if (double_indexer is True):<EOL><INDENT>real_index = <NUM_LIT:0>, <NUM_LIT:1>;<EOL><DEDENT>else:<EOL><INDENT>real_index += <NUM_LIT:1>;<EOL><DEDENT>for cluster in clusters:<EOL><INDENT>stage_cluster = [(<NUM_LIT:255>, <NUM_LIT:255>, <NUM_LIT:255>)] * (image_size[<NUM_LIT:0>] * image_size[<NUM_LIT:1>]);<EOL>for index in cluster:<EOL><INDENT>stage_cluster[index] = (<NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>);<EOL><DEDENT>stage = array(stage_cluster, numpy.uint8);<EOL>stage = numpy.reshape(stage, (image_size[<NUM_LIT:1>], image_size[<NUM_LIT:0>]) + ((<NUM_LIT:3>),)); <EOL>image_cluster = Image.fromarray(stage, '<STR_LIT>');<EOL>axarr[real_index].imshow(image_cluster, interpolation = '<STR_LIT:none>');<EOL>plt.setp(axarr[real_index], visible = True);<EOL>if (hide_axes is True):<EOL><INDENT>axarr[real_index].xaxis.set_ticklabels([]);<EOL>axarr[real_index].yaxis.set_ticklabels([]);<EOL>axarr[real_index].xaxis.set_ticks_position('<STR_LIT:none>');<EOL>axarr[real_index].yaxis.set_ticks_position('<STR_LIT:none>');<EOL><DEDENT>if (double_indexer is True):<EOL><INDENT>real_index = real_index[<NUM_LIT:0>], real_index[<NUM_LIT:1>] + <NUM_LIT:1>;<EOL>if (real_index[<NUM_LIT:1>] >= number_cols):<EOL><INDENT>real_index = real_index[<NUM_LIT:0>] + <NUM_LIT:1>, <NUM_LIT:0>; <EOL><DEDENT><DEDENT>else:<EOL><INDENT>real_index += <NUM_LIT:1>;<EOL><DEDENT><DEDENT>plt.show()<EOL>
!
    @brief Shows image segments using black masks.
    @details Each black mask of allocated segment is presented on separate plot.
             The first image is initial and others are black masks of segments.

    @param[in] source (string): Path to image.
    @param[in] clusters (list): List of clusters (allocated segments of image) where each cluster
                                consists of indexes of pixel from source image.
    @param[in] hide_axes (bool): If True then axes will not be displayed.