Prabhu Ramachandran | 1 Sep 2007 20:56
Picon
Gravatar

Re: [MayaVi-users] Threshold filter with timeseries

>>>>> "Luis" == Luis Armendariz <luis@...> writes:

    Luis> It seems that in Mayavi, the lower and upper thresholds
    Luis> reset to a different range when stepping through a
    Luis> timeseries, which is quite annoying.  I realize that this
    Luis> happens because the range of values changes from step to
    Luis> step, but it'd still be nice to have the option of stepping
    Luis> through a fixed threshold range.

    Luis> I've added two checkboxes to the Threshold class so I can
    Luis> control which of the upper/lower thresholds to fix. Mostly,

I've incorporated this and a feature that Fred asked for (thresholding
on cells and points) into the Threshold filter please check it and let
me know if it works OK.  Many thanks for the patch.

regards,
prabhu
Tim Bond | 13 Sep 2007 18:07
Picon

Colormap scaling

Hullo,

I wonder if someone could help me out?

I'm having trouble figuring out how to set a custom scale
on a colormap in Mayavi2. I'm reading in an unstructured
grid and plotting a scalar cut plane with warping, viz:

http://amcg.ese.ic.ac.uk/~tmb1/scalarvertscutwarp.png

The warping works nicely to pick out the scalar field
details, but the colormap is scaling to the entire scalar
dataset (which lower in the mesh has much greater range
than at the top of the mesh) hence showing minimal detail
at my cut.

What I'd like to do is to reset the colormap scale such 
that it is somewhere near the minimum and maximum of my cut
plane, not the minimum and maximum of the whole field.

Having worked through the source it looks like I can do
this by changing vmin and vmax, but I can't figure out what
they are traits of and thus I'm stumped as to how I would
do this working from the python command line in Mayavi2.

Any suggestions much appreciated!

Thanks,

Tim
(Continue reading)

Prabhu Ramachandran | 16 Sep 2007 13:42
Picon
Gravatar

Re: Multi-block plot3d

>>>>> "Praveen" == Praveen C <cpraveen <at> gmail.com> writes:

    Praveen> I am using Mayavi 1.5 to visualize a multiblock plot3d
    Praveen> file. I can visualize one block at a time which is better
    Praveen> than nothing. I have a small annoying problem with block
    Praveen> selection. Say I select to visualize block 3 using
    Praveen> "Configure Data". Thats fine. But if I again click on
    Praveen> "Configure Data" button, the block number is reset to
    Praveen> 1. I have been looking at the Mayavi code to figure out
    Praveen> how to fix this but cant understand it.  praveen

Sorry about the delayed response.  The relevant code is in
Sources/PLOT3DReader.py:

    286         if self.multi:
    287             self.slider = Tkinter.Scale (frame,
    288                                          label="Set Block Number",
    289                                          orient='horizontal', from_=1,
    290                                          to=self.n_blocks,
    291                                          command=self.change_block)
    292             self.slider.grid (row=rw, column=0, columnspan=2, padx=2,
    293                               pady=2,sticky='ew')
    294             self.slider.bind ("<ButtonRelease>", self.change_block )
    295             rw = rw + 1

You need to set the value of the slider to self.cur_block using
self.slider.set(self.cur_block).  

I've attached a patched file, let me know if it fixes the problem.  I
don't have a multiblock dataset to test with.  BTW, if you can send me
(Continue reading)

Paul Morrow | 18 Sep 2007 17:20
Picon
Favicon

MayaVi question: opening vtk files generated by ovf2vtk

Hi,

my name is Paul Morrow, and I am a graduate student in the physics 
department at Rensselaer Polytechnic Institute in Troy, NY, USA. I have 
been using the Nist-provided OOMMF micromagnetics software to generate 
.omf files, and I would like to convert (via ovf2vtk) and view them in 
MayaVI, but I have been having trouble getting this to work.

