I'm working on porting code from Matlab into python, and I'm using numpy and scipy as the main libraries. I've run into an issue where I need to repopulate a class with data. In the Matlab code this data was all precomputed so that on subsequent runs, it wouldn't need to be calculated again. I'm trying to load the data in the object, but can't seem to access the elements I want.
Printing the contents after running scipy.io.loadmat gives me the following:
{'__function_workspace__': array([[ 0, 1, 73, ..., 0, 0, 0]], dtype=uint8),
'None': MatlabOpaque([('TLib', 'MCOS', 'TexLib', [[3707764736L], [2L], [1L], [1L], [1L], [2L]])],
dtype=[('s0', 'O'), ('s1', 'O'), ('s2', 'O'), ('arr', 'O')]), '__version__': '1.0',
'__header__': 'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Thu Dec 12 17:40:42 2013', '__globals__': []}
I don't even see the properties I want to access, they all seem hidden. When I try to access parts of the above as dictionary elements, I don't see them either.
I'd like to avoid rewriting the Matlab code to recreate the objects if at all possible. Is there anyway to access the properties of a class using scipy?
EDIT
The class type I'm trying to load is called TexLib.
It contains:
- ImW (316944x824 uint8)
- ImW_G (316944x824 uint8)
- Gr (struct), Masks (struct)
- NormalizedTexSize (1x3 double)
- NumTexs (double)
- ShapeMeanTexSpace (1x178 double)
- PreComputePoisson (1x80 cell)
- TexDH (empty)