[ITK-users] Integrate new .h and .txx file as a part of ITK Framework

Francois Budin francois.budin at kitware.com
Fri Aug 11 17:38:08 EDT 2017


Hello Siming,

It looks like this publication is a little old (2007). A lot has changed in
ITK since this article has been written. The registration and
transformation framework has been greatly improved, and the ThinPlateSpline
can now be used in the registration framework (see [1]). If it is what you
were looking for, you may not need to integrate the code of the article you
mention in ITK.
As for using the code that is available in the Insighe Journal article, one
would need to first adapt the CMakeLists.txt file to be able to compile the
code (see the quick adaptation of the CMakeLists.txt I wrote below). And
then one would need to update the code to compile this project with a
recent version of ITK.

Francois

cmake_minimum_required(VERSION 2.8.12)
# This is based on the Insight Journal CMake Template

#Change PROJECT_NAME to the name of your project
PROJECT(KERNEL_TRANSFORM)

ENABLE_TESTING()

find_package(ITK REQUIRED)
include(${ITK_USE_FILE})


#the following block of code is an example of how to build an executable in
#cmake.  Unmodified, it will add an executable called "MyExe" to the
project.
#MyExe will be built using the files MyClass.h and MyClass.cxx, and it will
#be linked to all the libraries you specified above.
#You can build more than one executable per project
ADD_EXECUTABLE(itkSplineKernelTransform2Test
itkSplineKernelTransform2Test.cxx)
TARGET_LINK_LIBRARIES(itkSplineKernelTransform2Test ${ITK_LIBRARIES})

ADD_EXECUTABLE(TPSDeformableRegistration TPSDeformableRegistration.cxx)
TARGET_LINK_LIBRARIES(TPSDeformableRegistration ${ITK_LIBRARIES})

#the following line is an example of how to add a test to your project.
#Testname is the title for this particular test.  ExecutableToRun is the
#program which will be running this test.  It can either be a part of this
#project or an external executable.  After that list any args that are
needed
#for this test.  Include as many tests as you like.  If your project
doesn't have
#any tests you can comment out or delete the following line.
ADD_TEST(SplineKernelTransform2Test itkSplineKernelTransform2Test)

ADD_TEST(TPSDeformableRegistration TPSDeformableRegistration
${CMAKE_SOURCE_DIR}/data/transformpoints.txt
${CMAKE_SOURCE_DIR}/data/BrainProtonDensitySliceWarped.png
${CMAKE_SOURCE_DIR}/data/BrainProtonDensitySliceBorder20.png output.png
diffafter.png diffbefore.png)



[1]
https://itk.org/Doxygen/html/Examples_2RegistrationITKv4_2ThinPlateSplineWarp_8cxx-example.html

On Fri, Aug 11, 2017 at 5:15 PM, Sisi <siming.bayer at gmail.com> wrote:

