[vtkusers] Adding VTK/Tcl modules in 3d slicer

Vidya Setlur vidya at cs.northwestern.edu
Fri Feb 27 17:31:08 EST 2004


Hi,

Has anyone added customized modules to the Brigham and Women's
hospital's 3D slicer? I'm new to VTK and Tcl, and have been having some
trouble in understanding how this works. Basically the instructions tell
me to add
Header and source files to a directory cxx, and the tcl code to a Tcl
directory for the module. Now this is my basic problem...

Now is the VTK classes incorporated in the source code? Then what is the
Tcl code for? I'm assuming its for GUI operations. But I don't find any
correlation between the Tcl and c++ source code in the sample file?

Could anyone help me with all my confusion? Also, is there any good
resource to explain VTK/Tcl in an easy and intuitive manner?

Thanks,

-vidya



-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of vtkusers-request at vtk.org
Sent: Friday, February 27, 2004 1:57 PM
To: vtkusers at vtk.org
Subject: vtkusers digest, Vol 1 #2426 - 15 msgs

Send vtkusers mailing list submissions to
	vtkusers at vtk.org

To subscribe or unsubscribe via the World Wide Web, visit
	http://www.vtk.org/mailman/listinfo/vtkusers
or, via email, send a message with subject or body 'help' to
	vtkusers-request at vtk.org

You can reach the person managing the list at
	vtkusers-admin at vtk.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of vtkusers digest..."


Today's Topics:

   1. delnytriangulation.GetPoints Java Crash (Gearoid P Lydon)
   2. Re: RenderWindowInteractor on Mac OS X (Dr. Daniel James White
PhD)
   3. Re: Re: RenderWindowInteractor on Mac OS X (Markus)
   4. Getting an actor from vtkPicker (Wiebke Timm)
   5. getting mouse co-ordinates (=?iso-8859-1?q?megha=20agarwal?=)
   6. Virtual endoscopy (Henkjan Huisman)
   7. Re: delnytriangulation.GetPoints Java Crash (Ramakrishna
Shyamprakash)
   8. Re: Re: RenderWindowInteractor on Mac OS X (Chris Scharver)
   9. Re: Getting an actor from vtkPicker (Malcolm Drummond)
  10. vtkImageIterator - feature request? (Dean Inglis)
  11. Newbie: Load vtk formatted file into OpenGL (Ned Lowe)
  12. vtkImage > Data / MapToColors / Cast / Actor.. (Edward Pham)
  13. Re: Getting an actor from vtkPicker (Wiebke Timm)
  14. adding vtkMarchingCubes to vtk build (Vetria Byrd)
  15. RE: vtkImage > Data / MapToColors / Cast / Actor.. (Edward Pham)

--__--__--

Message: 1
From: "Gearoid P Lydon" <g.lydon at mars.ucc.ie>
To: <vtkusers at vtk.org>
Date: Fri, 27 Feb 2004 11:38:16 -0000
Subject: [vtkusers] delnytriangulation.GetPoints Java Crash

Dear Vtkusers,

I'm using Vtk v4.0 with Java on an application which uses vtkDelaunay.
The
problem occurs when I use delnytriangulation.GetPoints. The program
crashes.
Has anyone had a similar problem?

Error Report:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at
PC=0x1C81E126
Function=Java_vtk_vtkPointSet_GetPoints_113+0x16
Library=C:\Program Files\vtk40\bin\vtkCommonJava.dll
Current Java thread:
	at vtk.vtkPointSet.GetPoints_13(Native Method)
	at vtk.vtkPointSet.GetPoints(vtkPointSet.java:64)
Heap at VM Abort:
   the space 1408K,  52% used [0x104f0000, 0x105a7dd8, 0x105a7e00,
0x10650000)
 compacting perm gen  total 7424K, used 7314K [0x14010000, 0x14750000,
0x18010000)
   the space 7424K,  98% used [0x14010000, 0x14734b60, 0x14734c00,
0x14750000)
# The exception above was detected in native code outside the VM
# Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)

Best Regards

Gearóid Lydon

Informatics Research Unit for Sustainable Engineering
Department of Civil Engineering
University College Cork
College Road
Cork
Ireland

