PyDVT.DataSelection (version 1.1.0, 08/11/2002)
index
/mntdirect/_bliss/users/gobbo/PyDVT/PyDVT/DataSelection.py

DataSelection.py
Filter derived, basic selections on Data object

 
Modules
            
EventHandler
Numeric
copy
math
types

 
Classes
            
PyDVT.Filter.Filter
DataSelection
LineSelection
OrthoLineSelection
XYOrthoLineSelection
PointSelection
RectSelection
MultiPageRectSelection
XYRectSelection

 
class DataSelection(PyDVT.Filter.Filter)
      DataSelection base class.
This is a Filter derived class that has an Data object as source. 
This base class implements GetOutput that manages retrieving and assembling
data from different pages, and can be used by derived classes to perform more
complex operations.
 
  
DataChanged(self, (source, page_list))
Data change event.
Verifies if pages the selection have been changed and if so calls derived DataChange
DataCoord2SelectionCoord(self, data_coord)
Implements convertion from data coordinates to selection coordinates.
Must be overriden, since data selections are filters with Data object as sources.
(default implementation doesn't work)
Up to derived classes.
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self)
Returns a dictionary with initialization parameters for this data selection.
Can Used by views to retrieve data page's info (through "index_list")
Can be overriden if other information is needed.
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self)
Returns a dictionary, selection over source Data object, based on initialization parameters:
position,size,index_list and dimentions.
This method takes an multi-dimentional orthogonal slice from a given number of pages.
Keys:
    "data": NumPy array
If no selection or error happens returns {}
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, position=None, size=None, index_list=None)
Change position parameters and generates a refresh
Parameters:
    position: if not None changes position property (see __init__)
    size= if not None changes size property (see __init__)
    index_list= if not None changes index_list property (see __init__)
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord)
Implements convertion from selection coordinates to data coordinates.
Must be overriden, since data selections are filters with Data object as sources.
(default implementation doesn't work)
Up to derived classes.
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, position=None, size=None, index_list=None, dimentions=None, synchronized=1)
Parameters:
    source= source Data object 
    position= initial coordinates (a tuple (x,),(x,y) or (x,y,z), according to the dimention of the page)
    size= size of the slice (a tuple (x,),(x,y) or (x,y,z), according to the dimention of the page)
    index_list= page or list of the pages to take the selection on (if None, takes page=0)
                Each index can be either an integer meaning the sequencial position of the page
                or a dictionary that logically index the page based on keys of
                the page's Info dictionary.            
    dimentions= If declared, try to force the number of dimentions of the returned selection 
    synchronized: See Filter.__init__

 
class LineSelection(DataSelection)
      Generic line data selection
 
  
DataChanged(self, (source, page_list)) from DataSelection
DataCoord2SelectionCoord(self, data_coord) from DataSelection
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self) from DataSelection
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self)
See DataSelection.GetOutput
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, begin=None, end=None, index_list=None)
Change position parameters and generates a refresh
Parameters:
    position: if not None changes position property (see __init__)
    size= if not None changes size property (see __init__)
    index_list= if not None changes index_list property (see __init__)
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord) from DataSelection
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, begin=None, end=None, page=None, synchronized=1)
See DataSelection.__init__

 
class MultiPageRectSelection(RectSelection)
      Simple rectangle data selection .
This RectSelection derived class allows ViewSelect object
to draw over views displaying different pages
(doesn't mind page to perform DataCoord2SelectionCoord)
 
  
DataChanged(self, (source, page_list)) from DataSelection
DataCoord2SelectionCoord(self, data_coord)
See DataSelection.DataCoord2SelectionCoord
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self) from DataSelection
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self) from DataSelection
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, position=None, size=None, index_list=None) from DataSelection
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord) from RectSelection
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, position=None, size=None, page=None, synchronized=1) from RectSelection

 
class OrthoLineSelection(DataSelection)
      Simple orthogonal line data selection
 
  
DataChanged(self, (source, page_list)) from DataSelection
DataCoord2SelectionCoord(self, data_coord) from DataSelection
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self) from DataSelection
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self) from DataSelection
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, position=None, size=None, index_list=None) from DataSelection
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord) from DataSelection
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, position=None, size=None, page=None, synchronized=1)
See DataSelection.__init__

 
class PointSelection(DataSelection)
      Simple point selection
 
  
DataChanged(self, (source, page_list)) from DataSelection
DataCoord2SelectionCoord(self, data_coord) from DataSelection
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self) from DataSelection
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self)
See DataSelection.GetOutput
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, position=None, size=None, index_list=None) from DataSelection
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord) from DataSelection
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, position=None)
See DataSelection.__init__

 
class RectSelection(DataSelection)
      Simple rectangle data selection
 
  
DataChanged(self, (source, page_list)) from DataSelection
DataCoord2SelectionCoord(self, data_coord)
See DataSelection.DataCoord2SelectionCoord
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self) from DataSelection
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self) from DataSelection
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, position=None, size=None, index_list=None) from DataSelection
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord)
See DataSelection.SelectionCoord2DataCoord
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, position=None, size=None, page=None, synchronized=1)
See DataSelection.__init__

 
class XYOrthoLineSelection(OrthoLineSelection)
      Orthogonal line data selection with xdata.
Data changed events are rised just if ydata change.
If xdata selection is not valid, GetOutput returns {}
 
  
DataChanged(self, (source, page_list)) from DataSelection
DataCoord2SelectionCoord(self, data_coord) from DataSelection
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self) from DataSelection
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self)
See DataSelection.GetOutput
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, position=None, size=None, index_list=None) from DataSelection
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord) from DataSelection
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, position=None, size=None, page=None, xposition=None, xsize=None, xpage=None, synchronized=1)
See DataSelection.__init__

 
class XYRectSelection(RectSelection)
      Rectangle derived class thar includes "xdata" and "ydata" in output
based in position and size of the selection.
 
  
DataChanged(self, (source, page_list)) from DataSelection
DataCoord2SelectionCoord(self, data_coord) from RectSelection
Destroy(self, source=None) from PyDVT.Filter.Filter
GetData(self) from PyDVT.Filter.Filter
GetDataSelection(self) from PyDVT.Filter.Filter
GetInfo(self) from DataSelection
GetInput(self) from PyDVT.Filter.Filter
GetOutput(self)
See DataSelection.GetOutput
GetSource(self) from PyDVT.Filter.Filter
Reconfig(self, position=None, size=None, index_list=None) from DataSelection
Refresh(self) from PyDVT.Filter.Filter
SelectionCoord2DataCoord(self, selection_coord) from RectSelection
SetSynchronized(self, synchronized) from PyDVT.Filter.Filter
__init__(self, source=None, position=None, size=None, page=None, synchronized=1) from RectSelection

 
Author
             Alexandre Gobbo (gobbo@esrf.fr)