> Dear Francois,
>
> Thank you for your answer. In my case, I didn’t´t wrote any filter or
> module by myself. I just want to try a improved version of
> its::KernelTransform, developed by Brooks. The source code can be
> downloaded here (http://www.insight-journal.org/browse/publication/145 <
> http://www.insight-journal.org/browse/publication/145>). So my question
> is really really too simple: How can I integrate those header files and
> .txx file into the ITK Framework? If this is a remote module, where can I
> find it and how can I build it?
>
> Sorry for this stupid question…
>
> Thanks for your help!
> best,
> Siming
> > Am 11.08.2017 um 22:59 schrieb Francois Budin-3 [via ITK Insight Users] <
> ml+s2283740n7590185h17 at n2.nabble.com>:
> >
> > Hello Siming,
> >
> > Welcome to ITK! I am not sure if you have had a chance to look at the
> ITKSoftwareGuide [1], but it is a great place to find a lot of information.
> The chapters that are the most relevant for you are probably Chapter 8 (How
> to write a filter) and Chapter 9 (How to create a module). To answer your
> question more specifically, the easiest way to integrate a new filter or
> new files to ITK is to develop an ITK module. This module can then either
> be compiled outside of ITK, or if you think it would be useful to the whole
> ITK community, it can be integrated to ITK as a remote module [2].
> >
> > I hope this helps. Feel free to ask more questions.
> >
> > Francois
> >
> > [1] https://www.itk.org/ItkSoftwareGuide.pdf <https://www.itk.org/
> ItkSoftwareGuide.pdf>
> > [2] https://itk.org/Wiki/ITK/Policy_and_Procedures_for_
> Adding_Remote_Modules <https://itk.org/Wiki/ITK/Policy_and_Procedures_for_
> Adding_Remote_Modules>
> >
> > On Fri, Aug 11, 2017 at 4:11 PM, Sisi <[hidden email]
> <x-msg://27/user/SendEmail.jtp?type=node&node=7590185&i=0>> wrote:
> > Dear all,
> >
> > I am quite new with ITK. I would like to add some new .h file and .txx
> > files, which are not a part of the original ITK framework,  into the
> > original ITK Framework and use them together as library. How can I do it?
> >
> > I will be very happy to get any Information/hint/guide about it.
> >
> > best,
> > Siming
> >
> >
> >
> >
> > --
> > View this message in context: http://itk-insight-users.
> 2283740.n2.nabble.com/Integrate-new-h-and-txx-file-
> as-a-part-of-ITK-Framework-tp7590184.html <http://itk-insight-users.
> 2283740.n2.nabble.com/Integrate-new-h-and-txx-file-
> as-a-part-of-ITK-Framework-tp7590184.html>
> > Sent from the ITK Insight Users mailing list archive at Nabble.com.
> > _____________________________________
> > Powered by www.kitware.com <http://www.kitware.com/>
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html <
> http://www.kitware.com/opensource/opensource.html>
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.php <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 <http://www.itk.org/Wiki/ITK_FAQ>
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/insight-users <
> http://public.kitware.com/mailman/listinfo/insight-users>
> >
> >
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html <
> http://www.kitware.com/opensource/opensource.html>
> >
> > Kitware offers ITK Training Courses, for more information visit:
> > http://www.kitware.com/products/protraining.php <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 <http://www.itk.org/Wiki/ITK_FAQ>
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/insight-users <
> http://public.kitware.com/mailman/listinfo/insight-users>
> >
> >
> > If you reply to this email, your message will be added to the discussion
> below:
> > http://itk-insight-users.2283740.n2.nabble.com/
> Integrate-new-h-and-txx-file-as-a-part-of-ITK-Framework-
> tp7590184p7590185.html <http://itk-insight-users.2283740.n2.nabble.com/
> Integrate-new-h-and-txx-file-as-a-part-of-ITK-Framework-
> tp7590184p7590185.html>
> > To unsubscribe from Integrate new .h and .txx file as a part of ITK
> Framework, click here <http://itk-insight-users.2283740.n2.nabble.com/
> template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7590184&code=
> c2ltaW5nLmJheWVyQGdtYWlsLmNvbXw3NTkwMTg0fC0xNTI5Nzc4MTM3>.
> > NAML <http://itk-insight-users.2283740.n2.nabble.com/
> template/NamlServlet.jtp?macro=macro_viewer&id=instant_
> html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.naml.namespaces.BasicNamespace-nabble.view.
> web.template.NabbleNamespace-nabble.naml.namespaces.
> BasicNamespace-nabble.view.web.template.NabbleNamespace-
> nabble.view.web.template.NodeNamespace&breadcrumbs=
> notify_subscribers%21nabble%3Aemail.naml-instant_emails%
> 21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
>
>
> --
> View this message in context: http://itk-insight-users.
> 2283740.n2.nabble.com/Integrate-new-h-and-txx-file-
> as-a-part-of-ITK-Framework-tp7590184p7590186.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> 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://public.kitware.com/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20170811/16d19931/attachment.html>


More information about the Insight-users mailing list