[Insight-users] problem running ITK registration program from within Matlab

Koen Vermeer koen at vermeer.tv
Tue Nov 25 06:30:04 EST 2008


On Sat, 2008-11-22 at 15:57 -0800, pinpress wrote:
> Thanks for your input -- Unfortunately, I still haven't figured out how to
> make Matlab link to the right library. So if you could have a look at
> exactly what you did to make it work, that'll be much appreciated. Do you
> have to "move" matlab library "out of the way"? For myself, I don't think I
> will have the user access to move them because Matlab installation on our
> Linux is read only. 

Matlab includes a copy of some standard libraries, such as libstdc++.
Their version may not match your system's version, which is fine when
running Matlab, but may give problems when trying to run a program
that's compiled for a different version.

In my case, it was easy to remove Matlab's versions of those libraries,
and instead use the system libs. My mex files are also build against the
system libs, so this solves the problem.

An alternative may be to build the mex files against the libraries
shipped with Matlab. If you find some easy way to do that, let us know.

> By the way, I just want to let everybody know that I had a workaround to
> automate the process: I used Matlab to generate a text file (e.g.,
> "run_all"), which is composed of a bunch of command lines such as the
> following:

Why not use the 'unix' command from within Matlab to run the program?

In your mex file, how did you convert the Matlab array to an ITK image?
My routine now simply copies the data into an Image, but I'd rather base
it on ImageSource, so I can skip copying the data.

Best,
Koen




More information about the Insight-users mailing list