[Insight-users] Problem with itkConvolutionImageFilter from git
Cory Quammen
cquammen at cs.unc.edu
Tue Nov 15 10:58:30 EST 2011
Jothy,
I thought you would like to know that the FFTConvolutionImageFilter is
now in the ITK git repository.
Cory
On Mon, Sep 19, 2011 at 5:26 AM, Jothy <jothybasu at gmail.com> wrote:
> Hi Cory,
>
> As you suspected, mixing versions was causing the problem. The
> itkConvolutionImageFilter works fine with ITK git version.
>
> Thanks
>
> Jothy
>
>
> On Fri, Sep 16, 2011 at 3:29 PM, Cory Quammen <cquammen at cs.unc.edu> wrote:
>>
>> Jothy,
>>
>> I understand that you are copying files from git to the 3.20 source.
>> Is that correct? If so, that sounds dangerous to me, and my best
>> advice to you is to stick with one version.
>>
>> For what it's worth, the ConvolutionImageFilter tests are compiling
>> fine within the current source in git on the compilers ITK supports,
>> and the method giving you the error is being exercised by the tests.
>> My guess is that there is a problem with mixing source between
>> versions. There are many changes in git, and I wouldn't be surprised
>> if doing what you are doing causes problems.
>>
>> Would it be possible for you to switch completely to the source in git?
>>
>> Thanks,
>> Cory
>>
>> On Fri, Sep 16, 2011 at 10:10 AM, Jothy <jothybasu at gmail.com> wrote:
>> > Hi Cory,
>> >
>> > I use QtCreator, so the cmake lists is auomagically managed by qmake. In
>> > fact I don't even know how to create cmakeLists.txt and I never
>> > required
>> > with QtCreator.
>> >
>> > I have managed to make a simple function as shown below.
>> >
>> > It converts 2 vtkImageData into itkImages, both are 3D. The conversion
>> > works
>> > pretty well and verified with old itkConvolutionImageFilter. Then I
>> > convolve
>> > with the latest filter. I copied all the necessary files from itk4.0 to
>> > the
>> > src folder such as itkDivideByConstantImageFilter,....
>> >
>> > Hope you will be able to manage with this
>> >
>> > #include"itkVTKImageToImageFilter.h"
>> >
>> > #include "itkImageToVTKImageFilter.h"
>> >
>> > #include"itkImage.h"
>> >
>> > #include"itkConvolutionImageFilter.h"
>> >
>> > #include"vtkImageData.h"
>> >
>> > #include"QDebug"
>> >
>> > void main(vtkImageData* input,vtkImageData* kernel)
>> >
>> > {
>> >
>> > //Convert input vtkImageData to itkImage
>> >
>> > typedef itk::Image<unsigned int,3> ImageType;
>> >
>> > typedef itk::VTKImageToImageFilter<ImageType>VTKImageToImageType;
>> >
>> > VTKImageToImageType::Pointer converter=VTKImageToImageType::New();
>> >
>> > converter->SetInput(input->GetOutput());
>> >
>> > converter->Update();
>> >
>> > //Convert kernel vtkImageData to itkImage
>> >
>> > typedef itk::Image<unsigned int,3> ImageTypeKernel;
>> >
>> > typedef
>> > itk::VTKImageToImageFilter<ImageTypeKernel>VTKImageToImageTypeKernel;
>> >
>> > VTKImageToImageTypeKernel::Pointer
>> > converterKernel=VTKImageToImageTypeKernel::New();
>> >
>> > converterKernel->SetInput(kernel);
>> >
>> > converterKernel->Update();
>> >
>> > //Crashes while executing htis
>> >
>> > qDebug()<<"Convolving....";
>> >
>> > typedef itk::ConvolutionImageFilter<ImageType> ConvolutionFilterType;
>> >
>> > ConvolutionFilterType::Pointer convoluter= ConvolutionFilterType::New();
>> >
>> > convoluter->SetInput(converter->GetOutput());
>> >
>> > convoluter->SetImageKernelInput(converterKernel->GetOutput());
>> >
>> > //convoluter->SetOutputRegionModeToSame();
>> >
>> > convoluter->Update();
>> >
>> > qDebug()<<"Convolving done....";
>> >
>> >
>> > }
>> >
>> > Thanks
>> >
>> > Jothy
>> >
>> >
>> > On Fri, Sep 16, 2011 at 2:23 PM, Cory Quammen <cquammen at cs.unc.edu>
>> > wrote:
>> >>
>> >> Jothy,
>> >>
>> >> Could you post a minimal compilable and runnable example with an
>> >> accompanying CMakeLists.txt file that gives the compilation error?
>> >>
>> >> Thanks,
>> >> Cory
>> >>
>> >> On Fri, Sep 16, 2011 at 7:39 AM, Jothy <jothybasu at gmail.com> wrote:
>> >> > Hi all,
>> >> >
>> >> > I am trying to use the itkConvolutionImageFilter from git (since some
>> >> > of
>> >> > the
>> >> > bugs are fixed in this). i was able to sucessfully use the older
>> >> > version
>> >> > of
>> >> > this downloaded from the Insight journal. But I get the following
>> >> > errors
>> >> > with the git version.
>> >> >
>> >> > In file included from ..\BIOSIM2\/itkConvolutionImageFilter.h:197,
>> >> >
>> >> > from ..\BIOSIM2\myimagefilters.cpp:48:
>> >> >
>> >> > ..\BIOSIM2\/itkConvolutionImageFilter.hxx: In member function
>> >> > 'typename
>> >> > itk::ConvolutionImageFilter<TInputImage, TKernelImage,
>> >> > TOutputImage>::OutputRegionType
>> >> > itk::ConvolutionImageFilter<TInputImage,
>> >> > TKernelImage, TOutputImage>::GetValidRegion() const [with TInputImage
>> >> > =
>> >> > itk::Image<unsigned int, 3u>, TKernelImage = itk::Image<unsigned int,
>> >> > 3u>,
>> >> > TOutputImage = itk::Image<unsigned int, 3u>]':
>> >> >
>> >> > ..\BIOSIM2\/itkConvolutionImageFilter.hxx:200: instantiated from
>> >> > 'void
>> >> > itk::ConvolutionImageFilter<TInputImage, TKernelImage,
>> >> > TOutputImage>::GenerateOutputInformation() [with TInputImage =
>> >> > itk::Image<unsigned int, 3u>, TKernelImage = itk::Image<unsigned int,
>> >> > 3u>,
>> >> > TOutputImage = itk::Image<unsigned int, 3u>]'
>> >> >
>> >> > ..\BIOSIM2\myimagefilters.cpp:494: instantiated from here
>> >> >
>> >> > ..\BIOSIM2\/itkConvolutionImageFilter.hxx:267: error: passing 'const
>> >> > itk::ConvolutionImageFilter<itk::Image<unsigned int, 3u>,
>> >> > itk::Image<unsigned int, 3u>, itk::Image<unsigned int, 3u> >' as
>> >> > 'this'
>> >> > argument of 'const TInputImage* itk::ImageToImageFilter<TInputImage,
>> >> > TOutputImage>::GetInput() [with TInputImage = itk::Image<unsigned
>> >> > int,
>> >> > 3u>,
>> >> > TOutputImage = itk::Image<unsigned int, 3u>]' discards qualifiers
>> >> >
>> >> > And here is the code I use to convolve
>> >> >
>> >> > typedef itk::ConvolutionImageFilter<ImageType> ConvolutionFilterType;
>> >> >
>> >> > ConvolutionFilterType::Pointer convoluter=
>> >> > ConvolutionFilterType::New();
>> >> >
>> >> > convoluter->SetInput(converter->GetOutput());
>> >> >
>> >> > convoluter->SetImageKernelInput(converterKernel->GetOutput());
>> >> >
>> >> > convoluter->Update();
>> >> >
>> >> >
>> >> > Any hints
>> >> >
>> >> > Jothy
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Jothybasu K Selvaraj
>> >> > PhD Student
>> >> > University of Liverpool
>> >> > Liverpool,UK
>> >> >
>> >> >
>> >> > _____________________________________
>> >> > 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
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Cory Quammen
>> >> Research Associate
>> >> Department of Computer Science
>> >> The University of North Carolina at Chapel Hill
>> >
>> >
>> >
>> > --
>> > Jothybasu K Selvaraj
>> > PhD Student
>> > University of Liverpool
>> > Liverpool,UK
>> >
>> >
>>
>>
>>
>> --
>> Cory Quammen
>> Research Associate
>> Department of Computer Science
>> The University of North Carolina at Chapel Hill
>
>
>
> --
> Jothybasu K Selvaraj
> PhD Student
> University of Liverpool
> Liverpool,UK
>
>
--
Cory Quammen
Research Associate
Department of Computer Science
The University of North Carolina at Chapel Hill
More information about the Insight-users
mailing list