multicut module
GUI modules
- class lys.mcut.MultiCutGUI.MultiCut(wave, subWindow=True)[source]
Bases:
QObjectThis is central class of MultiCut.
Although MultiCut is mainly GUI interface, it is also possible to manipulate it programatically through methods.
Filters, axes ranges, free lines, child waves are controlled via
MultiCutCUIvia cui property.Canvases in grid and independent Graphs are added by
display()method of this class.After adding the canvases, they are managed by
CanvasManagerclass.CanvasManageralso manages interactive annotations in the canvas.- closed
Emited when the MultiCut window is closed.
- property cui
MultiCutCUI class that manages filters, axes ranges, free lines, child waves.
- display(wave, type='grid', pos=None, wid=None, **kwargs)[source]
Display wave data created by addWave method of cui.
- Parameters:
wave (_ChildWave) – The child wave data created by addWave method of cui.
type ('grid' or 'graph') – Specifi the wave is displayed in grid or independent graph.
pos (length 2 sequence) – The position in the grid where the wave is displayed. If type is ‘graph’, it is ignored.
wid (length 2 sequence) – The width of the graph displayed in grid. If type is ‘graph’, it is ignored.
- loadDefaultTemplate()[source]
Load default template for the current filtered wave. Call this method soon after the GUI is initialized when you want to initialize the multicut widget with default template.
- Returns:
the dictionary that contains the default template parameters.
- Return type:
dict
- property widget
Get the widget associated with the MultiCut instance.
- class lys.mcut.CanvasManager.CanvasManager(cui, color)[source]
Bases:
list- addAnnotations(c, annotations, syncLine=False, overwrite=False)[source]
Add annotations to the canvas.
This method is internal use only. Do not call.
- addCross(c=None, overwrite=True)[source]
Add cross annotation to canvas.
The added annotation is synchronized with axes range of MultiCut.
- Parameters:
c (canvas) – The canvas to which the annotation is added. If it is omitted, frontCanvas is used.
overwrite (bool) – If it is True, the axis range type is changed to “point”.
- addFreeLine(c=None, line=None, syncAnnot=False)[source]
Add free line annotation to canvas.
The added annotation is synchronized with axes range of MultiCut.
- Parameters:
c (canvas) – The canvas to which the annotation is added. If it is omitted, frontCanvas is used.
- addLine(c=None, orientation='vertical', overwrite=True)[source]
Add infinite line annotation to canvas.
The added annotation is synchronized with axes range of MultiCut.
- Parameters:
c (canvas) – The canvas to which the annotation is added. If it is omitted, frontCanvas is used.
overwrite (bool) – If it is True, the axis range type is changed to “point”.
- addRect(c=None, overwrite=True)[source]
Add rectangle annotation to canvas.
The added annotation is synchronized with axes range of MultiCut.
- Parameters:
c (canvas) – The canvas to which the annotation is added. If it is omitted, frontCanvas is used.
overwrite (bool) – If it is True, the axis range type is changed to “range”.
- addRegion(c=None, orientation='vertical', overwrite=True)[source]
Add region annotation to canvas.
The added annotation is synchronized with axes range of MultiCut.
- Parameters:
c (canvas) – The canvas to which the annotation is added. If it is omitted, frontCanvas is used.
overwrite (bool) – If it is True, the axis range type is changed to “range”.
- createCanvas(axes, *args, graph=False, **kwargs)[source]
Create canvas that is associated with axes. All canvas managed by MultiCut should be instanciated by this method.
- Parameters:
axes (list of int) – The axes that is associated with the canvas. This is required to specify the axes range from the interactive annotations.
graph (bool) – If True, the canvas is created as independent graph window. Otherwise it is in the grid.
args (any) – This is passed to display method of lys. See
lys.functions.display().kwargs (any) – This is passed to display method of lys. See
lys.functions.display().
CUI modules
- class lys.mcut.MultiCutCUI.MultiCutCUI(wave)[source]
Bases:
QObjectMultiCutCUI is a class that manage contents of
lys.multicut.MultiCutGUI.MultiCut.The instance of this class is automatically generated by
lys.multicut.MultiCutGUI.MultiCutand therefore users should not instantiate this class.The functionarities of this class is composed of
MultiCutWave,ChildWaves,AxesRangeManger, andFreeLineManager.The methods of above classes can be accessed directly from this class.
- class lys.mcut.MultiCutCUI.MultiCutWave(wave)[source]
Bases:
QObjectThis class manage wave and filter for analysis.
All methods in this class can be accessed from
MultiCutCUI.- applyFilter(filt)[source]
Apply filter to the wave.
- Parameters:
filt (Filter) – The filter to be applied.
- dimensionChanged
Emitted when the dimension of the filtered wave is changed.
- filterApplied
Emitted when filter is applied.
- rawDataChanged
Emitted when the raw data is changed.
- setRawWave(wave)[source]
Set the raw wave. The existing raw wave will be replaced if it exists. Use
updateRawWave()method for fast update of the data.
- updateRawWave(data=None, axes=None, update=True)[source]
Update raw wavefor fast update of the data.
- Parameters:
data (dict) – The dictionary that contains change of the data. The key of the dictionary should be index of the array. RawWave[key] will be replaced by data[key]
axes (list) – The new axes. If None, the axes will not be changed.
update (bool) – If True, the MultiCut result will be replaced by new data. Set False only when you want to continuously update the data before updating GUIs.
- class lys.mcut.MultiCutCUI.AxesRangeManager(wave)[source]
Bases:
QObjectAxesRangeManager manage axes range that determines the result of MultiCut.
This class is automatically instanciated by MultiCutCUI.
Do not directly instanciate this class.
- axesRangeChanged
Emitted after
setAxisRange()is called.
- getAxisRange(axis)[source]
Get the integrated range for MultiCut.
- Parameters:
axis (int) – The axis.
- Returns:
See
setAxisRange().- Return type:
float or length 2 sequence
- getAxisRangeType(axis)[source]
Get the axis range type for the specified axis.
- Returns:
The axis range type.
- Return type:
‘point’ or ‘range’
- loadFromDictionary(d, useRange=False, axesMap=None, **kwargs)[source]
Load the state from the dictionary.
- Parameters:
d (dict) – The dictionary.
useRange (bool) – If True, the range is loaded.
- saveAsDictionary(useRange=False, **kwargs)[source]
Save the present state as dictionary.
- Parameters:
useRange (bool) – If True, save the ranges.
- setAxisRange(*args, **kwargs)
- class lys.mcut.MultiCutCUI.FreeLineManager[source]
Bases:
QObjectFreeLineManager manages free lines in MultiCut.
Methods in this class can be accessed from MultiCutCUI.
Do not instantiate this class except in MultiCutCUI.
- addFreeLine(axes, position=[[0, 0], [1, 1]], width=1, name=None)[source]
Add free line to MultiCut.
- Parameters:
axes (length 2 sequence) – The axes for which the free line is added.
position (2*2 array) – The position of the free line in the form of [(x1,y1), (x2,y2)]
width (float) – The width of the free line.
name (str) – The name of the free line. If omitted, the line name is automatically generated.
- Returns:
The free line object.
- Return type:
_FreeLine
- freeLineChanged
Emitted when free lines are added or removed.
- freeLineMoved
Emitted when one of the free line is moved.
- getFreeLine(name)[source]
Get free line from name.
- Parameters:
name (str) – The name of free line.
- Returns:
The free line object.
- Return type:
_FreeLine
- getFreeLines()[source]
Return list of free lines.
- Returns:
The list of free lines.
- Return type:
list
- loadFromDictionary(d, useLine=False, axesMap=None, **kwargs)[source]
Load information of free lines from dictionary.
- Parameters:
d (dict) – The dictionary that is generated by saveAsDictionary method.
useLine (bool) – It determines to load position and width of the free lines.
- class lys.mcut.MultiCutCUI.ChildWaves(cui)[source]
Bases:
QObjectThis class manages child waves in MultiCut.
- addWave(axes, filter=None, name=None)[source]
Add new wave to MultiCut. The child waves that is generated by this method is automatically updated when axes range of free lines are changed.
- Parameters:
axes (list of int) – The axes of the child wave.
filter (filter) – The filter for postprocess.
name (str) – The name of the child wave.
- Returns:
The object that include information of the child wave.
- Return type:
_ChildWave
- childWavesChanged
Emitted when the child waves are added or removed.
- property cui
Return the cui of MultiCut.
- getChildWaves()[source]
Return the list of child waves:
- Returns:
The list of child waves.
- Return type:
list of _ChildWave