<div dir="ltr"><div><div><div><div><div>Sorry - I should have learned by now to include that by default. Here is what I am using..<br><br></div>I downloaded the revised itkInverseDisplacementFieldImageFilter.cxx and itkInverseDisplacementFieldImageFilter.hxx files from <a href="http://review.source.kitware.com/#/c/10827/">http://review.source.kitware.com/#/c/10827/</a><br>
<br></div><div>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<br><br></div><div>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..<br>
</div><div><br></div>the 'cxx' file:<br><br>#include "itkInverseDisplacementFieldImageFilter.h"<br>#include "itkImageFileWriter.h"<br>#include "itkFilterWatcher.h"<br><br>int itkInverseDisplacementFieldImageFilterTest( int argc, char * argv[] )<br>
{<br><br>  if( argc < 2 )<br>    {<br>    std::cerr << "Missing Parameters " << std::endl;<br>    std::cerr << "Usage: " << argv[0];<br>    std::cerr << " outputImage" << std::endl;<br>
    return EXIT_FAILURE;<br>    }<br><br>  const     unsigned int Dimension = 2;<br>  typedef   float VectorComponentType;<br><br>  typedef   itk::Vector< VectorComponentType, Dimension > VectorType;<br><br>  typedef itk::Image< VectorType,  Dimension > DisplacementFieldType;<br>
<br>  typedef itk::InverseDisplacementFieldImageFilter<<br>    DisplacementFieldType,<br>    DisplacementFieldType<br>    >  FilterType;<br><br>  FilterType::Pointer filter = FilterType::New();<br><br>  FilterWatcher watcher(filter);<br>
<br>  // Creating an input displacement field<br>  DisplacementFieldType::Pointer field = DisplacementFieldType::New();<br><br>  DisplacementFieldType::SpacingType spacing;<br>  spacing.Fill( 1.0 );<br><br>  DisplacementFieldType::PointType origin;<br>
  origin.Fill( 0.0 );<br><br>  DisplacementFieldType::RegionType region;<br>  DisplacementFieldType::SizeType   size;<br>  DisplacementFieldType::IndexType  start;<br><br>  size[0] = 128;<br>  size[1] = 128;<br><br>  start[0] = 0;<br>
  start[1] = 0;<br><br>  region.SetSize( size );<br>  region.SetIndex( start );<br><br>  field->SetOrigin( origin );<br>  field->SetSpacing( spacing );<br>  field->SetRegions( region );<br>  field->Allocate();<br>
<br>  VectorType pixelValue;<br><br>  itk::ImageRegionIteratorWithIndex< DisplacementFieldType > it( field, region );<br><br>  // Fill the field with some vectors<br>  it.GoToBegin();<br>  while( !it.IsAtEnd() )<br>
    {<br>    DisplacementFieldType::IndexType index = it.GetIndex();<br>    pixelValue[0] = index[0] * 2.0 - index[0];<br>    pixelValue[1] = index[1] * 2.0 - index[1];<br>    it.Set( pixelValue );<br>    ++it;<br>    }<br>
<br>  // Since the tested transform is upsampling by a factor of two, the<br>  // size of the inverse field should be twice the size of the input<br>  // field. All other geomtry parameters are the same.<br>  filter->SetOutputSpacing( spacing );<br>
<br>  // keep the origin<br>  filter->SetOutputOrigin( origin );<br><br>  // set the size<br>  DisplacementFieldType::SizeType invFieldSize;<br>  invFieldSize[0] = size[0] * 2;<br>  invFieldSize[1] = size[1] * 2;<br><br>
  filter->SetSize( invFieldSize );<br><br>  filter->SetInput( field );<br><br>  filter->SetSubsamplingFactor( 16 );<br><br>  try<br>    {<br>    filter->UpdateLargestPossibleRegion();<br>    }<br>  catch( itk::ExceptionObject & excp )<br>
    {<br>    std::cerr << "Exception thrown " << std::endl;<br>    std::cerr << excp << std::endl;<br>    }<br><br>  // Write an image for regression testing<br>  typedef itk::ImageFileWriter<  DisplacementFieldType  > WriterType;<br>
<br>  WriterType::Pointer writer = WriterType::New();<br><br>  writer->SetInput (filter->GetOutput() );<br>  writer->SetFileName( argv[1] );<br><br>  try<br>    {<br>    writer->Update();<br>    }<br>  catch( itk::ExceptionObject & excp )<br>
    {<br>    std::cerr << "Exception thrown by writer" << std::endl;<br>    std::cerr << excp << std::endl;<br>    return EXIT_FAILURE;<br>    }<br><br>  // Now, test for loop invariant (acts as filter validation)<br>
  // f^-1(f(p1) + p1 ) - f(p1)  = 0<br>  it.GoToBegin();<br>  while( !it.IsAtEnd() )<br>    {<br>    DisplacementFieldType::PointType p1;<br>    field->TransformIndexToPhysicalPoint(it.GetIndex(), p1);<br><br>    DisplacementFieldType::PixelType fp1 = it.Get();<br>
<br>    DisplacementFieldType::PointType p2;<br>    p2[0] = p1[0] + fp1[0];<br>    p2[1] = p1[1] + fp1[1];<br><br>    DisplacementFieldType::IndexType id2;<br>    filter->GetOutput()->TransformPhysicalPointToIndex(p2,id2);<br>
    DisplacementFieldType::PixelType fp2 = filter->GetOutput()->GetPixel(id2);<br><br>    if(vcl_abs(fp2[0] + fp1[0]) > 0.001<br>       || vcl_abs(fp2[1] + fp1[1]) > 0.001)<br>      {<br>      std::cerr<<"Loop invariant not satisfied for index "<<it.GetIndex()<<" : f^-1(f(p1) + p1 ) + f(p1)  = 0"<<   std::endl;<br>
      std::cerr<<"f(p1) = "<<fp1<<std::endl;<br>      std::cerr<<"f^-1(f(p1) + p1 ) = "<<fp2<<std::endl;<br>      std::cerr<<"diff: "<<fp1[0]+fp2[0]<<", "<<fp1[1]+fp2[1]<<std::endl;<br>
      return EXIT_FAILURE;<br>      }<br>    ++it;<br>    }<br><br>  return EXIT_SUCCESS;<br><br>}<br><br></div>*************************************************<br><br></div>and the 'hxx' file:<br><br>#ifndef __itkInverseDisplacementFieldImageFilter_hxx<br>
