[ITK Community] [Insight-users] not sure if there's an issue with itkInverseDisplacementFieldImageFilter.hxx

Tim Bhatnagar tim.bhatnagar at gmail.com
Tue Nov 26 16:10:05 EST 2013


Sorry - I should have learned by now to include that by default. Here is
what I am using..

I downloaded the revised itkInverseDisplacementFieldImageFilter.cxx and
itkInverseDisplacementFieldImageFilter.hxx files from
http://review.source.kitware.com/#/c/10827/

Below, I've pasted, in order, the 'cxx' file, the 'hxx' file, and the error
I receive when trying to Build in Visual C++ Express 2010

My apologies in advance for the formatting of this email - after 2 years of
being a user of this software, I still feel like a rookie..

the 'cxx' file:

#include "itkInverseDisplacementFieldImageFilter.h"
#include "itkImageFileWriter.h"
#include "itkFilterWatcher.h"

int itkInverseDisplacementFieldImageFilterTest( int argc, char * argv[] )
{

  if( argc < 2 )
    {
    std::cerr << "Missing Parameters " << std::endl;
    std::cerr << "Usage: " << argv[0];
    std::cerr << " outputImage" << std::endl;
    return EXIT_FAILURE;
    }

  const     unsigned int Dimension = 2;
  typedef   float VectorComponentType;

  typedef   itk::Vector< VectorComponentType, Dimension > VectorType;

  typedef itk::Image< VectorType,  Dimension > DisplacementFieldType;

  typedef itk::InverseDisplacementFieldImageFilter<
    DisplacementFieldType,
    DisplacementFieldType
    >  FilterType;

  FilterType::Pointer filter = FilterType::New();

  FilterWatcher watcher(filter);

  // Creating an input displacement field
  DisplacementFieldType::Pointer field = DisplacementFieldType::New();

  DisplacementFieldType::SpacingType spacing;
  spacing.Fill( 1.0 );

  DisplacementFieldType::PointType origin;
  origin.Fill( 0.0 );

  DisplacementFieldType::RegionType region;
  DisplacementFieldType::SizeType   size;
  DisplacementFieldType::IndexType  start;

  size[0] = 128;
  size[1] = 128;

  start[0] = 0;
  start[1] = 0;

  region.SetSize( size );
  region.SetIndex( start );

  field->SetOrigin( origin );
  field->SetSpacing( spacing );
  field->SetRegions( region );
  field->Allocate();

  VectorType pixelValue;

  itk::ImageRegionIteratorWithIndex< DisplacementFieldType > it( field,
region );

  // Fill the field with some vectors
  it.GoToBegin();
  while( !it.IsAtEnd() )
    {
    DisplacementFieldType::IndexType index = it.GetIndex();
    pixelValue[0] = index[0] * 2.0 - index[0];
    pixelValue[1] = index[1] * 2.0 - index[1];
    it.Set( pixelValue );
    ++it;
    }

  // Since the tested transform is upsampling by a factor of two, the
  // size of the inverse field should be twice the size of the input
  // field. All other geomtry parameters are the same.
  filter->SetOutputSpacing( spacing );

  // keep the origin
  filter->SetOutputOrigin( origin );

  // set the size
  DisplacementFieldType::SizeType invFieldSize;
  invFieldSize[0] = size[0] * 2;
  invFieldSize[1] = size[1] * 2;

  filter->SetSize( invFieldSize );

  filter->SetInput( field );

  filter->SetSubsamplingFactor( 16 );

  try
    {
    filter->UpdateLargestPossibleRegion();
    }
  catch( itk::ExceptionObject & excp )
    {
    std::cerr << "Exception thrown " << std::endl;
    std::cerr << excp << std::endl;
    }

  // Write an image for regression testing
  typedef itk::ImageFileWriter<  DisplacementFieldType  > WriterType;

  WriterType::Pointer writer = WriterType::New();

  writer->SetInput (filter->GetOutput() );
  writer->SetFileName( argv[1] );

  try
    {
    writer->Update();
    }
  catch( itk::ExceptionObject & excp )
    {
    std::cerr << "Exception thrown by writer" << std::endl;
    std::cerr << excp << std::endl;
    return EXIT_FAILURE;
    }

  // Now, test for loop invariant (acts as filter validation)
  // f^-1(f(p1) + p1 ) - f(p1)  = 0
  it.GoToBegin();
  while( !it.IsAtEnd() )
    {
    DisplacementFieldType::PointType p1;
    field->TransformIndexToPhysicalPoint(it.GetIndex(), p1);

    DisplacementFieldType::PixelType fp1 = it.Get();

    DisplacementFieldType::PointType p2;
    p2[0] = p1[0] + fp1[0];
    p2[1] = p1[1] + fp1[1];

    DisplacementFieldType::IndexType id2;
    filter->GetOutput()->TransformPhysicalPointToIndex(p2,id2);
    DisplacementFieldType::PixelType fp2 =
filter->GetOutput()->GetPixel(id2);

    if(vcl_abs(fp2[0] + fp1[0]) > 0.001
       || vcl_abs(fp2[1] + fp1[1]) > 0.001)
      {
      std::cerr<<"Loop invariant not satisfied for index
"<<it.GetIndex()<<" : f^-1(f(p1) + p1 ) + f(p1)  = 0"<<   std::endl;
      std::cerr<<"f(p1) = "<<fp1<<std::endl;
      std::cerr<<"f^-1(f(p1) + p1 ) = "<<fp2<<std::endl;
      std::cerr<<"diff: "<<fp1[0]+fp2[0]<<", "<<fp1[1]+fp2[1]<<std::endl;
      return EXIT_FAILURE;
      }
    ++it;
    }

  return EXIT_SUCCESS;

}