Tel: 353 (0) 21 4902913
Fax: 353 (0) 21 4276648
Web Page: http://www.ucc.ie/iruse/gplydon.html


--__--__--

Message: 2
From: "Dr. Daniel James White PhD" <dan at chalkie.org.uk>
Date: Fri, 27 Feb 2004 13:48:16 +0200
To: vtkusers at vtk.org
Subject: [vtkusers] Re: RenderWindowInteractor on Mac OS X

hi Markus,

Strangely,

using the aqua tck/Tk batteries included framework
in my installation of vtk
the middle button and right button behaviors are swapped compared to=20
linux....

On osx middle scales/zooms and right translates the image...

Dan

> _--__--
>
> Message: 2
> From: Markus <duke123 at gmx.net>
> Date: Fri, 27 Feb 2004 09:09:38 +0100
> To: vtkusers at vtk.org
> Subject: [vtkusers] RenderWindowInteractor on Mac OS X
>
>
> Hey guys!
>
> I have just ported my VTK app from Linux to Mac OS 10.3.2. Everything
> compiled fine, but the RenderWindowInteractor does not react to
> keyboard events anymore. The left mouse button works (rotation of
> camera), but the right mouse button (or ctrl + left) doesn't zoom the
> camera.
>
> Any ideas ?
>
> Thanks,
>
> Markus
>
>
Dr. Daniel James White BSc. (Hons.) PhD
Cell Biology
Department of biological and environmental science
PO Box  35
University of Jyv=E4skyl=E4
Jyv=E4skyl=E4 FIN 40014
Finland
+358 (0)14 260 4183 (work)
+358 (0)414740463 (mob)

http://www.chalkie.org.uk
dan at chalkie.org.uk
white at cc.jyu.fi


--__--__--

Message: 3
Cc: vtkusers at vtk.org
From: Markus <duke123 at gmx.net>
Subject: Re: [vtkusers] Re: RenderWindowInteractor on Mac OS X
Date: Fri, 27 Feb 2004 13:23:02 +0100
To: "Dr. Daniel James White PhD" <dan at chalkie.org.uk>

Hi Dan!


> the middle button and right button behaviors are swapped compared to 
> linux....
>
> On osx middle scales/zooms and right translates the image...

