ALBULA  4.0.1
dectris.albula.DSubFrame Class Reference

class DSubFrame displays an image within a DMainFrame More...

Inheritance diagram for dectris.albula.DSubFrame:
dectris.albula.DFrame

Public Member Functions

def __init__ (self, viewerClient, objID, mainFrame)
 
def mainFrame (self)
 DMainFrame the object is attached to Returns a valid DMainFrame even after it has been closed. More...
 
def hideToolButtons (self)
 Hide tool buttons in the title bar. More...
 
def showToolButtons (self)
 Show tool buttons in the title bar. More...
 
def setActiveColor (self, red, green, blue)
 Set title bar color of active DSubFrame in RGB space. More...
 
def setNonActiveColor (self, red, green, blue)
 Set title bar color of non-active DSubFrame in RGB space. More...
 
def loadFile (self, pathToImage)
 Load image from file. More...
 
def loadImage (self, image, contrast=None)
 Display DImage. More...
 
def highlightPixels (self, pixelArray, red, green, blue, alpha=255)
 Highlight the pixels passed by pixelArray with crosses of the given color. More...
 
def addToPaintList (self, paintList)
 Add drawing primitives to paint list. More...
 
def setPaintList (self, paintList)
 Set paint list, which is the list of drawing primitives (DDrawingPrimitive) to be painted. More...
 
def clearPaintList (self)
 Clear the paint list. More...
 
def goTo (self, imageNumber)
 If an currently loaded image belongs to a series open image of the current series by passing its number. More...
 
def setOffsetX (self, offsetX)
 Move image in X direction. More...
 
def setOffsetY (self, offsetY)
 Move image in Y direction. More...
 
def setZoomPower (self, zoomPower)
 Zoom the image. More...
 
def setViewport (self, offsetX, offsetY, zoomPower)
 Set the view port i.e. More...
 
def setForeground (self, foreground)
 Set the foreground value of the image. More...
 
def setBackground (self, background)
 Set the background value of the image. More...
 
def setContrast (self, foreground, background)
 Set the foreground and background values of the image, which defines the contrast for an image. More...
 
def setTitle (self, title)
 Set the title of the DSubFrame. More...
 
def unsetTitle (self)
 Call after setTitle() in order to restore the default behaviour of the DSubFrame: The path to the currently loaded image will be displayed in the title bar. More...
 
def setColorMode (self, colormode)
 Set color mode: More...
 
def showResolutionRings (self)
 Show Resolution Rings. More...
 
def hideResolutionRings (self)
 Hide Resolution Rings. More...
 
- Public Member Functions inherited from dectris.albula.DFrame
def __init__ (self, viewerClient, objID)
 
def viewerClient (self)
 
def objID (self)
 
def close (self)
 Closes the Frame. More...
 
def waitForClose (self)
 Blocks until object is closed by user. More...
 
def sendCommand (self, command, argList=list())
 

Detailed Description

class DSubFrame displays an image within a DMainFrame

Constructor & Destructor Documentation

◆ __init__()

def dectris.albula.DSubFrame.__init__ (   self,
  viewerClient,
  objID,
  mainFrame 
)

Member Function Documentation

◆ addToPaintList()

def dectris.albula.DSubFrame.addToPaintList (   self,
  paintList 
)

Add drawing primitives to paint list.

Parameters
paintListlist of elements of type DDrawingPrimitive

◆ clearPaintList()

def dectris.albula.DSubFrame.clearPaintList (   self)

Clear the paint list.

See also addToPaintList(), highlightPixels().

◆ goTo()

def dectris.albula.DSubFrame.goTo (   self,
  imageNumber 
)

If an currently loaded image belongs to a series open image of the current series by passing its number.

Parameters
imageNumberInteger number of the image within its series

◆ hideResolutionRings()

def dectris.albula.DSubFrame.hideResolutionRings (   self)

Hide Resolution Rings.

◆ hideToolButtons()

def dectris.albula.DSubFrame.hideToolButtons (   self)

Hide tool buttons in the title bar.

◆ highlightPixels()

def dectris.albula.DSubFrame.highlightPixels (   self,
  pixelArray,
  red,
  green,
  blue,
  alpha = 255 
)

Highlight the pixels passed by pixelArray with crosses of the given color.

See also clearPaintList().

Parameters
pixelArraylist of pairs of two integers (e.g. [[x0,y0],[x1,y1],...]
redint between 0 and 255
greenint between 0 and 255
blueint between 0 and 255
alphaint between 0 and 255. Opacity.

◆ loadFile()

def dectris.albula.DSubFrame.loadFile (   self,
  pathToImage 
)

Load image from file.

Parameters
pathToImageFull path to the image file

◆ loadImage()

def dectris.albula.DSubFrame.loadImage (   self,
  image,
  contrast = None 
)

Display DImage.

Parameters
imageDImage object
contrastCallable object returning a tuple used to compute foreground and background. If not None foreground (background) is set to the first (second) return value of contrast(image,image.optionalData().pixel_mask()). See DContrast for a reference implementation.

◆ mainFrame()

def dectris.albula.DSubFrame.mainFrame (   self)

DMainFrame the object is attached to Returns a valid DMainFrame even after it has been closed.

Returns
DMainFrame

◆ setActiveColor()

def dectris.albula.DSubFrame.setActiveColor (   self,
  red,
  green,
  blue 
)

Set title bar color of active DSubFrame in RGB space.

See setNonActiveColor

Parameters
redinteger between 0 and 255
greeninteger between 0 and 255
blueinteger between 0 and 255

◆ setBackground()

def dectris.albula.DSubFrame.setBackground (   self,
  background 
)

Set the background value of the image.

Pixels with intensities within the background region (foreground region) are drawn in the background color (foreground color). In between the pixel values are linearly mapped to a color scale specified by the color mode settings. See also setForeground and setContrast().

Parameters
backgroundInteger or float value depending on the type of the currently loaded image

◆ setColorMode()

def dectris.albula.DSubFrame.setColorMode (   self,
  colormode 
)

Set color mode:

Parameters
colormodeOne of the strings below
  • "High Dynamic Range" or "HDR"
  • "Grey Scale" or "GS"
  • "Heat" or "H"
  • "Rainbow" or "RB"

◆ setContrast()

def dectris.albula.DSubFrame.setContrast (   self,
  foreground,
  background 
)

Set the foreground and background values of the image, which defines the contrast for an image.

Pixels with intensities within the background region (foreground region) are drawn in the background color (foreground color). In between the pixel values are linearly mapped to a color scale specified by the color mode settings. See also setForeground() and setBackground().

Parameters
foregroundInteger or float value depending on the type of the currently loaded image
backgroundInteger or float value depending on the type of the currently loaded image

◆ setForeground()

def dectris.albula.DSubFrame.setForeground (   self,
  foreground 
)

Set the foreground value of the image.

Pixels with intensities within the background region (foreground region) are drawn in the background color (foreground color). In between the pixel values are linearly mapped to a color scale specified by the color mode settings. See also setBackground and setContrast().

Parameters
foregroundInteger or float value depending on the type of the currently loaded image

◆ setNonActiveColor()

def dectris.albula.DSubFrame.setNonActiveColor (   self,
  red,
  green,
  blue 
)

Set title bar color of non-active DSubFrame in RGB space.

See setActiveColor()

Parameters
redinteger between 0 and 255
greeninteger between 0 and 255
blueinteger between 0 and 255

◆ setOffsetX()

def dectris.albula.DSubFrame.setOffsetX (   self,
  offsetX 
)

Move image in X direction.

See also setOffsetY(), setZoomPower() and setViewport().

Parameters
offsetXInteger value between 0 and width of currently loaded image

◆ setOffsetY()

def dectris.albula.DSubFrame.setOffsetY (   self,
  offsetY 
)

Move image in Y direction.

See also setOffsetX(), setZoomPower() and setViewport().

Parameters
offsetYInteger value between 0 and height of currently loaded image

◆ setPaintList()

def dectris.albula.DSubFrame.setPaintList (   self,
  paintList 
)

Set paint list, which is the list of drawing primitives (DDrawingPrimitive) to be painted.

Parameters
paintListlist of elements of type DDrawingPrimitive

◆ setTitle()

def dectris.albula.DSubFrame.setTitle (   self,
  title 
)

Set the title of the DSubFrame.

If set the DSubFrame does no longer show the file path to the loaded image. Restore the default behaviour by calling unsetTitle().

Parameters
titleString that will be displayed in the title bar

◆ setViewport()

def dectris.albula.DSubFrame.setViewport (   self,
  offsetX,
  offsetY,
  zoomPower 
)

Set the view port i.e.

the section of image that is displayed.

Parameters
offsetXInteger value between 0 and width of currently loaded image
offsetYInteger value between 0 and height of currently loaded image
zoomPowerInteger value between -2 and 6. The image is zoomed by a factor of $ 2^\text{zoomPower}$.

◆ setZoomPower()

def dectris.albula.DSubFrame.setZoomPower (   self,
  zoomPower 
)

Zoom the image.

See also setOffsetX(), setOffsetY() and setViewport().

Parameters
zoomPowerInteger value between -2 and 6. The image is zoomed by a factor of $ 2^\text{zoomPower}$.

◆ showResolutionRings()

def dectris.albula.DSubFrame.showResolutionRings (   self)

Show Resolution Rings.

◆ showToolButtons()

def dectris.albula.DSubFrame.showToolButtons (   self)

Show tool buttons in the title bar.

◆ unsetTitle()

def dectris.albula.DSubFrame.unsetTitle (   self)

Call after setTitle() in order to restore the default behaviour of the DSubFrame: The path to the currently loaded image will be displayed in the title bar.