*************************************************

and the 'hxx' file:

#ifndef __itkInverseDisplacementFieldImageFilter_hxx
#define __itkInverseDisplacementFieldImageFilter_hxx

#include "itkInverseDisplacementFieldImageFilter.h"
#include "itkObjectFactory.h"
#include "itkProgressReporter.h"
#include "itkThinPlateSplineKernelTransform.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "itkVectorResampleImageFilter.h"

namespace itk
{
/**
 * Initialize new instance
 */
template< class TInputImage, class TOutputImage >
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::InverseDisplacementFieldImageFilter()
{
  m_OutputSpacing.Fill(1.0);
  m_OutputOrigin.Fill(0.0);
  for ( unsigned int i = 0; i < ImageDimension; i++ )
    {
    m_Size[i] = 0;
    }

  typedef ThinPlateSplineKernelTransform<
    double,
    itkGetStaticConstMacro(ImageDimension) >  DefaultTransformType;

  m_KernelTransform = DefaultTransformType::New();

  m_SubsamplingFactor = 16;
}

/**
 * Print out a description of self
 *
 * \todo Add details about this class
 */
template< class TInputImage, class TOutputImage >
void
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::PrintSelf(std::ostream & os, Indent indent) const
{
  Superclass::PrintSelf(os, indent);

  os << indent << "Size:              " << m_Size << std::endl;
  os << indent << "OutputSpacing:     " << m_OutputSpacing << std::endl;
  os << indent << "OutputOrigin:      " << m_OutputOrigin << std::endl;
  os << indent << "KernelTransform:   " << m_KernelTransform.GetPointer()
<< std::endl;
  os << indent << "SubsamplingFactor: " << m_SubsamplingFactor << std::endl;

  return;
}

/**
 * Set the output image spacing.
 */
template< class TInputImage, class TOutputImage >
void
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::SetOutputSpacing(const double *spacing)
{
  SpacingType s(spacing);

  this->SetOutputSpacing(s);
}

/**
 * Set the output image origin.
 */
template< class TInputImage, class TOutputImage >
void
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::SetOutputOrigin(const double *origin)
{
  OriginPointType p(origin);

  this->SetOutputOrigin(p);
}

/**
 * Sub-sample the input displacement field and prepare the KernelBase
 * BSpline
 */
template< class TInputImage, class TOutputImage >
void
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::PrepareKernelBaseSpline()
{
  typedef typename KernelTransformType::PointsContainer LandmarkContainer;
  typedef typename LandmarkContainer::Pointer
LandmarkContainerPointer;

  // Source contains points with physical coordinates of the
  // destination displacement fields (the inverse field)
  LandmarkContainerPointer source = LandmarkContainer::New();

  // Target contains vectors (stored as points) indicating
  // displacement in the inverse direction.
  LandmarkContainerPointer target = LandmarkContainer::New();

  typedef itk::VectorResampleImageFilter<
    InputImageType,
    InputImageType  > ResamplerType;

  typename ResamplerType::Pointer resampler = ResamplerType::New();

  const InputImageType *inputImage = this->GetInput();

  resampler->SetInput(inputImage);
  resampler->SetOutputOrigin( inputImage->GetOrigin() );

  typename InputImageType::SpacingType spacing = inputImage->GetSpacing();

  typedef typename InputImageType::RegionType InputRegionType;
  typedef typename InputImageType::SizeType   InputSizeType;
  typedef typename InputImageType::IndexType  InputIndexType;

  InputRegionType region;

  region = inputImage->GetLargestPossibleRegion();

  InputSizeType size = region.GetSize();

  for ( unsigned int i = 0; i < ImageDimension; i++ )
    {
    size[i]    =  static_cast< SizeValueType >( size[i] /
m_SubsamplingFactor );
    spacing[i] *= m_SubsamplingFactor;
    }

  InputRegionType subsampledRegion;
  subsampledRegion.SetSize(size);
  subsampledRegion.SetIndex( region.GetIndex() );

  resampler->SetSize(size);
  resampler->SetOutputStartIndex( subsampledRegion.GetIndex() );
  resampler->SetOutputSpacing(spacing);

  resampler->Update();

  // allocate a landmark pair for each
  // pixel in the subsampled field
  const SizeValueType numberOfLandmarks =
subsampledRegion.GetNumberOfPixels();
  source->Reserve(numberOfLandmarks);
  target->Reserve(numberOfLandmarks);

  const InputImageType *sampledInput = resampler->GetOutput();

  typedef ImageRegionConstIteratorWithIndex< InputImageType > IteratorType;

  unsigned int landmarkId = 0;

  IteratorType ot(sampledInput, subsampledRegion);
  ot.GoToBegin();

  OutputPixelType                 value;
  Point< double, ImageDimension > sourcePoint;
  Point< double, ImageDimension > targetPoint;

  while ( !ot.IsAtEnd() )
    {
    value = ot.Get();

    // Here we try to evaluate the inverse transform, so points from
    // input displacement field are actually the target points
    sampledInput->TransformIndexToPhysicalPoint(ot.GetIndex(), targetPoint);

    target->InsertElement(landmarkId,  targetPoint);

    for ( unsigned int i = 0; i < ImageDimension; i++ )
      {
      sourcePoint[i] = targetPoint[i] + value[i];
      }
    source->InsertElement(landmarkId, sourcePoint);    // revert direction
of
                                                       // displacement

    ++landmarkId;
    ++ot;
    }

  itkDebugMacro(<< "Number of Landmarks created = " <<  numberOfLandmarks);

  m_KernelTransform->GetModifiableTargetLandmarks()->SetPoints(target);
  m_KernelTransform->GetModifiableSourceLandmarks()->SetPoints(source);

  itkDebugMacro(<< "Before ComputeWMatrix() ");

  m_KernelTransform->ComputeWMatrix();

  itkDebugMacro(<< "After ComputeWMatrix() ");
}

/**
 * GenerateData
 */
template< class TInputImage, class TOutputImage >
void
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::GenerateData()
{
  // First subsample the input displacement field in order to create
  // the KernelBased spline.
  this->PrepareKernelBaseSpline();

  itkDebugMacro(<< "Actually executing");

  // Get the output pointers
  OutputImageType *outputPtr = this->GetOutput();

  outputPtr->SetBufferedRegion( outputPtr->GetRequestedRegion() );
  outputPtr->Allocate();

  // Create an iterator that will walk the output region for this thread.
  typedef ImageRegionIteratorWithIndex<
    TOutputImage > OutputIterator;

  OutputImageRegionType region = outputPtr->GetRequestedRegion();

  OutputIterator outIt(outputPtr, region);

  // Define a few indices that will be used to translate from an input pixel
  // to an output pixel
  IndexType outputIndex;         // Index to current output pixel

  typedef typename KernelTransformType::InputPointType  InputPointType;
  typedef typename KernelTransformType::OutputPointType OutputPointType;

  InputPointType outputPoint;    // Coordinates of current output pixel

  // Support for progress methods/callbacks
  ProgressReporter progress(this, 0, region.GetNumberOfPixels(), 10);

  outIt.GoToBegin();

  // Walk the output region
  while ( !outIt.IsAtEnd() )
    {
    // Determine the index of the current output pixel
    outputIndex = outIt.GetIndex();
    outputPtr->TransformIndexToPhysicalPoint(outputIndex, outputPoint);

    // Compute corresponding inverse displacement vector
    OutputPointType interpolation =
      m_KernelTransform->TransformPoint(outputPoint);

    OutputPixelType inverseDisplacement;

    for ( unsigned int i = 0; i < ImageDimension; i++ )
      {
      inverseDisplacement[i] = interpolation[i] - outputPoint[i];
      }

    outIt.Set(inverseDisplacement);   // set inverse displacement.
    ++outIt;
    progress.CompletedPixel();
    }

  return;
}

/**
 * Inform pipeline of necessary input image region
 *
 * Determining the actual input region is non-trivial, especially
 * when we cannot assume anything about the transform being used.
 * So we do the easy thing and request the entire input image.
 */
template< class TInputImage, class TOutputImage >
void
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::GenerateInputRequestedRegion()
{
  // call the superclass's implementation of this method
  Superclass::GenerateInputRequestedRegion();

  if ( !this->GetInput() )
    {
    return;
    }

  // get pointers to the input and output
  InputImagePointer inputPtr  =
    const_cast< InputImageType * >( this->GetInput() );

  // Request the entire input image
  InputImageRegionType inputRegion;
  inputRegion = inputPtr->GetLargestPossibleRegion();
  inputPtr->SetRequestedRegion(inputRegion);

  return;
}

/**
 * Inform pipeline of required output region
 */
template< class TInputImage, class TOutputImage >
void
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::GenerateOutputInformation()
{
  // call the superclass' implementation of this method
  Superclass::GenerateOutputInformation();

  // get pointers to the input and output
  OutputImagePointer outputPtr = this->GetOutput();
  if ( !outputPtr )
    {
    return;
    }

  // Set the size of the output region
  typename TOutputImage::RegionType outputLargestPossibleRegion;
  outputLargestPossibleRegion.SetSize(m_Size);
  outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion);