I had an Expose function on my middle mouse button, but after changing 
that,
the middle button indeed translates the image, and the right button does
nothing at all :(   And still no keyboard events.

Markus


--__--__--

Message: 4
To: vtkusers at vtk.org
From: Wiebke Timm <wiebke.timm at uni-bielefeld.de>
Date: Fri, 27 Feb 2004 13:25:36 +0100
Subject: [vtkusers] Getting an actor from vtkPicker

Hi!

I'm trying to pick an Object which is drawn by a renderer using the 
vtkqt libraries. The setup looks like this:


    // create VtkQt widget
    ren = vtkRenderer::New();
    renwin = vtkRenderWindow::New();
    iren = vtkRenderWindowInteractor::New();
    vtkPicker* ppick = vtkPicker::New();

    iren->SetPicker(ppick);
    renwin->AddRenderer(ren);
    renwin->SetInteractor(iren);

    // instead of iren->Start()
    vtkQtObjectFactory::SetQtBase(f,NULL);
    renwin->Start();

    ren->AddActor(fishact);
    ren->AddActor(fishact2);
    ren->SetBackground(1,1,1);


fishact and fishact2 are vtkMyActor objects. vtkMyActor extends 
vtkActor by introducing an id value (which will help assigning actors 
to the objects which created them lateron).

When a button is pressed in the qt gui, the following code is executed:

vtkActorCollection* ac = ((vtkPicker*)(iren->GetPicker()))->GetActors();
    if(ac != NULL) {
       cout << "got actor collection:" << endl;
       ac->PrintSelf(cout,3);
       cout << endl;
       vtkProp* prop = ac->GetNextActor();
       if(prop != NULL) {
           cout << "fnord" << endl;
       }
}


The resulting output is

got actor collection:
    Debug: Off
    Modified Time: 2451
    Reference Count: 1
    Registered Events: (none)
    Number Of Items: 1


But that's it. No "fnord" is printed. That's what I don't understand: 
The actor collection obviously has one item because of "Number Of 
Items: 1". But GetNextActor() returns NULL!

Any ideas would be greatly appreciated!


Also I'm not sure if I have to set the picker (iren->SetPicker()) for 
the RenderInteractor because it should have one by itself. But I get a 
segfault in the code that is executed by the button when I don't set a 
picker...

Are there any Problems with extending vtkActor...?

Thanks!
    Wiebke


--__--__--

Message: 5
Date: Fri, 27 Feb 2004 13:25:12 +0000 (GMT)
From: =?iso-8859-1?q?megha=20agarwal?= <megha_agar at yahoo.co.in>
To: vtkusers at vtk.org
Subject: [vtkusers] getting mouse co-ordinates

--0-970004223-1077888312=:13684
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Dear vtk users
how do i get the mouse coordinates in the render window.
I have tried using  
          iren->GetMousePosition(&x,&y)
but it does not work
Please suggest
 
megha

Yahoo! India Insurance Special: Be informed on the best policies,
services, tools and more.
--0-970004223-1077888312=:13684
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV>Dear vtk users</DIV>
<DIV>how do i get the mouse coordinates in the render window.</DIV>
<DIV>I have tried using&nbsp; </DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
iren-&gt;GetMousePosition(&amp;x,&amp;y)</DIV>
<DIV>but it does not work</DIV>
<DIV>Please suggest</DIV>
<DIV>&nbsp;</DIV>
<DIV>megha</DIV><p><font face=arial size=-1>
<a
href="http://in.rd.yahoo.com/specials/mailtag/*http://in.insurance.yahoo
.com/licspecial/index.html" target="_blank"><b>Yahoo! India Insurance
Special</a>:</b> Be informed on the best policies, services, tools and
more.</font>
--0-970004223-1077888312=:13684--

--__--__--

Message: 6
From: Henkjan Huisman <h.huisman at rad.umcn.nl>
To: vtkusers <vtkusers at vtk.org>
Date: Fri, 27 Feb 2004 14:55:45 +0100
Subject: [vtkusers] Virtual endoscopy

Hi,

Is there a virtual endoscopy tool out there that is available for test
driving? We have good CT's, patients, enthousiast radiologists, but not
the proper tools. I have sufficient expertise in VTK (and ITK) to get a
work in progress thing operational. 

Thanks,

-- 
Henkjan

 ------------------------------------------------------------- 
|H.J. Huisman, PhD, MSEE       E : h.huisman at rad.umcn.nl      |
|Biomedical Physicist          T : +31 24 3617536/14545       |
|Dept. Radiology               F : +31 24 3540866             |
|UMC St. Radboud               S : 430 Radiologie/POBox 9101/ | 
|                                  6500HB Nijmegen/Netherlands|
 -------------------------------------------------------------


--__--__--

Message: 7
Date: Fri, 27 Feb 2004 19:53:17 +0530
From: "Ramakrishna Shyamprakash" <ramakrishna.prakash at quest-global.com>
To: "Gearoid P Lydon" <g.lydon at mars.ucc.ie>, vtkusers at vtk.org
Subject: Re: [vtkusers] delnytriangulation.GetPoints Java Crash

I have had enough of these crashes. check if the point id argument that 
you are passing to GetPoints method is less than the actual number of 
points in the dataset. even then, once in 100 times, it crashes for me.
I 
don't understand what exactly is going wrong.

--Shyam

-----Original Message-----
From: "Gearoid P Lydon" <g.lydon at mars.ucc.ie>
To: <vtkusers at vtk.org>
Date: Fri, 27 Feb 2004 11:38:16 -0000
Subject: [vtkusers] delnytriangulation.GetPoints Java Crash

> Dear Vtkusers,
> 
> I'm using Vtk v4.0 with Java on an application which uses vtkDelaunay.
> The
> problem occurs when I use delnytriangulation.GetPoints. The program
> crashes.
> Has anyone had a similar problem?
> 
> Error Report:
> An unexpected exception has been detected in native code outside the
> VM.
> Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred
at
> PC=0x1C81E126
> Function=Java_vtk_vtkPointSet_GetPoints_113+0x16
> Library=C:\Program Files\vtk40\bin\vtkCommonJava.dll
> Current Java thread:
> 	at vtk.vtkPointSet.GetPoints_13(Native Method)
> 	at vtk.vtkPointSet.GetPoints(vtkPointSet.java:64)
> Heap at VM Abort:
>    the space 1408K,  52% used [0x104f0000, 0x105a7dd8, 0x105a7e00,
> 0x10650000)
>  compacting perm gen  total 7424K, used 7314K [0x14010000, 0x14750000,
> 0x18010000)
>    the space 7424K,  98% used [0x14010000, 0x14734b60, 0x14734c00,
> 0x14750000)
> # The exception above was detected in native code outside the VM
> # Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)
> 
> Best Regards
> 
> Gearóid Lydon
> 
> Informatics Research Unit for Sustainable Engineering
> Department of Civil Engineering
> University College Cork
> College Road
> Cork
> Ireland
> 
> Tel: 353 (0) 21 4902913
> Fax: 353 (0) 21 4276648
> Web Page: http://www.ucc.ie/iruse/gplydon.html
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at:
> <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers


--__--__--

Message: 8
Cc: vtkusers at vtk.org,
	"Dr. Daniel James White PhD" <dan at chalkie.org.uk>
From: Chris Scharver <scharver at evl.uic.edu>
Subject: Re: [vtkusers] Re: RenderWindowInteractor on Mac OS X
Date: Fri, 27 Feb 2004 08:42:59 -0600
To: Markus <duke123 at gmx.net>

On Feb 27, 2004, at 6:23 AM, Markus wrote:

> I had an Expose function on my middle mouse button, but after changing

> that,
> the middle button indeed translates the image, and the right button 
> does
> nothing at all :(   And still no keyboard events.

You need to do one of two things to get your executable to properly 
register with the MacOS X window manager:

1) Add a resource fork to the file using the command "Rez Carbon.r -o 
foo". This will add some resources to your file, but note that this 
means that you now have a unique MacOS X file. You cannot back it up 
with tar or zip without losing information. Resource forks are 
depreciated in the current MacOS in favor of...

2) Package your executable within a MacOS X application package:
mkdir -p foo.app/Contents/MacOS
cp foo foo.app/Contents/MacOS