#define __itkInverseDisplacementFieldImageFilter_hxx<br><br>#include "itkInverseDisplacementFieldImageFilter.h"<br>#include "itkObjectFactory.h"<br>#include "itkProgressReporter.h"<br>#include "itkThinPlateSplineKernelTransform.h"<br>
#include "itkImageRegionIteratorWithIndex.h"<br>#include "itkVectorResampleImageFilter.h"<br><br>namespace itk<br>{<br>/**<br> * Initialize new instance<br> */<br>template< class TInputImage, class TOutputImage ><br>
InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>::InverseDisplacementFieldImageFilter()<br>{<br>  m_OutputSpacing.Fill(1.0);<br>  m_OutputOrigin.Fill(0.0);<br>  for ( unsigned int i = 0; i < ImageDimension; i++ )<br>
    {<br>    m_Size[i] = 0;<br>    }<br><br>  typedef ThinPlateSplineKernelTransform<<br>    double,<br>    itkGetStaticConstMacro(ImageDimension) >  DefaultTransformType;<br><br>  m_KernelTransform = DefaultTransformType::New();<br>
<br>  m_SubsamplingFactor = 16;<br>}<br><br>/**<br> * Print out a description of self<br> *<br> * \todo Add details about this class<br> */<br>template< class TInputImage, class TOutputImage ><br>void<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>
::PrintSelf(std::ostream & os, Indent indent) const<br>{<br>  Superclass::PrintSelf(os, indent);<br><br>  os << indent << "Size:              " << m_Size << std::endl;<br>  os << indent << "OutputSpacing:     " << m_OutputSpacing << std::endl;<br>
  os << indent << "OutputOrigin:      " << m_OutputOrigin << std::endl;<br>  os << indent << "KernelTransform:   " << m_KernelTransform.GetPointer() << std::endl;<br>
  os << indent << "SubsamplingFactor: " << m_SubsamplingFactor << std::endl;<br><br>  return;<br>}<br><br>/**<br> * Set the output image spacing.<br> */<br>template< class TInputImage, class TOutputImage ><br>
