Skip to main content

Read and write native DaVis images and vectors filetypes VC7 and IM7

Project description

Overview

ReadIM is a c++ wrapper to load DaVis Images and Vectors created by DaVis V8. ReadIM is a ‘low level’ wrapper of C++ libraries provided by LaVision GMBH. ReadIMX source was latest updated by LaVision in Aug-2014.

Installation

This module must be compiled to work correctly. If there isn’t a binary on pip you’ll need to have the appropriate build tools installed to compile it.

>>> pip install ReadIM

If this fails you will need to compile yourself. Ensure you have the necessary build tools. Clone the source and run the following.

>>> python setup.py build install

Usage

To load a .vc7 file run:

>>> buffer, atts   =  ReadIM.extra.get_Buffer_andAttributeList('filename.vc7')
>>> v_array, _ = ReadIM.extra.buffer_as_array(vbuff)
>>> ReadIM.DestroyBuffer(buffer)
>>> ReadIM.DestroyAttributeListSafe(atts)

similarly for a .im7 file run:

>>> buffer, atts   =  ReadIM.extra.get_Buffer_andAttributeList('filename.im7')
>>> im_array, _ = ReadIM.extra.buffer_as_array(vbuff)
>>> ReadIM.DestroyBuffer(buffer)
>>> ReadIM.DestroyAttributeListSafe(atts)

Writing files

(requires existing buffer and atts first) >>> atts = ReadIM.load_AttributeList({‘attribute’:’value’}) >>> ReadIM.WriteIM7(‘saved_file.im7’, True, buffer, atts.next)

Mermory leaks

Memory cleanup of the buffer and attribute list is not automatic. Both the buffer and attribute list must be destroyed manually. Once they are destroyed no attempt should be made to access the corresponding memory -doing so will crash the program.

>>> ReadIM.DestroyBuffer(buffer)
>>> ReadIM.DestroyAttributeListSafe(atts)

VC7 files

Depending on the filetype, there could be several frames that make up the optimal vecrtor field as decided by DaVis. For a full description of the buffer you can contact LaVision support. Below is a link for some code snippets.

see the function “_get_vectors” at https://bitbucket.org/fleming79/im/src/master/IM/core.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ReadIM-0.8.3.tar.gz (8.1 MB view hashes)

Uploaded Source

Built Distributions

ReadIM-0.8.3-cp38-cp38-win_amd64.whl (8.2 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

ReadIM-0.8.3-cp37-cp37m-win_amd64.whl (8.2 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

ReadIM-0.8.3-cp36-cp36m-win_amd64.whl (8.2 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

ReadIM-0.8.3-cp36-cp36m-win32.whl (8.2 MB view hashes)

Uploaded CPython 3.6m Windows x86

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page