running octave from a c++ program

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

running octave from a c++ program

Gamaliel Isaac
I would like to run a matlab program on an MRI scanner.  The MRI scanner uses software written in C++ which I can modify.  One option is to translate the code into C++ which could be very time consuming especially since I would have to implement matlab functions.  I would rather interface the c++ program with octave and run the program that way if that is possible.  Is it and if so how would that be done?  I don't need the graphics capability of octave just the capability of doing the math.
 
Another issue is if it is possible I don't have system administrator access to the scanner and I doubt Siemens would install the software for me.  Their scanners have to work in a clinical environment and anything they put on there has to be tested thoroughly to make sure it doesn't interfere with scanner operation.  If I could put an OCTAVE dll in a directory though that would be OK.  Is that possible?
 
If all this is not possible is it possible to get matlab functions that were translated into C?
 
Gamaliel

_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: running octave from a c++ program

Przemek Klosowski-7
On 10/23/2011 02:01 PM, Gamaliel Isaac wrote:
> I would like to run a matlab program on an MRI scanner. The MRI scanner
> uses software written in C++ which I can modify. One option is to
> translate the code into C++ which could be very time consuming
> especially since I would have to implement matlab functions. I would
> rather interface the c++ program with octave and run the program that
> way if that is possible. Is it and if so how would that be done?

Octave does offer a nice C++-callable API

           http://octave.sourceforge.net/coda/index.html

The question that always arises when combining native and interpreted
code is "who's driving", i.e. which part is executing the main loop.
  Are you going to write some C++ code that the Octave interpreter will
call? or do you expect the main loop of your application to be in C++,
making occasional calls to the Octave libraries? From your question, it
seems that you plan the latter, but it's easier and more flexible to do
it the other way around---Octave does a lot of things already that you
don't have to do by hand.

> Another issue is if it is possible I don't have system administrator
> access to the scanner and I doubt Siemens would install the software for
> me. Their scanners have to work in a clinical environment and anything
> they put on there has to be tested thoroughly to make sure it doesn't
> interfere with scanner operation. If I could put an OCTAVE dll in a
> directory though that would be OK. Is that possible?

Sure, it should be doable.

> If all this is not possible is it possible to get matlab functions that
> were translated into C?

There is a Matlab toolbox that allows that, yes.
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave