[ITK Community] [Insight-users] ITK External Modules

Xiaoxiao Liu xiaoxiao.liu at kitware.com
Tue Jan 7 15:44:05 EST 2014


In your executable project (which contains the application specific code,
namely, an ITK application), you can "super build" ITK as a third party
library. You could specify the corresponding module cmake variable
(Module_<your remote module name> = ON )  to include the remote module when
building ITK. You can refer to Slicer on this.

Or if the project size is not very big, you can also put in your executable
code together in your remote module. They serve as great examples.  You can
refer to LesionSizingToolkit[1],which is an ITK remote module. But yes, you
need to build your remote module in the process of building ITK.

See more inline comments below.

[1] https://github.com/InsightSoftwareConsortium/LesionSizingToolkit


On Tue, Jan 7, 2014 at 2:32 PM, Luke Bloy <luke.bloy at gmail.com> wrote:

> I figured it would be more complicated then I thought :)
>
> Here is my situation and perhaps someone can suggest a good path forward.
>
> I'm in the process of of reorganizing the code from my graduate thesis on
> diffusion imaging for use in my new lab and for my collaborators. This code
> is a mix of filters and executables etc. Ideally Id like to develop an ITK
> external module for the core filters and libraries and then another package
> for the executable code.
>
> I like the idea of an external module to share with the community etc, but
> I need be able to build the executables as a stand alone project on
> production systems where I may or may not have access to the ITK build
> process.
>
> I think the ideal situation would be to develop an external itk module
> (get it registered as a remote module), then in the executables project I
> would
> 1) include ITK
> 2) check if ITK was build with my external module  (is this possible at
> the moment???)
>

*>> Yes. You can check whether the module is included in your ITK build
when using find_package
<http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:find_package> cmake
command with "REQUIRED components", such as*
* find_package(ITK REQUIRED  ITKFoo ... )*


3) if not I would build it myself as an external project ( I assume this is
> how ITK handles remote modules)
>

*>> The remote module concept is the same as the external model in that the
source code all sit in the source tree of ITK. The difference between the
two is that  remote module can be automatically downloaded during the build
process of ITK, while external module source code needs to be dropped in
manually.*



> Does this even seem feasible? I am totally open to other ideas
>
> Thanks
> Luke
>
>
>
>
> On Tue, Jan 7, 2014 at 10:43 AM, Xiaoxiao Liu <xiaoxiao.liu at kitware.com>wrote:
>
>> An ITK module follows a set of unified CMake APIs and  some default
>> source code organization ( src, test, include folder ).  Each module uses
>> the modular CMake macros defined in" CMake/ITKModuleMacros.cmake", e.g.
>>  itk_module() in the itk-module.cmake  sets up the module's name and its
>> dependencies on other modules.
>>
>> Before compiling each module, a global dependency DAG is sorted out based
>> on the module dependencies specified in those itk-module.cmake files to
>> decide the order of build.
>>
>> The top level CMake code looks for itk-module.cmake files inside the
>> source tree of ITK  at  the CMake configuration time. If you have a module
>> outside the source tree, it won't find it.
>>
>> I hope this helps.
>> Thanks.
>>
>>
>>
>> On Tue, Jan 7, 2014 at 10:00 AM, Luke Bloy <luke.bloy at gmail.com> wrote:
>>
>>> Am I wrong in thinking that this would only require access to some of
>>> the cmake functions that ITK supplies in the CMake directory?
>>>
>>>
>>> On Mon, Jan 6, 2014 at 2:06 PM, Matt McCormick <
>>> matt.mccormick at kitware.com> wrote:
>>>
>>>> Hi Luke,
>>>>
>>>> Not at this time, but this would be a great feature to have.
>>>>
>>>> Thanks,
>>>> Matt
>>>>
>>>> On Mon, Jan 6, 2014 at 1:38 PM, Luke Bloy <luke.bloy at gmail.com> wrote:
>>>> > Hi All,
>>>> >
>>>> > Is it possible to build external modules outside of the ITK source
>>>> tree?
>>>> >
>>>> > Thanks,
>>>> > Luke
>>>> >
>>>> > _____________________________________
>>>> > Powered by www.kitware.com
>>>> >
>>>> > Visit other Kitware open-source projects at
>>>> > http://www.kitware.com/opensource/opensource.html
>>>> >
>>>> > Kitware offers ITK Training Courses, for more information visit:
>>>> > http://www.kitware.com/products/protraining.php
>>>> >
>>>> > Please keep messages on-topic and check the ITK FAQ at:
>>>> > http://www.itk.org/Wiki/ITK_FAQ
>>>> >
>>>> > Follow this link to subscribe/unsubscribe:
>>>> > http://www.itk.org/mailman/listinfo/insight-users
>>>> >
>>>>
>>>
>>>
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.php
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>> _______________________________________________
>>> Community mailing list
>>> Community at itk.org
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>>>
>>>
>>
>>
>> --
>>
>>
>> ---------------------------------------------
>> *Xiaoxiao Liu*, Ph.D.
>> R & D Engineer
>> Kitware Inc <http://www.kitware.com/>.
>> Clifton Park, NY
>> Phone: (518) 881-4924  or  (518) 371-3971 x124
>>
>>
>


-- 


---------------------------------------------
*Xiaoxiao Liu*, Ph.D.
R & D Engineer
Kitware Inc <http://www.kitware.com/>.
Clifton Park, NY
Phone: (518) 881-4924  or  (518) 371-3971 x124
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140107/073914e2/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list