[Insight-users] NCC in itk
somi
seesomi at gmail.com
Wed Nov 10 10:49:21 EST 2010
Hi,
I am trying to use itk::NormalizedCorrelationImageFilter , with template as
another image.
To set up another image as as templete, I use itk::ImageKernelOperator
itk::ImageKernelOperator<float, Dimension> kernelOperator;
kernelOperator.SetImageKernel(readerTemplate->GetOutput());
kernelOperator.CreateToRadius(radius);
typedef itk::NormalizedCorrelationImageFilter<InputImageType,
InputImageType, InputImageType> NCCFilterType;
NCCFilterType::Pointer filter = NCCFilterType::New();
filter->SetInput(reader->GetOutput());
filter->SetTemplate(kernelOperator);
However, ther output of NCC is all infinity. I found all the coefficients
of itk::ImageKernelOperator were zero.
Is there any step I am missing ? My test code and inputs are attached.
Usage:
NCC main.png templete.png out.nii
Thanks,
Somi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101110/19573244/attachment.htm>
-------------- next part --------------
# This is the root ITK CMakeLists file.
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
# This project is designed to be built outside the Insight source tree.
PROJECT(NCC)
# Find ITK.
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
ADD_EXECUTABLE(NCC NCC.cxx )
TARGET_LINK_LIBRARIES(NCC ITKCommon ITKIO ITKBasicFilters)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.png
Type: image/png
Size: 16707 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101110/19573244/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: template.png
Type: image/png
Size: 2686 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101110/19573244/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NCC.cxx
Type: text/x-c++src
Size: 2646 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101110/19573244/attachment.cxx>
More information about the Insight-users
mailing list