<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=Windows-1254">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceName"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PlaceType"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
h4
        {margin-top:12.0pt;
        margin-right:0cm;
        margin-bottom:3.0pt;
        margin-left:43.2pt;
        text-indent:-43.2pt;
        page-break-after:avoid;
        mso-list:l0 level4 lfo3;
        font-size:14.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p.Style2, li.Style2, div.Style2
        {margin-top:12.0pt;
        margin-right:0cm;
        margin-bottom:3.0pt;
        margin-left:43.2pt;
        text-indent:-43.2pt;
        page-break-after:avoid;
        mso-list:l0 level4 lfo3;
        font-size:12.0pt;
        font-family:Arial;
        font-weight:bold;}
p.style20, li.style20, div.style20
        {margin-top:12.0pt;
        margin-right:0cm;
        margin-bottom:3.0pt;
        margin-left:43.2pt;
        text-indent:-43.2pt;
        page-break-after:avoid;
        mso-list:l0 level4 lfo3;
        font-size:12.0pt;
        font-family:Arial;
        font-weight:bold;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Times New Roman";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Times New Roman";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:497774475;
        mso-list-template-ids:1719176970;}
@list l0:level1
        {mso-level-text:%1;
        mso-level-tab-stop:21.6pt;
        mso-level-number-position:left;
        margin-left:21.6pt;
        text-indent:-21.6pt;}
@list l0:level2
        {mso-level-text:"%1\.%2";
        mso-level-tab-stop:28.8pt;
        mso-level-number-position:left;
        margin-left:28.8pt;
        text-indent:-28.8pt;}
@list l0:level3
        {mso-level-text:"%1\.%2\.%3";
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        margin-left:36.0pt;
        text-indent:-36.0pt;}
@list l0:level4
        {mso-level-style-link:"Heading 4";
        mso-level-text:"%1\.%2\.%3\.%4";
        mso-level-tab-stop:43.2pt;
        mso-level-number-position:left;
        margin-left:43.2pt;
        text-indent:-43.2pt;}
@list l0:level5
        {mso-level-text:"%1\.%2\.%3\.%4\.%5";
        mso-level-tab-stop:50.4pt;
        mso-level-number-position:left;
        margin-left:50.4pt;
        text-indent:-50.4pt;}
@list l0:level6
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6";
        mso-level-tab-stop:57.6pt;
        mso-level-number-position:left;
        margin-left:57.6pt;
        text-indent:-57.6pt;}
@list l0:level7
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7";
        mso-level-tab-stop:64.8pt;
        mso-level-number-position:left;
        margin-left:64.8pt;
        text-indent:-64.8pt;}
@list l0:level8
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8";
        mso-level-tab-stop:72.0pt;
        mso-level-number-position:left;
        margin-left:72.0pt;
        text-indent:-72.0pt;}
