<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Amy,<div> Is this the correct way to do it? I'm getting an interpreter error for vtkProjectTerrainPath::SetSource(vtkImageData* )</div><div><br></div><div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">vtkPolyData terrainPaths</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> terrainPaths SetPoints pts</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> terrainPaths SetLines lines</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"># Use a probe filter to obtain elevation data from the reconstructed surface</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">vtkImageData elevationData</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> elevationData SetDimensions $XmaxR $YmaxR $ZmaxR</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">vtkProbeFilter probe </span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> probe SetInput [surface GetOutput]</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> probe SetSource elevationData</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">vtkProjectedTerrainPath projectedPaths</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetInput terrainPaths</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetSource [probe GetOutput]</span></font></div><div><br></div><div>Best regards,</div><div><br></div><div>Elvis Dowson</div><div><br></div><div><br></div><div><div>On Nov 10, 2008, at 10:21 PM, Elvis Dowson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Amy,<div> Could you please help me out by giving me a code fragment on how to achieve this? I have created an outline below. </div><div><br></div><div>I've created a vtkImageData and set it's dimensions by reading the max extent of the original DEM file. I hope that is correct. Now vtkProjectedPath::SetSource(vtkImageData* ) expects a vtkImageData*, and I don't know how to pass the vtkImageData object called elevationData to this method. I have highlighted it in red below.</div><div><br></div><div>I have put the wrap scalar code fragment below. Could you please help me with a code fragment to extract the vtkImageData from the wrap scalar output?</div><div><br></div><div>#<font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> Create a reader to read the unstructured grid data.</span></font></div><div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">vtkDataSetReader reader</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> reader SetFileName "SampleDEM.vtk"</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"># Get the physical xy extent of dataset</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">scan [[reader GetOutput] GetWholeExtent] "%d %d %d %d %d %d" XminR XmaxR YminR YmaxR ZminR ZmaxR</span></font></div><div><br></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">..</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><div># Now warp the surface based on the scalar elevation values</div><div># This creates the 3D mesh model of the terrain.</div></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><div>vtkWarpScalar surface</div><div> surface SetInput [geom GetOutput]</div><div> surface SetScaleFactor 0.1; # $scale variable controls vertical exaggeration</div><div><br></div><div>....</div></span></font></div></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"># Use a probe filter to obtain elevation data from the reconstructed surface</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">vtkImageData elevationData</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> elevationData SetDimensions $XmaxR $YmaxR $ZmaxR</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><font class="Apple-style-span" color="#FF0000">#vtkProbeFilter</font></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"><br></span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;">vtkProjectedTerrainPath projectedPaths</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetInput terrainPaths</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetSource [<font class="Apple-style-span" color="#FF0000">elevationData</font>]</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetHeightOffset 25</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetHeightTolerance 5</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetProjectionModeToNonOccluded</span></font></div><div><font class="Apple-style-span" face="Monaco" size="2"><span class="Apple-style-span" style="font-size: 10px;"> projectedPaths SetProjectionModeToHug</span></font></div><div><br></div><div>Best regards,</div><div><br></div><div>Elvis Dowson</div></div></div></div><div><br></div><div><br></div></div></blockquote></div></div></body></html>