http://www.commontk.org/api.php?action=feedcontributions&user=Ernesto+Coto&feedformat=atomCommontk - User contributions [en]2024-03-28T15:58:04ZUser contributionsMediaWiki 1.39.3http://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2056Documentation/CLI In Context2013-11-28T16:43:20Z<p>Ernesto Coto: </p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Test datasets:<br />
<br />
The test datasets [https://drive.google.com/file/d/0B3kBRNGHGeP0bGFjZlZNcHJLNEU/edit?usp=sharing source_2down.nii] and [https://drive.google.com/file/d/0B3kBRNGHGeP0N2gzZTVYV2JTX28/edit?usp=sharing target_2down.nii] were obtained from [http://brainweb.bic.mni.mcgill.ca/brainweb BrainWeb] and [http://adni.loni.usc.edu/ ADNI].<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
<gallery caption="niftyreg on the different platforms" widths="400px" heights="300px" perrow="3"><br />
Image:Niftyreg-ctk.png|CTK command line module explorer <br />
Image:Niftyreg-slicer.png|3D Slicer<br />
Image:Niftyreg-niftyview.png|NiftyView<br />
Image:Niftyreg-gimias.png|GIMIAS<br />
Image:medinria-cli-niftyreg.png|MedInria <br />
</gallery><br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
This interoperability test was done under Windows 8. Similar steps can be performed in other platforms.<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to the cache folder ('''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache''' on MS Windows). Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
General instructions on how to install GIMIAS Command-Line Taverna Plugin can be found [https://drive.google.com/file/d/0B3kBRNGHGeP0dE53THFMYjdsdDQ/edit?usp=sharing here].<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The sample plugin is called '''CopyPlugin'''. It is a simple code to open a VTK ASCII file containing a PolyData, and save the contents of the file on another VTK file. The plugin code can be accessed [https://drive.google.com/file/d/0B3kBRNGHGeP0bVZVWHZkS1NydnM/edit?usp=sharing here].<br />
<br />
The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''. <br />
<br />
The following image shows the CopyPlugin running on CTK's Command Line Module Explorer.<br />
<br />
[[File:COPYPLUGIN_CTK_CLME.png|400px]]<br />
<br />
The CopyPlugin Command Line Module Explorer can also be imported into GIMIAS, see the following image<br />
<br />
[[File:COPYPLUGIN_CTK_GIMIAS.png|400px]]<br />
<br />
The following image shows a simple workflow that includes the CopyPlugin, after being imported using GIMIAS Command-Line Taverna Plugin.<br />
<br />
[[File:CTL_CLM_TAVERNA.png|400px]]<br />
<br />
GIMIAS's CLPs and CTK's Command Line Modules can be combined into the same Taverna workflow. See the following image where a Marching Cubes GIMIAS's CLP is used along with the CopyPlugin, a CTK Command Line Module.<br />
<br />
[[File:GIMIAS_CTK_WORKFLOW.png|400px]]</div>Ernesto Cotohttp://www.commontk.org/index.php?title=CTK-Hackfest-Nov-2013&diff=2038CTK-Hackfest-Nov-20132013-11-08T10:52:32Z<p>Ernesto Coto: </p>
<hr />
<div>== Event pictures ==<br />
<br />
Images from the hackfest<br />
<gallery widths=300 px heights=200px perrow=3><br />
File:20131107_192029.jpg|<big>Hacking</big><br />
File:Bentham.png|<big>[http://en.wikipedia.org/wiki/Jeremy_Bentham#Death_and_the_Auto-Icon Honorary CTK Hacker]</big><br />
</gallery><br />
<br />
<!--<br />
Social programs<br />
<br />
<gallery widths=150 px heights=100px perrow=4><br />
</gallery><br />
--><br />
<br />
=== Progress ===<br />
<br />
<gallery widths=400px heights=300px perrow=2><br />
File:Screen Shot 2013-11-07 at 1.24.00 PM.png|DICOM Table Interface integrated in 3D Slicer's nightly build [http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/DICOM (Documentation)]<br />
File:DICOM Header Browser.png|DICOM Header Browser<br />
File:ctkDicomWidgetsInMITK.png|New ctkDicomTableWidgets in the MITK Dicom Editor<br />
File:GIMIAS_CTK_WORKFLOW.png|Taverna Workflow with GIMIAS Command Line Plugins and CTK Command Line Modules, see more [http://www.commontk.org/index.php/Documentation/CLI_In_Context#Second_Interoperability_tests here].<br />
</gallery><br />
<br />
== Introduction ==<br />
<br />
'''Date:''' Nov 4-8, 2013<br />
<br />
'''Location:'''<br />
<br />
Room 1.19 (Monday, Friday) and Room 2.14 (other days)<br />
Malet Place Engineering Building, University College London.<br />
<br />
[[#location|How to get here.]]<br />
<br />
'''Goal:''' A follow on to the [[Commontk:Current_events#Past_events|wildly successful previous hackfests!]]<br />
<br />
'''Requirements:''' Attendees must be willing to spend their time during the event writing ctk code that contributes to the main [[CTK-Roadmap | ctk roadmap]]. This means spending the week immersed in C++, Qt, DCMTK, CMake, and related technologies. People who do not feel qualified for this task are politely not invited :)<br />
<br />
'''Group size:''' Maximum 20 participants so we can have a manageable working meeting. The organizing committee will invite and select participants based on input from [[TheTeam]].<br />
<br />
'''Site Hosts:''' Matt Clarkson (m.clarkson@ucl.ac.uk), Miklos Espak (m.espak@ucl.ac.uk)<br />
<br />
'''Organizing Committee:''' (need to ask people)<br />
<br />
'''Future Events:''' Future hackfests will be announced in advance, and we hope lots of people will be interested in participating. The venue and activities at future hackfests will be determined based on the number of active participants in the project. We welcome participation via the CTK email lists, the source code repository, and this website.<br />
<br />
== Attendees ==<br />
<br />
* So far we have received confirmation for the following people (in no particular order). <br />
<br />
<br />
Please fill in your intentions in terms of common accommodation.<br />
<br />
{|class="wikitable alternance" style="text-align:left; border:1px solid black;"<br />
|+ '''''Participants'''''<br />
|-<br />
! scope=col style="background:#cde6f8;"| Name<br />
! scope=col style="background:#cde6f8;"| Organization<br />
|-<br />
|Matt Clarkson<br />
|University College London, UK.<br />
|-<br />
|Miklos Espak<br />
|University College London, UK.<br />
|-<br />
|Nicolas Toussaint<br />
|University College London, UK.<br />
|-<br />
|Marco Nolden<br />
|German Cancer Research Center, Heidelberg, Germany.<br />
|-<br />
|Sascha Zelzer<br />
|German Cancer Research Center, Heidelberg, Germany.<br />
|-<br />
|Andreas Fetzer<br />
|German Cancer Research Center, Heidelberg, Germany.<br />
|-<br />
|Steve Pieper<br />
|Isomics, Inc. Cambridge, USA.<br />
|-<br />
|Florian Vichot<br />
|INRIA, Sophia-Antipolis, France<br />
|-<br />
|Ivo Wolf<br />
|Mannheim University of Applied Sciences, Germany<br />
|-<br />
| Ernesto Coto<br />
| University of Sheffield, UK.<br />
|-<br />
|}<br />
<br />
{|class="wikitable alternance" style="text-align:left; border:1px solid black;"<br />
|+ '''''Google Hangout Participants'''''<br />
|-<br />
! scope=col style="background:#cde6f8;"| Name<br />
! scope=col style="background:#cde6f8;"| Organization<br />
! scope=col style="background:#cde6f8;"| Availablity (London time)<br />
|-<br />
|Jean-Christophe Fillion-Robin<br />
|Kitware Inc, North Carolina, USA<br />
| 1pm to 6pm <br />
|-<br />
|Michael Onken (planned)<br />
|OFFIS, Germany.<br />
| as needed. Skype: "michaeloffis"<br />
|-<br />
|Csaba Pinter<br />
|Queen's University, Kingston, ON<br />
| TBD<br />
|-<br />
|}<br />
<br />
<!--<br />
* People who manifested interest in joining the fest. Please move your names up to the confirmed table, with the details as soon as you can to facilitate discussions with potential hotels.<br />
<br />
{|class="wikitable alternance" style="text-align:left; border:1px solid black;"<br />
|+ '''''Confirmed'''''<br />
|-<br />
! scope=col style="background:#cde6f8;"| Name<br />
! scope=col style="background:#cde6f8;"| Organization<br />
<br />
|}<br />
--><br />
<br />
{{Note}}There were also other invitations sent to active people on the community, and people who recently showed interest. When their intent will be known they will be added to the list.<br />
<br />
== Preparation ==<br />
<br />
Developers should bring a laptop with the [http://github.com/commontk/CTK current CTK source code] downloaded and [[Build_Instructions|built]].<br />
<br />
Use the [http://public.kitware.com/cgi-bin/mailman/listinfo/ctk-developers CTK developers mailing list] to discuss build issues and topics for ongoing work.<br />
<br />
Phone conferences have been scheduled in the weeks leading to the event:<br />
* To be announced<br />
<br />
== Topics and Projects ==<br />
<br />
=== XNAT Library ===<br />
<br />
Interested people: Miklos, Nicolas, Florian, Ivo, Sascha<br />
<br />
* Stabilize API and make it more robust<br />
* Merge to master<br />
<br />
Open topics<br />
<br />
* Error handling (Miklos)<br />
* Timeout handling (Miklos)<br />
* Unit tests for ctkXnatCore<br />
* Zip support (Sascha)<br />
* Up/Download support in the API (Sascha / Miklos)<br />
* SSL support (ask about disabling SSL) (Florian?)<br />
* Support browsing files attached to assessments<br />
* General API review (Sascha, Miklos, Ivo, Florian)<br />
* Add API documentation<br />
<br />
=== CLI Library ===<br />
<br />
Florian, Sascha, Ernesto, Steve, Marco<br />
<br />
Open Topics<br />
<br />
* Add a CTK "test" for validating the XML of external CLIs<br />
** Maybe a "web service" for quickly validating the XML files<br />
* CTK should become the official CTK schema hosting site<br />
* Default values for some elements are problematic (e.g. for SpinBox)<br />
** Have a best practices document how to handle optional default values<br />
* CLIs depending on external dependencies (shared libraries) are problematic<br />
** Probably nothing we can solve inside CTK<br />
* The UiLoader should be more customizable (JC did that in a branch for the Slicer integration)<br />
* Maybe have a way to check for long running modules during the XML retrieval and cancel them (more of a developer thing)<br />
* Add a method for clearing the XML cache (probably in ctkCmdLineModuleManager)<br />
* Having a new web services front-end could be interesting<br />
<br />
Discussion<br />
<br />
* Make GIMIAS CLI modules work with the ctkCmdLineModuleExplorer (Ernesto)<br />
<br />
=== DICOM Application Hosting ===<br />
<br />
Ivo, Sascha<br />
<br />
=== DICOM Libraries ===<br />
<br />
Andreas, Steve<br />
<br />
* Improve and finish the widgets<br />
* DICOM Database backend (Marco, Steve)<br />
<br />
=== CTK packaging ===<br />
<br />
Marco, Sascha<br />
<br />
* continue [[Debian_Packaging | Debian packaging support]]<br />
<br />
=== General Discussion ===<br />
<br />
* Create support for CLI Web Services in CTK?<br />
* Could we make CLI modules run in Osirix?<br />
<br />
== Agenda ==<br />
<br />
==== Monday ====<br />
<br />
Opening discussion<br />
* Review topics and projects<br />
* Plans for the week<br />
* Review [https://github.com/commontk/CTK/issues?state=open open issues on github].<br />
<br />
Evening:<br />
<br />
==== Tuesday ====<br />
<br />
During the day: hack, hack, hack...<br />
<br />
15:00 Google Hangout with US and other participants<br />
<br />
* Talk about DCMTK_DIR ([https://github.com/commontk/CTK/issues/382 Issue 382])<br />
** Michael: Would integrate the DCMTKConfig.cmake file but needs more time to check the changes and make sure it works for everyone<br />
** Jc: NO_DEFAULT_PATH in FindDCMTK.cmake would work for Slicer, CTK, etc. but in the future (when all distributions contain a DCMTK package with a DCMTKConfig.cmake) FindDCMTK.cmake should not be needed anymore<br />
** Marco: We still need a way to find the system installed DCMTK<br />
** Steve: We should be able to tell the scripts that it should find a specific DCMTK version and not automatically prefer one version over another. E.g. there could be a system DCMTK but we would still want to use a developer DCMTK build<br />
** Jc: Is not sure why it failed at all on Csaba's machine. Will look remotely at the concrete problem on that machine.<br />
** Marco: NO_DEFAULT_PATH would still work for the Debian packages if we pass DCMTK_DIR=/usr<br />
** Steve: Mentions that find_program was gone from FindDCMTK.cmake leading to test failures. It is probably okay to add the find_program paths to the CMakeLists.txt file of the CTK tests.<br />
** Jc: The DCMTK fixes are in the commontk DCMTK fork<br />
** Marco: We should not depend on the commontk DCMTK fork since it makes compatibility with official snapshots difficult<br />
** Jc: We should set-up a dashboard for DCMTK builds on cdash.org<br />
* Discuss CTK install and Debian package support<br />
** Marco: Let's have a separate hangout for that<br />
* Failing tests on Steves machine (and others like Ivos)<br />
** Steve: ctkCrosshairTest2 is failing on all platforms.<br />
** Jc: It is not used anymore in Slicer<br />
** Steve: We could remove the class and the test if nobody is using it<br />
** General agreement<br />
* Dashboard<br />
** Jc suggests to move back to a traditional dashboard style (no splitting by library)<br />
** Everyone agrees<br />
<br />
Evening:<br />
<br />
==== Wednesday ====<br />
<br />
10:00 Roadmap discussion<br />
<br />
* Matt: Right now we have Widgets, DICOM, etc. is that still how we see CTK?<br />
* Steve:<br />
** Generally we factor out common stuff. Mainly project driven requirements<br />
** Adding JavaScript widgets for image processing (on top of e.g. jQuery) would be nice<br />
* Marco:<br />
** Currently we are focusing on data management aspects (XNAT, DICOM RT, CLIs, etc.)<br />
** Image guided therapy applications are driving the requirements for us<br />
** New data structures for imaging are hard to agree on<br />
* Marco:<br />
** How CTK is presented to the outside is important<br />
** CTK could provide standardized approaches to develop e.g. CLIs<br />
* Florian:<br />
** Students ask what they could CTK use for - has to tell them that it is rather for application/platform developers<br />
* Matt:<br />
** Pushing the XNAT work is important for us<br />
** Also interested in mor DICOM data structure support<br />
** Wrapping algorithms inside a proper DICOM workflow would be interesting<br />
** What about Application Hosting?<br />
* Steve:<br />
** Its not directly in the QIICR proposal<br />
* Sascha:<br />
** We are still not ready for a production grade implementation<br />
** Same goes for probably any other implementation<br />
* Steve:<br />
** Syngo Via does not seem to see a role for application hosting (they have a kind of distributed client server architecture)<br />
** Doesn't fit with running applications locally on the workstation supporting application hosting<br />
* Marco:<br />
** Physicians are not really happy with proprietary solutions so there is some pressure for a more open system<br />
** There is an IHE profile which contains application hosting, so there is also some interest<br />
* Matt:<br />
** We are working on XNAT support which also supports pipelines. But there is also Nipype, the GIMIAS Taverna approach, etc.<br />
** Having XNAT in CTK is nice since people converge somehow to using the same type of database<br />
* Marco:<br />
** What is QIICR using as a data backend?<br />
** Having a more light-weight, easily installable and searchable PACS would be nice<br />
* Steve:<br />
** The plan is to use TCIA<br />
** It is unclear which backend technology is used for it<br />
<br />
Conclusion:<br />
<br />
* We are pretty much happy as it is<br />
* A light-weight database solution would be really nice to have<br />
* Same goes for a pipeline system<br />
<br />
<br />
During the day: hack, hack, hack...<br />
<br />
Evening:<br />
<br />
==== Thursday ====<br />
<br />
During the day: hack, hack, hack...<br />
<br />
Evening: <br />
<br />
==== Friday ====<br />
<br />
During the day: hack, hack, hack...<br />
<br />
10:00; Closing discussion<br />
<br />
Afternoon: hack or travel<br />
<br />
== Travel & Hotel ==<br />
<br />
'''Local contact'''<br />
<br />
Need any help in organizing your visit, contact Miklos Espak (m.espak@ucl.ac.uk).<br />
If you have any troubles during your visit, call +44 792 6656 927.<br />
<br />
'''Transportation'''<br />
<br />
[http://www.ucl.ac.uk/maps/public-transport How to get to the UCL.]<br />
<br />
'''Lodging''' <br />
<br />
Hotels in central London can be expensive, this one seems reasonably priced:<br />
<br />
* [http://www.imperialhotels.co.uk/tavistock The Tavistock Hotel]<br />
<br />
<div id="location">'''Meeting Location'''</div><br />
<br />
Malet Place Engineering Building, University College London<br />
[http://goo.gl/maps/2encP]<br />
<br />
Monday and Friday: room 1.19<br />
Other days: room 2.14<br />
<br />
The reception is at the '''Engineering Front Building''' right at the gate, so please come there and refer to the CTK hackfest.<br />
<br />
[http://www.ucl.ac.uk/maps UCL Bloomsbury campus map]<br />
<br />
[http://crf.casa.ucl.ac.uk/ UCL campus route finder]<br />
<br />
'''Weather'''<br />
<br />
Daily temperature will be around 12-15C (53-59F), mostly dry, light rain is possible some days.<br />
<br />
'''Food'''<br />
<br />
Plan on having breakfast at your hotel before the meeting. Please email the organizers if you have any allergies or dietary restrictions. <br />
<br />
<!--'''Optional Activities in the Area'''--></div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2020Documentation/CLI In Context2013-11-07T16:06:29Z<p>Ernesto Coto: /* Second Interoperability tests */</p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
This interoperability test was done under Windows 8. Similar steps can be performed in other platforms.<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to the cache folder ('''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache''' on MS Windows). Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
General instructions on how to install GIMIAS Command-Line Taverna Plugin can be found [https://drive.google.com/file/d/0B3kBRNGHGeP0dE53THFMYjdsdDQ/edit?usp=sharing here].<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The sample plugin is called '''CopyPlugin'''. It is a simple code to open a VTK ASCII file containing a PolyData, and save the contents of the file on another VTK file. The plugin code can be accessed [https://drive.google.com/file/d/0B3kBRNGHGeP0bVZVWHZkS1NydnM/edit?usp=sharing here].<br />
<br />
The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''. <br />
<br />
The following image shows the CopyPlugin running on CTK's Command Line Module Explorer.<br />
<br />
[[File:COPYPLUGIN_CTK_CLME.png|400px]]<br />
<br />
The CopyPlugin Command Line Module Explorer can also be imported into GIMIAS, see the following image<br />
<br />
[[File:COPYPLUGIN_CTK_GIMIAS.png|400px]]<br />
<br />
The following image shows a simple workflow that includes the CopyPlugin, after being imported using GIMIAS Command-Line Taverna Plugin.<br />
<br />
[[File:CTL_CLM_TAVERNA.png|400px]]<br />
<br />
GIMIAS's CLPs and CTK's Command Line Modules can be combined into the same Taverna workflow. See the following image where a Marching Cubes GIMIAS's CLP is used along with the CopyPlugin, a CTK Command Line Module.<br />
<br />
[[File:GIMIAS_CTK_WORKFLOW.png|400px]]</div>Ernesto Cotohttp://www.commontk.org/index.php?title=File:COPYPLUGIN_CTK_GIMIAS.png&diff=2019File:COPYPLUGIN CTK GIMIAS.png2013-11-07T16:01:17Z<p>Ernesto Coto: The CopyPlugin, a CTK Command Line Module, imported to GIMIAS</p>
<hr />
<div>The CopyPlugin, a CTK Command Line Module, imported to GIMIAS</div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2018Documentation/CLI In Context2013-11-07T15:50:37Z<p>Ernesto Coto: /* Second Interoperability tests */</p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
This interoperability test was done under Windows 8. Similar steps can be performed in other platforms.<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to the cache folder ('''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache''' on MS Windows). Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
General instructions on how to install GIMIAS Command-Line Taverna Plugin can be found [https://drive.google.com/file/d/0B3kBRNGHGeP0dE53THFMYjdsdDQ/edit?usp=sharing here].<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The sample plugin is called '''CopyPlugin'''. It is a simple code to open a VTK ASCII file containing a PolyData, and save the contents of the file on another VTK file. The plugin code can be accessed [https://drive.google.com/file/d/0B3kBRNGHGeP0bVZVWHZkS1NydnM/edit?usp=sharing here].<br />
<br />
The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''. <br />
<br />
The following image shows the CopyPlugin running on CTK's Command Line Module Explorer.<br />
<br />
[[File:COPYPLUGIN_CTK_CLME.png|400px]]<br />
<br />
The following image shows a simple workflow that includes the CopyPlugin, after being imported using GIMIAS Command-Line Taverna Plugin.<br />
<br />
[[File:CTL_CLM_TAVERNA.png|400px]]<br />
<br />
The following image shows a Taverna Workflow composed by one GIMIAS Command Line Plugin and one CTK Command Line Module.<br />
<br />
[[File:GIMIAS_CTK_WORKFLOW.png|400px]]</div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2017Documentation/CLI In Context2013-11-07T15:48:35Z<p>Ernesto Coto: /* Second Interoperability tests */</p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
This interoperability test was done under Windows 8. Similar steps can be performed in other platforms.<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to the cache folder ('''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache''' on MS Windows). Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
General instructions on how to install GIMIAS Command-Line Taverna Plugin can be found [https://drive.google.com/file/d/0B3kBRNGHGeP0dE53THFMYjdsdDQ/edit?usp=sharing here].<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The sample plugin is called '''CopyPlugin'''. It is a simple code to open a VTK ASCII file containing a PolyData, and save the contents of the file on another VTK file. The plugin code can be accessed [https://drive.google.com/file/d/0B3kBRNGHGeP0bVZVWHZkS1NydnM/edit?usp=sharing here].<br />
<br />
The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''. <br />
<br />
The following image shows the CopyPlugin running on CTK's Command Line Module Explorer.<br />
<br />
[[File:COPYPLUGIN_CTK_CLME.png|400px]]<br />
<br />
The following image shows a simple workflow that includes the CopyPlugin, after beign imported using GIMIAS Command-Line Taverna Plugin.<br />
<br />
[[File:CTL_CLM_TAVERNA.png|400px]]<br />
<br />
The following image shows a Taverna Workflow composed by one GIMIAS Command Line Plugin and one CTK Command Line Module.<br />
<br />
[[File:GIMIAS_CTK_WORKFLOW.png|400px]]</div>Ernesto Cotohttp://www.commontk.org/index.php?title=File:GIMIAS_CTK_WORKFLOW.png&diff=2016File:GIMIAS CTK WORKFLOW.png2013-11-07T15:46:50Z<p>Ernesto Coto: A Taverna Workflow composed by one GIMIAS Command Line Plugin and one CTK Command Line Module</p>
<hr />
<div>A Taverna Workflow composed by one GIMIAS Command Line Plugin and one CTK Command Line Module</div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2015Documentation/CLI In Context2013-11-07T15:40:03Z<p>Ernesto Coto: </p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
This interoperability test was done under Windows 8. Similar steps can be performed in other platforms.<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to the cache folder ('''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache''' on MS Windows). Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
General instructions on how to install GIMIAS Command-Line Taverna Plugin can be found [https://drive.google.com/file/d/0B3kBRNGHGeP0dE53THFMYjdsdDQ/edit?usp=sharing here].<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The sample plugin is called '''CopyPlugin'''. It is a simple code to open a VTK ASCII file containing a PolyData, and save the contents of the file on another VTK file. The plugin code can be accessed [https://drive.google.com/file/d/0B3kBRNGHGeP0bVZVWHZkS1NydnM/edit?usp=sharing here].<br />
<br />
The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''. <br />
<br />
The following image shows the CopyPlugin running on CTK's Command Line Module Explorer.<br />
<br />
[[File:COPYPLUGIN_CTK_CLME.png|400px]]<br />
<br />
The following image shows a simple workflow that includes the CopyPlugin, after beign imported using GIMIAS Command-Line Taverna Plugin.<br />
<br />
[[File:CTL_CLM_TAVERNA.png|400px]]</div>Ernesto Cotohttp://www.commontk.org/index.php?title=File:COPYPLUGIN_CTK_CLME.png&diff=2014File:COPYPLUGIN CTK CLME.png2013-11-07T15:35:43Z<p>Ernesto Coto: CopyPlugin on CTK's Command Line Module Explorer</p>
<hr />
<div>CopyPlugin on CTK's Command Line Module Explorer</div>Ernesto Cotohttp://www.commontk.org/index.php?title=File:CTL_CLM_TAVERNA.png&diff=2013File:CTL CLM TAVERNA.png2013-11-07T15:24:44Z<p>Ernesto Coto: CTK Command Line Module working on Taverna Workbench via GIMIAS's Command Line Taverna Plugin</p>
<hr />
<div>CTK Command Line Module working on Taverna Workbench via GIMIAS's Command Line Taverna Plugin</div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2012Documentation/CLI In Context2013-11-07T15:19:08Z<p>Ernesto Coto: </p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
This interoperability test was done under Windows 8. Similar steps can be performed in other platforms.<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to the cache folder ('''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache''' on MS Windows). Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
General instructions on how to install GIMIAS Command-Line Taverna Plugin can be found [https://drive.google.com/file/d/0B3kBRNGHGeP0dE53THFMYjdsdDQ/edit?usp=sharing here].<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The sample plugin is called '''CopyPlugin'''. It is a simple code to open a VTK ASCII file containing a PolyData, and save the contents of the file on another VTK file. The plugin code can be accessed [https://drive.google.com/file/d/0B3kBRNGHGeP0bVZVWHZkS1NydnM/edit?usp=sharing here].<br />
<br />
The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!''', as shown in the following images</div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2011Documentation/CLI In Context2013-11-07T14:34:14Z<p>Ernesto Coto: /* Second Interoperability tests */</p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
This interoperability test was done under Windows 8. Similar steps can be performed in other platforms.<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to the cache folder ('''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache''' on MS Windows). Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''.<br />
<br />
The sample plugin is called '''CopyPlugin'''. It is a simple code to open a VTK ASCII file containing a PolyData, and save the contents of the file on another VTK file. The plugin code can be accessed [https://drive.google.com/file/d/0B3kBRNGHGeP0bVZVWHZkS1NydnM/edit?usp=sharing here].<br />
<br />
GIMIAS Command-Line Taverna Plugin can be installed from [http://repository.cistib.org/nexus/content/repositories/GCLTP_Snapshot here].<br />
<br />
General instructions on how to install a Taverna Plugin can be found [http://www.taverna.org.uk/documentation/taverna-plugins/ here], but for a more detailed guide, this [http://www.youtube.com/watch?v=XZ2pOHQwAcg video] shows how to install GIMIAS Command-Line Taverna Plugin (from minute 0:30). Notice that in the video Taverna Workbench is embedded in GIMIAS, but this is not necessary to install the plugin. Simply install Taverna Workbench and use the video to guide you through the installation process of the plugin.<br />
<br />
The plugin requires [http://www.taverna.org.uk/download/workbench/2-4/ Taverna Workbench 2.4] and at least [http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html Java 7u17] to work.</div>Ernesto Cotohttp://www.commontk.org/index.php?title=File:GIMIAS_CLPs_on_CTK_CLME.png&diff=2010File:GIMIAS CLPs on CTK CLME.png2013-11-07T14:14:02Z<p>Ernesto Coto: uploaded a new version of &quot;File:GIMIAS CLPs on CTK CLME.png&quot;: Full resolution version</p>
<hr />
<div>GIMIAS's Command Line Plugins (CLPs) loaded on CTK's Command Line Module Explorer (CLME). The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths.</div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2009Documentation/CLI In Context2013-11-07T12:30:31Z<p>Ernesto Coto: </p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to '''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache'''. Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
The following image shows GIMIAS's CLPs loaded in CTK's CLME. The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths. Notice that some CLPs are shown with a warning sign, so their XML definitions has to be corrected.<br />
<br />
[[File:GIMIAS_CLPs_on_CTK_CLME.png|400px]]<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''.<br />
<br />
General instructions on how to install a Taverna Plugin can be found [http://www.taverna.org.uk/documentation/taverna-plugins/ here].<br />
<br />
GIMIAS Command-Line Taverna Plugin can be installed from [http://54.228.194.171:8081/nexus/content/repositories/GCLTP_Snapshot here].<br />
<br />
For a more detailed guide, the following [http://www.youtube.com/watch?v=XZ2pOHQwAcg video] shows how to install GIMIAS Command-Line Taverna Plugin (from minute 0:30). Notice that in the video Taverna Workbench is embedded in GIMIAS, but this is not necessary to install the plugin. Simply install Taverna Workbench and use the video to guide you through the installation process of the plugin.<br />
<br />
The plugin requires [http://www.taverna.org.uk/download/workbench/2-4/ Taverna Workbench 2.4] and at least [http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html Java 7u17] to work.</div>Ernesto Cotohttp://www.commontk.org/index.php?title=File:GIMIAS_CLPs_on_CTK_CLME.png&diff=2008File:GIMIAS CLPs on CTK CLME.png2013-11-07T12:24:28Z<p>Ernesto Coto: GIMIAS's Command Line Plugins (CLPs) loaded on CTK's Command Line Module Explorer (CLME). The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths.</p>
<hr />
<div>GIMIAS's Command Line Plugins (CLPs) loaded on CTK's Command Line Module Explorer (CLME). The "Create a DICOM Series" CLP is selected. The "Settings" dialog is also shown, indicating how to add the CLPs directory to the CLME's search paths.</div>Ernesto Cotohttp://www.commontk.org/index.php?title=Documentation/CLI_In_Context&diff=2007Documentation/CLI In Context2013-11-07T11:59:15Z<p>Ernesto Coto: </p>
<hr />
<div>This page lists some example and notes on different integration of CLI modules in different frameworks including CTK (see [[Documentation/Command_Line_Interface]]). The first interoperability testing was done during the [http://www.creatis.insa-lyon.fr/Interoperability_workshop third] VPH NoE Imaging workshop hold in Lyon, France on October 22-23, 2012. It will be continued in consecutive hackfests. The aim is to try to plug in CLI modules in CLI compatible frameworks and come up with possible improvement of the CLI standard, advice to CLI module and CLI framework developers.<br />
<br />
== Events ==<br />
<br />
* [[CTK-Hackfest-Nov-2011|CTK Hackfest]] in Sophia Antipolis, France in November 2011<br />
** Preliminary work to integrate CLI into GIMIAS<br />
* [[CTK-Hackfest-Jul-2012|CTK Hackfest]] in Boston, USA in July 2012<br />
** Preliminary work to integrate CLI into MITK<br />
* [http://www.creatis.insa-lyon.fr/Interoperability_workshop 3rd VPH NoE Imaging workshop] in Lyon, France on October 22-23, 2012<br />
** [[#First_Interoperability_tests|First Interoperability tests]] with CTK, GIMIAS, NiftyView and Slicer<br />
* [[CTK-Hackfest-Dec-2012|CTK Hackfest]] in Bologna, Italy on December, 2012<br />
** Preliminary work to integrate CLI into medInria, MAF3<br />
** Semi-Automatic framework CLI integration tests<br />
* [[CTK-Hackfest-Nov-2013|CTK Hackfest]] in London, UK on November, 2013<br />
** [[#Second_Interoperability_tests|Second Interoperability tests]]: GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer, CTK's Command Line Modules in Taverna Workbench<br />
<br />
== First Interoperability tests ==<br />
<br />
These first tests mainly concern the integration of niftyreg (registration algorithms from UCL). The different stages of integration are: load, execute and results. Meaning that the CLI module can be loaded. executed and provides the same results as if it was run only from the command line. The problems we encountered were:<br />
<br />
* GIMIAS does not support to have a `default` element different that `None` for the output, not sure about the `advanced` option for the `parameters` element <br />
* niftyreg was using `fileExtensions` with stars (`*.nii`) which is not supported by neither GIMIAS nor Slicer (the star is directly used in the file name)<br />
* The default output folder should be set to the user folder and not the running one, otherwise the CLI module can crash because they were denied access to write in that folder (for example `Program Files` under Windows)<br />
* What to do with CLI modules that have dependencies on shared libraries with the platform but of different versions? Platforms should have the option to only use the libraries shipped with the CLI module<br />
* Platforms should align the way they treat data since if two load data differently, the same CLI module could give different results<br />
<br />
It would be interesting to create test CLI modules for these integration tests. For example one that exposes all possible types of options, one running a simple algorithm without any dependencies (as niftyreg) and one with dependencies.<br />
<br />
Some thoughts on the tested platforms:<br />
* Niftyview has nice controls on the way CLI modules are found and loaded (control on the `XML` validation)<br />
* Slicer has a nice display of the loaded and non loaded CLI modules (appear in red, there could be more explanation why the loading failed)<br />
<br />
Here are the snapshots of niftyreg on the different platforms:<br />
<br />
* CTK command line module explorer <br />
<br />
[[File:Niftyreg-ctk.png|400px]]<br />
<br />
* Slicer<br />
<br />
[[File:Niftyreg-slicer.png|400px]]<br />
<br />
* NiftyView<br />
<br />
[[File:Niftyreg-niftyview.png|400px]]<br />
<br />
* GIMIAS <br />
<br />
[[File:Niftyreg-gimias.png|400px]]<br />
<br />
* medInria<br />
<br />
[[File:medinria-cli-niftyreg.png|400px]]<br />
<br />
== Second Interoperability tests ==<br />
<br />
* GIMIAS's Command Line Plugins in CTK's Command Line Module Explorer<br />
<br />
Typically, GIMIAS's Command Line Plugins (CLPs) are located in folder '''<GIMIAS_install_dir>\commandLinePlugins'''. However, the DLL dependencies of these CLPs are located in '''<GIMIAS_install_dir>'''. This is a problem when attempting to use GIMIAS's CLPs in CTK's Command Line Module Explorer (CLME), as the CLME will fail to load the CLPs. <br />
<br />
This can be easily solved by copying GIMIAS's CLPs in a different folder, let's say '''<CLP_folder>''', along with its DLL dependencies (for finding out the DLL dependencies of a CLP, a program such as [http://dependencywalker.com/ Dependency Walker] can be used).<br />
<br />
After creating '''<CLP_folder>''' and copying the necessary files in it. Start CTK's CLME, go to menu "Module" and choose "Options". In "Module Settings" go to "Search Paths", and then add '''<CLP_folder>''' to the search paths. Press "OK" and the CLME will scan '''<CLP_folder>''' and load the CLPs. <br />
<br />
If the loading process fails, you are probably missing a DLL dependency, close the CLME and go to '''<user_directory>\AppData\Local\CommonTK\CommandLineModuleExplorer\cache'''. Clear the content of that directory, add the additional DLL to '''<CLP_folder>''' and then start the CLME again.<br />
<br />
If a CLP shows up in the list with a warning sign, place the mouse on top of the CLP's name and look at the warning message. Most likely the XML that defines the CLP has a compatibility problem with the CLME, which means that is does not adhere to the [http://www.commontk.org/docs/html/ctkCmdLineModule.xsd CTK XML Schema]. See the definition of the Schema, correct the XML of the CLP, clear CLME's cache folder as described in the previous paragraph, and start the CLME again.<br />
<br />
After following these steps, you will be able to see and use your CLP in the CLME. '''This means that you can share your GIMIAS's CLP with any CTK user at any time, by just sharing your CLPs executable file and its DLL dependencies'''.<br />
<br />
* CTK's Command Line Modules in Taverna Workbench<br />
<br />
[http://www.taverna.org.uk/download/workbench/ Taverna Workbench] is an open source Workflow Management System written in Java. GIMIAS's Command Line Plugins (CLPs) can be used in Taverna Workbench for creating medical imaging workflows composed of several filters. In order to be able to do this, the '''Center Computational Imaging and Simulation Technologies in Biomedicine (CISTIB)''' at the [http://www.shef.ac.uk/ University of Sheffield] has created a Taverna Workbench plugin for GIMIAS.<br />
<br />
In this interoperability test, a CTK Command Line Module was created and tested with GIMIAS Command-Line Taverna Plugin. The result was successful, which means that '''GIMIAS's CLPs and CTK's Command Line Modules can be combined to create processing workflows in Taverna Workbench !!'''.<br />
<br />
General instructions on how to install a Taverna Plugin can be found [http://www.taverna.org.uk/documentation/taverna-plugins/ here].<br />
<br />
GIMIAS Command-Line Taverna Plugin can be installed from [http://54.228.194.171:8081/nexus/content/repositories/GCLTP_Snapshot here].<br />
<br />
For a more detailed guide, the following [http://www.youtube.com/watch?v=XZ2pOHQwAcg video] shows how to install GIMIAS Command-Line Taverna Plugin (from minute 0:30). Notice that in the video Taverna Workbench is embedded in GIMIAS, but this is not necessary to install the plugin. Simply install Taverna Workbench and use the video to guide you through the installation process of the plugin.<br />
<br />
The plugin requires [http://www.taverna.org.uk/download/workbench/2-4/ Taverna Workbench 2.4] and at least [http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html Java 7u17] to work.</div>Ernesto Coto