Visionx V4 python package

Introduction

the python package to support the VisionX v4 image anlysis system is called v4. This package provides an interface bewteen the python programming language and the VisionX V4 image analysis system. When VisionX V4 is not installed on the system it provides some useful image analysis functions and facilitates the reading and writing of visionx images.

Installation

The VisionX V4 package is installed on the pypi repository and may typically be installed with pip; for example:


python3 -m pip install v4

Overview

The VisionX V4 package contains two modules, vx for image management and vd for image presentation. The main functions in these modules are as follows:

Image Management
vx.Vx class for managing both image data and image metadata. It may be initialized by an image file, vx structure, and np-array or an explicit specification

vx.vxsh

Execute a command in the operating system. Makes possible operations on images within python and/or external image files.

vx.vaparse For standalone python programs vaparse performs command line argument parsing and includes the v4 scheme for documenting command line argument definitions. It conforms to the v4 argument parsing conventions. It is much simpler than the python argparse function.

Image Presentation

vd.dispvx Present an image in a Jupyter Notebook using the Display feature. This provides a quick and precise presentation of the image data. Images with sizes less than 25 pixels are displayed magnified with pixel values printed.

vd.dispmvx Present an image in a Jupyter Notebook using the maplotlib package. This provides a highly convenient method of presenting one or more images together. The size of the image is always scaled to fit the designated space, several presentation options are available.

vd.dispsvx Presents small images scaled with pixel values printed on each. This is implemented with maplotlib similar to dispmvx.

vd.dhist Present a histogram plot of the image.

V4 file supported pixel formats

All numpy data types may be used in python programs. However, currently, only the following pixel data types are supported by v4 image files.

Format Python typeVisionX Type
unsigned byteuint8 VX_PBYTE
signed byteint8 VX_PCHAR
16-bit signed integerint16 VX_PSHORT
32-bit signed integerint32 VX_PINT
32-bit float float32 VX_PFLOAT
64-bit double float64 VX_PDOUBLE

References