<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Hi,</span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span> I have changed to point index instead of: 1 0.00 0.00 0.00 to 1 0. I still get error reading cell data. But it still does not work. Another thing about CELL_TYPES. I need some clarification. If a cell has 4 vertices, I found it is written 9; 3 vertices 5, please clarify a bit about that.</span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span></span> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal;
background-color: transparent;"><span>I have again attached my modofied vtk file.</span></div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span></span> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>/**************************/</span></div><span><span lang="EN"><div># vtk DataFile Version 1.0</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>track data of XX well</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>ASCII</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>DATASET POLYDATA</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>POINTS 10 float</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 0.00 0.00 0.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 0.00 0.00 1400.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 0.00 0.48 1466.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 0.50 2.34 1600.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 2.68 4.17 1800.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 5.53 4.68 2000.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 9.15 4.36 2200.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 12.02 1.95 2400.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> 8.68 -0.86 2599.96</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> -1.14 4.81 2799.95</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>VERTICES 10 10</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>0 <var id="yui-ie-cursor"></var> 0.00 0.00 0.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 0.00 0.00 1400.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>2 0.00 0.48 1466.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>3 0.50 2.34 1600.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>4 2.68 4.17 1800.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>5 5.53 4.68 2000.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>6 9.15 4.36 2200.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>7 12.02 1.95 2400.00</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>8 8.68 -0.86 2599.96</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>9 -1.14 4.81 2799.95</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>CELLS 10 10</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 0</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 1</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 2</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 3</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 4</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 5</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 6</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 7</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 8</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>1 9</div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;">
</div><div>CELL_TYPES 10</div></span></span><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span></span> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span></span> </div><div style="color: rgb(0, 0, 0); font-family: times new roman, new york, times, serif; font-size: 16px; font-style: normal; background-color: transparent;"><span>/***************************/</div><div> </div><div>Thanks,</div><div>Hayden</div></span><div><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); height: 0px;
line-height: 0; font-size: 0px;" class="hr" contentEditable="false" readonly="true"></div> <font size="2" face="Arial"> <b><span style="font-weight: bold;">From:</span></b> Marco Nawijn <nawijn@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Hayden Smith <s_hayden_28@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Hal Canary <hal@cs.unc.edu>; "vtkusers@vtk.org" <vtkusers@vtk.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, April 26, 2013 12:18 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [vtkusers] Can a VTK file consists of Points only<br> </font> </div> <div class="y_msg_container"><br><div id="yiv0129908985"><div dir="ltr"><div>Hi,</div><div> </div><div>I have not worked with the ASCII VTK format, but looking at it I suspect that you have to drop the coordinates in the CELLS section and use point indices instead, so instead of:</div>
<div>1 0.00 0.00 0.00</div><div> </div><div>it should probably read:</div><div> </div><div>1 0</div><div> </div><div>The 1 means that for the definition of the cell you need one cell point. The 0 is the index to the cell point.</div>
<div> </div><div>If you have access to Python with the VTK bindings, I highly recommend you to use that. You can easily build an in-memory grid and export it to a VTK file. </div><div> </div><div>If you need a working example, drop me an e-mail and I will send you one.</div>
<div> </div><div>Marco</div><div> </div><div> </div><div> </div><div> </div></div><div class="yiv0129908985gmail_extra"><br><br><div class="yiv0129908985gmail_quote">On Fri, Apr 26, 2013 at 6:12 AM, Hayden Smith <span dir="ltr"><<a href="mailto:s_hayden_28@yahoo.com" rel="nofollow" target="_blank" ymailto="mailto:s_hayden_28@yahoo.com">s_hayden_28@yahoo.com</a>></span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="yiv0129908985gmail_quote"><div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"><div><span>Hello,</span></div><div><span> Thank you very much for the reply. Could you tell me what is the problem with the following vtk file, why it shows error reading cell data?</span></div>
<div><span></span> </div><div><span>/**************************************************/</span></div><span><span lang="EN"><div># vtk DataFile Version 1.0</div><div>
</div><div>track data of XX well</div><div>
</div><div>ASCII</div><div>
</div><div>DATASET POLYDATA</div><div>
</div><div>POINTS 10 float</div><div>
</div><div> 0.00 0.00 0.00</div><div>
</div><div> 0.00 0.00 1400.00</div><div>
</div><div> 0.00 0.48 1466.00</div><div>
</div><div> 0.50 2.34 1600.00</div><div>
</div><div> 2.68 4.17 1800.00</div><div>
</div><div> 5.53 4.68 2000.00</div><div>
</div><div> 9.15 4.36 2200.00</div><div>
</div><div> 12.02 1.95 2400.00</div><div>
</div><div> 8.68 -0.86 2599.96</div><div>
</div><div> -1.14 4.81 2799.95</div><div>
</div><div> </div><div>
</div><div>VERTICES 10 10</div><div>
</div><div>0 0.00 0.00 0.00</div><div>
</div><div>1 0.00 0.00 1400.00</div><div>
</div><div>2 0.00 0.48 1466.00</div><div>
</div><div>3 0.50 2.34 1600.00</div><div>
</div><div>4 2.68 4.17 1800.00</div><div>
</div><div>5 5.53 4.68 2000.00</div><div>
</div><div>6 9.15 4.36 2200.00</div><div>
</div><div>7 12.02 1.95 2400.00</div><div>
</div><div>8 8.68 -0.86 2599.96</div><div>
</div><div>9 -1.14 4.81 2799.95</div><div>
</div><div> </div><div>
</div><div>CELLS 10 10</div><div>
</div><div>1 0.00 0.00 0.00</div><div>
</div><div>1 0.00 0.00 1400.00</div><div>
</div><div>1 0.00 0.48 1466.00</div><div>
</div><div>1 0.50 2.34 1600.00</div><div>
</div><div>1 2.68 4.17 1800.00</div><div>
</div><div>1 5.53 4.68 2000.00</div><div>
</div><div>1 9.15 4.36 2200.00</div><div>
</div><div>1 12.02 1.95 2400.00</div><div>
</div><div>1 8.68 -0.86 2599.96</div><div>
</div><div>1 -1.14 4.81 2799.95</div><div>
</div><div>CELL_TYPES 10</div></span></span><div><span></span> </div><div><span></span> </div><div><span></span> </div><div><span>/***************************************************/</span></div><div>Thanks,</div><div>Hayden<var></var><br>
</div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); line-height: 0; font-size: 0px; min-height: 0px;">
</div> <font face="Arial"> <b><span style="font-weight: bold;">From:</span></b> Hal Canary <<a href="mailto:hal@cs.unc.edu" rel="nofollow" target="_blank" ymailto="mailto:hal@cs.unc.edu">hal@cs.unc.edu</a>><br> <b><span style="font-weight: bold;">To:</span></b> <a href="mailto:vtkusers@vtk.org" rel="nofollow" target="_blank" ymailto="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a> <br>
<b><span style="font-weight: bold;">Sent:</span></b> Thursday, April 25, 2013 9:21 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [vtkusers] Can a VTK file consists of Points only<br> </font> </div> <div>
<div><div class="yiv0129908985h5"><br>
On 04/25/2013 10:08 PM, Hal Canary wrote:<br>> On 04/25/2013 10:04 PM, Hayden Smith wrote:<br>>> I have a set of points which I would like to use to make a VTK<br>>> file. As there are several formals, which formats will be suitable. I<br>
>> used Poydata type only with points. But I can't display the points.<br>>> Please provide me suggestions.<br>> <br>> Add a cell array for the vertices. vtkMaskPoints can do that.<br><br>Here's an example:<br>
<br>#!/usr/bin/env python<br>import vtk<br>fileName = '/tmp/in.csv'<br>outFileName = '/tmp/out.vtp'<br>with open(fileName,'r') as f:<br> columns = f.readline().strip().split(',')<br>reader = vtk.vtkDelimitedTextReader()<br>
reader.SetFileName(fileName)<br>reader.SetFieldDelimiterCharacters(",")<br>reader.DetectNumericColumnsOn()<br>reader.SetHaveHeaders(True)<br>reader.Update()<br>numberOfRows =
reader.GetOutput().GetNumberOfRows()<br>tableToPolyData = vtk.vtkTableToPolyData()<br>tableToPolyData.SetInputConnection(reader.GetOutputPort())<br>tableToPolyData.SetXColumn(columns[0])<br>tableToPolyData.SetYColumn(columns[1])<br>
tableToPolyData.SetZColumn(columns[2])<br>try:<br> tableToPolyData.PreserveCoordinateColumnsAsDataArraysOn();<br>except:<br> pass # introduced in 5.10?<br>maskPoints = vtk.vtkMaskPoints()<br>maskPoints.SetInputConnection(tableToPolyData.GetOutputPort())<br>
maskPoints.SetOnRatio(1)<br>maskPoints.RandomModeOff()<br>maskPoints.SetMaximumNumberOfPoints(numberOfRows)<br>maskPoints.GenerateVerticesOn()<br>maskPoints.SingleVertexPerCellOn()<br>writer =
vtk.vtkXMLPolyDataWriter()<br>writer.SetInputConnection(maskPoints.GetOutputPort())<br>writer.SetFileName(outFileName)<br>writer.Write()<br>###############<br>x,y,z,v<br>0,0,0,2<br>0,0,1,3<br>0,1,0,4<br>0,1,1,5<br>1,0,0,6<br>
1,0,1,7<br>1,1,0,8<br>1,1,1,9<br><br><br><br>_______________________________________________<br></div></div>Powered by <a href="http://www.kitware.com/" rel="nofollow" target="_blank">http://www.kitware.com/</a><div class="yiv0129908985im"><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="nofollow" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="nofollow" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" rel="nofollow" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br><br></div></div> </div> </div> </div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com/" rel="nofollow" target="_blank">http://www.kitware.com/</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="nofollow" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="nofollow" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" rel="nofollow" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div></div><br><br></div> </div> </div> </div></body></html>