<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'><font class="Apple-style-span" size="3" style="color: rgb(0, 0, 0); ">Hello Michael,</font><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">First, we always refer to this document when in doubt: <meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.commontk.org/index.php/File:DicomAppHostingSpecs.pdf">http://www.commontk.org/index.php/File:DicomAppHostingSpecs.pdf</a></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">It's been some time since we touched that code, so forgive me if my answers are sometimes a bit vague.</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: small; ">"</span><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: small; "> I am updating the </span><span class="Apple-style-span" style="font-family: Calibri, sans-serif; font-size: small; ">AvailableData structure and then publish it to the hosted application when I am starting it"</span></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">So I am guessing you are sending a notifyDataAvailable(AvailableData input,true ), with the descriptors for all your files, right?</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">Now from your application you should call getData() with the UUIDs you got from the notification, are we still on the same page?</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">So If I understood you correctly, the problem is that you only receive on UUID from the notification?</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">My question is then: did you use the helper functions to fill in your data structure:</div><div> <span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#800080;">ctkDicomSoapArrayOfObjectDescriptors</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#000000;">(</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#808000;">const</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#c0c0c0;"> </span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#800080;">QString</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#000000;">&</span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#c0c0c0;"> </span></span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; ">name</span><span class="Apple-style-span" style="font-family: monospace; white-space: pre; "><span style=" color:#000000;">,</span></span></div><meta name="qrichtext" content="1"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ctkDicomAppHosting</span><span style=" color:#000000;">::</span><span style=" color:#800080;">ArrayOfObjectDescriptors</span><span style=" color:#000000;">&</span><span style=" color:#c0c0c0;"> </span>ods<span style=" color:#000000;">);</span><!--EndFragment--></pre><pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#000000;">
<meta name="qrichtext" content="1"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>ArrayOfObjectDescriptor being this:
<pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!--StartFragment--><span style=" color:#808000;">typedef</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">QList</span><span style=" color:#000000;"><</span><span style=" color:#800080;">ObjectDescriptor</span><span style=" color:#000000;">></span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">ArrayOfObjectDescriptors</span><span style=" color:#000000;">;</span></pre></span></pre><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">You must use the types defined in plugins/org.commontk.dah.core/ctkDicomAppHostingTypes.h and the helpers in plugins/org.commontk.dah.core/ctkDicomAppHostingTypesHelpers.h</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">You must fill in your AvailableData::patients list, down to the Series level, or just the AvailableData::objectDescriptors array if you just want a quick test (the recommended way is to fill in properly the hierarchy of Patient/study/series properly).</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">I think I remember we sent several files at once with Ivo at some point as a test, but I can't be 100% sure. But I am fairly confident this should work.</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">Now to unpack the results from soap messages to Qt objects, you must once again use the typeHelpers structures:</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; "><meta name="qrichtext" content="1"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<pre style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; text-indent: 0px; "><!--StartFragment--><span style="color: rgb(128, 0, 128); ">ctkDicomAppHosting</span><span style="color: rgb(0, 0, 0); ">::</span><span style="color: rgb(128, 0, 128); ">ArrayOfObjectDescriptors</span><span style="color: rgb(192, 192, 192); "> </span><span style="color: rgb(128, 0, 128); ">ctkDicomSoapArrayOfObjectDescriptors</span><span style="color: rgb(0, 0, 0); ">::</span>getArrayOfObjectDescriptors<span style="color: rgb(0, 0, 0); ">(</span><span style="color: rgb(128, 128, 0); ">const</span><span style="color: rgb(192, 192, 192); "> </span><span style="color: rgb(128, 0, 128); ">QtSoapType</span><span style="color: rgb(0, 0, 0); ">&</span><span style="color: rgb(192, 192, 192); "> </span><span style="color: rgb(0, 0, 0); ">type</span><span style="color: rgb(0, 0, 0); ">)</span><!--EndFragment--></pre></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">Now if this doesn't work we will have to look at the marshalling functions we wrote (all the helper functions). </div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">Cheers,</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; ">Ben.</div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><br></div><div style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 12pt; "><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;">
<title></title>
Hi Michael,<br>
<br>
As far as I know, we only tested the data exchange interface with
one single .dcm file yet. I am also not aware of any restrictions
regarding the QtSoap array support (apart from a max dimension of
5).<br>
<br>
How are you updating the AvailableData structure? Could you send the
SOAP messages send by the client and received by the server (you
might have to edit
/opt/git/CTK/Plugins/org.commontk.dah.core/ctkSoapLog.h to enable
logging).<br>
<br>
Maybe Ivo and Benoit can also comment on this issue, they where
mainly involved in writing the data exchange interface.<br>
<br>
Thanks,<br>
Sascha<br>
<br>
On 06/06/2011 09:35 PM, Caylus, Michael (SCR US) wrote:
<blockquote cite="mid:63D07F9AA364DB4C901F02EF93465C8D780878D789@USMLVA0E934MSX.ww017.siemens.net">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
<font face="Calibri, sans-serif" size="2">
<div>Hi Sascha,</div>
<div> </div>
<div>First thanks a lot for the quick reply I got on my previous
post. I decided to go for the first approach and created my
own CTK plugin as we should stay in the context of a hosting
application. I managed to start and run my hosted application
through
the DICOM Application Host interface with this approach.</div>
<div> </div>
<div>I am now looking into passing some dataset to the hosted
application. I wanted to start with something simple where
the end-user select a folder that contains a list of DICOM
files (one series) and pass it to my application. After
choosing the folder;
I am updating the AvailableData structure and then publish it
to the hosted application when I am starting it. By the time
the SOAP request is done I could see that the SOAP message
will contains my list of uuids I created for one series but
when the message
is received <font size="2">(</font><font face="ProggySquareTTSZ" size="2">ctkSoapMessageProcessorList::process
method)</font> on the hosted application; the message is not
the same and only contains one uuid now for the series. Is
there any limitation currently
within QtSoap to support arrays that you are aware of? I have
seen some discussion regarding on the ctk website (<a href="http://www.commontk.org/index.php/Documentation/DicomApplicationHosting:DataExchangeDevelopment" target="_blank"><font color="#0000ff"><u>http://www.commontk.org/index.php/Documentation/DicomApplicationHosting:DataExchangeDevelopment</u></font></a>)
but I am not sure what the status here. </div>
<div> </div>
<div>If there is still some restriction with QtSoap regarding
the array; should I send multiple notifyDataAvailable messages
to the application; one for each file I am willing to get on
the application side. Is there any other best alternative
beside my first
approach?</div>
<div> </div>
<div>Best,</div>
<div>Michael</div>
<div> </div>
<div> </div>
<div><font face="Consolas, monospace" size="2">-------------------------------------------------------------------------------------------------------------------------------</font></div>
<div><font face="Consolas, monospace" size="2">From: Sascha
Zelzer <a class="moz-txt-link-rfc2396E" href="mailto:s.zelzer@dkfz-heidelberg.de" target="_blank"><s.zelzer@dkfz-heidelberg.de></a></font></div>
<div><font face="Consolas, monospace" size="2">Subject: Re:
[Ctk-developers] How to wrap a Qt App into an hosted app</font></div>
<div><font face="Consolas, monospace" size="2">
confirming to DICOM Supplement 118 / Working Group 23</font></div>
<div><font face="Consolas, monospace" size="2">To:
<a class="moz-txt-link-abbreviated" href="mailto:ctk-developers@commontk.org" target="_blank">ctk-developers@commontk.org</a></font></div>
<div><font face="Consolas, monospace" size="2">Message-ID:
<a class="moz-txt-link-rfc2396E" href="mailto:4DCD447F.7060402@dkfz-heidelberg.de" target="_blank"><4DCD447F.7060402@dkfz-heidelberg.de></a></font></div>
<div><font face="Consolas, monospace" size="2">Content-Type:
text/plain; charset="windows-1252"; Format="flowed"</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">Hi Michael,</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">Welcome to the
CTK mailing list.</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">DICOM Application
Hosting support in CTK is still work in progress, so please
be aware that not everything will work yet. Especially the
data exchange interface needs more work. Nevertheless, I
hope my comments
below will get you started to experiment with your own Qt
based DICOM App. Comments, bug reports, patches etc. are
also always welcome!</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">Best,</font></div>
<div><font face="Consolas, monospace" size="2">Sascha</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">On 05/13/2011
03:56 AM, Caylus, Michael (SCR US) wrote:</font></div>
<div><font face="Consolas, monospace" size="2">> Hello,</font></div>
<div><font face="Consolas, monospace" size="2">> I am new to
the CTK SDK and would like to wrap my Qt application into </font></div>
<div><font face="Consolas, monospace" size="2">> an hosted
app. I have seen such an example by turning on in the CMake</font></div>
<div><font face="Consolas, monospace" size="2">>
configuration: ctkExampleHost and ctkExampleHosted App. I
came up </font></div>
<div><font face="Consolas, monospace" size="2">> with the
following questions after playing with it:</font></div>
<div><font face="Consolas, monospace" size="2">></font></div>
<div><font face="Consolas, monospace" size="2">> 1. In
order to make this wrap-up for my app; I was considering to</font></div>
<div><font face="Consolas, monospace" size="2">> edit
the org_commontk_dah_exampleapp plug-in which relies on the</font></div>
<div><font face="Consolas, monospace" size="2">>
org_commontk_dah_app and org_commontk_dah_core plug-in and
keep</font></div>
<div><font face="Consolas, monospace" size="2">> the
ctkExampleHostedApp. Is this approach the right way to</font></div>
<div><font face="Consolas, monospace" size="2">>
proceed? This implies splitting my app into the hostedApp
and a</font></div>
<div><font face="Consolas, monospace" size="2">> CTK
plugin; with most of the work to be done on the plug-in</font></div>
<div><font face="Consolas, monospace" size="2">> level
I guess. I have seen some doc explaining how to embed the</font></div>
<div><font face="Consolas, monospace" size="2">> CTK
plugin framework in my app too. Can I achieve the same</font></div>
<div><font face="Consolas, monospace" size="2">> result
with this approach and how?</font></div>
<div><font face="Consolas, monospace" size="2">></font></div>
<div><font face="Consolas, monospace" size="2">As you have
already seen, it is possible to use the plugin framework
from inside your own application and this is also the
preferred way (instead of modifying the existing CTK
plug-ins directly). In the case of
a DICOM App, I can think of two different approaches,
depending on your requirements:</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">1.) Your app is a
"pure" DICOM App, i.e. you do not need run it outside the
context of a "Hosting Application"</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">This is the
easier approach. You would create your own plug-in,
equivalent to org.commontk.dah.exampleapp, which contains
all your app code (logic, widgets, etc.). Additionally, you
create your own ctkExampleHostedApp
executable, which is essentially the same code as in the CTK
repository (just adapt paths and plug-in names).</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">The</font></div>
<div><font face="Consolas, monospace" size="2"><a href="http://www.commontk.org/index.php/Documentation/CTK_Plugin_Framework:_Setting_up_a_project?action=purge" target="_blank"><font color="#0000ff"><u>http://www.commontk.org/index.php/Documentation/CTK_Plugin_Framework:_Setting_up_a_project?action=purge</u></font></a></font></div>
<div><font face="Consolas, monospace" size="2">tutorial explains
how to create a CTK-based project.</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">2.) You want to
use your app both "stand-alone" and as a "hosted app"</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">This involves a
little bit more knowledge about the plugin framework, but
should also be easy to achieve. What the
org.commontk.dah.exampleapp plug-in actually does, is to
register a class containing the DICOM
"application logic" as a service within the
plugin-framework. You could either create this class
(similar as the ctkExampleDicomAppLocig class) inside your
current project (not in a separate plug-in) and register an
instance by using the plugin framework context,
or create a small plug-in containing this class and taking
care of the registration itself. Then start the plugin
framework from inside your executable, if you recognize the
host and app url command line parameters (otherwise, create
a QMainWindow yourself).</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">Depending on how
fancy you would like to get concerning the minimization of
dependencies of your app in stand-alone mode to the CTK
libraries, you could think of a more complex set-up
containing two small wrapper
executables, one for "app mode" starting the CTK plugin
framework and one for "stand-alone mode", both linked to a
library containing your application gui and logic...</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">> 1. I
couldn?t find to which QMainWindow is the button attached to</font></div>
<div><font face="Consolas, monospace" size="2">> in the
ctkExampleDicomAppLogic::do_something()function.It</font></div>
<div><font face="Consolas, monospace" size="2">>
doesn?t look like thectkExampleDicomAppLogic is heritating
from</font></div>
<div><font face="Consolas, monospace" size="2">> a
widgetalso. Which object is responsible of the creation of
the</font></div>
<div><font face="Consolas, monospace" size="2">>
mainwindow?</font></div>
<div><font face="Consolas, monospace" size="2">></font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">The
org.commontk.dah.exampleapp plugin does not create a
QMainWindow. It just create a button an shows it (moved and
resized to respect the prescribed screen area from the
host). In Qt, widgets become top-level
windows if they don't have a parent widget and are "shown".</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">> 1. Is
there any doc that explains how to create a CTK plug-in and</font></div>
<div><font face="Consolas, monospace" size="2">> App
from scratch. It would be probably better in my case to</font></div>
<div><font face="Consolas, monospace" size="2">> create
a new plugin instead of editing an existing one.</font></div>
<div><font face="Consolas, monospace" size="2">></font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">There is no doc
about creating a plug-in yet, but you can easily create one
by using the ctkPluginGenerator executable (you may have to
enable it in CMake). It might have some rough edges
though...</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">A CTK "app" is
actually nothing special. Any executable can do, which links
to the CTK libraries. The tutorial linked above explains how
to use the plugin framework in an arbitrary executable.</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">> 1. How
can I add additional includes directories through a</font></div>
<div><font face="Consolas, monospace" size="2">>
CMakeLists in the CTK framework. I couldn?t find a way to</font></div>
<div><font face="Consolas, monospace" size="2">> define
additional directories in the CMakeList of a plug-in (no</font></div>
<div><font face="Consolas, monospace" size="2">>
include_directories). Is that define somewhere else?</font></div>
<div><font face="Consolas, monospace" size="2">></font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">Inside CTK
itself, include directories are set-up auto-magically
through our custom CMake dependency system. If you need to
use external libraries in your own CTK plug-in (contained in
your own project), just use
standard CMake INCLUDE_DIRECTORIES (before calling the
ctkMacroBuildPlugin macro) and
LINK_LIBRARIES(${PROJECT_NAME} ...) (after the
ctkMacroBuildPlugin call) commands.</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">Happy coding,</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">Sascha</font></div>
<div><font face="Consolas, monospace" size="2">--------------
next part --------------</font></div>
<div><font face="Consolas, monospace" size="2">An HTML
attachment was scrubbed...</font></div>
<div><font face="Consolas, monospace" size="2">URL: <<a href="http://public.kitware.com/pipermail/ctk-developers/attachments/20110513/539b8908/attachment-0001.htm" target="_blank"><font color="#0000ff"><u>http://public.kitware.com/pipermail/ctk-developers/attachments/20110513/539b8908/attachment-0001.htm</u></font></a>></font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">------------------------------</font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">_______________________________________________</font></div>
<div><font face="Consolas, monospace" size="2">Ctk-developers
mailing list</font></div>
<div><font face="Consolas, monospace" size="2"><a href="mailto:Ctk-developers@commontk.org" target="_blank"><font color="#0000ff"><u>Ctk-developers@commontk.org</u></font></a></font></div>
<div><font face="Consolas, monospace" size="2"><a href="http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers" target="_blank"><font color="#0000ff"><u>http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers</u></font></a></font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2"> </font></div>
<div><font face="Consolas, monospace" size="2">End of
Ctk-developers Digest, Vol 22, Issue 6</font></div>
<div><font face="Consolas, monospace" size="2">*********************************************</font></div>
<div> </div>
<div> </div>
</font>
</blockquote>
<br>
<br>_______________________________________________<br>Ctk-developers mailing list<br>Ctk-developers@commontk.org<br>http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers<br></blockquote><br></div></div></body></html>