I usually use #1 during testing since it's the quickest and easiest, 
and then I use #2 when I need to provide an application to somebody 
else.

Chris
--
Chris Scharver
Electronic Visualization Laboratory
The University of Illinois at Chicago
Ph: 312-996-3002   FAX: 312-413-7585
<http://www.evl.uic.edu/scharver/>


--__--__--

Message: 9
From: "Malcolm Drummond" <malcolm at geovision.co.za>
To: "vtkusers" <vtkusers at vtk.org>
Subject: Re: [vtkusers] Getting an actor from vtkPicker
Date: Fri, 27 Feb 2004 17:38:25 +0200
Organization: GeoVision cc

Hi

Try calling InitTraversal() to place you at the beginning of the
collection
before calling GetNextActor()

HTH
Malcolm

----- Original Message -----
From: "Wiebke Timm" <wiebke.timm at uni-bielefeld.de>
To: <vtkusers at vtk.org>
Sent: Friday, February 27, 2004 2:25 PM
Subject: [vtkusers] Getting an actor from vtkPicker


> Hi!
>
> I'm trying to pick an Object which is drawn by a renderer using the
> vtkqt libraries. The setup looks like this:
>
>
>     // create VtkQt widget
>     ren = vtkRenderer::New();
>     renwin = vtkRenderWindow::New();
>     iren = vtkRenderWindowInteractor::New();
>     vtkPicker* ppick = vtkPicker::New();
>
>     iren->SetPicker(ppick);
>     renwin->AddRenderer(ren);
>     renwin->SetInteractor(iren);
>
>     // instead of iren->Start()
>     vtkQtObjectFactory::SetQtBase(f,NULL);
>     renwin->Start();
>
>     ren->AddActor(fishact);
>     ren->AddActor(fishact2);
>     ren->SetBackground(1,1,1);
>
>
> fishact and fishact2 are vtkMyActor objects. vtkMyActor extends
> vtkActor by introducing an id value (which will help assigning actors
> to the objects which created them lateron).
>
> When a button is pressed in the qt gui, the following code is
executed:
>
> vtkActorCollection* ac =
((vtkPicker*)(iren->GetPicker()))->GetActors();
>     if(ac != NULL) {
>        cout << "got actor collection:" << endl;
>        ac->PrintSelf(cout,3);
>        cout << endl;
>        vtkProp* prop = ac->GetNextActor();
>        if(prop != NULL) {
>            cout << "fnord" << endl;
>        }
> }
>
>
> The resulting output is
>
> got actor collection:
>     Debug: Off
>     Modified Time: 2451
>     Reference Count: 1
>     Registered Events: (none)
>     Number Of Items: 1
>
>
> But that's it. No "fnord" is printed. That's what I don't understand:
> The actor collection obviously has one item because of "Number Of
> Items: 1". But GetNextActor() returns NULL!
>
> Any ideas would be greatly appreciated!
>
>
> Also I'm not sure if I have to set the picker (iren->SetPicker()) for
> the RenderInteractor because it should have one by itself. But I get a
> segfault in the code that is executed by the button when I don't set a
> picker...
>
> Are there any Problems with extending vtkActor...?
>
> Thanks!
>     Wiebke
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>


