Dimitrios E. Kiousis | 4 Jul 2006 11:31
Picon
Picon

Point & Cell data

Hello MayaVi friends,

My question concerns .VTK files and MayaVi.

I want my .VTK file to containt:

POINT data
  Scalars
    xxxxx
  Vectors
    xxxxx
  Tensors
    xxxxx

CELL data
  Scalars

Is it possible to:
  (a) Have more than 2 types (scalars/vectors) under POINT data?
  (b) Have POINT and CELL data in the same file?

Thanks,

DQ

--
Dimitrios E. Kiousis

PhD Student
School of Engineering Sciences
(Continue reading)

Prabhu Ramachandran | 4 Jul 2006 12:34

Re: Point & Cell data

>>>>> "Dimitrios" == Dimitrios E Kiousis <dk <at> hallf.kth.se> writes:

    Dimitrios> POINT data Scalars xxxxx Vectors xxxxx Tensors xxxxx

    Dimitrios> CELL data Scalars

    Dimitrios> Is it possible to: (a) Have more than 2 types
    Dimitrios> (scalars/vectors) under POINT data?  (b) Have POINT and
    Dimitrios> CELL data in the same file?

Yes, you can do both (a) and (b).

cheers,
prabhu

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Michael Franklin | 4 Jul 2006 21:44
Picon

vtk header & data type

Hello All,

I am writing Python scripts which read-in byte data, with the purpose of visualizing using the Volume module.   Problem is, whenever I create the .vtk files, I end up with the following header:

# vtk DataFile Version 2.0
Data array
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 32 32 32
ORIGIN 0 0 0
SPACING 1 1 1
POINT_DATA 32768
SCALARS Data_array int 1
LOOKUP_TABLE default

Now the Volume module only works for data type "unsigned_char" or "unsigned_short".  Is there a way to set the line "SCALARS Data_array int 1" to read "SCALARS Data_array unsigned_char" within my script so I don't have to manually change the .vtk file or use the StructuredPointProbe?  Any help would be appreciated.

Michael Franklin
Claremont Grad. University

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
MayaVi-users mailing list
MayaVi-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mayavi-users
Prabhu Ramachandran | 5 Jul 2006 20:15

Re: vtk header & data type

>>>>> "Michael" == Michael Franklin <mbfranklin <at> gmail.com> writes:

    Michael> Hello All, I am writing Python scripts which read-in byte
    Michael> data, with the purpose of visualizing using the Volume
    Michael> module.  Problem is, whenever I create the .vtk files, I
    Michael> end up with the following header:
[...]
    Michael> Now the Volume module only works for data type
    Michael> "unsigned_char" or "unsigned_short".  Is there a way to
    Michael> set the line "SCALARS Data_array int 1" to read "SCALARS
    Michael> Data_array unsigned_char" within my script so I don't
    Michael> have to manually change the .vtk file or use the
    Michael> StructuredPointProbe?  Any help would be appreciated.

Given what you have written I assume that you are using pyvtk to
generate the files?  If that is the case, use a Numeric data array of
typecode 'b' or 'w' to get unsigned_char/unsigned_short in your
output.  I figured this out by reading the pyvtk sources.  Look in
pyvtk/common.py.

cheers,
prabhu

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Dimitrios E. Kiousis | 6 Jul 2006 14:42
Picon
Picon

Effective stress?

Hello MayaVi users,

I am exporting stresses from my FE computation and I use
POINTDATA
TENSOR stre float
s(11)  s(12)  s(13)
s(12)  s(22)  s(23)
s(13)  s(23)  s(33)

in my MayaVi file.

When I try to plot my results and use the filter ExtractTensorComp I get an
addition option "Effective Stress".

What is this exactly?

Thanks,

Dimitris

--
Dimitrios E. Kiousis

PhD Student
School of Engineering Sciences
KTH - Royal Institute of Technology

Tel.: +46 733 684025
E-post: dk <at> hallf.kth.se
Web: www.dqdev.net

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Picon

Re: Effective stress?

On Thursday 06 July 2006 13:42, Dimitrios E. Kiousis wrote:
....
>
> When I try to plot my results and use the filter ExtractTensorComp I get an
> addition option "Effective Stress".
>
> What is this exactly?
>

Accordig to the source (VTK/Graphics/vtkExtractTensorComponents.cxx)

     if ( this->ScalarMode == VTK_EXTRACT_EFFECTIVE_STRESS )
        {
        sx = tensor[0];
        sy = tensor[4];
        sz = tensor[8];
        txy = tensor[3];
        tyz = tensor[7];
        txz = tensor[6];

        s = sqrt (0.16666667 * ((sx-sy)*(sx-sy) + (sy-sz)*(sy-sz) +
                                (sz-sx)*(sz-sx) +
                                6.0*(txy*txy + tyz*tyz + txz*txz)));
        }

I think that this should correspond to the Von Mises effective stress. 
Does it?

Regards

ZP

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Les Clowney | 7 Jul 2006 04:09
Picon
Favicon

citation

Hi,
   Is there a publication to cite for referring to mayavi?

Regards,
Les

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Prabhu Ramachandran | 7 Jul 2006 10:03

Re: citation

>>>>> "Les" == Les Clowney <clowney.lester <at> aist.go.jp> writes:

    Les> Hi, Is there a publication to cite for referring to mayavi?

 http://mayavi.sourceforge.net/docs.html#articles 

