openigtlink / OpenIGTLink

Free, open-source network communication library for image-guided therapy
http://openigtlink.org
BSD 3-Clause "New" or "Revised" License
102 stars 184 forks source link

transferring ultrasonix images with openigtlink protocole #213

Closed ghost closed 3 years ago

ghost commented 5 years ago

Hi, I am trying to understand how igtlink protocol is working. I do not understand how to develop a client which will grab image from an igtlink server... Especially how Image works, and how to get all the pixels from an image send with igtlink protocol. Can someone help me?

adamrankin commented 5 years ago

Hello,

You can see some client examples here, or here.

The protocol is very simple on purpose. Once connected, you first receive the 58 byte header. In that header, it tells you what kind of message it is, and how much more data is in that message. You then receive the additional amount of data, and use the OpenIGTLink infrastructure to unpack the message.

ghost commented 5 years ago

Thank you for you answer. I still have an issue when launching the executable, after compiling ReceiveClient.cxx file. I have two error messages: malloc(): memory corruption Abandon (core dumped) Did you encounter this kind of messages?

ghost commented 5 years ago

The error seems to come from igtl::TimeStamp::New in igtlTimeStamp.h

adamrankin commented 5 years ago

I've never experienced this. Is it an out-of-memory error?

ghost commented 5 years ago

Ok. The problem should come from me. Here is my setup: a plusServer running on ultrasonix pc, wired to another pc. I just want to get us images on the other pc by coding my own client using the ReceiveClient.cxx sample. Is it an appropriated approach? Or did I miss something? Thank you for your patience

leochan2009 commented 5 years ago

it might be different protocol version. Plusserver might use version2 message and your receiveclient might use version 3 message, you could try build your code from previous stable release, such as release2.0

ghost commented 5 years ago

Ok, fine. Do you have any link pointing to the official 2.0 release? I have tried to install this one, but when compiling it, I have the following error messages: /OpenIGTLink-2.0/Source/igtlNDArrayMessage.h: In member function ‘int igtl::Array::SetValue(igtl::ArrayBase::IndexType, T)’: /OpenIGTLink-2.0/Source/igtlNDArrayMessage.h:94:62: error: ‘void*’ is not a pointer-to-object type

leochan2009 commented 5 years ago

Hi,

This is a bug fixed in version release2.1, could you try using that version?

ghost commented 5 years ago

Ok, I managed to install 2.1 version but I still have this allocation memory issue when executing ReceiveClient.cxx... The problem still comes from timestamp pointer: igtl::TimeStamp::Pointer ts; ts = igtl::TimeStamp::New();

Any idea with this? If no, I will close this issue

adamrankin commented 5 years ago

PlusServer uses v3 messages.

adamrankin commented 5 years ago

I am able to compile and run ReceiveClient successfully using PlusServer

adamrankin commented 5 years ago

Both on master.

What version of PlusServer are you running?

ghost commented 5 years ago

I don't know why I'm facing this issue... Thank you all for the help

ghost commented 5 years ago

Sorry @adamrankin I did not see your last answer I am running version 2.6.0/Ultrasonix-6.1/32Win of plusServer

leochan2009 commented 5 years ago

i don't have a plusserver installed, but just tried the ImagerServer example from release-2.1 and ReceiveClient example from master, the two sample app communicate very well.. We try to make the code backward compatible, so even if you are using older version of Plusserver, the ReceiveClient from the master branch will still work. Could the issue come from the 32bit machine?

ghost commented 5 years ago

Could the issue come from the 32bit machine?

No, I don't think so. I managed to make igtLink protocole work with ServerPlus and 3D Slicer (3D Slicer configured as a client).

ghost commented 4 years ago

Hi, excuse me for disturbing you again, but I am still stuck with the same problem as before: transferring us image probe from ultrasonix pc to another pc. I saw that you developed a tool to perform this: igtlVideoStreamIGTLinkReceiver.h Is this the correct way to send video flow through openigtlink protocol? And do you have a small piece of code which uses igtlVideoStreamIGTLinkReceiver.h? Thank you in advance!

leochan2009 commented 4 years ago

HI,

The igtlVideoStreamIGTLinkReceiver is for RGB video data, though it could also work on grey images. However, to get images from Ultrasonix PC, you will need to use the ImageMessage, as plusserver is using ImageMessage for transmission. if you could show me the error output i might be able to dig into the issue