SPM sn3D TO AIMS : failure : no module named pymat

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
User avatar
François Leroy
Posts: 30
Joined: Wed Feb 22, 2006 5:22 pm

SPM sn3D TO AIMS : failure : no module named pymat

Post by François Leroy »

Hello,

I am trying to run the SPM sn3d to AIMS transformation converter.
I got the following error message :
"in SPM sn3d to AIMS transformation converter 1 No module named pymat"

My input parameters :
- read : anat00299_sn.mat
- write : anat00299_sn_TO_spm_template.trm
- normalized image : wanat00299.img

Error log :
ImportError
neuroProcesses.py (1649) in _processExecution:
result = process.execution( self )
SPMsn3dToAims.py (205) in execution:
matlab.matlab().eval( matlabcom )
matlab.py (266) in matlab:
_matlabInstance = Matlab( '"' + matlabExecutable + '" ' + matlabOptions )
matlab.py (112) in __init__:
Matlab.importpymat()
matlab.py (107) in importpymat:
exec( _pymatmoduleimport, globals(), globals() )
<string> (1) in <module>:
?

Thank you for your help,
François :?
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hi,
Have you checked the matlab part in the configuration panel of brainvisa ? Does matlab work alone ?
If yes, also check the matlab configuration section of BV log (and tell us what it shows).
Otherwise, I will come and look at it in a moment.
Denis
User avatar
François Leroy
Posts: 30
Joined: Wed Feb 22, 2006 5:22 pm

Post by François Leroy »

Hi,
Here is the matlab environnement set in the BV logbook

matlabRelease = None
matlabExecutable = matlab
matlabOptions = -nosplash -nojvm
matlabPath = ['/home/appli/Fedora-4/cartopack-linux-3.0.3-2007_01_31shfj/brainvisa/matlab', '/home/appli/Fedora-4/cartopack-linux-3.0.3-2007_01_31shfj/brainvisa/matlab/MSP', '/home/appli/Fedora-4/cartopack-linux-3.0.3-2007_01_31shfj/brainvisa/matlab/utils', '/home/appli/Fedora-4/cartopack-linux-3.0.3-2007_01_31shfj/brainvisa/matlab/mesh', '/home/appli/Fedora-4/cartopack-linux-3.0.3-2007_01_31shfj/brainvisa/matlab/LoadSave', '/neurospin/local/matlab-R2007a/bin/matlab']
matlabStartup = []
:(

Thanks for your help,
François
denghien
Posts: 209
Joined: Mon Apr 05, 2004 1:35 pm
Location: IFR49 / SHFJ Orsay
Contact:

Post by denghien »

Hi,

I spent a little time with François to figure out why the process didnt' work.
I tried with demo data to check the mechanism and we have had the same pb. I removed all settings for matlabpath.

The two processes using matlab (neuropsin package) are displayed but when the process is launched, then it seems there is a pb with the pymat python module. It isn't loaded.

In the meantime, I advise to Francois to use the matlab code of the python pocess to extract the transformation. I hope it helps him.


Isa
User avatar
Yann Cointepas
Posts: 316
Joined: Tue Jan 20, 2004 2:56 pm
Location: Neurospin, Saint Aubin, France
Contact:

Post by Yann Cointepas »

Could it be a licence problem ? Try to use d directly the pymat module from IPython with

Code: Select all

brainvisa --shell (/code].
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Could it be a licence problem ?
apparently not: matlab seems to be enabled in BV so it hasn't been detected as non-working (I talked with François at the coffee break).
I will come and look at it. I didn't find time today. Maybe tomorrow..
Denis
denghien
Posts: 209
Joined: Mon Apr 05, 2004 1:35 pm
Location: IFR49 / SHFJ Orsay
Contact:

Post by denghien »

Hi,

Otherwise, in order to obtain your result and to check, I suppose if you install the stable package available on the web site, it should work.

Isa
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

Hi,

Well, after looking at it for a while, we found 2 problems:

- one bug in brainvisa when checking matlab version with matlab version 2006a or newer. It's fixed on our repository, and I think you can avoid it by specifying the 'matlabRelease' variable in BV config (set it to 14), then the version checking is bypassed (and it starts faster, too - hum, I mean, a bit less slowly).

- a path problem to matlab engine libraries: you have to set the correct matlab directory in your LD_LIBRARY_PATH environment variable before running brainvisa (I think we cannot set it from BV once python is running). For matlab7 in Neurospin the path is /neurospin/local/matlab/bin/glnx86. But warning: in this directory some old libraries may override some standard system-wide libraries, so you have to set matlab lib path *after* the standard /usr/lib path:

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/neurospin/local/matlab/bin/glnx86
(for a bash shell on a 32bit linux)
We will try to find a way to set it automatically for matlab7 in Neurospin.

Denis
Post Reply