Metadata-Version: 2.1
Name: ReadIM
Version: 0.8.3
Summary: Read and write native DaVis images and vectors filetypes VC7 and IM7
Home-page: https://bitbucket.org/fleming79/readim
Author: Alan Fleming + LaVision
Author-email: alanf@amc.edu.au
License: MIT
Keywords: IM7 VC7 DaVis LaVision FileIO PIV
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8

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(buffer)
>>> 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(buffer)
>>> 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



