Pointer model and matlab function

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

Pointer model and matlab function

lui8errador
Hello guys,

When I connect a tool via 'Plus Server' and 'OpenIGTLink' there's a model of
the tool that appears. Does anyone know how can I get it when writing the
code? I mean, I'm doing a Slicer module in Python that makes the same as
OpenIGTLink, but I don't know how to get the tool model by code.

Another thing that I have to ask is if it is possible to use a MatLab
function in Python. What I'm doing is create a Matlab module using the
MatLabBridge Extension and then run this module in Python. Is there any way
to do it without creating the MatLab module?

Thank you!



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/Pointer-model-and-matlab-function-tp4038007.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Pointer model and matlab function

Tamas Ungi-2
Hi,

It seems like you could use the SlicerIGT extension. There are many tutorials on http://www.slicerigt.org
To create a needle model (blue stick), you can find an example in the ExampleGuidelet module (accessible from the Developer tutorial page. This code gets the needle model, and creates it if there isn't one already:

    self.needleModel = slicer.util.getNode('NeedleModel')
    if not self.needleModel:
      self.needleModel = slicer.modules.createmodels.logic().CreateNeedle(80, 1.0, 2.5, 0)
      self.needleModel.SetName('NeedleModel')

You need the SlicerIGT extension to have the createmodels module. The developer documentation is not extensive on SlicerIGT, but most modules are very simple, and you have figure out how to use them by looking at their code: https://github.com/SlicerIGT/SlicerIGT

For calling Matlab functions, I think MatLabBridge is your best option.

Tamas



-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of lui8errador
Sent: February 13, 2017 7:35 AM
To: SPL Slicer Devel <[hidden email]>
Subject: [slicer-devel] Pointer model and matlab function

Hello guys,

When I connect a tool via 'Plus Server' and 'OpenIGTLink' there's a model of the tool that appears. Does anyone know how can I get it when writing the code? I mean, I'm doing a Slicer module in Python that makes the same as OpenIGTLink, but I don't know how to get the tool model by code.

Another thing that I have to ask is if it is possible to use a MatLab function in Python. What I'm doing is create a Matlab module using the MatLabBridge Extension and then run this module in Python. Is there any way to do it without creating the MatLab module?

Thank you!



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/Pointer-model-and-matlab-function-tp4038007.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
Reply | Threaded
Open this post in threaded view
|

Re: Pointer model and matlab function

lui8errador
This post has NOT been accepted by the mailing list yet.
Thank you so much for your help Tamas!!! :)
Reply | Threaded
Open this post in threaded view
|

Re: Pointer model and matlab function

lasso2
In reply to this post by lui8errador
> Is there any way to do it without creating the MatLab module?

You have to specify what input and outputs your Matlab module has and that's exactly the Matlab module descriptor file does. If you don't want to use MatlabBridge then you have to manually write your inputs to files, invoke Matlab functions, and read output back into Slicer. Certainly doable, but it would be much more work than creating the module descriptor file.

In the long term you may better off not relying on Matlab, as nowadays you can do almost everything in Python that you can do in Matlab - and much more.
 
Andras

-----Original Message-----
From: slicer-devel [mailto:[hidden email]] On Behalf Of lui8errador
Sent: February 13, 2017 7:35
To: SPL Slicer Devel <[hidden email]>
Subject: [slicer-devel] Pointer model and matlab function

Hello guys,

When I connect a tool via 'Plus Server' and 'OpenIGTLink' there's a model of the tool that appears. Does anyone know how can I get it when writing the code? I mean, I'm doing a Slicer module in Python that makes the same as OpenIGTLink, but I don't know how to get the tool model by code.

Another thing that I have to ask is if it is possible to use a MatLab function in Python. What I'm doing is create a Matlab module using the MatLabBridge Extension and then run this module in Python. Is there any way to do it without creating the MatLab module?

Thank you!



--
View this message in context: http://slicer-devel.65872.n3.nabble.com/Pointer-model-and-matlab-function-tp4038007.html
Sent from the slicer-devel mailing list archive at Nabble.com.
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/FAQ