OriginPro
Public Member Functions | List of all members
originpro.image.IPage Class Reference
Inheritance diagram for originpro.image.IPage:
originpro.base.BasePage originpro.base.BaseObject

Public Member Functions

def __repr__ (self)
 
def from_np (self, arr, dstack=False)
 
def to_np (self)
 
def to_np2d (self, frame)
 
def from_np2d (self, arr, frame)
 
def from_file (self, fname)
 
def rgb2gray (self)
 
def split (self)
 
def merge (self)
 
def layer (self)
 
def setup (self, channels, multiframe, channelType=-1)
 
def size (self)
 
def channels (self)
 
def frames (self)
 
def type (self)
 
- Public Member Functions inherited from originpro.base.BasePage
def __len__ (self)
 
def is_open (self)
 
def is_active (self)
 
def lt_range (self)
 
def activate (self)
 
def destroy (self)
 
def duplicate (self)
 
- Public Member Functions inherited from originpro.base.BaseObject
def __init__ (self, obj)
 
def __del__ (self)
 
def __str__ (self)
 
def __bool__ (self)
 
def index (self)
 
def get_str (self, prop)
 
def get_int (self, prop)
 
def get_float (self, prop)
 
def set_str (self, prop, value)
 
def set_int (self, prop, value)
 
def set_float (self, prop, value)
 
def method_int (self, name, arg='')
 
def method_float (self, name, arg='')
 
def method_str (self, name, arg='')
 
def lt_exec (self, labtalk)
 
def name (self)
 
def name (self, value)
 
def lname (self)
 
def lname (self, value)
 
def comments (self)
 
def comments (self, value)
 
def show (self)
 
def show (self, value)
 
def usertree (self)
 
def usertree (self, tr)
 
def userprops (self)
 

Additional Inherited Members

- Public Attributes inherited from originpro.base.BaseObject
 obj
 

Detailed Description

This class represents an Origin Image Window, it holds an instance of a PyOrigin ImagePage

Member Function Documentation

◆ channels()

def originpro.image.IPage.channels (   self)
image number of channels

◆ frames()

def originpro.image.IPage.frames (   self)
number of frames for an image stack, or return 1 if not multi-frames

◆ from_file()

def originpro.image.IPage.from_file (   self,
  fname 
)
load image(s) into the image window

Parameters:
    fname(str): file path to an image file or with wildcard to a group of image files to be loaded into an image stack

Returns:
    success of failure

Examples:
    im = op.find_image('Image1')
    folder = op.path('e') + r'Samples\Image Processing and Analysis'
    fn = folder + r'\Flower.jpg'
    im.from_file(fn)
    #load image stack simply by wildcard
    im2 = op.find_image('Image2')
    fn = folder + r'\*.tif'
    im2.from_file(fn)

◆ from_np()

def originpro.image.IPage.from_np (   self,
  arr,
  dstack = False 
)
Set an Image page data from a multi-dimensional numpy array.

Parameters:
    arr (numpy array):
    dstack (bool):  True if arr as row,col,frames, False if frames,row,col
Returns:
    None

Examples:

◆ from_np2d()

def originpro.image.IPage.from_np2d (   self,
  arr,
  frame 
)
Transfers data from a 2D numpy array into one frame of an ImagePage.
The image must be multiframe, otherwise nothing is returned.
The size (width, height) of the supplied data must match the size of the image.

Parameters:
    frame (int) the index of the image frame

Returns:
    (bool) success or failure

Examples:
    im2=iw.to_np2d(1)
    im2*=10
    iw.from_np2d(im2,2)

◆ layer()

def originpro.image.IPage.layer (   self)
Graph layer as image holder

◆ merge()

def originpro.image.IPage.merge (   self)
merge a 3 or 4 images in Image Window to a single color image

◆ rgb2gray()

def originpro.image.IPage.rgb2gray (   self)
convert image window to grayscale

◆ setup()

def originpro.image.IPage.setup (   self,
  channels,
  multiframe,
  channelType = -1 
)
It allows simple initialization by specifying the number of channels
and whether it should be multiframe or not. The existing image
held in the object (if present) is wiped out.

Parameters:
    channels(int): the number of channels (1, 3 or 4).
    multiframe(bool): whethwer it should be multiframe (Image Stack) or not.
    channelType (int, optional): the variable type of the channel.
                                Possible values are:
                                    0 : float64
                                    1 : float32
                                    8 : uint16
                                For all the other values the channel size will be set
                                to uint8.

Returns (bool): success or not

◆ size()

def originpro.image.IPage.size (   self)
width and height of the image

◆ split()

def originpro.image.IPage.split (   self)
split a color image into RGB channels

◆ to_np()

def originpro.image.IPage.to_np (   self)
Transfers data from an ImagePage to a numpy array.

Parameters:

Returns:
    (numpy array)

Examples:

◆ to_np2d()

def originpro.image.IPage.to_np2d (   self,
  frame 
)
Transfers data from one frame of an ImagePage to a 2D numpy array.
The image must be multiframe, otherwise nothing is returned.

Parameters:
    frame (int) the index of the image frame

Returns:
    (numpy array)

Examples:
    im2=iw.to_np2d(1)

◆ type()

def originpro.image.IPage.type (   self)
image media type, 1=single image, 2=multi-frame, 3=video

The documentation for this class was generated from the following file: