<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hello,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I have a problem with vtkStreamTracer. <br>
<br>
</p>
<p style="margin-top:0;margin-bottom:0">Here is the code:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">```</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>def generate_streamline(source_file, dest_file, axis, resolution=1):</div>
<div> reader = vtk.vtkXMLImageDataReader()</div>
<div> reader.SetFileName(source_file)</div>
<div><span style="font-size: 12pt;"> reader.GetPointDataArraySelection().DisableArray('density')</span><br>
</div>
<div> reader.Update()</div>
<div> extent = reader.GetOutput().GetExtent()</div>
<div> center = [np.mean(extent[0:2]), np.mean(extent[2:4]), np.mean(extent[4:6])]</div>
<div><span style="font-size: 12pt;"><br>
</span></div>
<div><span style="font-size: 12pt;"> seeds = vtk.vtkPointSource()</span><br>
</div>
<div> seeds.SetCenter(center)</div>
<div> seeds.SetRadius(10.5)</div>
<div> seeds.SetNumberOfPoints(100)</div>
<div> seeds.Update()</div>
<div><br>
</div>
<div> streamTracer = vtk.vtkStreamTracer()</div>
<div> streamTracer.SetInterpolatorTypeToDataSetPointLocator()</div>
<div> streamTracer.SetInputData(reader.GetOutputDataObject(0))</div>
<div> streamTracer.SetSourceData(seeds.GetOutputDataObject(0))</div>
<div><span style="font-size: 12pt;"> streamTracer.SetIntegratorTypeToRungeKutta45()</span><br>
</div>
<div> streamTracer.SetMaximumPropagation(104)</div>
<div> streamTracer.SetInitialIntegrationStep(0.2)</div>
<div> streamTracer.SetMaximumIntegrationStep(0.5)</div>
<div> streamTracer.SetIntegrationDirectionToBoth()</div>
<div> streamTracer.SetStartPosition(center)</div>
<div> streamTracer.SurfaceStreamlinesOn()</div>
<div> streamTracer.Update()<br>
<br>
<span> print(streamTracer.GetOutputDataObject(0))</span><br>
</div>
<p></p>
<p style="margin-top:0;margin-bottom:0">```<br>
<br>
The output is:<br>
```</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>vtkPolyData (0x273ece0)</div>
<div> Debug: Off</div>
<div> Modified Time: 2638</div>
<div> Reference Count: 2</div>
<div> Registered Events: (none)</div>
<div> Information: 0x2ccb540</div>
<div> Data Released: False</div>
<div> Global Release Data: Off</div>
<div> UpdateTime: 2680</div>
<div> Field Data:</div>
<div> Debug: Off</div>
<div> Modified Time: 2628</div>
<div> Reference Count: 1</div>
<div> Registered Events: (none)</div>
<div> Number Of Arrays: 0</div>
<div> Number Of Components: 0</div>
<div> Number Of Tuples: 0</div>
<div> Number Of Points: 0</div>
<div> Number Of Cells: 0</div>
<div> Cell Data:</div>
<div> Debug: Off</div>
<div> Modified Time: 2636</div>
<div> Reference Count: 1</div>
<div> Registered Events: </div>
<div> Registered Observers:</div>
<div> vtkObserver (0x2ccc370)</div>
<div> Event: 33</div>
<div> EventName: ModifiedEvent</div>
<div> Command: 0x2ccb880</div>
<div> Priority: 0</div>
<div> Tag: 1</div>
<div> Number Of Arrays: 0</div>
<div> Number Of Components: 0</div>
<div> Number Of Tuples: 0</div>
<div> Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )</div>
<div> Interpolate Flags: ( 1 1 1 1 1 0 0 1 )</div>
<div> Pass Through Flags: ( 1 1 1 1 1 1 1 1 )</div>
<div> Scalars: (none)</div>
<div> Vectors: (none)</div>
<div> Normals: (none)</div>
<div> TCoords: (none)</div>
<div> Tensors: (none)</div>
<div> GlobalIds: (none)</div>
<div> PedigreeIds: (none)</div>
<div> EdgeFlag: (none)</div>
<div> Point Data:</div>
<div> Debug: Off</div>
<div> Modified Time: 2638</div>
<div> Reference Count: 1</div>
<div> Registered Events: </div>
<div> Registered Observers:</div>
<div> vtkObserver (0x2ccc210)</div>
<div> Event: 33</div>
<div> EventName: ModifiedEvent</div>
<div> Command: 0x2ccb880</div>
<div> Priority: 0</div>
<div> Tag: 1</div>
<div> Number Of Arrays: 0</div>
<div> Number Of Components: 0</div>
<div> Number Of Tuples: 0</div>
<div> Copy Tuple Flags: ( 1 1 1 1 1 0 1 1 )</div>
<div> Interpolate Flags: ( 1 1 1 1 1 0 0 1 )</div>
<div> Pass Through Flags: ( 1 1 1 1 1 1 1 1 )</div>
<div> Scalars: (none)</div>
<div> Vectors: (none)</div>
<div> Normals: (none)</div>
<div> TCoords: (none)</div>
<div> Tensors: (none)</div>
<div> GlobalIds: (none)</div>
<div> PedigreeIds: (none)</div>
<div> EdgeFlag: (none)</div>
<div> Bounds: </div>
<div> Xmin,Xmax: (1, -1)</div>
<div> Ymin,Ymax: (1, -1)</div>
<div> Zmin,Zmax: (1, -1)</div>
<div> Compute Time: 2692</div>
<div> Number Of Points: 0</div>
<div> Point Coordinates: 0</div>
<div> Locator: 0</div>
<div> Number Of Vertices: 0</div>
<div> Number Of Lines: 0</div>
<div> Number Of Polygons: 0</div>
<div> Number Of Triangle Strips: 0</div>
<div> Number Of Pieces: 1</div>
<div> Piece: 0</div>
<div> Ghost Level: 0</div>
```
<p></p>
<p style="margin-top:0;margin-bottom:0">And I get an empty <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">vtkPolyData
without any streamline in it.</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">Attached please find the
testing dataset.</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">Please help me.</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">Thanks,</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">Joey</span></p>
</div>
</body>
</html>