  // Set spacing and origin
  outputPtr->SetSpacing(m_OutputSpacing);
  outputPtr->SetOrigin(m_OutputOrigin);

  return;
}

/**
 * Verify if any of the components has been modified.
 */
template< class TInputImage, class TOutputImage >
ModifiedTimeType
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage >
::GetMTime(void) const
{
  ModifiedTimeType latestTime = Object::GetMTime();

  if ( m_KernelTransform )
    {
    if ( latestTime < m_KernelTransform->GetMTime() )
      {
      latestTime = m_KernelTransform->GetMTime();
      }
    }

  return latestTime;
}

} // end namespace itk

#endif

******************************************************

and the list of VS errors (note that I revised my cxx file to its original
state, so the errors are different from those I previously mentioned)

c:\itkrap\insighttoolkit-4.2.0\modules\filtering\displacementfield\include\itkInverseDisplacementFieldImageFilter.hxx(347):
error C2143: syntax error : missing ';' before
'itk::InverseDisplacementFieldImageFilter<TInputImage,TOutputImage>::GetMTime'
1>c:\itkrap\insighttoolkit-4.2.0\modules\filtering\displacementfield\include\itkInverseDisplacementFieldImageFilter.hxx(347):
error C4430: missing type specifier - int assumed. Note: C++ does not
support default-int
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(68):
error C2955: 'itk::LightProcessObject' : use of class template requires
template argument list
1>
C:\ITKrap\InsightToolkit-4.2.0\Modules\Core\Common\include\itkLightProcessObject.h(72)
: see declaration of 'itk::LightProcessObject'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(68):
error C2504: 'itk::LightProcessObject' : base class undefined
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(561):
error C2079: 'itk::ImageIOBase::m_IORegion' uses undefined class
'itk::ImageIORegion'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(79):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161):
error C2679: binary '<<' : no operator found which takes a right-hand
operand of type 'const itk::ImageIORegion' (or there is no acceptable
conversion)
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(679): could be 'std::basic_ostream<_Elem,_Traits>
&std::operator
<<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const
char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(726): or       'std::basic_ostream<_Elem,_Traits>
&std::operator
<<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char)'
[found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(764): or       'std::basic_ostream<_Elem,_Traits>
&std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits>
&,const char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(811): or       'std::basic_ostream<_Elem,_Traits>
&std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits>
&,char)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(937): or       'std::basic_ostream<_Elem,_Traits>
&std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits>
&,const signed char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(944): or       'std::basic_ostream<_Elem,_Traits>
&std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits>
&,signed char)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(951): or       'std::basic_ostream<_Elem,_Traits>
&std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits>
&,const unsigned char *)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(958): or       'std::basic_ostream<_Elem,_Traits>
&std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits>
&,unsigned char)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(968): or       'std::basic_ostream<_Elem,_Traits>
&std::operator
<<<char,std::char_traits<char>,itk::ImageIORegion>(std::basic_ostream<_Elem,_Traits>
&&,_Ty)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>,
1>              _Ty=itk::ImageIORegion
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(1085): or       'std::basic_ostream<_Elem,_Traits>
&std::operator
<<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const
std::error_code &)' [found using argument-dependent lookup]
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>
c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkExceptionObject.h(153):
or       'std::ostream &itk::operator <<(std::ostream
&,itk::ExceptionObject &)'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkIndent.h(72):
or       'std::ostream &itk::operator <<(std::ostream &,const itk::Indent
&)'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkEventObject.h(101):
or       'std::ostream &itk::operator <<(std::ostream &,itk::EventObject &)'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkRealTimeInterval.h(94):
or       'std::ostream &itk::operator <<(std::ostream &,const
itk::RealTimeInterval &)'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkRealTimeStamp.h(86):
or       'std::ostream &itk::operator <<(std::ostream &,const
itk::RealTimeStamp &)'
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(186): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator
<<(std::basic_ostream<_Elem,_Traits> &(__cdecl
*)(std::basic_ostream<_Elem,_Traits> &))'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(192): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator
<<(std::basic_ios<_Elem,_Traits> &(__cdecl *)(std::basic_ios<_Elem,_Traits>
&))'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(199): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(std::ios_base &(__cdecl
*)(std::ios_base &))'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(206): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(std::_Bool)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(226): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(short)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(260): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(unsigned short)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(280): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(int)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(305): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(unsigned int)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(325): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(long)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(345): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(unsigned long)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(366): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(__int64)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(386): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(unsigned __int64)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(407): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(float)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(427): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(double)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(447): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(long double)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(467): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\ostream(487): or       'std::basic_ostream<_Elem,_Traits>
&std::basic_ostream<_Elem,_Traits>::operator
<<(std::basic_streambuf<_Elem,_Traits> *)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          while trying to match the argument list
'(std::basic_ostream<_Elem,_Traits>, const itk::ImageIORegion)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161):
error C2678: binary '!=' : no operator found which takes a left-hand
operand of type 'int' (or there is no acceptable conversion)
1>          C:\Program Files\Microsoft
SDKs\Windows\v7.1\include\guiddef.h(197): could be 'int operator !=(const
GUID &,const GUID &)'
1>          while trying to match the argument list '(int, const
itk::ImageIORegion)'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161):
error C2440: '=' : cannot convert from 'const itk::ImageIORegion' to 'int'
1>          Source or target has incomplete type
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(162):
error C2440: 'return' : cannot convert from 'const int' to 'const
itk::ImageIORegion &'
1>          Reason: cannot convert from 'const int' to 'const
itk::ImageIORegion'
1>          Source or target has incomplete type
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(169):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(169):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(174):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(174):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(187):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(187):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(191):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(191):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(196):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(196):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(201):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(201):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(229):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(229):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(252):
error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(252):
error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'
1>
c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67)
: see declaration of 'itk::ImageIOBase'
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageFileWriter.h(213):
error C2079: 'itk::ImageFileWriter<TInputImage>::m_PasteIORegion' uses
undefined class 'itk::ImageIORegion'
1>          with
1>          [
1>              TInputImage=DisplacementFieldType
1>          ]
1>
C:\ITKrap\InsightToolkit-4.2.0\Examples\Filtering\FlipImageFilter.cxx(124)
: see reference to class template instantiation
'itk::ImageFileWriter<TInputImage>' being compiled
1>          with
1>          [
1>              TInputImage=DisplacementFieldType
1>          ]
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========





