[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    Re: [vtkusers] Fwd: Choose the second component in vtkDataArray without copy
From:       Manh Nguyen <nevermind145 () gmail ! com>
Date:       2013-05-29 9:25:43
Message-ID: CAPjudh_jet=wmu46tFwU8bPHRRjCxApC1TY40owTJih_B-kc7Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


HI,

basically I just need 1 component out of the vectorData (and later on
select other component).
As u see in my previous email, the vtkDataArray  reads all the data (from
qflow velocities) and put it in the vtkDataArray, So basically,
vtkDataArray hold all the data, with the information that it knows that it
has 3 components (it is defined in the file). Also I can not use another
reader, because I'm loading VTI files, which requires a different reader. I
hope this will answer your question.
Sincerely

Tat Manh Nguyen


On Wed, May 29, 2013 at 10:29 AM, mirko heuegger <mheuegger@gmail.com>wrote:

> Hello!
>
> A Other Question, how are you trying to read the vectorData?
>
> And what is the return from reader->GetNumberOfVectorsInFile() (the
> reader-object should be something like a vtkDataSetReader)?
>
>
> regards
>
> mirko
>
>
>
> On Tue, May 28, 2013 at 3:58 PM, Manh Nguyen <nevermind145@gmail.com>wrote:
>
>>
>> Dear vtk developers,
>>
>> I have created this code:
>>
>> vtkDataArray *DataArray =
>> reader->GetOutput()->GetPointData()->GetArray("qflow velocities");
>>
>>
>> The DataArray is an array with 3 components (x,y,z), but by default it
>> read only the x component?
>>
>>
>> Is there a way to select only the components without using CopyComponent
>> or any other copy functions?
>>
>>  I have tried GetVectors but it crashed. the data just load single
>> Scalars.
>>
>> Does vtkDataArray have something like get Component Array? or something?
>>
>> Sincerely,
>>
>> Tat Manh Nguyen
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Real programmers don't document; if it was
> hard to write, it should be hard to understand.
>

[Attachment #5 (text/html)]

<div dir="ltr">HI, <div><br></div><div style>basically I just need 1 component out of \
the vectorData (and later on select other component).</div><div style>As u see in my \
previous email, the vtkDataArray  reads all the data (from qflow velocities) and put \
it in the vtkDataArray, So basically, vtkDataArray hold all the data, with the \
information that it knows that it has 3 components (it is defined in the file). Also \
I can not use another reader, because I&#39;m loading VTI files, which requires a \
different reader. I hope this will answer your question. </div> <div \
style>Sincerely</div><div style><br></div><div style>Tat Manh Nguyen</div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 29, 2013 at 10:29 \
AM, mirko heuegger <span dir="ltr">&lt;<a href="mailto:mheuegger@gmail.com" \
target="_blank">mheuegger@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hello!<div><br></div><div>A Other Question, \
how are you trying to read the vectorData?</div><div><br></div> <div>And what is the \
return from <span style="font-size:13px;font-family:arial,sans-serif">reader-&gt;</span>GetNumberOfVectorsInFile() \
(the reader-object should be something like a vtkDataSetReader)?<br> \
</div><div><br></div><div><br></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">regards</span><span \
class="HOEnZb"><font color="#888888"><br></font></span></div><span \
class="HOEnZb"><font color="#888888"><div> <span \
style="font-family:arial,sans-serif;font-size:13px"><br></span></div> <div><span \
style="font-family:arial,sans-serif;font-size:13px">mirko</span></div><div><br></div></font></span></div><div \
class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Tue, May \
28, 2013 at 3:58 PM, Manh Nguyen <span dir="ltr">&lt;<a \
href="mailto:nevermind145@gmail.com" \
target="_blank">nevermind145@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><br><div \
class="gmail_quote"><div dir="ltr"><div><div>Dear vtk developers,<div> \
<br></div><div> I have created this code:</div><div><br></div><div>vtkDataArray \
*DataArray = reader-&gt;GetOutput()-&gt;GetPointData()-&gt;GetArray(&quot;qflow \
velocities&quot;);</div>

<div><br></div></div></div><div><div><div><div><br></div><div>The DataArray is an \
array with 3 components (x,y,z), but by default it read only the x component? \
</div><div><br></div><div><br></div><div>Is there a way to select only the components \
without using CopyComponent or any other copy functions?</div>


<div><br></div></div></div><div><span \
style="font-family:arial,sans-serif;font-size:12.727272033691406px"> I have tried \
GetVectors but it crashed. the data just load single \
Scalars.</span><br></div><div><span \
style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>


</span></div><div><span \
style="font-family:arial,sans-serif;font-size:12.727272033691406px">Does vtkDataArray \
have something like get Component Array? or something?</span></div> \
<div><br></div><div>Sincerely,</div><div><br></div><div>Tat Manh \
Nguyen</div></div></div> </div><br></div>
<br></div></div><div class="im">_______________________________________________<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></div></blockquote></div><div class="im"><br><br clear="all"><div><br></div>-- \
<br>Real programmers don&#39;t document; if it was<br>hard to write, it should be \
hard to understand. </div></div>
</blockquote></div><br></div>



_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic