<div dir="ltr">Recently I updated my VTK to Release <a href="http://5.2.0.">5.2.0.</a> However, I encountered an error when using the function GetNumberOfPoints in using vtkPoints. In the past when I used a earlier version I didn&#39;t have this problem. My code remains the same, but I got an error now. Any help would be appreciated.&nbsp;<div>
<br></div><div>The sample code is shown below:</div><div><br></div><div><div>#include &quot;itkImage.h&quot;</div><div><br></div><div>#include &quot;itkImageFileReader.h&quot;</div><div>#include &quot;itkImageFileWriter.h&quot;</div>
<div><br></div><div>#include &quot;vtkCellArray.h&quot;</div><div>#include &quot;vtkPoints.h&quot;</div><div>#include &quot;vtkPolyData.h&quot;</div><div>#include &quot;vtkPolyDataWriter.h&quot;</div><div>#include &quot;vtkPolyDataReader.h&quot;</div>
<div>#include &quot;vtkDoubleArray.h&quot;</div><div>#include &quot;vtkPointData.h&quot;</div><div><br></div><div>#include &lt;fstream&gt;</div><div><br></div><div>// ------ end of header files &nbsp;------</div><div><br></div>
<div><br></div><div><br></div><div>const &nbsp; unsigned int &nbsp; Dimension = 3;</div><div>typedef float VectorComponentType;</div><div><br></div><div>typedef itk::Vector&lt; VectorComponentType, Dimension &gt;<span class="Apple-tab-span" style="white-space:pre">                        </span> &nbsp;VectorType;</div>
<div>typedef itk::Image&lt; VectorType, &nbsp;Dimension &gt;<span class="Apple-tab-span" style="white-space:pre">                                        </span> &nbsp;DeformationFieldType;</div><div>typedef itk::DeformationFieldSource&lt; DeformationFieldType &gt;<span class="Apple-tab-span" style="white-space:pre">                </span> &nbsp;DeformationSourceType;</div>
<div><br></div><div>typedef float PixelType;</div><div>typedef itk::Image&lt; PixelType, Dimension &gt;<span class="Apple-tab-span" style="white-space:pre">                                                </span> &nbsp;ImageType;</div><div>//typedef itk::ImageFileReader&lt; &nbsp;ImageType &gt;<span class="Apple-tab-span" style="white-space:pre">                                                </span> &nbsp;ReaderType;</div>
<div>typedef itk::ImageFileWriter&lt; &nbsp;ImageType &gt;<span class="Apple-tab-span" style="white-space:pre">                                                </span> &nbsp;WriterType;</div><div><br></div><div>typedef itk::ImageFileReader&lt; DeformationFieldType &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DeformationFieldReaderType;</div>
<div><br></div><div>typedef itk::WarpImageFilter&lt; ImageType, ImageType, DeformationFieldType &gt; FilterType;</div><div><br></div><div>typedef itk::LinearInterpolateImageFunction&lt; ImageType, double &gt; InterpolaterType;</div>
<div><br></div><div>typedef itk::Point&lt; double, Dimension&gt; PointType;</div><div><br></div><div>//ReaderType::Pointer<span class="Apple-tab-span" style="white-space:pre">                        </span>fixedReader;</div><div>WriterType::Pointer<span class="Apple-tab-span" style="white-space:pre">                        </span>outputWriter;</div>
<div><br></div><div>DeformationFieldReaderType::Pointer &nbsp;deformationFieldReader;</div><div><br></div><div>InterpolaterType::Pointer &nbsp; interpolator;</div><div><br></div><div>//PointType point;</div><div><br></div><div>//---------------------------------------------------------------------------------------</div>
<div><br></div><div>int main( int argc, char * argv[] )</div><div>{</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>std::cout &lt;&lt; &quot; Starting....... &quot; &lt;&lt; std::endl;</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if( argc &lt; 1 ) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr &lt;&lt; &quot;Missing Parameters &quot; &lt;&lt; std::endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; argv[0];</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr &lt;&lt; &quot;fixedImage &quot;;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr &lt;&lt; &quot;contour &quot; &lt;&lt; std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return 1;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>outputWriter<span class="Apple-tab-span" style="white-space:pre">        </span>= WriterType::New();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>interpolator &nbsp; &nbsp;= InterpolaterType::New();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>// read in the original contour</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkPolyDataReader *contourReader = vtkPolyDataReader::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>contourReader-&gt;SetFileName( argv[1] );</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>try {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>contourReader-&gt;Update();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>catch( itk::ExceptionObject &amp; excp_poly ) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr &lt;&lt; &quot;Exception thrown &quot; &lt;&lt; std::endl;</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cerr &lt;&lt; excp_poly &lt;&lt; std::endl;</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return EXIT_FAILURE;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkPolyData *poly = vtkPolyData::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>poly-&gt;DeepCopy( contourReader-&gt;GetOutput() );</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>contourReader-&gt;Delete();</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>vtkPoints *points = poly-&gt;GetPoints();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//vtkFloatArray *array = &nbsp;vtkFloatArray::New();</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//array-&gt;SetNumberOfComponents(3);</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>//return 0;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>int NumberOfTotalPoints = points-&gt;GetNumberOfPoints();</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>std::cout &lt;&lt; &quot;total number of points = &quot; &lt;&lt; NumberOfTotalPoints &lt;&lt; std::endl;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>return 0;</div><div><br></div><div>}</div></div></div>