--__--__--

Message: 10
From: "Dean Inglis" <dean.inglis at camris.ca>
To: "vtkusers archive" <vtkusers at vtk.org>
Date: Fri, 27 Feb 2004 10:53:26 -0500
Subject: [vtkusers] vtkImageIterator - feature request?

I'm almost certain, but please correct me if I'm wrong,
that there is no way to reset a vtkImageIterator after
it has been used: e.g., 

  vtkImageIterator<T> inIt(inData, outExt);
  vtkImageIterator<T> outIt(outData, outExt);

  // copy input to output 
  while (!outIt.IsAtEnd())
    {
    T* inSI = inIt.BeginSpan();
    T* outSI = outIt.BeginSpan();
    T* outSIEnd = outIt.EndSpan();
    while (outSI != outSIEnd)
      {
      *outSI++ = *inSI++;
      }
    inIt.NextSpan();
    outIt.NextSpan();
    }

// further on ...

  // Loop through output pixels agian

// but this will never execute since after the first execution
//  outIt.IsAtEnd() always returns true


  while (!outIt.IsAtEnd())  
    {
    T* outSI = outIt.BeginSpan();
    T* outSIEnd = outIt.EndSpan();
    while (outSI != outSIEnd)
      {
      if(*outSI == processed)
        {   
        *outSI = outValue;
        }  
      outSI++; 
      }
    outIt.NextSpan();
    }

Can such a feature be implemented?

Dean



 


--__--__--

Message: 11
From: "Ned Lowe" <ned.lowe at talk21.com>
To: <vtkusers at vtk.org>
Date: Fri, 27 Feb 2004 16:28:51 -0000
Subject: [vtkusers] Newbie: Load vtk formatted file into OpenGL

Hi,

Probably a really dumb question - apologies in advance.

I have a vtk formatted file:

# vtk DataFile Version 3.0
Somebody's face
ASCII
DATASET POLYDATA
POINTS 26460 float
0 -0.2048 -0.090616 0 -0.204 -0.090824 0 -0.2032 -0.09104 
0 -0.2024 -0.091256 0 -0.2016 -0.091464 0 -0.2008 -0.09168


Etc etc etc

I am writing an OpenGL application which has to load that vtk file so it
can then be manipulated.

Can anyone give me any hints as to how I would achieve this?

Thanks a lot,
Ned Lowe


--__--__--

Message: 12
From: "Edward Pham" <lost_bits1110 at hotmail.com>
To: vtkusers at vtk.org
Date: Fri, 27 Feb 2004 16:55:17 +0000
Subject: [vtkusers] vtkImage > Data / MapToColors / Cast / Actor..

Hi
I'm trying to create a noisy background using vtkImageData (i've used
the 
gaussian distribution to create this)  Its a 2D image along x and z

Below are some details of my code (its not that long, it just seems long
but 
its quite straightforward):
I used vtkImageMapToColors and vtkImageCast (because my scalars aer of
type 
float not unsigned char)

