<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.8%2FDevelopers%2FTutorials%2FMigrationGuide%2FVTK5-to-VTK6</id>
	<title>Documentation/4.8/Developers/Tutorials/MigrationGuide/VTK5-to-VTK6 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.8%2FDevelopers%2FTutorials%2FMigrationGuide%2FVTK5-to-VTK6"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.8/Developers/Tutorials/MigrationGuide/VTK5-to-VTK6&amp;action=history"/>
	<updated>2026-04-13T02:45:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.8/Developers/Tutorials/MigrationGuide/VTK5-to-VTK6&amp;diff=55558&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.8</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.8/Developers/Tutorials/MigrationGuide/VTK5-to-VTK6&amp;diff=55558&amp;oldid=prev"/>
		<updated>2017-10-18T07:05:42Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.8&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Migration Guide ==&lt;br /&gt;
&lt;br /&gt;
This section documents required change to make Slicer code work with VTK6.&lt;br /&gt;
&lt;br /&gt;
* See [http://www.vtk.org/Wiki/VTK/VTK_6_Migration_Guide VTK_6 Migration Guide]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Use SetInputPolyDataConnection and GetPolyDataConnection===&lt;br /&gt;
&lt;br /&gt;
Starting with Slicer [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=24801 r24801], support for VTK5 API was removed and VTK6 API should be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 error: ‘class vtkMRMLModelDisplayNode’ has no member named ‘SetInputPolyData’&lt;br /&gt;
  resultDisplay-&amp;gt;SetInputPolyData(resultModel-&amp;gt;GetPolyData());&lt;br /&gt;
                 ^&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace occurrences of &amp;lt;tt&amp;gt;SetInputPolyData/GetPolyData&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;SetInputPolyDataConnection/GetPolyDataConnection&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===Use AllocateScalars===&lt;br /&gt;
&lt;br /&gt;
Starting with Slicer [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=24801 r24801], support for VTK5 API was removed and VTK6 API should be used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   error: no matching function for call to ‘vtkImageData::SetNumberOfScalarComponents(int)’&lt;br /&gt;
     mp_phi-&amp;gt;SetNumberOfScalarComponents(1);&lt;br /&gt;
                                          ^&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  imageData-&amp;gt;SetScalarTypeToUnsignedShort();		&lt;br /&gt;
  imageData-&amp;gt;SetNumberOfScalarComponents(1); // image holds one value intensities		&lt;br /&gt;
  imageData-&amp;gt;AllocateScalars(); // allocate storage for image data&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  imageData-&amp;gt;AllocateScalars(VTK_UNSIGNED_SHORT, 1); // allocate storage for image data&lt;/div&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
</feed>