has references you can use for mayavi1.  For MayaVi2 you can look at
the paper mentioned here: 

 https://svn.enthought.com/enthought/wiki/MayaVi

cheers,
prabhu

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Duncan Smith | 31 Jul 2006 19:46
Picon
Picon

Faulty installation / bug?

Hello,
      I installed the binary for VTK 5.0.1, but there were no Python
bindings.  So I uninstalled and tried to install from the source, but no
luck.  Eventually I just unzipped the files from
VTK-6.4.2-Python-2.4.1.zip (not a typo, this is the name of the file,
though I guess it should be 4.4.2) and got an apparently working
installation.  (I also installed ActiveTCL prior to this.)

I unzipped MayaVi-2.5.zip (not a typo) to my C drive and ran setup.py
install; everything seemed OK.

All the tests in test_vtk.py seem to pass.

But if I try the following (more or less copied directly from the
documentation) I have a problem.

>>> import Tkinter
>>> r = Tkinter.Tk()
>>> r.withdraw()
''
>>> import mayavi
>>> v = mayavi.Main.MayaViTkGUI(r)
>>> v.load_visualization('c:\MayaVi-1.5\examples\heart.mv')

The window hangs until I restart the shell.

A little editing allows me to get a traceback,

Traceback (most recent call last):
  File "<pyshell#5>", line 1, in -toplevel-
    v.load_visualization('c:\MayaVi-1.5\examples\heart.mv')
  File "C:\Python24\lib\site-packages\mayavi\Main.py", line 1847, in
load_visualization
    self.mayavi.load_visualization (file_name)
  File "C:\Python24\lib\site-packages\mayavi\Main.py", line 844, in
load_visualization
    exception ()
  File "C:\Python24\lib\site-packages\mayavi\Main.py", line 832, in
load_visualization
    dvm.load_config (file)
  File "C:\Python24\Lib\site-packages\mayavi\Base\DataVizManager.py",
line 164, in load_config
    self.mod_mgr[self.cur_mm_name].load_config (file)
  File "C:\Python24\Lib\site-packages\mayavi\Base\ModuleManager.py",
line 370, in load_config
    self.scalar_lut_h.load_config (file)
  File "C:\Python24\lib\site-packages\mayavi\Misc\LutHandler.py", line
255, in load_config
    lut_v, r_on, v_r_on, v_d_r = eval (val)
  File "<string>", line 0, in -toplevel-
NameError: name 't' is not defined

although the line numbers will be a little out due to a few print
statements that I added.

It seems that 'val' is a string (the end of the line in heart.mv
containing 'custom16.lut\n').  Any clue whether this is a problem with
my installation, or something else?  BTW, executing MayaVi.pyw from
C:\Python\Scripts does not open a window, and C:\MayaVi-1.5\mayavi has
not been renamed (which I expected after glancing at setup.py).  Any
help much appreciated.

Duncan Smith

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Prabhu Ramachandran | 31 Jul 2006 21:08
Picon
Gravatar

Re: Faulty installation / bug?

>>>>> "Duncan" == Duncan Smith <buzzard <at> urubu.freeserve.co.uk> writes:

    Duncan> Hello, I installed the binary for VTK 5.0.1, but there
    Duncan> were no Python bindings.  So I uninstalled and tried to
    Duncan> install from the source, but no luck.  Eventually I just
    Duncan> unzipped the files from VTK-6.4.2-Python-2.4.1.zip (not a
    Duncan> typo, this is the name of the file, though I guess it
    Duncan> should be 4.4.2) and got an apparently working
    Duncan> installation.  (I also installed ActiveTCL prior to this.)

Easiest way to get it installed is to install the latest Enthought
Python edition:

        http://code.enthought.com

    Duncan> I unzipped MayaVi-2.5.zip (not a typo) to my C drive and
    Duncan> ran setup.py install; everything seemed OK.

Well, I don't understand the typos because there isn't a
VTK-6.4.2*.zip that I know of nor is there a MayaVi-2.5.zip.  OTOH if
you do have one of those handy time machines I'd like a copy of the
2.5 release. ;-)

    >>>> v.load_visualization('c:\MayaVi-1.5\examples\heart.mv')

    Duncan> The window hangs until I restart the shell.

    Duncan> "C:\Python24\lib\site-packages\mayavi\Misc\LutHandler.py",
    Duncan> line 255, in load_config lut_v, r_on, v_r_on, v_d_r = eval
    Duncan> (val) File "<string>", line 0, in -toplevel- NameError:
    Duncan> name 't' is not defined

    Duncan> although the line numbers will be a little out due to a
    Duncan> few print statements that I added.
    Duncan> It seems that 'val' is a string (the end of the line in
    Duncan> heart.mv containing 'custom16.lut\n').  Any clue whether
    Duncan> this is a problem with my installation, or something else?

Does the heart.mv file have unix line endings?  If so you will need to
convert it to a Windows line ending.  I used to use the lfcr.py script
that is usually part of a Python install.  It used to be available in
the Enthought Python edition in Tools/Scripts.

    Duncan> BTW, executing MayaVi.pyw from C:\Python\Scripts does not

I am not sure why this is the case.  Are there any error messages?

    Duncan> open a window, and C:\MayaVi-1.5\mayavi has not been
    Duncan> renamed (which I expected after glancing at setup.py).
    Duncan> Any help much appreciated.

C:\MayaVi-1.5\mayavi will not be renamed the installed MayaVi.pyw *is*
the renamed mayavi.

cheers,
prabhu

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Gmane