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

pinpress sb_ji at yahoo.com
Tue Nov 25 09:05:56 EST 2008


Koen,

I think somehow you probably misunderstood me -- the ITK registration
programs are not mex files to run from within Matlab. Instead, they are
compiled using Cmake and make and they run as an executable on the shell.
Because cmake and make link the executable dynamically against all the
necessary shared libraries at run time, it has to know where to look for the
right libraries, either at command prompt or from Matlab if you want it to
run from within. 

Yes, exactly that I used "unix(command_line)" type of call from Matlab,
where "command_line" is the compiled ITK program. 

So, can you post where your libstdc++ libraries are located on your system,
either the one comes with the system, or the Matlab version? I may do some
more digging (e.g., create symbolic link to point to the right ones) if I
know where they are.

Since I did not really use mex file, sorry that I can't answer your question
regarding image array. 

thanks. pinpress


Koen Vermeer-4 wrote:
> 
> 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
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 

-- 
View this message in context: http://www.nabble.com/problem-running-ITK-registration-program-from-within-Matlab-tp20627249p20681799.html
Sent from the ITK - Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list