[Insight-users] Doubt in derivative calculation using itkDerivativeImageFilter
Luis Ibanez
luis.ibanez at kitware.com
Sat Oct 16 15:39:21 EDT 2010
Hi Kana,
It looks like you are not taking the spacing
of the image into account when you compute
the derivatives manually.
The manual derivative computation should be:
( 22923 – 20850 ) / (2.0 x spacingAlongX )
that is:
f( i+1) - f( i- 1 ) / ( 2 Dx )
So, I would guess that you image as an
spacing along X that is equal to: 2.0.
Regards,
Luis
------------------------------------------------------------
On Fri, Oct 15, 2010 at 9:51 AM, Arunachalam Kana <
Kana.Arunachalam at fh-wels.at> wrote:
> Dear ITK Users,
>
>
>
> I have a small doubt while I compare the itkDerivativeImageFilter result
> with manually calculated derivative. The code below for
> itkDerivativeImageFilter:
>
> typedef itk::DerivativeImageFilter<CastImageType,CastImageType>
> DerivativeFilterType;
>
>
>
> //create First derivative in X direction
>
> DerivativeFilterType::Pointer DXfilter = DerivativeFilterType::New();
>
> DXfilter->SetInput(inputimage);
>
> DXfilter->SetDirection(0);
>
> DXfilter->SetOrder(1);
>
> DXfilter->Update();
>
>
>
> The following are the grayvalue of indics:
>
> Gray value at index [9,31,11] = 20850
>
> Gray value at index [10,31,11] = 22923
>
> Gray value at index [11,31,11] = 22923
>
>
>
> Manual calculation of DX at index [10,31,11] = 22923 – 20850 = 2073
>
> The filter calculation of DX at index [10,31,11] = 518.25
>
>
>
> I have a doubt in how the filter calculates the derivative. When I read the
> manual it said “A derivative at pixel index i = ( j,k), for example, is
> taken as a weighted
>
> difference of the values at ( j+1,k) and ( j−1,k).” . I would like to know
> how is the weighted difference of the values is calculated and is it ok to
> calculated the weighted difference ?
>
>
>
> Thank you,
>
>
>
> Regards,
>
> Kana Arunachalam Kannappan
>
> Research Associate
>
> FH OÖ Forschungs & Entwicklungs GmbH
>
> Stelzhamer Strasse 23,
>
> 4600 Wels,
>
> Austria.
>
> Phone: +43 (0)7242 72811 -4420
>
> kana.arunachalam at fh-wels.at
>
> www.fh-ooe.at; www.3dct.at
>
>
>
> _____________________________________
> 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.html
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101016/c6a5d5f3/attachment.htm>
More information about the Insight-users
mailing list