[ITK] [ITK-users] help

Jon Haitz Legarreta jhlegarreta at vicomtech.org
Wed Apr 29 04:26:44 EDT 2015


Hi Denis,
welcome to ITK. ITK's wiki [1] can be extremely helpful to start with ITK.

Copying the code of the class you are referring to will be of no advantage,
since it includes and inherits from a variety of other ITK classes. And
unless your project includes and links against ITK, your approach will not
work.

One of the most sensible alternatives you have is to download the ITK
sources, build them and include it in your project.

Once you do that, you may want to create your own, specialized metric
class, inheriting from the corresponding ITK base class so that you avoid
duplicating methods and work that has already been done.

And last but not least, if your metric has an added value compared to what
exists in ITK, you may want to submit a contribution to the library [2].

HTH,
JON HAITZ


[1] http://www.itk.org/Wiki/ITK/Getting_Started
[2] http://www.itk.org/Wiki/ITK/Contribute


On 29 April 2015 at 09:04, Abu-Sammour, Denis <
Denis.Abu-Sammour at medma.uni-heidelberg.de> wrote:

>  Dear itk Community,
>
> I am a fresh user of itk and c++ as well. I am trying to implement a new
> metric (similarity measure) to be used for image registration which is not
> available in the metrics provided by itk. I have seen comments on how to do
> that which simply stated to take a metric that is already implemented in
> itk such as “MeanSquaresImageToImageMetric” and modify the content
> specifically GetValue (), GetDerivative  () and GetValueAndDerivative ()
> members.
>
> Now I have found a itkMeanSquaresImageToImageMetric.txx on the web which I
> suppose is a templated class code (
> *http://www.na-mic.org/svn/Slicer3-lib-mirrors/trunk/Insight/Code/Algorithms/itkMeanSquaresImageToImageMetric.txx*
> <http://www.na-mic.org/svn/Slicer3-lib-mirrors/trunk/Insight/Code/Algorithms/itkMeanSquaresImageToImageMetric.txx>).
> As a primitive itk and cpp user, what I have in mind is to copy and paste
> the content of this class into my code, modify the GetValue (),
> GetDerivative () and GetValueAndDerivative () functions and rename anything
> that says  “MeanSquaresImageToImageMetric” with my own metric i.e.
> “MyMetric”. Afterwards link it to the registration as outlined in the itk
> examples. Is that the way to go for it?!
>
> Additionally, in the “itkMeanSquaresImageToImageMetric.txx” there is also
> #include “itkMeanSquaresImageToImageMetric.h”, should I leave it as is or
> modify it to #include “itkImageToImageMetric.h” instead? I am a bit lost
> here..
>
> Thanks you for your time and consideration.
>
> Denis
>
>
>
> _____________________________________
> 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/community/attachments/20150429/1ef048aa/attachment-0001.html>


More information about the Community mailing list