I followed the directions on the website 
(http://www.soton.ac.uk/~fangohr/software/ovf2vtk.html#Download) for 
"Enthought distribution of Python", PyVTK, and ovf2vtk (for Windows). 
Then, I ran (successfully, I think) ovf2vtk to convert the sample 
"cantedvortex.omf" file to .vtk format. Though the installation notes 
say that MayaVi is installed with the "Enthought distribution", I 
couldn't find it in my Start menu, so I installed it manually (v1.5 from 
http://mayavi.sourceforge.net/). I was able to open the example 
"heart.vk" (and "heart.mv") in MayaVi with no problems, but when I open 
"cantedvortex.vtk", it doesn't look like any of the visualizations are 
working (i.e., I cannot see any of the data). When I try to use MayaVi 
to open "cantedvortex.mv" directly, I get this error:

Exception: C:\user\prabhu\MayaVi-1.5\Misc\LutHandler.py:242:SyntaxError: 
invalid syntax (Line 1) (in load config)

I do not understand why the Mayavi example files (.vtk and .mv) will 
open, but the sample files from the ovf2vtk site will not. If you have 
any suggestions, I would be very grateful. If you need any other 
information or if something is not clear please let me know.

Thank you for your time,
(Continue reading)

fred | 18 Sep 2007 20:48
Picon

Re: MayaVi question: opening vtk files generated by ovf2vtk

Paul Morrow a écrit :
> Hi,
>
> my name is Paul Morrow, and I am a graduate student in the physics 
> department at Rensselaer Polytechnic Institute in Troy, NY, USA. I have 
> been using the Nist-provided OOMMF micromagnetics software to generate 
> .omf files, and I would like to convert (via ovf2vtk) and view them in 
> MayaVI, but I have been having trouble getting this to work.
>   
Hi,

Can we have a look at your VTK file ?

--

-- 
http://scipy.org/FredericPetit

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Hans Fangohr | 18 Sep 2007 20:52
Picon

Re: MayaVi question: opening vtk files generated by ovf2vtk

Hi Paul,

> my name is Paul Morrow, and I am a graduate student in the physics
> department at Rensselaer Polytechnic Institute in Troy, NY, USA. I  
> have
> been using the Nist-provided OOMMF micromagnetics software to generate
> .omf files, and I would like to convert (via ovf2vtk) and view them in
> MayaVI, but I have been having trouble getting this to work.
>
> I followed the directions on the website
> (http://www.soton.ac.uk/~fangohr/software/ovf2vtk.html#Download) for
> "Enthought distribution of Python", PyVTK, and ovf2vtk (for Windows).
> Then, I ran (successfully, I think) ovf2vtk to convert the sample
> "cantedvortex.omf" file to .vtk format. Though the installation notes
> say that MayaVi is installed with the "Enthought distribution", I
> couldn't find it in my Start menu, so I installed it manually (v1.5  
> from
> http://mayavi.sourceforge.net/). I was able to open the example
> "heart.vk" (and "heart.mv") in MayaVi with no problems, but when I  
> open
> "cantedvortex.vtk", it doesn't look like any of the visualizations are
> working (i.e., I cannot see any of the data). When I try to use MayaVi
> to open "cantedvortex.mv" directly, I get this error:
>
> Exception: C:\user\prabhu\MayaVi-1.5\Misc\LutHandler.py: 
> 242:SyntaxError:
> invalid syntax (Line 1) (in load config)

Sorry for not getting back to you earlier.

(Continue reading)

Hans Fangohr | 19 Sep 2007 12:07
Picon

Re: MayaVi question: opening vtk files generated by ovf2vtk

Hi Paul,

>> my name is Paul Morrow, and I am a graduate student in the physics
>> department at Rensselaer Polytechnic Institute in Troy, NY, USA. I have
>> been using the Nist-provided OOMMF micromagnetics software to generate
>> .omf files, and I would like to convert (via ovf2vtk) and view them in
>> MayaVI, but I have been having trouble getting this to work.
>> 
>> I followed the directions on the website
>> (http://www.soton.ac.uk/~fangohr/software/ovf2vtk.html#Download) for
>> "Enthought distribution of Python", PyVTK, and ovf2vtk (for Windows).
>> Then, I ran (successfully, I think) ovf2vtk to convert the sample
>> "cantedvortex.omf" file to .vtk format. Though the installation notes
>> say that MayaVi is installed with the "Enthought distribution", I
>> couldn't find it in my Start menu, so I installed it manually (v1.5 from
>> http://mayavi.sourceforge.net/). I was able to open the example
>> "heart.vk" (and "heart.mv") in MayaVi with no problems, but when I open
>> "cantedvortex.vtk", it doesn't look like any of the visualizations are
>> working (i.e., I cannot see any of the data). When I try to use MayaVi
>> to open "cantedvortex.mv" directly, I get this error:
>> 
>> Exception: C:\user\prabhu\MayaVi-1.5\Misc\LutHandler.py:242:SyntaxError:
>> invalid syntax (Line 1) (in load config)
>
> Sorry for not getting back to you earlier.
>
> I suspect that I created the mv file with an older version of MayaVi so that 
> you couldn't read it but didn't have time to test this. (Or the mv file is 
> just broken).
>
(Continue reading)

Prabhu Ramachandran | 19 Sep 2007 15:02
Picon
Gravatar

Re: MayaVi question: opening vtk files generated by ovf2vtk

>>>>> "Hans" == Hans Fangohr <h.fangohr <at> soton.ac.uk> writes:

    >>> Exception:
    >>> C:\user\prabhu\MayaVi-1.5\Misc\LutHandler.py:242:SyntaxError:
    >>> invalid syntax (Line 1) (in load config)
    >>  Sorry for not getting back to you earlier.
    >> 
    >> I suspect that I created the mv file with an older version of
    >> MayaVi so that you couldn't read it but didn't have time to
    >> test this. (Or the mv file is just broken).
    >> 
    >> In any case, once you have loaded the cantedvortex.vtk into
    >> MayaVi (and you see nothing, that is normal), try to click on
    >> Modules->Velocity Vector. Do you see something now?

    Hans> in reply to my own email, some more details:

    Hans> I have now tested the file you mention
    Hans> (http://www.soton.ac.uk/~fangohr/software/ovf2vtk/example/cantedvortex.mv)
    Hans> and it loads fine with MayaVi 1.5 (on Debian Linux,
    Hans> stable=etch).

    Hans> Prabhu, can this have somehing to do with the fact that Paul
    Hans> runs this on Windows? It is probably not very important for
    Hans> him (as Paul now knows how to create visualisations from the
    Hans> vtk file directly), but it is still strange that this mv
    Hans> file seems not to work on Windows but on Linux.

Ahh, thanks for asking.  I've seen this error before.  I think the
.mv2 file has line ending conversion problems!  They should all be
(Continue reading)

Hans Fangohr | 19 Sep 2007 16:43
Picon

Re: MayaVi question: opening vtk files generated by ovf2vtk

Hi Paul and Prabhu,

>>>>>> "Hans" == Hans Fangohr <h.fangohr <at> soton.ac.uk> writes:
>
>    >>> Exception:
>    >>> C:\user\prabhu\MayaVi-1.5\Misc\LutHandler.py:242:SyntaxError:
>    >>> invalid syntax (Line 1) (in load config)
>    >>  Sorry for not getting back to you earlier.
>    >>
>    >> I suspect that I created the mv file with an older version of
>    >> MayaVi so that you couldn't read it but didn't have time to
>    >> test this. (Or the mv file is just broken).
>    >>
>    >> In any case, once you have loaded the cantedvortex.vtk into
>    >> MayaVi (and you see nothing, that is normal), try to click on
>    >> Modules->Velocity Vector. Do you see something now?
>
>    Hans> in reply to my own email, some more details:
>
>    Hans> I have now tested the file you mention
>    Hans> (http://www.soton.ac.uk/~fangohr/software/ovf2vtk/example/cantedvortex.mv)
>    Hans> and it loads fine with MayaVi 1.5 (on Debian Linux,
>    Hans> stable=etch).
>
>    Hans> Prabhu, can this have somehing to do with the fact that Paul
>    Hans> runs this on Windows? It is probably not very important for
>    Hans> him (as Paul now knows how to create visualisations from the
>    Hans> vtk file directly), but it is still strange that this mv
>    Hans> file seems not to work on Windows but on Linux.
>
(Continue reading)

Prabhu Ramachandran | 19 Sep 2007 21:06
Picon
Gravatar

Re: Colormap scaling

>>>>> "Tim" == Tim Bond <timothy.bond <at> imperial.ac.uk> writes:

    Tim> Hullo, I wonder if someone could help me out?

I'll try.  Sorry for the delayed response.

    Tim> I'm having trouble figuring out how to set a custom scale on
    Tim> a colormap in Mayavi2. I'm reading in an unstructured grid
    Tim> and plotting a scalar cut plane with warping, viz:

    Tim> http://amcg.ese.ic.ac.uk/~tmb1/scalarvertscutwarp.png

    Tim> The warping works nicely to pick out the scalar field
    Tim> details, but the colormap is scaling to the entire scalar
    Tim> dataset (which lower in the mesh has much greater range than
    Tim> at the top of the mesh) hence showing minimal detail at my
    Tim> cut.

You could set the data range to something more relevant.  The only
difficulty in that case is that anything outside the range you specify
will be rendered with the same colour.

    Tim> What I'd like to do is to reset the colormap scale such that
    Tim> it is somewhere near the minimum and maximum of my cut plane,
    Tim> not the minimum and maximum of the whole field.

Yes, you can do that.  Just go to the "Modules" node on the tree view
deselect the use default range and specify the range you need.  This
should do the trick.

(Continue reading)


Gmane