So all I see is black on my screen...!  :o(
what could i be missing? any ideas..??
thanks in advance...
Ed

------------------------------------------------------------------------
---------------------------------------------------------------

  int offset, iOffset, kOffset, gaussLimit;
  float scalarRange[2] = {VTK_LARGE_FLOAT,-VTK_LARGE_FLOAT};
float x, y, z, gauss, sigmaSquared, sigma;

  NoiseData = vtkImageData::New();
  NoiseFloatArray = vtkFloatArray::New();
  NoiseLookupTable = vtkLookupTable::New();
  ImageMapToColors = vtkImageMapToColors::New();
  ImageCast = vtkImageCast::New();
  ConvertedNoiseData = vtkImageData::New();

NoiseData->SetDimensions( 50, 1, 50 );
NoiseData->SetOrigin(0, 1, 0);
NoiseData->SetSpacing( 1, 1, 1 );
NoiseData->SetScalarType(VTK_FLOAT);

for ( int k=0; k < noiseDimZ; k++ )
{
	z = sigma*Randomize()*gaussLimit;
	kOffset = k*noiseDimZ*noiseDimY;

	for ( int i=0; i < noiseDimX; i++ )
	{
		x = sigma*Randomize()*gaussLimit;        //Randomize
generates a random 
number b/w -1 & 1
		gauss = exp(-0.5*((x*x + z*z)/(sigmaSquared)));

		if (gauss<scalarRange[0])
			scalarRange[0] = gauss;
		if (gauss>scalarRange[1])
			scalarRange[1] = gauss;

		offset = i + kOffset;
		NoiseFloatArray->InsertTuple1(  offset, gauss );
	}
}

        NoiseData->GetPointData()->SetScalars( NoiseFloatArray );
	NoiseLookupTable->SetAlphaRange(0,1);
	NoiseLookupTable->SetHueRange(0, 0);
	NoiseLookupTable->SetNumberOfColors(256);
	NoiseLookupTable->SetSaturationRange(0, 1);
	NoiseLookupTable->SetValueRange(0, 1);
	NoiseLookupTable->SetTableRange(scalarRange);
	NoiseLookupTable->Build();

	ImageCast->SetInput( NoiseData );
	ImageCast->SetOutputScalarTypeToUnsignedChar();

	ImageMapToColors->SetInput(ImageCast->GetOutput());
	ImageMapToColors->SetLookupTable(NoiseLookupTable);

//	NoiseData->Modified();
//	ImageMapToColors->Update();
	NoiseActor->SetInput(ImageMapToColors->GetOutput());

	Ren1->AddActor( NoiseActor );
        RenWin->AddRenderer( Ren1 );
       RenWin->SetInteractor(Iren);
       Iren->Initialize();
       Iren->Render();

_________________________________________________________________
Get fast, reliable access with MSN 9 Dial-up. Click here for Special
Offer! 
http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/


--__--__--

Message: 13
From: Wiebke Timm <wiebke.timm at uni-bielefeld.de>
Subject: Re: [vtkusers] Getting an actor from vtkPicker
Date: Fri, 27 Feb 2004 19:07:23 +0100
To: vtkusers at vtk.org

Hi!

On 27.02.2004, at 16:38, Malcolm Drummond wrote:

> Try calling InitTraversal() to place you at the beginning of the 
> collection

That helped, thanks a lot!

It would be more easy to figure things out by oneself if there was some 
kind of explanation about that in the descriptions for 
GetNext<something>() so you don't have to read through all methods of 
every superclass for a class you use...

Ciao!
    Wiebke


--__--__--

Message: 14
Date: Fri, 27 Feb 2004 13:19:51 -0600 (CST)
From: Vetria Byrd <byrdv at cis.uab.edu>
To: vtkusers at vtk.org
Subject: [vtkusers] adding vtkMarchingCubes to vtk build

I have installed vtk on my WindowsXP laptop.
Since vtkMarchingCubes is not included in the binary build, how do I add
it?

Thanks,
Vetria


--__--__--

Message: 15
From: "Edward Pham" <lost_bits1110 at hotmail.com>
To: vtkusers at vtk.org
Subject: RE: [vtkusers] vtkImage > Data / MapToColors / Cast / Actor..
Date: Fri, 27 Feb 2004 19:56:44 +0000

okay nevermind
i forgot to setDisplayExtent
thanks anyways
ed


>From: "Edward Pham" <lost_bits1110 at hotmail.com>
>To: vtkusers at vtk.org
>Subject: [vtkusers] vtkImage > Data / MapToColors / Cast / Actor..
>Date: Fri, 27 Feb 2004 16:55:17 +0000
>
>Hi
>I'm trying to create a noisy background using vtkImageData (i've used
the 
>gaussian distribution to create this)  Its a 2D image along x and z
>
>Below are some details of my code (its not that long, it just seems
long 
>but its quite straightforward):
>I used vtkImageMapToColors and vtkImageCast (because my scalars aer of
type 
>float not unsigned char)
>
>So all I see is black on my screen...!  :o(
>what could i be missing? any ideas..??
>thanks in advance...
>Ed
>
>-----------------------------------------------------------------------
----------------------------------------------------------------
>
>  int offset, iOffset, kOffset, gaussLimit;
>  float scalarRange[2] = {VTK_LARGE_FLOAT,-VTK_LARGE_FLOAT};
>float x, y, z, gauss, sigmaSquared, sigma;
>
>  NoiseData = vtkImageData::New();
>  NoiseFloatArray = vtkFloatArray::New();
>  NoiseLookupTable = vtkLookupTable::New();
>  ImageMapToColors = vtkImageMapToColors::New();
>  ImageCast = vtkImageCast::New();
>  ConvertedNoiseData = vtkImageData::New();
>
>NoiseData->SetDimensions( 50, 1, 50 );
>NoiseData->SetOrigin(0, 1, 0);
>NoiseData->SetSpacing( 1, 1, 1 );
>NoiseData->SetScalarType(VTK_FLOAT);
>
>for ( int k=0; k < noiseDimZ; k++ )
>{
>	z = sigma*Randomize()*gaussLimit;
>	kOffset = k*noiseDimZ*noiseDimY;
>
>	for ( int i=0; i < noiseDimX; i++ )
>	{
>		x = sigma*Randomize()*gaussLimit;        //Randomize
generates a random 
>number b/w -1 & 1
>		gauss = exp(-0.5*((x*x + z*z)/(sigmaSquared)));
>
>		if (gauss<scalarRange[0])
>			scalarRange[0] = gauss;
>		if (gauss>scalarRange[1])
>			scalarRange[1] = gauss;
>
>		offset = i + kOffset;
>		NoiseFloatArray->InsertTuple1(  offset, gauss );
>	}
>}
>
>        NoiseData->GetPointData()->SetScalars( NoiseFloatArray );
>	NoiseLookupTable->SetAlphaRange(0,1);
>	NoiseLookupTable->SetHueRange(0, 0);
>	NoiseLookupTable->SetNumberOfColors(256);
>	NoiseLookupTable->SetSaturationRange(0, 1);
>	NoiseLookupTable->SetValueRange(0, 1);
>	NoiseLookupTable->SetTableRange(scalarRange);
>	NoiseLookupTable->Build();
>
>	ImageCast->SetInput( NoiseData );
>	ImageCast->SetOutputScalarTypeToUnsignedChar();
>
>	ImageMapToColors->SetInput(ImageCast->GetOutput());
>	ImageMapToColors->SetLookupTable(NoiseLookupTable);
>
>//	NoiseData->Modified();
>//	ImageMapToColors->Update();
>	NoiseActor->SetInput(ImageMapToColors->GetOutput());
>
>	Ren1->AddActor( NoiseActor );
>        RenWin->AddRenderer( Ren1 );
>       RenWin->SetInteractor(Iren);
>       Iren->Initialize();
>       Iren->Render();
>
>_________________________________________________________________
>Get fast, reliable access with MSN 9 Dial-up. Click here for Special
Offer! 
>http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/
>
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic.

>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers

_________________________________________________________________
Say “good-bye” to spam, viruses and pop-ups with MSN Premium -- free
trial 
offer! http://click.atdmt.com/AVE/go/onm00200359ave/direct/01/



--__--__--

_______________________________________________
vtkusers mailing list
vtkusers at vtk.org
http://www.vtk.org/mailman/listinfo/vtkusers


End of vtkusers Digest




More information about the vtkusers mailing list