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.
-
closeEvent
(self, QCloseEvent)¶
-
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.
-
framerate
= None¶ float – The number of frames per second (Hz).
-
getScatterPts
(self)¶ 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
(self)¶ Returns: Image as a 3d array, correcting for color or 2d image
-
keyPressEvent
(self, QKeyEvent)¶
-
link
(self, win)¶ 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.
-
mouseClickEvent
(ev)¶ ‘mouseClickevent(self, ev) Event handler for when the mouse is pressed in a flika window.
-
mouseMoved
(self, point)¶ Event handler function for mouse movement.
-
mousePressEvent
(self, QMouseEvent)¶
-
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
(self)¶ This function pastes a ROI from one window into another. The ROIs will be automatically linked using the link() fucntion so that when you alter one of them, the other will be altered in the same way.
-
resizeEvent
(self, QResizeEvent)¶
-
save
(self, filename)¶ Saves the current window to a specificed directory as a (.tif) file
Parameters: filename (str) – The filename, including the full path, where this (.tif) file will be saved.
-
save_rois
(self, filename=None)¶ Parameters: filename (str) – The filename, including the full path, where the ROI file will be saved.
-
setAsCurrentWindow
(self)¶ 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
(self, index)¶ This sets the index (frame) of this window.
Parameters: index (int) – The index of the image this window will display
-
setName
(self, name)¶ Set the name of this window.
Parameters: name (str) – the name for window to be set to
-
unlink
(self, win)¶ This unlinks a window from this one.
Parameters: win (flika.window.Window) – The window that will be unlinked from this one