Simple reader for raw lif data. Will not encode anything to an image. Just gives metadata and bytes.
It is a python version of https://github.com/rharkes/RawLIFreader which was written for Matlab.
pip install .
Export all metadata as xml:
from lxml import etree
from pyrawlifreader import LifFile
liff = LifFile(r'c:\mylif.lif')
with open('metadata.xml', 'wt') as fp:
fp.write(etree.tostring(liff.xml).decode('utf-8'))Show xml of a single memoryblock:
from lxml import etree
from pyrawlifreader import LifFile
liff = LifFile(r'c:\mylif.lif')
print(etree.tostring(liff.memblocks[6].xml).decode('utf-8'))Load data from memoryblock
from pyrawlifreader import LifFile
liff = LifFile(r'c:\mylif.lif')
data = liff.getbinaryblockdata('MemBlock_2644')
data2 = liff.getbinaryblockdata(1)