void<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>::SetOutputSpacing(const double *spacing)<br>{<br>  SpacingType s(spacing);<br><br>  this->SetOutputSpacing(s);<br>}<br><br>/**<br> * Set the output image origin.<br>
 */<br>template< class TInputImage, class TOutputImage ><br>void<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>::SetOutputOrigin(const double *origin)<br>{<br>  OriginPointType p(origin);<br>
<br>  this->SetOutputOrigin(p);<br>}<br><br>/**<br> * Sub-sample the input displacement field and prepare the KernelBase<br> * BSpline<br> */<br>template< class TInputImage, class TOutputImage ><br>void<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>
::PrepareKernelBaseSpline()<br>{<br>  typedef typename KernelTransformType::PointsContainer LandmarkContainer;<br>  typedef typename LandmarkContainer::Pointer           LandmarkContainerPointer;<br><br>  // Source contains points with physical coordinates of the<br>
  // destination displacement fields (the inverse field)<br>  LandmarkContainerPointer source = LandmarkContainer::New();<br><br>  // Target contains vectors (stored as points) indicating<br>  // displacement in the inverse direction.<br>
  LandmarkContainerPointer target = LandmarkContainer::New();<br><br>  typedef itk::VectorResampleImageFilter<<br>    InputImageType,<br>    InputImageType  > ResamplerType;<br><br>  typename ResamplerType::Pointer resampler = ResamplerType::New();<br>
<br>  const InputImageType *inputImage = this->GetInput();<br><br>  resampler->SetInput(inputImage);<br>  resampler->SetOutputOrigin( inputImage->GetOrigin() );<br><br>  typename InputImageType::SpacingType spacing = inputImage->GetSpacing();<br>
<br>  typedef typename InputImageType::RegionType InputRegionType;<br>  typedef typename InputImageType::SizeType   InputSizeType;<br>  typedef typename InputImageType::IndexType  InputIndexType;<br><br>  InputRegionType region;<br>
<br>  region = inputImage->GetLargestPossibleRegion();<br><br>  InputSizeType size = region.GetSize();<br><br>  for ( unsigned int i = 0; i < ImageDimension; i++ )<br>    {<br>    size[i]    =  static_cast< SizeValueType >( size[i] / m_SubsamplingFactor );<br>
    spacing[i] *= m_SubsamplingFactor;<br>    }<br><br>  InputRegionType subsampledRegion;<br>  subsampledRegion.SetSize(size);<br>  subsampledRegion.SetIndex( region.GetIndex() );<br><br>  resampler->SetSize(size);<br>
  resampler->SetOutputStartIndex( subsampledRegion.GetIndex() );<br>  resampler->SetOutputSpacing(spacing);<br><br>  resampler->Update();<br><br>  // allocate a landmark pair for each<br>  // pixel in the subsampled field<br>
  const SizeValueType numberOfLandmarks = subsampledRegion.GetNumberOfPixels();<br>  source->Reserve(numberOfLandmarks);<br>  target->Reserve(numberOfLandmarks);<br><br>  const InputImageType *sampledInput = resampler->GetOutput();<br>
<br>  typedef ImageRegionConstIteratorWithIndex< InputImageType > IteratorType;<br><br>  unsigned int landmarkId = 0;<br><br>  IteratorType ot(sampledInput, subsampledRegion);<br>  ot.GoToBegin();<br><br>  OutputPixelType                 value;<br>
  Point< double, ImageDimension > sourcePoint;<br>  Point< double, ImageDimension > targetPoint;<br><br>  while ( !ot.IsAtEnd() )<br>    {<br>    value = ot.Get();<br><br>    // Here we try to evaluate the inverse transform, so points from<br>
    // input displacement field are actually the target points<br>    sampledInput->TransformIndexToPhysicalPoint(ot.GetIndex(), targetPoint);<br><br>    target->InsertElement(landmarkId,  targetPoint);<br><br>    for ( unsigned int i = 0; i < ImageDimension; i++ )<br>
      {<br>      sourcePoint[i] = targetPoint[i] + value[i];<br>      }<br>    source->InsertElement(landmarkId, sourcePoint);    // revert direction of<br>                                                       // displacement<br>
<br>    ++landmarkId;<br>    ++ot;<br>    }<br><br>  itkDebugMacro(<< "Number of Landmarks created = " <<  numberOfLandmarks);<br><br>  m_KernelTransform->GetModifiableTargetLandmarks()->SetPoints(target);<br>
  m_KernelTransform->GetModifiableSourceLandmarks()->SetPoints(source);<br><br>  itkDebugMacro(<< "Before ComputeWMatrix() ");<br><br>  m_KernelTransform->ComputeWMatrix();<br><br>  itkDebugMacro(<< "After ComputeWMatrix() ");<br>
}<br><br>/**<br> * GenerateData<br> */<br>template< class TInputImage, class TOutputImage ><br>void<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>::GenerateData()<br>{<br>  // First subsample the input displacement field in order to create<br>
  // the KernelBased spline.<br>  this->PrepareKernelBaseSpline();<br><br>  itkDebugMacro(<< "Actually executing");<br><br>  // Get the output pointers<br>  OutputImageType *outputPtr = this->GetOutput();<br>
<br>  outputPtr->SetBufferedRegion( outputPtr->GetRequestedRegion() );<br>  outputPtr->Allocate();<br><br>  // Create an iterator that will walk the output region for this thread.<br>  typedef ImageRegionIteratorWithIndex<<br>
    TOutputImage > OutputIterator;<br><br>  OutputImageRegionType region = outputPtr->GetRequestedRegion();<br><br>  OutputIterator outIt(outputPtr, region);<br><br>  // Define a few indices that will be used to translate from an input pixel<br>
  // to an output pixel<br>  IndexType outputIndex;         // Index to current output pixel<br><br>  typedef typename KernelTransformType::InputPointType  InputPointType;<br>  typedef typename KernelTransformType::OutputPointType OutputPointType;<br>
<br>  InputPointType outputPoint;    // Coordinates of current output pixel<br><br>  // Support for progress methods/callbacks<br>  ProgressReporter progress(this, 0, region.GetNumberOfPixels(), 10);<br><br>  outIt.GoToBegin();<br>
<br>  // Walk the output region<br>  while ( !outIt.IsAtEnd() )<br>    {<br>    // Determine the index of the current output pixel<br>    outputIndex = outIt.GetIndex();<br>    outputPtr->TransformIndexToPhysicalPoint(outputIndex, outputPoint);<br>
<br>    // Compute corresponding inverse displacement vector<br>    OutputPointType interpolation =<br>      m_KernelTransform->TransformPoint(outputPoint);<br><br>    OutputPixelType inverseDisplacement;<br><br>    for ( unsigned int i = 0; i < ImageDimension; i++ )<br>
      {<br>      inverseDisplacement[i] = interpolation[i] - outputPoint[i];<br>      }<br><br>    outIt.Set(inverseDisplacement);   // set inverse displacement.<br>    ++outIt;<br>    progress.CompletedPixel();<br>    }<br>
<br>  return;<br>}<br><br>/**<br> * Inform pipeline of necessary input image region<br> *<br> * Determining the actual input region is non-trivial, especially<br> * when we cannot assume anything about the transform being used.<br>
 * So we do the easy thing and request the entire input image.<br> */<br>template< class TInputImage, class TOutputImage ><br>void<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>::GenerateInputRequestedRegion()<br>
{<br>  // call the superclass's implementation of this method<br>  Superclass::GenerateInputRequestedRegion();<br><br>  if ( !this->GetInput() )<br>    {<br>    return;<br>    }<br><br>  // get pointers to the input and output<br>
  InputImagePointer inputPtr  =<br>    const_cast< InputImageType * >( this->GetInput() );<br><br>  // Request the entire input image<br>  InputImageRegionType inputRegion;<br>  inputRegion = inputPtr->GetLargestPossibleRegion();<br>
  inputPtr->SetRequestedRegion(inputRegion);<br><br>  return;<br>}<br><br>/**<br> * Inform pipeline of required output region<br> */<br>template< class TInputImage, class TOutputImage ><br>void<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>
