Module: window

class flika.window.Window(tif, name='flika', filename='', commands=[], metadata={})

Window objects are the central objects in flika. Almost all functions in the process module are performed on Window objects and output Window objects.

Parameters:
  • tif (numpy.array) – The image the window will store and display
  • name (str) – The name of the window.
  • filename (str) – The filename (including full path) of file this window’s image orinated from.
  • commands (list of str) – a list of the commands used to create this window, starting with loading the file.
  • metadata (dict) – dict: a dictionary containing the original file’s metadata.
closed = None

bool – True if the window has been closed, False otherwise.

commands = None

list of str – a list of the commands used to create this window, starting with loading the file.

currentROI = None

ROI – When an ROI is clicked, it becomes the currentROI of that window and can be accessed via this variable.

dtype = None

dtype – The datatype of the stored image, e.g. uint8.

filename = None

str – The filename (including full path) of file this window’s image orinated from.

getScatterPts()
Returns:an Nx3 array of scatter points, where N is the number of points. Col0 is frame, Col1 is x, Col2 is y.
Return type:numpy array
imageArray()

returns image as a 3d array, correcting for color or 2d image

Linking a window to another means when the current index of one changes, the index of the other will automatically change.

Parameters:win (flika.window.Window) – The window that will be linked with this one
metadata = None

dict – a dictionary containing the original file’s metadata.

mt = None

int – The number of frames in the image stack.

mx = None

int – The number of pixels wide the image is in the x (left to right) dimension.

my = None

int – The number of pixels heigh the image is in the y (up to down) dimension.

name = None

str – The name of the window.

paste()

This function pastes an ROI from one window into another. The ROIs will be linked so that when you alter one of them, the other will be altered in the same way.

rois = None

list of ROIs – a list of all the ROIs inside this window.

save(filename)
Parameters:filename (str) – The filename, including the full path, where this (.tif) file will be saved.
save_rois(filename=None)
Parameters:filename (str) – The filename, including the full path, where the ROI file will be saved.
setAsCurrentWindow()

This function sets this window as the current window. There is only one current window. All operations are performed on the current window. The current window can be accessed from the variable g.win.

setIndex(index)

This sets the index (frame) of this window.

Parameters:index (int) – The index of the image this window will display
setName(name)

set the name of this window.

This unlinks a window from this one.

Parameters:win (flika.window.Window) – The window that will be unlinked from this one