[slicer-devel] =?GB2312?B?UmU6IFtzbGljZXItZGV2ZWxdILvYuLSjuiC72Li0o7ogTGlzdGVuIHRoZSBPdQ==?= =?GB2312?B?dGVyIERldmljZQ==?=

Steve Pieper pieper at ibility.net
Mon Mar 25 09:53:00 EDT 2013


That makes a lot of sense - thanks Junichi.

-Steve


On Mon, Mar 25, 2013 at 9:39 AM, Junichi Tokuda <tokuda at bwh.harvard.edu>wrote:

> Hi Steve,
>
> Sounds like a great idea to provide a general way to send states over
> OpenIGTLink and make them accessible through the Get/SetAttribute methods.
> I would use STRING type to send key/value combinations. The challenge is
> how to differentiate STRING messages for attributes from those for
> AnnotationText (as Tamas and Andras described in the earlier posts).
>
> I would suggest to use BIND type to send a set of POSITION/TRANSFORM and
> STRING messages to 3D Slicer. BIND type is used to bundle multiple
> OpenIGTLink messages in one OpenIGTLink message. At the OpenIGTLink
> interface in 3D Slicer, such a BIND message could be converted to
> vtkMRMLTransformNode with key/value array defined by STRING messages
> contained in the BIND message. If a STRING message comes alone, it could be
> converted to AnnotationText.
>
> Junichi
>
>
>
> On Mar 25, 2013, at 8:57 AM, Steve Pieper wrote:
>
> Hi Junichi -
>
> I'm also interested in how to send extra information over openigtlink and
> associate it with mrml nodes - for example we have some tracking devices
> that have buttons and I would like send that state over openigtlink.  Do we
> have examples of that?  Would these come as String messages or some other
> type?
>
> On the mrml side, every vtkMRMLNode has a general keyword/value array
> accessible by the Get/SetAttribute methods [1] and available in the GUI
> through a widget in the Data module [2] (thanks Csaba).  We have been using
> the format "ModuleName.attribute" as the key, and then arbitrary string
> data as the value.
>
> In my experiments I've been setting attributes on transform nodes based on
> the state of the input device and I would like to come up with a generic
> way within slicer to translate state changes on mrml attributes into
> actions.  I have some experimental code [3] that I have been using with the
> kinect-based hand tracker but it would be great to also drive this with
> openigtlink data.  In this case it responds to 'SlicerHands.gesture' having
> a value of 'pinch' but I think we could generalize this to work with
> arbitrary input devices.
>
> -Steve
>
> [1] http://slicer.org/doc/html/classvtkMRMLNode.html
> [2] http://slicer.org/doc/html/classqMRMLNodeAttributeTableView.html
> [3] https://github.com/pieper/SlicerHands/blob/master/manipulator.py
>
>
> On Mon, Mar 25, 2013 at 8:27 AM, Junichi Tokuda <tokuda at bwh.harvard.edu>wrote:
>
>> Dear Feng,
>>
>> The OpenIGTLinkIF module does not currently support string message,
>> because I'm still not sure which MRML node type is suitable to represent
>> string data. Basically, you need to have a converter class (a child class
>> of MRML/vtkIGTLToMRMLBase.h) to convert OpenIGTLink messages to MRML node
>> using Python as demonstrated in the page you read. Otherwise, a converter
>> class has to be defined in your module and registered using
>> vtkMRMLIGTLConnectorNode::RegisterMessageConverter() function. In
>> default, the module registers the following converter classes, which can be
>> found in the OpenIGTLinkIF/MRML directory:
>>
>> vtkIGTLToMRMLImage.h
>> vtkIGTLToMRMLImageMetaList.h
>> vtkIGTLToMRMLLinearTransform.h
>> vtkIGTLToMRMLPosition.h
>> vtkIGTLToMRMLTrackingData.h
>>
>> I'm thinking to implement converters for other data types supported in
>> the OpenIGTLink protocol. If you wish to implement something like
>> vtkIGTLToMRMLString class, I'm happy to work with you.
>>
>> Thanks,
>>
>> Junichi
>>
>>
>>
>>
>>
>> On Mar 25, 2013, at 2:56 AM, Feng Chen wrote:
>>
>> Dear Slicer:
>>     I have read the OpenIGTLinkIF module source code. And I read this
>> website
>> http://wiki.slicer.org/slicerWiki/index.php/Documentation/4.2/Developers/OpenIGTLinkIF
>>  too and I tried the code in that website. After then, I tried to send some
>> string messages to the slicer using the example in the OpenIGTLink source
>> code ("StringServer.cxx"), but I don't know which API I can use to show
>> these string messages in the Slicer in the python code.
>> Thanks a lot.
>> Feng Chen
>>
>>   ------------------------------
>> *·¢¼þÈË£º* Andras Lasso <lasso at cs.queensu.ca>
>> *ÊÕ¼þÈË£º* 'Feng Chen' <crfzjutfirst at yahoo.cn>
>> *³­ËÍ£º* 'slicer' <slicer-devel at bwh.harvard.edu>
>> *·¢ËÍÈÕÆÚ£º* 2013Äê3ÔÂ23ÈÕ, ÐÇÆÚÁù, 12:02 ÉÏÎç
>> *Ö÷Ìâ:* RE: [slicer-devel] »Ø¸´£º Listen the Outer Device
>>
>> Hi Feng,
>>
>> You can have a look at the OpenIGTLinkIF module source code to see how
>> data injection from a worker thread to the main thread can be implemented
>> correctly.
>>
>> Even better, just update your software to send the information with an
>> OpenIGTLink-compatible message header. OpenIGTLink is about the simplest
>> possible socket-based protocol for streaming pose information (
>> http://openigtlink.org/spec.html), so you should be able to make your
>> software compatible very easily.
>>
>> You may also consider using the PlusServer application of the PLUS
>> toolkit (www.plustoolkit.org), which can readily acquire orientation
>> information from some orientation sensors (PhidgetSpatial
>> http://www.phidgets.com/products.php?product_id=1044 or CH Robotics
>> http://www.chrobotics.com/shop/orientation-sensor-um6) and stream the
>> data to Slicer.
>>
>> Andras
>>
>> *From:* slicer-devel-bounces at bwh.harvard.edu [mailto:
>> slicer-devel-bounces at bwh.harvard.edu] *On Behalf Of *Feng Chen
>> *Sent:* March 22, 2013 6:11 AM
>> *To:* slicer
>> *Subject:* [slicer-devel] »Ø¸´£º Listen the Outer Device
>>
>> Dear Slicer:
>>         I have solved the "Busy Waiting" problem by using multi-thread
>> methods. I used the "threading" module in the python standard library. But
>> it produces a new problem : when the python module is running as a server,
>> and my phone as a client sends some data to this module. It can't work well
>> before I press the "Enter" key in the Slicer Python Interactor. While both
>> the server and the client are running, if  I pressed the "Enter" key in the
>> Slicer Python Interactor, it can work well only once . But if I didn't
>> press the "Enter" key , it can not work. How can I solve this problem to
>> make this python module to work smoothly? If there is no good ideas, I had
>> to use the OpenIGTLink to solve my problem(my phone to Slicer). It may be
>> difficult for me to use the OpenIGTLink to solve this problem.
>> Thanks a lot
>> Feng Chen
>>
>> ------------------------------
>> *·¢¼þÈË£º* Andras Lasso <lasso at cs.queensu.ca>
>> *ÊÕ¼þÈË£º* Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>; Feng
>> Chen <crfzjutfirst at yahoo.cn>
>> *³­ËÍ£º* slicer <slicer-devel at bwh.harvard.edu>
>> *·¢ËÍÈÕÆÚ£º* 2013Äê3ÔÂ13ÈÕ, ÐÇÆÚÈý, 8:31 ÏÂÎç
>> *Ö÷**Ìâ**:* RE: [slicer-devel] Listen the Outer Device
>>
>> OpenIGTLink is developed for allowing  real-time data streaming to/from
>> Slicer. Multi-threaded background acquisition, buffering, safe update of
>> the MRML tree are all already implemented in Slicer. There are lots of
>> examples, test clients and servers that can help in the development of the
>> phone side. You don't have to implement anything in Slicer if you just want
>> to stream images or transforms, they are automatically injected and updated
>> in the scene. Using the SlicerIGT extension you can receive any other
>> custom data in a string message in Slicer and you can even send commands to
>> your phone.
>>
>> Andras
>> ------------------------------
>> *From: *Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>
>> *Sent: *2013-03-13 02:19
>> *To: *Feng Chen <crfzjutfirst at yahoo.cn>
>> *Cc: *slicer <slicer-devel at bwh.harvard.edu>
>> *Subject: *Re: [slicer-devel] Listen the Outer Device
>> Hi Feng,
>>
>> The approach consisting in using a "while(true)" is what we could call
>> "BusyWaiting" approach [1]. By doing so, you don't give any time to the GUI
>> Event loop to process event as it should.
>>
>> I would recommend you to read the following article to see available
>> option: http://doc.qt.digia.com/qq/qq27-responsive-guis.html
>>
>> Hth
>> Jc
>>
>> [1] http://en.wikipedia.org/wiki/Busy_waiting
>>
>> On Wed, Mar 13, 2013 at 2:06 AM, Feng Chen <crfzjutfirst at yahoo.cn> wrote:
>> Dear, Slicer:
>>          I am writing a Python module to listen some outer device such as
>> Phone. I used the Socket to communicate with each other. But when I used
>> the "While True: ........" ,the Slicer can't work well. Then I removed the
>> statement of "While True: ...... ......" , It worked well. But it is just
>> worked well once. I want it to work well always, when I used this module to
>> listen what the phone sent to the slicer. How can I do?
>>  Thanks a lot.
>>   Feng Chen
>>
>> _______________________________________________
>> slicer-devel mailing list
>> slicer-devel at bwh.harvard.edu
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to
>> slicer-devel-request at massmail.spl.harvard.edu with unsubscribe as the
>> subject
>>
>>
>>
>> --
>> +1 919 869 8849
>>
>>
>>
>>  _______________________________________________
>> slicer-devel mailing list
>> slicer-devel at bwh.harvard.edu
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to
>> slicer-devel-request at massmail.spl.harvard.edu with unsubscribe as the
>> subject
>>
>>
>>
>> _______________________________________________
>> slicer-devel mailing list
>> slicer-devel at bwh.harvard.edu
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to
>> slicer-devel-request at massmail.spl.harvard.edu with unsubscribe as the
>> subject
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://massmail.spl.harvard.edu/public-archives/slicer-devel/attachments/20130325/987251e1/attachment-0001.html 


More information about the slicer-devel mailing list