::GenerateOutputInformation()<br>{<br>  // call the superclass' implementation of this method<br>  Superclass::GenerateOutputInformation();<br><br>  // get pointers to the input and output<br>  OutputImagePointer outputPtr = this->GetOutput();<br>
  if ( !outputPtr )<br>    {<br>    return;<br>    }<br><br>  // Set the size of the output region<br>  typename TOutputImage::RegionType outputLargestPossibleRegion;<br>  outputLargestPossibleRegion.SetSize(m_Size);<br>  outputPtr->SetLargestPossibleRegion(outputLargestPossibleRegion);<br>
<br>  // Set spacing and origin<br>  outputPtr->SetSpacing(m_OutputSpacing);<br>  outputPtr->SetOrigin(m_OutputOrigin);<br><br>  return;<br>}<br><br>/**<br> * Verify if any of the components has been modified.<br> */<br>
template< class TInputImage, class TOutputImage ><br>ModifiedTimeType<br>InverseDisplacementFieldImageFilter< TInputImage, TOutputImage ><br>::GetMTime(void) const<br>{<br>  ModifiedTimeType latestTime = Object::GetMTime();<br>
<br>  if ( m_KernelTransform )<br>    {<br>    if ( latestTime < m_KernelTransform->GetMTime() )<br>      {<br>      latestTime = m_KernelTransform->GetMTime();<br>      }<br>    }<br><br>  return latestTime;<br>
}<br><br>} // end namespace itk<br><br>#endif<br><br>******************************************************<br><br></div>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)<br>
<br>c:\itkrap\insighttoolkit-4.2.0\modules\filtering\displacementfield\include\itkInverseDisplacementFieldImageFilter.hxx(347): error C2143: syntax error : missing ';' before 'itk::InverseDisplacementFieldImageFilter<TInputImage,TOutputImage>::GetMTime'<br>
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<br>
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<br>1>          C:\ITKrap\InsightToolkit-4.2.0\Modules\Core\Common\include\itkLightProcessObject.h(72) : see declaration of 'itk::LightProcessObject'<br>
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(68): error C2504: 'itk::LightProcessObject' : base class undefined<br>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'<br>
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(79): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>
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)<br>
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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char>,<br>1>              _Ty=itk::ImageIORegion<br>1>          ]<br>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]<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>1>          c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkExceptionObject.h(153): or       'std::ostream &itk::operator <<(std::ostream &,itk::ExceptionObject &)'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkIndent.h(72): or       'std::ostream &itk::operator <<(std::ostream &,const itk::Indent &)'<br>1>          c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkEventObject.h(101): or       'std::ostream &itk::operator <<(std::ostream &,itk::EventObject &)'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkRealTimeInterval.h(94): or       'std::ostream &itk::operator <<(std::ostream &,const itk::RealTimeInterval &)'<br>1>          c:\itkrap\insighttoolkit-4.2.0\modules\core\common\include\itkRealTimeStamp.h(86): or       'std::ostream &itk::operator <<(std::ostream &,const itk::RealTimeStamp &)'<br>
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> &))'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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> &))'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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 &))'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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 *)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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> *)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>1>          while trying to match the argument list '(std::basic_ostream<_Elem,_Traits>, const itk::ImageIORegion)'<br>
1>          with<br>1>          [<br>1>              _Elem=char,<br>1>              _Traits=std::char_traits<char><br>1>          ]<br>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)<br>
1>          C:\Program Files\Microsoft SDKs\Windows\v7.1\include\guiddef.h(197): could be 'int operator !=(const GUID &,const GUID &)'<br>1>          while trying to match the argument list '(int, const itk::ImageIORegion)'<br>
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161): error C2440: '=' : cannot convert from 'const itk::ImageIORegion' to 'int'<br>1>          Source or target has incomplete type<br>
1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(161): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>
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 &'<br>1>          Reason: cannot convert from 'const int' to 'const itk::ImageIORegion'<br>
1>          Source or target has incomplete type<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(169): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(169): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(174): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(174): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(187): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(187): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(191): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(191): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(196): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(196): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(201): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(201): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(229): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(229): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(252): error C2039: 'GetDebug' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>1>c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(252): error C2039: 'Modified' : is not a member of 'itk::ImageIOBase'<br>
1>          c:\itkrap\insighttoolkit-4.2.0\modules\io\imagebase\include\itkImageIOBase.h(67) : see declaration of 'itk::ImageIOBase'<br>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'<br>
1>          with<br>1>          [<br>1>              TInputImage=DisplacementFieldType<br>1>          ]<br>1>          C:\ITKrap\InsightToolkit-4.2.0\Examples\Filtering\FlipImageFilter.cxx(124) : see reference to class template instantiation 'itk::ImageFileWriter<TInputImage>' being compiled<br>
1>          with<br>1>          [<br>1>              TInputImage=DisplacementFieldType<br>1>          ]<br>========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========<br><br><div><div><div><div><div><br>
<br></div></div></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 12:56 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Tim,<br>
<br>
If you can post a small, compilable (with all includes) example that<br>
illustrates the problem, I'm sure you'll get a quick answer.<br>
<br>
Bill<br>
<div><div class="h5"><br>
<br>
On Tue, Nov 26, 2013 at 3:12 PM, Tim Bhatnagar <<a href="mailto:tim.bhatnagar@gmail.com">tim.bhatnagar@gmail.com</a>> wrote:<br>
> Hello all,<br>
><br>
> I am trying to implement a filter to obtain the inverse of a Demon's-derived<br>
> displacement field. I've found a number of code candidates, but they all<br>
> rely on itkInverseDisplacementFieldImageFilter.hxx<br>
><br>
> and in each case, I'm getting errors like:<br>
><br>
> c:\itkrap\insighttoolkit-4.2.0\modules\filtering\displacementfield\include\itkInverseDisplacementFieldImageFilter.hxx(343):<br>
> error C2143: syntax error : missing ';' before<br>
> 'itk::InverseDisplacementFieldImageFilter<TInputImage,TOutputImage>::GetMTime'<br>
><br>
> c:\itkrap\insighttoolkit-4.2.0\modules\filtering\displacementfield\include\itkInverseDisplacementFieldImageFilter.hxx(343):<br>
> error C4430: missing type specifier - int assumed. Note: C++ does not<br>
> support default-int<br>
><br>
> I'm using VS10 Express, and until this code, everything in ITK has been<br>
> working well.<br>
><br>
> Sorry if there is a basic solution to this issue - I'm stumped! Any help is<br>
> much appreciated.<br>
><br>
> Thanks,<br>
><br>
> --<br>
> Tim Bhatnagar<br>
> PhD Candidate<br>
> Orthopaedic Injury Biomechanics Group<br>
> Department of Mechanical Engineering<br>
> University of British Columbia<br>
><br>
> Rm 5000 - 818 West 10th Ave.<br>
> Vancouver, BC<br>
> Canada<br>
> V5Z 1M9<br>
><br>
> Ph: (604) 675-8845<br>
> Fax: (604) 675-8820<br>
> Web: <a href="http://oibg.mech.ubc.ca" target="_blank">oibg.mech.ubc.ca</a><br>
><br>
><br>
</div></div>> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Tim Bhatnagar<br>PhD Candidate<br>Orthopaedic Injury Biomechanics Group<br>Department of Mechanical Engineering<br>University of British Columbia<br><br>Rm 5000 - 818 West 10th Ave.<br>
Vancouver, BC<br>Canada<br>V5Z 1M9<br><br>Ph: (604) 675-8845<br>Fax: (604) 675-8820<br>Web: <a href="http://oibg.mech.ubc.ca" target="_blank">oibg.mech.ubc.ca</a><br>
</div>