I've tried this solution in python string to latin1 look:<div>self.string = string.encode("latin-1")</div><div><br></div><div>but it didn't work and I'd like to put some specials characters on my project like "~ , ´ and ç" .</div>
<div><br></div><div>Could you help me?</div><div>Thanks<br><div><br><div class="gmail_quote">On Mon, Dec 13, 2010 at 3:00 PM, <span dir="ltr"><<a href="mailto:vtkusers-request@vtk.org">vtkusers-request@vtk.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Send vtkusers mailing list submissions to<br>
<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:vtkusers-request@vtk.org">vtkusers-request@vtk.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:vtkusers-owner@vtk.org">vtkusers-owner@vtk.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of vtkusers digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Problem with viewing vtkReebGraph (Mehdi Ben Larbi)<br>
2. Re: Triangle Geometry and Vertices<br>
(Paulo Henrique Junqueira Amorim)<br>
3. Re: Problem with viewing vtkReebGraph (Jim Peterson)<br>
4. Re: Triangle Geometry and Vertices (David Gobbi)<br>
5. Re: Problem with viewing vtkReebGraph (David Doria)<br>
6. Re: vtk.vtkExodusIIReader: information in GetOutput()?<br>
(Nico Schl?mer)<br>
7. Re: vtkPExodusIIWriter? (Nico Schl?mer)<br>
8. DICOM information (Xiaopeng Yang)<br>
9. Re: [Insight-users] DICOM information (Luis Ibanez)<br>
10. Re: [Insight-users] DICOM information (Xiaopeng Yang)<br>
11. Re: bug 0009618 and UTF 8 text rendering fix question<br>
(Roger Bramon Feixas)<br>
12. Re: VTK/Examples/Cxx/ImageData/IterateImageData (Rachel)<br>
13. Re: VTK/Examples/Cxx/ImageData/IterateImageData (David Doria)<br>
14. Re: VTK/Examples/Cxx/ImageData/IterateImageData (Rachel)<br>
15. Re: Link error when building VTK with boost support in Visual<br>
Studio 2010 (Jeff Baumes)<br>
16. About the VTK_USE_ANSI_STDLIB (???)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sun, 12 Dec 2010 21:21:44 +0100<br>
From: Mehdi Ben Larbi <<a href="mailto:donniebrasco912@gmail.com">donniebrasco912@gmail.com</a>><br>
Subject: [vtkusers] Problem with viewing vtkReebGraph<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<AANLkTikOCPUx1rKV+AHXHtWEPWcaFowsPO5=<a href="mailto:Y%2BR9Yt3c@mail.gmail.com">Y+R9Yt3c@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hello,<br>
<br>
I'm new to VTK,i'm working on a 3D indexing project for my research so i<br>
need to use Reeb's graph.<br>
I have been trying to view vtkReebGraph since 2 days now,i have he correct<br>
data but i'm not able to display it.<br>
I'm developing on Java and this is my code,the view part copied form this<br>
one <a href="http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph</a> i<br>
just translated it to Java :<br>
<br>
vtkPolyDataToReebGraphFilter surfaceReebGraphFilter = new<br>
> vtkPolyDataToReebGraphFilter();<br>
><br>
<br>
<br>
> surfaceReebGraphFilter.SetInput(reader.GetOutput());<br>
><br>
> surfaceReebGraphFilter.Update();<br>
><br>
> vtkReebGraph surfaceReebGraph = surfaceReebGraphFilter.GetOutput();<br>
><br>
> System.out.println(surfaceReebGraph.Print());<br>
><br>
><br>
> vtkGraphLayoutView graphLayoutView =new vtkGraphLayoutView ();<br>
><br>
> vtkGraphLayout layout = new vtkGraphLayout ();<br>
> vtkSimple2DLayoutStrategy strategy = new<br>
> vtkSimple2DLayoutStrategy ();<br>
> layout.SetInput(surfaceReebGraph);<br>
> layout.SetLayoutStrategy(strategy);<br>
> ......<br>
><br>
<br>
<br>
The Graph is correctly printed but i have this weird error : Exception in<br>
thread "main" java.lang.UnsatisfiedLinkError:<br>
vtk.vtkGraphLayoutView.VTKInit()J<br>
<br>
The PATH is correctly set so i don't know where it may come from.<br>
Can you please help me ? I'm desperate.<br>
Maybe another method to display ReebGraph without using the graphLayoutView<br>
?<br>
<br>
Thanks a lot.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.vtk.org/pipermail/vtkusers/attachments/20101212/0569a423/attachment-0001.htm" target="_blank">http://www.vtk.org/pipermail/vtkusers/attachments/20101212/0569a423/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Sun, 12 Dec 2010 18:58:54 -0200<br>
From: Paulo Henrique Junqueira Amorim <<a href="mailto:paulojamorim@gmail.com">paulojamorim@gmail.com</a>><br>
Subject: Re: [vtkusers] Triangle Geometry and Vertices<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Cc: David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>><br>
Message-ID:<br>
<AANLkTinA4t=M=<a href="mailto:R2mGig%2BtnTezo_LCMyV-vG5_4SDL%2BCj@mail.gmail.com">R2mGig+tnTezo_LCMyV-vG5_4SDL+Cj@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Thank's David and Jim.<br>
<br>
Generate a triangle is really what I wanted.<br>
<br>
By the same token, there is some way from a vtkPolyData, generate a mesh of<br>
triangles more regular?<br>
<br>
I would like to improve the mesh for use in finite elements.<br>
<br>
Ragards,<br>
Paulo<br>
<br>
<br>
<br>
On 12 December 2010 14:04, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
<br>
> I'm going to throw in a little addition. You say "triangle verts" so<br>
> I'm guessing<br>
> you want your cells to be triangles, not verts. If that is the case,<br>
> the code you<br>
> really need is as follows:<br>
><br>
> ids = vtkIdList()<br>
> ids.SetNumberOfIds(3)<br>
><br>
> for i in xrange(3):<br>
> ids.SetId(i, i)<br>
> points.InsertNextPoint(X[i],Y[i],Z[i])<br>
><br>
> vertices.InsertNextCell(ids) # call for every cell, not for every point<br>
><br>
> polydata = vtkPolyData()<br>
> polydata.SetPoints(points)<br>
> polydata.SetPolys(vertices) # use SetPolys for triangles<br>
> polydata.Update()<br>
><br>
> The above code will create a polydata that has one triangle.<br>
><br>
> David<br>
><br>
><br>
> On Sun, Dec 12, 2010 at 8:43 AM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>><br>
> wrote:<br>
> ><br>
> > On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson <<a href="mailto:jimcp@cox.net">jimcp@cox.net</a>> wrote:<br>
> >><br>
> >> Paulo,<br>
> >> I am no Python expert, but if I understand the sequence of events, you<br>
> should create the polydata object before writing the file.<br>
> >><br>
> >> Hope that helps,<br>
> >> Jim<br>
> ><br>
> > What Jim said. Also, the id list is never filled in. The following code<br>
> is wrong:<br>
> ><br>
> > ids = vtkIdList()<br>
> > ids.SetNumberOfIds(3)<br>
> ><br>
> > for i in xrange(3):<br>
> > ids.SetId(i, i)<br>
> > points.InsertNextPoint(X[i],Y[i],Z[i])<br>
> > vertices.InsertNextCell(ids)<br>
> ><br>
> > To fix it, you have two choices. You can have all three verts in the<br>
> same cell:<br>
> ><br>
> > ids = vtkIdList()<br>
> > ids.SetNumberOfIds(3)<br>
> ><br>
> > for i in xrange(3):<br>
> > ids.SetId(i, i)<br>
> > points.InsertNextPoint(X[i],Y[i],Z[i])<br>
> ><br>
> > vertices.InsertNextCell(ids)<br>
> > Or you can have each vert in its own cell:<br>
> ><br>
> > ids = vtkIdList()<br>
> > ids.SetNumberOfIds(1)<br>
> ><br>
> > for i in xrange(3):<br>
> > ids.SetId(0, i)<br>
> > points.InsertNextPoint(X[i],Y[i],Z[i])<br>
> > vertices.InsertNextCell(ids)<br>
> ><br>
> > In the "for" loop, you were calling vertices.InsertNextCell(ids)<br>
> > when "ids" still had some unititialized values, since the three<br>
> > ids values were not filled in until the third loop iteration.<br>
> ><br>
> > - David<br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.vtk.org/pipermail/vtkusers/attachments/20101212/24dcaa9d/attachment-0001.htm" target="_blank">http://www.vtk.org/pipermail/vtkusers/attachments/20101212/24dcaa9d/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Sun, 12 Dec 2010 16:10:15 -0500<br>
From: Jim Peterson <<a href="mailto:jimcp@cox.net">jimcp@cox.net</a>><br>
Subject: Re: [vtkusers] Problem with viewing vtkReebGraph<br>
To: Mehdi Ben Larbi <<a href="mailto:donniebrasco912@gmail.com">donniebrasco912@gmail.com</a>><br>
Cc: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID: <<a href="mailto:4D053A37.3050801@cox.net">4D053A37.3050801@cox.net</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
Mehdi,<br>
The unsatisfied link error would mean you have not loaded the<br>
vtkViewsJava library in order to have access to the native vtk functions<br>
for the vtkGraphLayout class.<br>
<br>
I hope that helps,<br>
Jim<br>
<br>
Mehdi Ben Larbi wrote:<br>
> Hello,<br>
><br>
> I'm new to VTK,i'm working on a 3D indexing project for my research so<br>
> i need to use Reeb's graph.<br>
> I have been trying to view vtkReebGraph since 2 days now,i have he<br>
> correct data but i'm not able to display it.<br>
> I'm developing on Java and this is my code,the view part copied form<br>
> this one<br>
> <a href="http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph</a> i<br>
> just translated it to Java :<br>
><br>
> vtkPolyDataToReebGraphFilter surfaceReebGraphFilter = new<br>
> vtkPolyDataToReebGraphFilter();<br>
><br>
><br>
><br>
> surfaceReebGraphFilter.SetInput(reader.GetOutput());<br>
><br>
> surfaceReebGraphFilter.Update();<br>
><br>
> vtkReebGraph surfaceReebGraph =<br>
> surfaceReebGraphFilter.GetOutput();<br>
><br>
> System.out.println(surfaceReebGraph.Print());<br>
><br>
><br>
> vtkGraphLayoutView graphLayoutView =new<br>
> vtkGraphLayoutView ();<br>
><br>
> vtkGraphLayout layout = new vtkGraphLayout ();<br>
> vtkSimple2DLayoutStrategy strategy = new<br>
> vtkSimple2DLayoutStrategy ();<br>
> layout.SetInput(surfaceReebGraph);<br>
> layout.SetLayoutStrategy(strategy);<br>
> ......<br>
><br>
><br>
><br>
> The Graph is correctly printed but i have this weird error : Exception<br>
> in thread "main" java.lang.UnsatisfiedLinkError:<br>
> vtk.vtkGraphLayoutView.VTKInit()J<br>
><br>
> The PATH is correctly set so i don't know where it may come from.<br>
> Can you please help me ? I'm desperate.<br>
> Maybe another method to display ReebGraph without using the<br>
> graphLayoutView ?<br>
><br>
> Thanks a lot.<br>
><br>
> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" 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" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Sun, 12 Dec 2010 14:17:11 -0700<br>
From: David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>><br>
Subject: Re: [vtkusers] Triangle Geometry and Vertices<br>
To: Paulo Henrique Junqueira Amorim <<a href="mailto:paulojamorim@gmail.com">paulojamorim@gmail.com</a>><br>
Cc: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<<a href="mailto:AANLkTimu%2BNHHeLFss1A0grqpMs7WLgJMSopNO48uBAhB@mail.gmail.com">AANLkTimu+NHHeLFss1A0grqpMs7WLgJMSopNO48uBAhB@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi Paulo,<br>
<br>
You can use vtkMeshQuality to compute the quality of a mesh, but I don't<br>
think there is anything in VTK for improving the quality of a mesh.<br>
Hopefully someone will tell me that I'm wrong about this...<br>
<br>
David<br>
<br>
<br>
On Sun, Dec 12, 2010 at 1:58 PM, Paulo Henrique Junqueira Amorim <<br>
<a href="mailto:paulojamorim@gmail.com">paulojamorim@gmail.com</a>> wrote:<br>
> Thank's David and Jim.<br>
><br>
> Generate a triangle is really what I wanted.<br>
><br>
> By the same token, there is some way from a vtkPolyData, generate a mesh<br>
of<br>
> triangles more regular?<br>
><br>
> I would like to improve the mesh for use in finite elements.<br>
><br>
> Ragards,<br>
> Paulo<br>
><br>
><br>
><br>
> On 12 December 2010 14:04, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
>><br>
>> I'm going to throw in a little addition. You say "triangle verts" so<br>
>> I'm guessing<br>
>> you want your cells to be triangles, not verts. If that is the case,<br>
>> the code you<br>
>> really need is as follows:<br>
>><br>
>> ids = vtkIdList()<br>
>> ids.SetNumberOfIds(3)<br>
>><br>
>> for i in xrange(3):<br>
>> ids.SetId(i, i)<br>
>> points.InsertNextPoint(X[i],Y[i],Z[i])<br>
>><br>
>> vertices.InsertNextCell(ids) # call for every cell, not for every point<br>
>><br>
>> polydata = vtkPolyData()<br>
>> polydata.SetPoints(points)<br>
>> polydata.SetPolys(vertices) # use SetPolys for triangles<br>
>> polydata.Update()<br>
>><br>
>> The above code will create a polydata that has one triangle.<br>
>><br>
>> David<br>
>><br>
>><br>
>> On Sun, Dec 12, 2010 at 8:43 AM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>><br>
>> wrote:<br>
>> ><br>
>> > On Sun, Dec 12, 2010 at 6:39 AM, Jim Peterson <<a href="mailto:jimcp@cox.net">jimcp@cox.net</a>> wrote:<br>
>> >><br>
>> >> Paulo,<br>
>> >> I am no Python expert, but if I understand the sequence of events, you<br>
>> >> should create the polydata object before writing the file.<br>
>> >><br>
>> >> Hope that helps,<br>
>> >> Jim<br>
>> ><br>
>> > What Jim said. Also, the id list is never filled in. The following<br>
>> > code is wrong:<br>
>> ><br>
>> > ids = vtkIdList()<br>
>> > ids.SetNumberOfIds(3)<br>
>> ><br>
>> > for i in xrange(3):<br>
>> > ids.SetId(i, i)<br>
>> > points.InsertNextPoint(X[i],Y[i],Z[i])<br>
>> > vertices.InsertNextCell(ids)<br>
>> ><br>
>> > To fix it, you have two choices. You can have all three verts in the<br>
>> > same cell:<br>
>> ><br>
>> > ids = vtkIdList()<br>
>> > ids.SetNumberOfIds(3)<br>
>> ><br>
>> > for i in xrange(3):<br>
>> > ids.SetId(i, i)<br>
>> > points.InsertNextPoint(X[i],Y[i],Z[i])<br>
>> ><br>
>> > vertices.InsertNextCell(ids)<br>
>> > Or you can have each vert in its own cell:<br>
>> ><br>
>> > ids = vtkIdList()<br>
>> > ids.SetNumberOfIds(1)<br>
>> ><br>
>> > for i in xrange(3):<br>
>> > ids.SetId(0, i)<br>
>> > points.InsertNextPoint(X[i],Y[i],Z[i])<br>
>> > vertices.InsertNextCell(ids)<br>
>> ><br>
>> > In the "for" loop, you were calling vertices.InsertNextCell(ids)<br>
>> > when "ids" still had some unititialized values, since the three<br>
>> > ids values were not filled in until the third loop iteration.<br>
>> ><br>
>> > - David<br>
><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.vtk.org/pipermail/vtkusers/attachments/20101212/a7d63e5b/attachment-0001.htm" target="_blank">http://www.vtk.org/pipermail/vtkusers/attachments/20101212/a7d63e5b/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Sun, 12 Dec 2010 17:28:45 -0500<br>
From: David Doria <<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>><br>
Subject: Re: [vtkusers] Problem with viewing vtkReebGraph<br>
Cc: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<AANLkTimnk5-2=<a href="mailto:XGS_ekUtWawJqqHPfONF_QNUgXiAWM4@mail.gmail.com">XGS_ekUtWawJqqHPfONF_QNUgXiAWM4@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
>> Hello,<br>
>><br>
>> I'm new to VTK,i'm working on a 3D indexing project for my research so i<br>
>> need to use Reeb's graph.<br>
>> I have been trying to view vtkReebGraph since 2 days now,i have he correct<br>
>> data but i'm not able to display it.<br>
>> I'm developing on Java and this is my code,the view part copied form this<br>
>> one <a href="http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Graphs/VisualizeDirectedGraph</a> i<br>
>> just translated it to Java ?:<br>
<br>
Mehdi,<br>
<br>
If you could add the example that you translated here:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Java#Graphs" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Java#Graphs</a><br>
<br>
that would be great!<br>
<br>
David<br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Mon, 13 Dec 2010 01:56:31 +0100<br>
From: Nico Schl?mer <<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>><br>
Subject: Re: [vtkusers] vtk.vtkExodusIIReader: information in<br>
GetOutput()?<br>
To: "Thompson, David C" <<a href="mailto:dcthomp@sandia.gov">dcthomp@sandia.gov</a>><br>
Cc: vtkusers <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTikX4EbmvTjXd3trchsrr4xh_otykzpNyp92r5KH@mail.gmail.com">AANLkTikX4EbmvTjXd3trchsrr4xh_otykzpNyp92r5KH@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
I've written and alternative implementation for the Exodus<br>
reader/writer using vtkExodusReader (as opposed to the<br>
vtkExodusIIReader) and found that things work out much more easily.<br>
<br>
It's basically enough to<br>
<br>
reader.ExodusModelMetadataOn()<br>
<br>
to get information on all the time steps, for example. With the<br>
vtkExodusIIReader (where there is no ModelMetadata), I could get the<br>
same to work only with a loop over [0:GetNumberOfTimeSteps()], then<br>
SetTimeStep(k) and subsequently retrieve a vtkUnstructuredGrid for<br>
each step with the corresponding point data.<br>
<br>
The only thing I need to do now is to figure out how to extract the<br>
individual time step arrays from the vtkUnstructuredGrid, work on<br>
them, and inject them back to be written to a file.<br>
<br>
Cheers,<br>
Nico<br>
<br>
<br>
<br>
On Sun, Dec 12, 2010 at 5:11 PM, Nico Schl?mer <<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I was able to get it all together with<br>
><br>
> ? ?reader.UpdateInformation()<br>
> ? ?for k in xrange( reader.GetNumberOfPointResultArrays() ):<br>
> ? ? ? ?arr_name = reader.GetPointResultArrayName( k )<br>
> ? ? ? ?reader.SetPointResultArrayStatus( arr_name, 1 )<br>
><br>
> Then, after Update() has been called, the vtkUnstructuredGrid will<br>
> magically containt the array. Great!<br>
><br>
>> Note that because "_R" and "_Z" imply cylindrical coordinates, the two scalars<br>
>> in the exodus file will be combined into a 2-component vector by the reader and<br>
>> the result will be named either "x0" or "x0_" (I forget whether the trailing underscore<br>
>> is omitted or not).<br>
><br>
> Cylindrical coordinates, alright? Well, I got the data in there by<br>
> providing a complex valued array, but I guess that doesn't really<br>
> matter. The underscore is preserved by the way, so I'll just go ahead<br>
> and cut it off.<br>
><br>
> Thanks for the help!<br>
> --Nico<br>
><br>
><br>
><br>
> On Sun, Dec 12, 2010 at 3:30 AM, Thompson, David C <<a href="mailto:dcthomp@sandia.gov">dcthomp@sandia.gov</a>> wrote:<br>
>> Hi Nico,<br>
>><br>
>>> Alright, so this<br>
>>> ...<br>
>>> gives me all vtkUnstructuredGrid in the vtkExodusIIReader output. Nice!<br>
>>> However, there's more data in the Exodus file I'd like to retrieve,<br>
>>> for example a data array for point data. In the ExodusII file, the<br>
>>> values are declared as "vals_nod_var1=..." and "name_nod_var =<br>
>>> "x0_R", ?"x0_Z" ;", but those are certainly not contained in the block<br>
>>> hierarchy above.<br>
>><br>
>> Each unstructured grid that is output may have point and cell<br>
>> arrays (I forget whether they are read by default or whether you<br>
>> must call SetObjectArrayStatus() to tell the reader you want them<br>
>> loaded). For the point variables "x0_R" and "x0_Z" in your example<br>
>> above, you would call<br>
>><br>
>> ?rdr = vtkExodusIIReader()<br>
>> ?rdr.SetFileName( 'foo.exo' ) # or whatever<br>
>> ?rdr.UpdateInformation() # this tells the reader to fetch metadata from the file<br>
>> ?# Iterate over all the point arrays:<br>
>> ?for i in range( rdr.GetNumberOfObjectArrays( rdr.NODAL ) ):<br>
>> ? ?nname = rdr.GetObjectArrayName( rdr.NODAL, i )<br>
>> ? ?print 'Array %d is "%s"' % (i,nname)<br>
>> ? ?# if an array name matches, tell the reader we want to load it:<br>
>> ? ?if nname == 'x0' or nname == 'x0_':<br>
>> ? ? ?# 0 means "don't load", 1 means "load" the i-th nodal array<br>
>> ? ? ?rdr.SetObjectArrayStatus( rdr.NODAL, i, 1 )<br>
>> ?rdr.Update()<br>
>> ?out = rdr.GetOutput()<br>
>> ?# Assuming you have an element block, its point data will have<br>
>> ?# the x0 array.<br>
>> ?elem_blks = out.GetBlock( 0 )<br>
>> ?elem_blk0 = elem_blks.GetBlock( 0 )<br>
>> ?x0 = elem_blk0.GetPointData().GetArray( 'x0' )<br>
>><br>
>> Note that because "_R" and "_Z" imply cylindrical coordinates, the two scalars<br>
>> in the exodus file will be combined into a 2-component vector by the reader and<br>
>> the result will be named either "x0" or "x0_" (I forget whether the trailing underscore<br>
>> is omitted or not).<br>
>><br>
>> Because Exodus defines a single, global set of nodes for all element/face/edge<br>
>> blocks, any nodal variables you request will be present on every output block.<br>
>> However, because the cells in a block don't necessarily reference every point,<br>
>> the point coordinates and point data for each block are subsets of the global<br>
>> arrays. For instance, if you have 10 points defined in a mesh but the first<br>
>> element block contains a single quadrilateral (4 points), there will only be 4<br>
>> values in the 'x0' array attached to that element block's unstructured grid.<br>
>><br>
>> ? ?David<br>
>><br>
>><br>
>> On Mon, Dec 6, 2010 at 9:21 PM, David Thompson <<a href="mailto:dcthomp@sandia.gov">dcthomp@sandia.gov</a>> wrote:<br>
>>>> ... when reading an ExodusII file with<br>
>>>> ?reader = vtk.vtkExodusIIReader()<br>
>>>> ?reader.Update()<br>
>>>> ?out = reader.GetOutput()<br>
>>>> 'out' would contain a whole lot of output the significance of which I<br>
>>>> don't quite understant;<br>
>>><br>
>>> Hi Nico,<br>
>>><br>
>>> The old vtkExodusReader used to output a single unstructured grid. This made<br>
>>> it difficult to handle the case when a variable was defined on some cells<br>
>>> (in one element block) but not on others (in a different element block). It<br>
>>> was also awkward to provide information about node sets and face sets. At<br>
>>> the time, there was also no concept of pedigree and global ID arrays in<br>
>>> vtkDataSetAttributes. This made writing Exodus datasets back out to a file<br>
>>> after some manipulation difficult since much of the information in the<br>
>>> original file could not be preserved. The vtkExodusModel and<br>
>>> vtkModelMetadata classes were attempts to encapsulate some of that<br>
>>> information for later access by a writer.<br>
>>><br>
>>> The new vtkExodusIIReader outputs a multiblock dataset. Each multiblock<br>
>>> dataset may have an arbitrary number of blocks, where each block is a<br>
>>> arbitary dataset (an unstructured grid, an image, or even another multiblock<br>
>>> dataset). The new reader outputs a multiblock dataset where each of the<br>
>>> top-level blocks is itself a multiblock dataset holding unstructured grids<br>
>>> of a single type (element blocks, face blocks, edge blocks, element sets,<br>
>>> side sets, face sets, edge sets, node sets). When you "print out" you are<br>
>>> seeing all of the internal variables associated with the one toplevel<br>
>>> multiblock dataset and its children.<br>
>>><br>
>>> This should print some more concise information about the blocks:<br>
>>> ====================== *snip* ======================<br>
>>> for i in range( out.GetNumberOfBlocks() ):<br>
>>> ?print out.GetMetaData( i ).Get( vtkCompositeDataSet.NAME() )<br>
>>> ?blk = out.GetBlock( i )<br>
>>> ?for j in range( blk.GetNumberOfBlocks() ):<br>
>>> ? ?print ' ?' + blk.GetMetaData( j ).Get( vtkCompositeDataSet.NAME() )<br>
>>><br>
>>> ====================== *snip* ======================<br>
>>> When the reader is told to read a block or set (only element blocks are read<br>
>>> by default), then an unstructured grid will be inserted into the appropriate<br>
>>> sub-block of the main reader's output.<br>
>>><br>
>>> ? ? ? ?Hope this helps,<br>
>>> ? ? ? ?David<br>
>>><br>
>>><br>
>>><br>
>>><br>
>><br>
>><br>
>><br>
><br>
<br>
<br>
------------------------------<br>
<br>
Message: 7<br>
Date: Mon, 13 Dec 2010 01:59:56 +0100<br>
From: Nico Schl?mer <<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>><br>
Subject: Re: [vtkusers] vtkPExodusIIWriter?<br>
To: "Thompson, David C" <<a href="mailto:dcthomp@sandia.gov">dcthomp@sandia.gov</a>><br>
Cc: vtkusers <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTinv8CMaYzmYWB7cFKRV163MrC3YiwKXFZEKm0ji@mail.gmail.com">AANLkTinv8CMaYzmYWB7cFKRV163MrC3YiwKXFZEKm0ji@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
I just came across the sentence<br>
<br>
"However if this writer is part of a parallel application (hence<br>
writing out a distributed Exodus file), then we need at the very least<br>
a list of all the block IDs that appear in the file. And we need the<br>
element array of block IDs for the input unstructured grid."<br>
<br>
in the vtkExodusIIWriter documentation, so I guess it *does* support<br>
parallel writes, just that the data has to be fitted for it somehow.<br>
Is there a newbie howto for parallel data structures in VTK?<br>
<br>
--Nico<br>
<br>
<br>
<br>
On Sun, Dec 12, 2010 at 3:30 AM, Thompson, David C <<a href="mailto:dcthomp@sandia.gov">dcthomp@sandia.gov</a>> wrote:<br>
> Hi Nico,<br>
><br>
> I didn't write the vtkExodusIIWriter, so I don't know about how/whether it works in parallel.<br>
><br>
> ? ?David<br>
> ________________________________________<br>
> From: <a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a> [<a href="mailto:vtkusers-bounces@vtk.org">vtkusers-bounces@vtk.org</a>] On Behalf Of Nico Schl?mer [<a href="mailto:nico.schloemer@gmail.com">nico.schloemer@gmail.com</a>]<br>
> Sent: Saturday, December 11, 2010 11:10<br>
> To: vtkusers<br>
> Subject: [vtkusers] vtkPExodusIIWriter?<br>
><br>
> Hi all,<br>
><br>
> I notice that with VTK, it's possible to read parallel ExodusII files<br>
> via "vtkPExodusIIReader"<br>
> <<a href="http://www.vtk.org/doc/nightly/html/classvtkPExodusIIReader.html" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkPExodusIIReader.html</a>>.<br>
> Curiously, however, I didn't find the corresponding vtkPExodusIIWriter<br>
> class.<br>
><br>
> Is it possible to write parallel Exodus files with VTK at all then,<br>
> using the regular vtkExodusIIWriter classes?<br>
><br>
> Cheers,<br>
> Nico<br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" 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" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
><br>
<br>
<br>
------------------------------<br>
<br>
Message: 8<br>
Date: Mon, 13 Dec 2010 11:10:11 +0900<br>
From: "Xiaopeng Yang" <<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>><br>
Subject: [vtkusers] DICOM information<br>
To: <<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>>, <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
Message-ID: <00b901cb9a6a$e467cd50$ad3767f0$@<a href="http://ac.kr" target="_blank">ac.kr</a>><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
Hello everyone,<br>
<br>
I'm trying to get patient name, age, and sex from a series of CT images. But<br>
I have no idea how to do this. I am using ITK GDCMImageIO to load the<br>
dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to<br>
visualize the dataset.<br>
<br>
Based on the algorithms I used, how can I get patient information?<br>
<br>
Thank you for your help.<br>
<br>
Best,<br>
Xiaopeng<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 9<br>
Date: Sun, 12 Dec 2010 21:32:23 -0500<br>
From: Luis Ibanez <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>><br>
Subject: Re: [vtkusers] [Insight-users] DICOM information<br>
To: Xiaopeng Yang <<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>><br>
Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a>, <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<<a href="mailto:AANLkTimE9WiFz1AFX%2B5NvmHB-f%2Bfq-j6SN9f4AsjfBfY@mail.gmail.com">AANLkTimE9WiFz1AFX+5NvmHB-f+fq-j6SN9f4AsjfBfY@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Hi Xiaopeng,<br>
<br>
Please look at the example<br>
<br>
ITK/Examples/IO/DicomImageReadPrintTags.cxx<br>
<br>
The tags that you need are listed here:<br>
<br>
<a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html" target="_blank">http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html</a><br>
<br>
0010,0010 PatientName<br>
0010,0040 PatientSex<br>
0010,1010 PatientAge<br>
<br>
In the Example above,<br>
the lines of code 300 to 333 show you<br>
how to get the patient name.<br>
<br>
You can get the other values by using the<br>
DICOM tags for Sex and Age.<br>
<br>
<br>
<br>
Regards<br>
<br>
<br>
Luis<br>
<br>
<br>
------------------------------------------------------<br>
On Sun, Dec 12, 2010 at 9:10 PM, Xiaopeng Yang <<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>> wrote:<br>
> Hello everyone,<br>
><br>
> I'm trying to get patient name, age, and sex from a series of CT images. But<br>
> I have no idea how to do this. I am using ITK GDCMImageIO to load the<br>
> dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to<br>
> visualize the dataset.<br>
><br>
> Based on the algorithms I used, how can I get patient information?<br>
><br>
> Thank you for your help.<br>
><br>
> Best,<br>
> Xiaopeng<br>
><br>
><br>
><br>
><br>
><br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
<br>
<br>
------------------------------<br>
<br>
Message: 10<br>
Date: Mon, 13 Dec 2010 14:33:17 +0900<br>
From: "Xiaopeng Yang" <<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>><br>
Subject: Re: [vtkusers] [Insight-users] DICOM information<br>
To: "'Luis Ibanez'" <<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>><br>
Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a>, <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID: <00c301cb9a87$3f18bf40$bd4a3dc0$@<a href="http://ac.kr" target="_blank">ac.kr</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hi Luis,<br>
<br>
Thanks very much. It works! May I ask you another question please? Do you know some fast hole filling algorithm for binary image?<br>
<br>
Best regards,<br>
<br>
Xiaopeng<br>
<br>
-----????-----<br>
???: Luis Ibanez [mailto:<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>]<br>
????: 2010? 12? 13? ??? ?? 11:32<br>
???: Xiaopeng Yang<br>
??: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a>; <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
??: Re: [Insight-users] DICOM information<br>
<br>
Hi Xiaopeng,<br>
<br>
Please look at the example<br>
<br>
ITK/Examples/IO/DicomImageReadPrintTags.cxx<br>
<br>
The tags that you need are listed here:<br>
<br>
<a href="http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html" target="_blank">http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/DICOM.html</a><br>
<br>
0010,0010 PatientName<br>
0010,0040 PatientSex<br>
0010,1010 PatientAge<br>
<br>
In the Example above,<br>
the lines of code 300 to 333 show you<br>
how to get the patient name.<br>
<br>
You can get the other values by using the<br>
DICOM tags for Sex and Age.<br>
<br>
<br>
<br>
Regards<br>
<br>
<br>
Luis<br>
<br>
<br>
------------------------------------------------------<br>
On Sun, Dec 12, 2010 at 9:10 PM, Xiaopeng Yang <<a href="mailto:yxp233@postech.ac.kr">yxp233@postech.ac.kr</a>> wrote:<br>
> Hello everyone,<br>
><br>
> I'm trying to get patient name, age, and sex from a series of CT images. But<br>
> I have no idea how to do this. I am using ITK GDCMImageIO to load the<br>
> dataset, then connecting ITK to VTK, and then using VTK Imageviewer2 to<br>
> visualize the dataset.<br>
><br>
> Based on the algorithms I used, how can I get patient information?<br>
><br>
> Thank you for your help.<br>
><br>
> Best,<br>
> Xiaopeng<br>
><br>
><br>
><br>
><br>
><br>
> _____________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Kitware offers ITK Training Courses, for more information visit:<br>
> <a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
><br>
> Please keep messages on-topic and check the ITK FAQ at:<br>
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 11<br>
Date: Mon, 13 Dec 2010 10:43:14 +0100<br>
From: Roger Bramon Feixas <<a href="mailto:rogerbramon@gmail.com">rogerbramon@gmail.com</a>><br>
Subject: Re: [vtkusers] bug 0009618 and UTF 8 text rendering fix<br>
question<br>
To: Sean McBride <<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>><br>
Cc: David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>>, <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<AANLkTi=<a href="mailto:n4HBOK3qGTu-SH2U-4OOQW5GV9K%2BvoujsUmm%2B@mail.gmail.com">n4HBOK3qGTu-SH2U-4OOQW5GV9K+voujsUmm+@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi,<br>
<br>
Sean, at my system vtkTextActor::SetInput() also expects ISO-8859-1. I'm<br>
using Qt and I have to call QString::toLatin1() to be able to use accents in<br>
VTK.<br>
<br>
Marcus, let me know if you has any questions about the patch which tries to<br>
solve the drop shadow rendering problem.<br>
<br>
Thanks for your attention,<br>
<br>
Roger<br>
<br>
<br>
On Tue, Dec 7, 2010 at 10:35 PM, Sean McBride <<a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a>>wrote:<br>
<br>
> On Tue, 7 Dec 2010 15:27:03 -0500, Marcus D. Hanwell said:<br>
><br>
> >>> Just to clarify, what encoding should be given to<br>
> vtkTextActor::SetInput<br>
> >>> ()? Last I tried, it seemed to expect ISO-8859-1. Certainly a step up<br>
> >>> from ASCII! Is the long term plan for it to accept UTF8?<br>
> >><br>
> >> I think it is best if VTK strings use the system default encoding,<br>
> rather<br>
> >> than utf-8. For unicode there is always vtkUnicodeString. More classes<br>
> >> should be adapted to take vtkUnicodeString as input (but only, of<br>
> course,<br>
> >> if they are internally capable of using/rendering unicode).<br>
> >><br>
> >> But I'm flexible. Really, I'm just pushing for VTK's string handling to<br>
> be<br>
> >> more similar to Python's. ;)<br>
> >><br>
> >I am not too concerned about aligning with Python's string handling,<br>
> >but agree with David - I think we should be adjusting existing classes<br>
> >to deal with and take vtkUnicodeString, which can take UTF8 strings<br>
> >for construction.<br>
><br>
> Agreed.<br>
><br>
> >It would probably be simplest to interpret all const<br>
> >char* and vtkStdString as UTF8 when it came to rendering, as minimal<br>
> >code/API changes would be required.<br>
><br>
> I agree here too, but such a change would appear to break binary<br>
> compatibility. Today's vtkTextActor::SetInput() expects ISO-8859-1 (at<br>
> least on my system), if we change it to expect UTF8 we break existing<br>
> clients of VTK.<br>
><br>
> In any case, API that take char* should document which encoding they<br>
> expect. Consider the tiny attached patch.<br>
><br>
> >If you look at vtkContext2D and friends, where I have been prototyping<br>
> >the UTF8 string handling and Unicode rendering, I have used<br>
> >vtkUnicodeString as the function argument.<br>
><br>
> Sounds great.<br>
><br>
> >I certainly welcome people's thoughts on this. Working through the<br>
> >relevant classes, and adding vtkUnicodeString API to them where and<br>
> >when they can really render Unicode seems like a reasonable approach<br>
> >to me.<br>
><br>
> vtkTextActor appears to be in need of vtkUnicodeString support...<br>
><br>
> --<br>
> ____________________________________________________________<br>
> Sean McBride, B. Eng <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
> Rogue Research <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
> Mac Software Developer Montr?al, Qu?bec, Canada<br>
><br>
> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" 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" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.vtk.org/pipermail/vtkusers/attachments/20101213/18488da8/attachment-0001.htm" target="_blank">http://www.vtk.org/pipermail/vtkusers/attachments/20101213/18488da8/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 12<br>
Date: Mon, 13 Dec 2010 06:14:50 -0800 (PST)<br>
From: Rachel <<a href="mailto:aracha2010@gmail.com">aracha2010@gmail.com</a>><br>
Subject: Re: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID: <<a href="mailto:1292249690501-3303147.post@n5.nabble.com">1292249690501-3303147.post@n5.nabble.com</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
<br>
Thank you Davis. i got the same results as you but when i change the code as<br>
you see below, it gives me 0:<br>
<br>
I change the input image and I assigned 2.0 to each pixel (as in the example<br>
)<br>
int main(){<br>
// Create an image data<br>
vtkSmartPointer<vtkImageData> imageData =<br>
vtkSmartPointer<vtkImageData>::New();<br>
<br>
//imageData= LoadImage(OutputImage);<br>
vtkSmartPointer<vtkPNGReader> reader =<br>
vtkSmartPointer<vtkPNGReader>::New();<br>
reader->SetFileName(OutputImage);<br>
reader->Update();<br>
imageData= reader->GetOutput();<br>
<br>
//i removed these three lines<br>
// Specify the size of the image data<br>
/* imageData->SetDimensions(2,3,1);<br>
imageData->SetNumberOfScalarComponents(1);<br>
imageData->SetScalarTypeToDouble();*/<br>
<br>
int* dims = imageData->GetDimensions();<br>
<br>
std::cout << "Dims: " << " x: " << dims[0] << " y: " << dims[1] << " z: "<br>
<< dims[2] << std::endl;<br>
std::cout << "Number of points: " << imageData->GetNumberOfPoints() <<<br>
std::endl;<br>
std::cout << "Number of cells: " << imageData->GetNumberOfCells() <<<br>
std::endl;<br>
<br>
// Fill every entry of the image data with "2.0"<br>
for (int z = 0; z < dims[2]; z++)<br>
{<br>
for (int y = 0; y < dims[1]; y++)<br>
{<br>
for (int x = 0; x < dims[0]; x++)<br>
{<br>
<br>
double* pixel =<br>
static_cast<double*>(imageData->GetScalarPointer(x,y,z));<br>
pixel[0] = 2.0;<br>
<br>
}<br>
}<br>
}<br>
<br>
<br>
// Retrieve the entries from the image data and print them to the screen<br>
for (int z = 0; z < dims[2]; z++)<br>
{<br>
for (int y = 0; y < dims[1]; y++)<br>
{<br>
for (int x = 0; x < dims[0]; x++)<br>
{<br>
double* pixel =<br>
static_cast<double*>(imageData->GetScalarPointer(x,y,z));<br>
// do something with v<br>
std::cout << pixel[0] << " ";<br>
}<br>
std::cout << std::endl;<br>
}<br>
std::cout << std::endl;<br>
}<br>
return EXIT_SUCCESS;<br>
}<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303147.html" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303147.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<br>
<br>
------------------------------<br>
<br>
Message: 13<br>
Date: Mon, 13 Dec 2010 09:44:31 -0500<br>
From: David Doria <<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>><br>
Subject: Re: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData<br>
To: Rachel <<a href="mailto:aracha2010@gmail.com">aracha2010@gmail.com</a>><br>
Cc: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<<a href="mailto:AANLkTim8A%2BB71778xUb64mk3ULKJAg5UYF0_qEAs5Xr2@mail.gmail.com">AANLkTim8A+B71778xUb64mk3ULKJAg5UYF0_qEAs5Xr2@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
On Mon, Dec 13, 2010 at 9:14 AM, Rachel <<a href="mailto:aracha2010@gmail.com">aracha2010@gmail.com</a>> wrote:<br>
><br>
> Thank you Davis. i got the same results as you but when i change the code as<br>
> you see below, it gives me 0:<br>
><br>
> I change the input image and I assigned 2.0 to each pixel (as in the example<br>
> )<br>
<br>
The problem is that the reader is creating an image with pixels of<br>
type Unsigned Char.<br>
<br>
You have to change the cast in both the loop setting the pixels and<br>
reading the pixels:<br>
<br>
Set loop:<br>
<br>
unsigned char* pixel =<br>
static_cast<unsigned char*>(imageData->GetScalarPointer(x,y,z));<br>
pixel[0] = 2;<br>
<br>
Get loop:<br>
<br>
unsigned char* pixel =<br>
static_cast<unsigned char*>(imageData->GetScalarPointer(x,y,z));<br>
// do something with v<br>
std::cout << (int)pixel[0] << " ";<br>
<br>
David<br>
<br>
<br>
------------------------------<br>
<br>
Message: 14<br>
Date: Mon, 13 Dec 2010 06:54:22 -0800 (PST)<br>
From: Rachel <<a href="mailto:aracha2010@gmail.com">aracha2010@gmail.com</a>><br>
Subject: Re: [vtkusers] VTK/Examples/Cxx/ImageData/IterateImageData<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID: <<a href="mailto:1292252062862-3303214.post@n5.nabble.com">1292252062862-3303214.post@n5.nabble.com</a>><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
<br>
Thank you very much David. It works now :)<br>
Have a great day :)<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303214.html" target="_blank">http://vtk.1045678.n5.nabble.com/VTK-Examples-Cxx-ImageData-IterateImageData-tp3300844p3303214.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
<br>
<br>
------------------------------<br>
<br>
Message: 15<br>
Date: Mon, 13 Dec 2010 10:39:47 -0500<br>
From: Jeff Baumes <<a href="mailto:jeff.baumes@kitware.com">jeff.baumes@kitware.com</a>><br>
Subject: Re: [vtkusers] Link error when building VTK with boost<br>
support in Visual Studio 2010<br>
To: Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>><br>
Cc: VTK Users <<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTikjoLrrAeNBBOT944sUeWQCc%2B_f_SDTUReKbwm8@mail.gmail.com">AANLkTikjoLrrAeNBBOT944sUeWQCc+_f_SDTUReKbwm8@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="windows-1252"<br>
<br>
On Sat, Dec 11, 2010 at 10:52 PM, Hong Yi <<a href="mailto:hongyi@renci.org">hongyi@renci.org</a>> wrote:<br>
<br>
> Thanks, Jeff.<br>
><br>
><br>
><br>
> I don?t get this error (i.e., fatal error LNK1104: cannot open file<br>
> 'libboost_serialization-vc100-mt-gd-1_44.lib') any more after I turned off<br>
> Windows 7 Account Access Control and rebuilt everything, so this error was<br>
> caused by windows 7 Account Access Control. However, I got the following 3<br>
> linking errors:<br>
><br>
><br>
><br>
> 8>BoostArrayLogWeighting.obj : error LNK2019: unresolved external symbol<br>
> "__declspec(dllimport) public: static class vtkBoostLogWeighting * __cdecl<br>
> vtkBoostLogWeighting::New(void)" (__imp_?New@vtkBoostLogWeighting<br>
> @@SAPAV1@XZ) referenced in function "public: static class<br>
> vtkSmartPointer<class vtkBoostLogWeighting> __cdecl vtkSmartPointer<class<br>
> vtkBoostLogWeighting>::New(void)" (?New@<br>
> ?$vtkSmartPointer@VvtkBoostLogWeighting@@@@SA?AV1@XZ)<br>
><br>
> 8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved<br>
> external symbol "__declspec(dllimport) public: static class<br>
> vtkBoostRandomSparseArraySource * __cdecl<br>
> vtkBoostRandomSparseArraySource::New(void)"<br>
> (__imp_?New@vtkBoostRandomSparseArraySource@@SAPAV1@XZ) referenced in<br>
> function "public: static class vtkSmartPointer<class<br>
> vtkBoostRandomSparseArraySource> __cdecl vtkSmartPointer<class<br>
> vtkBoostRandomSparseArraySource>::New(void)" (?New@<br>
> ?$vtkSmartPointer@VvtkBoostRandomSparseArraySource@@@@SA?AV1@XZ)<br>
><br>
> 8>BoostArrayRandomSparseArraySource.obj : error LNK2019: unresolved<br>
> external symbol "__declspec(dllimport) public: void __thiscall<br>
> vtkBoostRandomSparseArraySource::SetExtents(class vtkArrayExtents const &)"<br>
> (__imp_?SetExtents@vtkBoostRandomSparseArraySource<br>
> @@QAEXABVvtkArrayExtents@@@Z) referenced in function "int __cdecl<br>
> BoostArrayRandomSparseArraySource(int,char * * const)"<br>
> (?BoostArrayRandomSparseArraySource@@YAHHQAPAD@Z)<br>
><br>
> 8>C:\Users\hongyi.HONGYI-W510\VTK-CMake\bin\RelWithDebInfo\InfovisBoostArrayCxxTests.exe<br>
> : fatal error LNK1120: 3 unresolved externals<br>
><br>
><br>
><br>
> Any suggestions on what additional libs I should include in the link<br>
> property setup to make above three symbols resolved?<br>
><br>
><br>
It would seem that vtkInfovis is not building with vtkBoostLogWeighting<br>
and vtkBoostRandomSparseArraySource, but they should if you have<br>
VTK_USE_N_WAY_ARRAYS and VTK_USE_BOOST on. If either is not on, then the<br>
executable InfovisBoostArrayCxxTests should not be built, so I'm not sure<br>
what the issue is here.<br>
<br>
Another not-directly-related question: I have written a simple example using<br>
> VTK and QT and it only works with release configuration with VTK built and<br>
> installed with release configuration also. When I run the example with debug<br>
> configuration, I got an error message ?this application has failed to start<br>
> because the application configuration is incorrect. Review the manifest file<br>
> for possible errors.? I am new to VTK and read from the web that VTK should<br>
> be installed with release configuration since the debug configuration does<br>
> not work well, is that a true statement? I am currently using visual studio<br>
> 2010 to build VTK 5.6 version. If I want my VTK+QT example to work with<br>
> debug configuration, is there anything special I should do and be aware of?<br>
> Thanks for any suggestions and guidelines on this.<br>
><br>
<br>
You may want to start a new thread on this topic.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.vtk.org/pipermail/vtkusers/attachments/20101213/070ac36d/attachment-0001.htm" target="_blank">http://www.vtk.org/pipermail/vtkusers/attachments/20101213/070ac36d/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 16<br>
Date: Tue, 14 Dec 2010 00:11:00 +0800<br>
From: ??? <<a href="mailto:zhuyanqiao0413@gmail.com">zhuyanqiao0413@gmail.com</a>><br>
Subject: [vtkusers] About the VTK_USE_ANSI_STDLIB<br>
To: <a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
Message-ID:<br>
<AANLkTinRg=<a href="mailto:WVUGYM1fMM2aZp6jFDT%2BYzPdEt-Qsojo_K@mail.gmail.com">WVUGYM1fMM2aZp6jFDT+YzPdEt-Qsojo_K@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="gb2312"<br>
<br>
Sorry, every one. I started to learn itk and vtk yesterday. I am using Arch<br>
Linux, and I have installed vtk throught its software repos. But when I<br>
tried to configure VTK as is told in "Starting with ITK and VIK", I can not<br>
find the VTK_USE_ANSI_STDLIB option which needs to be turned on. My VTK is<br>
the latest version, and does that matter? And what is the effect of this<br>
option. Also, I can not find the option "USE_VTK" metioned in the itk faq<br>
"<br>
<br>
> In order to use ITK with VTK you must build VTK from sources and make sure<br>
> that it is configured with the flag USE_ANSI_STDLIB enabled.<br>
><br>
> Then you have to reconfigure ITK making sure that the option USE_VTK is<br>
> enabled.<br>
><br>
"<br>
<br>
<br>
By the way, I am still not clear about the combination of ItK and vtk. It<br>
seems I will have to copy the files like in<br>
"InsightApplications-3.20.0/Auxiliary/vtk" to my application source<br>
directory whenever I need to combine itk and vtk. Is that true?<br>
<br>
Another question is why I can simply build the Examples\Installation in itk<br>
but cannot build other examples like Examples\IO. I found that the<br>
CMakeLists.txt are slightly different. CMakeLists.txt for<br>
Examples\Installation has<br>
<br>
<br>
> FIND_PACKAGE(ITK_REQIIRED)<br>
><br>
INCLUDE(${ITK_USE_FILE})<br>
<br>
I think the effection of these statement is to create ITK_DIR when build<br>
the project using ccmake. This is crucial, am I right?<br>
<br>
Sorry for the expression. And thanks in advance for help.<br>
<br>
<br>
<br>
<br>
-------------------------------------------<br>
???<br>
??????????<br>
????1#431<br>
86-10-62742310<br>
Luke<br>
School of Mathematical Sciences,<br>
Peking University.<br>
phone: 86-10-62742310<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.vtk.org/pipermail/vtkusers/attachments/20101214/795f448f/attachment-0001.htm" target="_blank">http://www.vtk.org/pipermail/vtkusers/attachments/20101214/795f448f/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
vtkusers mailing list<br>
<a href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</a><br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br>
<br>
End of vtkusers Digest, Vol 80, Issue 16<br>
****************************************<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br><img src="http://lh6.ggpht.com/_8tbgcIDVCy0/TJgluKf1K3I/AAAAAAAAABo/VF66046Ldc0/Assinatura_Bruno%20Lara_3d.PNG"><br><br>
</div></div>