[Insight-users] Problem compiling with ITK 3.16.0 in Linux

Alfonso Castro Martinez alfonsocastro at udc.es
Mon Oct 19 09:12:01 EDT 2009


Thanks for your reply.

We are using the class to join a TAC separated in two images: left lobe and 
right lobe.

The error is in a include file: Paste.h in our source:

#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkGDCMImageIO.h"
#include "itkPasteImageFilter.h"

void PasteImages(char *imGrande, char *imPeque, int indx, int indy, char 
*name);
void PasteImages2(char *imGrande2, char *imPeque2, int indx2, int indy2, char 
*name2);

From there the message error comes from itkPasteImageFilter.txx in the source 
directory of ITK in line 46, the  code in this position:

template <class TInputImage, class TSourceImage, class TOutputImage>
void 
PasteImageFilter<TInputImage,TSourceImage,TOutputImage>
::SetSourceImage(const SourceImageType *src)
{
  // Process object is not const-correct so the const casting is required.
  this->SetNthInput(1, const_cast<SourceImageType *>( src ));
}


Thanks in advance.

Alfonso Castro Martinez
Dept. of Information and Communication Technologies
University of A Coruna
Spain


O Venres 16 Outubro 2009 05:55:09 Bill Lorensen escribiu:
> Luis,
> 
> Perhaps the const correctness changes you made to itkPasteImageFilter
> are not bacward compatible?
> 
> Alfonso,
> 
> How are you using this class? Our intent is to not break backward
>  compatibility.
> 
> Bill
> 
> 2009/10/14 Alfonso Castro Martinez <alfonsocastro at udc.es>:
> > Hi.
> >
> > I have a program to preprocess lung TACs made with ITK. I don't have
> > problems compiling this program in OpenSuSE 11.1 x86_64 with ITK 3.12.0
> > but when I compile it with ITK 3.16.0. I obtain the next error:
> >
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:46: error: expected ‘,’ or ‘...’ before ‘*’ token
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:46: error: ISO C++ forbids declaration of ‘SourceImageType’ with no type
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:46: error: prototype for ‘void itk::PasteImageFilter<TInputImage,
> > TSourceImage, TOutputImage>::SetSourceImage(int)’ does not match any in
> > class
> > ‘itk::PasteImageFilter<TInputImage, TSourceImage, TOutputImage>’
> > /mia/itk/preprocesado tac pulmon/Codigo/src/itkPasteImageFilter.h:53:
> > error: candidate is: void itk::PasteImageFilter<TInputImage,
> > TSourceImage, TOutputImage>::SetSourceImage(TSourceImage*)
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:55: error: prototype for ‘const typename
> > itk::PasteImageFilter<TInputImage, TSourceImage,
> > TOutputImage>::SourceImageType*
> > itk::PasteImageFilter<TInputImage, TSourceImage,
> > TOutputImage>::GetSourceImage() const’ does not match any in class
> > ‘itk::PasteImageFilter<TInputImage, TSourceImage, TOutputImage>’
> > /mia/itk/preprocesado tac pulmon/Codigo/src/itkPasteImageFilter.h:54:
> > error: candidate is: const TSourceImage*
> > itk::PasteImageFilter<TInputImage, TSourceImage,
> > TOutputImage>::GetSourceImage()
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:65: error: expected ‘,’ or ‘...’ before ‘*’ token
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:65: error: ISO C++ forbids declaration of ‘InputImageType’ with no type
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:65: error: prototype for ‘void itk::PasteImageFilter<TInputImage,
> > TSourceImage, TOutputImage>::SetDestinationImage(int)’ does not match any
> > in class ‘itk::PasteImageFilter<TInputImage, TSourceImage, TOutputImage>’
> > /mia/itk/preprocesado tac pulmon/Codigo/src/itkPasteImageFilter.h:51:
> > error: candidate is: void itk::PasteImageFilter<TInputImage,
> > TSourceImage, TOutputImage>::SetDestinationImage(TInputImage*)
> > /toolkits/InsightToolkit-3.16.0/Code/BasicFilters/itkPasteImageFilter.txx
> >:74: error: prototype for ‘const typename
> > itk::PasteImageFilter<TInputImage, TSourceImage,
> > TOutputImage>::InputImageType*
> > itk::PasteImageFilter<TInputImage, TSourceImage,
> > TOutputImage>::GetDestinationImage() const’ does not match any in class
> > ‘itk::PasteImageFilter<TInputImage, TSourceImage, TOutputImage>’
> >
> > Can some help me, please?
> >
> > Thanks in advance.
> >
> > Alfonso Castro Martinez
> > Dept. of Information and Communication Technologies
> > University of A Coruna
> > Spain
> > _____________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.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
> 


More information about the Insight-users mailing list