ImageUtils

ImageUtils.makeImage(id, inpath, t, colormap, timestamp=False, label=False, scale=1, bc=None, fontsize=6, border=True, gzipped=True, fieldname=None, fontpath='/usr/share/fonts/msttcore/')[source]

Draw morphology for one timestep

Parameters:
  • id (str) – simulation identifier
  • inpath (str) – path containing data files
  • t (int) – time step
  • outpath (str) – path to save images to
  • colormap – dictionary with cell types as keys and colors (r,g,b) as values
  • timestamp (bool) – add time stamp to the image
  • label (bool) – add id as label to the image
  • scale (number) – scaling of the image
  • bc – color of cell boundaries (r,g,b)
  • fontsize (int) – size of the fonts used for label and time stamp; font size will be multiplied by scale.
  • border (bool) – cut of border pixels
  • gzipped (bool) – data is gzipped
  • fieldname (str) – name of chemical field
  • fontpath (str) – path to freetype fonts
Returns:

image object

See also

drawCells(), addTimeStamp(), addLabel()

ImageUtils.drawRelDirField(field, sigma, scale=1)[source]

Draw gray-scale image of a field representing the relative director

Parameters:
  • field – numpy array with relative director
  • sigma – numpy array with cell id’s
  • scale (number) – scaling factor
Returns:

image object

ImageUtils.stackImages(images, geometry, filename, label=False, title=None, fontsize=20, border=False, scale=1, fontpath='/usr/share/fonts/msttcore/')[source]

Stack a set of images together in one image.

Parameters:
  • images – dictionary with labels as keys and image filenames as values
  • geometry – number of rows and columns (x,y)
  • filename (str) – target of the stacked image
  • label (bool) – add labels to the subimages
  • title (str) – overall title for image
  • fontsize (int) – font size (only for freetype fonts)
  • border (bool) – add border to subimages
  • scale (number) – scaling factor of the created picture
  • fontpath (str) – path to freetype fonts
ImageUtils.morphImages(images, filename, xlabel=None, ylabel=None, xtics=None, ytics=None, fontsize=20, scale=1, border=False, title=None, bcolor=(255, 255, 255), fcolor=(0, 0, 0), fontpath='/usr/share/fonts/msttcore/', delta=0)[source]

Stack a set of images together in one morphospace.

Parameters:
  • images – 2D array with image filenames
  • filename (str) – target of the stacked image
  • xlabel (str) – label to be plotted on x-axis
  • ylabel – label to be plotted on y-axis
  • ylabel – str
  • xtics – list of labels on x-axis
  • ytics – list of labels on y-axis
  • fontsize (int) – fontsize for labels and title
  • scale (number) – scaling factor of the created picture
  • border (bool) – add border to subimages
  • title (str) – overall title for image
  • bcolor – background color (r,g,b)
  • fcolor – font color (r,g,b)
  • fontpath (str) – path to freetype fonts
  • delta (number) – extra space between images

Previous topic

AnalysisUtils

Next topic

Readers

This Page