@list l0:level9
        {mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9";
        mso-level-tab-stop:79.2pt;
        mso-level-number-position:left;
        margin-left:79.2pt;
        text-indent:-79.2pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>

</head>

<body lang=EN-GB link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=3 color=blue face="Times New Roman"><span
style='font-size:12.0pt;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>hi, thanks for the replies.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>i need to clarify one thing straight. the coloring i
am trying is not restricted to three orthogonal dimension as ugur assumed. for
each tensor, i need a set of colors calculated for each theta and phi direction
(in the spherical coordinates.) assuming a thetaResolution of 20 and
phiresolution of 20, color scalar array will be 400 scalars. i tried to explain
how i get the colors in the first message. basically a colour is calculated
from the surface normal and vector at that location (the vector is calculated
from the tensor by a scalar product of the tensor and the surface normal) (see
my first message below.) although the visualization idea is complicated, i know
that vtk script should not necessarily be as complex.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>a visualization task with vtk follows <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>source &gt; filters&gt; mapper &gt; actor
&gt;rendering<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>i understand i need to scale and aling a
vtkTensorGlyph using my tensor. then i need to create a vtkDoubleArray with 400
components using the same tensor and vtkTensorGlpyh surface normals.&nbsp; what
is not clear to me is: how to calculate the color array and store them in a
vtkDoubleArray from the tensor and surface normals. i suppose i need to
getSurfaceNormals and multiply them component by component with my tensor to
obtain another set of vectors. and with this new set i need to do scalar
multiplication with the surface normals to get the scalar color array.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>once i have a
scalar array i assign them to the vtkTensorGlyph, as luca wrote, with </span>vtkPolyData::GetPointData::SetScalars(array).<o:p></o:p></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>i am familiar with vtk theoretically and used it for straightforward tasks.
i will appreciate any help regarding how to practically create the color array.
btw &nbsp;i’m using java to write the scripts.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>cheers,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'>mecit yaman<o:p></o:p></span></font></p>

<p class=MsoNormal><st1:place w:st="on"><st1:PlaceType w:st="on"><font size=3
  face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>university</span></font></st1:PlaceType><span
 lang=EN-US> of <st1:PlaceName w:st="on">cape town</st1:PlaceName></span></st1:place><span
lang=EN-US><o:p></o:p></span></p>

<p class=MsoNormal><font size=3 color=blue face="Times New Roman"><span
style='font-size:12.0pt;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 color=blue face="Times New Roman"><span
style='font-size:12.0pt;color:blue'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
Luca Pallozzi Lavorante [mailto:<st1:PersonName w:st="on">lplavorante@gmail.com</st1:PersonName>]
<br>
<b><span style='font-weight:bold'>Sent:</span></b> 25 July 2006 01:55 PM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">yaman@myhorizon.org</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [vtkusers] colour
mapping stress ellipsoids</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Yaman, I do agree with
Ugur.<br>
I have used the vtkTensorGlyph class in order to get strain ellipsoids. I also
have tried to color the deformed object and, as far as I know, the only way is
to associate scalar values to the object´s points through the vtkFloatArray or
vtkDoubleArray. Once you created the array, the association is made via a call
like vtkPolyData::GetPointData::SetScalars(array).<br>
I hope this helps<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luca<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>On 7/24/06, <b><span style='font-weight:bold'>Ugur
BOZKAYA</span></b> &lt;<a href="mailto:u.bozkaya@fmcon.com">u.bozkaya@fmcon.com</a>&gt;
wrote:</span></font></span><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Selam Mecit,<br>
<br>
As far as I know, there is no class for this purpose in VTK currently.<br>
vtkTensorGlyph and vtkGlyph3D can be used for typical tensor<br>
visualization. But the tensors are shown only in one color(RGB is also <br>
possible I guess, but it will not solve your problem). If you are<br>
familiar enough with VTK, you can change these classes for your purpose.<br>
Those glyph shapes such as ellipsoids (deformed spheres) are already<br>
defined as vtkPolyData, so you can use other shapes.<br>
<br>
I assume you are planning to use 3 orthogonal directions for coloring.<br>
You only need a vtkDataArray (e.g. vtkDoubleArray) with 3 components. So<br>
for each tensor location you will have 3 values. <br>
<br>
I guess it will be easier to write your own class which looks simpler.<br>
You will have your output as vtkPolyData, which is actually composed of<br>
your tensors. May be you can have a function which calculates a<br>
tensorshape(multicolored vtkPolyData) for a given location then you can<br>
add the output of this function to your volume output for each location.<br>
<br>
Good Luck,<br>
Ugur<br>
<br>
Mecit Yaman wrote:<br>
&gt; hi,<br>
&gt;<br>
&gt; i am trying to visualize second order tensors using stress ellipsoids with
a<br>
&gt; different color mapping. the usual colouring is to map a scalar value,
e.g.<br>
&gt; components, effective stress, trace or other scalars on the surface. i
want <br>
&gt; to do a colouring where each point/polygon on the ellipsoid will be
coloured<br>
&gt; differently. the color scheme is defined as follows:<br>
&gt;<br>
&gt; the color along direction n(i) of the ellipsoid is obtained from the angle
<br>
&gt; between the n(i), direction vector, and the stress vector along n(i). (the<br>
&gt; stress vector along a direction can be obtained by multiplying the stress<br>
&gt; tensor, T(ij) with the direction vector, n(i)).&nbsp;&nbsp;Thus: <br>
&gt;<br>
&gt; T(ij)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tensor<br>
&gt; n(i)&nbsp;&nbsp;direction vector<br>
&gt;<br>
&gt; stress vector(i) = T(ij) . n(i)<br>
&gt;<br>
&gt; angle between stress vector and direction vector<br>
&gt;<br>
&gt; cos(angle) = stress vector (i) . n(i) / ( |stress vector(i)| | n(i)|) <br>
&gt;<br>
&gt; how does one colour map these angles, which are different for every<br>
&gt; direction on an ellipsoid? do I need to change stress ellipsoid into a<br>
&gt; polygonal data type? how do I calculate and store the angles in VTK? <br>
&gt;<br>
&gt; i am able to render the icons in Mathematica, and will be happy to share<br>
&gt; information with anyone interested.<br>
&gt;<br>
&gt; thanks,<br>
&gt;<br>
&gt; M Yaman<br>
&gt; <st1:place w:st="on"><st1:PlaceType w:st="on">University</st1:PlaceType>
 of <st1:PlaceName w:st="on">Cape Town</st1:PlaceName></st1:place><br>
&gt; <br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; This is the private VTK discussion list.<br>
&gt; Please keep messages on-topic. Check the FAQ at: <a
href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
&gt;<br>
&gt;<br>
<br>
_______________________________________________<br>
This is the private VTK discussion list.<br>
Please keep messages on-topic. Check the FAQ at: <a
href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a> <br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>