On Tue, Nov 26, 2013 at 12:56 PM, Bill Lorensen <bill.lorensen at gmail.com>wrote:

> Tim,
>
> If you can post a small, compilable (with all includes) example that
> illustrates the problem, I'm sure you'll get a quick answer.
>
> Bill
>
>
> On Tue, Nov 26, 2013 at 3:12 PM, Tim Bhatnagar <tim.bhatnagar at gmail.com>
> wrote:
> > Hello all,
> >
> > I am trying to implement a filter to obtain the inverse of a
> Demon's-derived
> > displacement field. I've found a number of code candidates, but they all
> > rely on itkInverseDisplacementFieldImageFilter.hxx
> >
> > and in each case, I'm getting errors like:
> >
> >
> c:\itkrap\insighttoolkit-4.2.0\modules\filtering\displacementfield\include\itkInverseDisplacementFieldImageFilter.hxx(343):
> > error C2143: syntax error : missing ';' before
> >
> 'itk::InverseDisplacementFieldImageFilter<TInputImage,TOutputImage>::GetMTime'
> >
> >
> c:\itkrap\insighttoolkit-4.2.0\modules\filtering\displacementfield\include\itkInverseDisplacementFieldImageFilter.hxx(343):
> > error C4430: missing type specifier - int assumed. Note: C++ does not
> > support default-int
> >
> > I'm using VS10 Express, and until this code, everything in ITK has been
> > working well.
> >
> > Sorry if there is a basic solution to this issue - I'm stumped! Any help
> is
> > much appreciated.
> >
> > Thanks,
> >
> > --
> > Tim Bhatnagar
> > PhD Candidate
> > Orthopaedic Injury Biomechanics Group
> > Department of Mechanical Engineering
> > University of British Columbia
> >
> > Rm 5000 - 818 West 10th Ave.
> > Vancouver, BC
> > Canada
> > V5Z 1M9
> >
> > Ph: (604) 675-8845
> > Fax: (604) 675-8820
> > Web: oibg.mech.ubc.ca
> >
> >
> > _____________________________________
> > 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://www.itk.org/mailman/listinfo/insight-users
> >
>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>



-- 
Tim Bhatnagar
PhD Candidate
Orthopaedic Injury Biomechanics Group
Department of Mechanical Engineering
University of British Columbia

Rm 5000 - 818 West 10th Ave.
Vancouver, BC
Canada
V5Z 1M9

Ph: (604) 675-8845
Fax: (604) 675-8820
Web: oibg.mech.ubc.ca
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20131126/837e843f/attachment.html>
-------------- next part --------------
_____________________________________
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://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list