[vtkusers] strange behavior of vtkImageActor on MacOSX Jaguar

Gala Wind wind at climate.gsfc.nasa.gov
Thu Sep 26 12:23:56 EDT 2002


I'm running VTK 4.0.2 official release on MacOSX Jaguar. Everything 
works fine, except me trying to display, say a tiff image on the screen 
as a 3D actor.

So I have a TIFF image that I generated from an airborne weather 
instrument's data. All I want is to display that image on the screen. 
So all that my code is for this is as following:

// Create render window, renderer, interactor, the usual

vtkTIFFReader *tr = vtkTIFFReader :: New();
tr->SetFileName("Safari.tif");
tr->Update();

vtkImageActor *im_actor = vtkImageActor::New();
im_actor->SetInput(tr->GetOutput());

renderer->AddActor(im_actor);

Simple, right? As you can see, all this is just a C++ equivalent of 
vtkImageActor.tcl.
Well, it doesn't work. Just happily gives me a bus error.  Here's the 
backtrace for it from gdb:

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x002b71a4 in vtkIdList::InsertNextId(int) ()
(gdb) bt
#0  0x002b71a4 in vtkIdList::InsertNextId(int) ()
#1  0x001c6e20 in 
vtkOpenGLRenderWindow::RegisterTextureResource(unsigned long) ()
#2  0x00158698 in vtkOpenGLImageActor::Load(vtkRenderer*) ()
#3  0x0001fbc0 in vtkImageActor::RenderOpaqueGeometry(vtkViewport*) ()
#4  0x0000de98 in vtkRenderer::UpdateGeometry() ()
#5  0x001569a8 in vtkOpenGLRenderer::DeviceRender() ()
#6  0x0000d248 in vtkRenderer::Render() ()
#7  0x000e83e8 in vtkRendererCollection::Render() ()
#8  0x00027834 in vtkRenderWindow::DoStereoRender() ()
#9  0x000277ac in vtkRenderWindow::DoFDRender() ()
#10 0x000271c4 in vtkRenderWindow::DoAARender() ()
#11 0x00026724 in vtkRenderWindow::Render() ()
#12 0x00004568 in main ()
#13 0x00002d5c in _start (argc=1, argv=0xbffffdd4, envp=0xbffffddc) at 
/SourceCache/Csu/Csu-45/crt.c:267
#14 0x00002bdc in start ()

Now your suspicion would be that VTK is compiled incorrectly, or 
something. Well, then why everything else works? The image display is 
just to provide some base to a visualization of cloud optical 
thickness, which has a very complex code. That visualization alone 
involves reading an HDF file, generating vtkStructuredPoints from that, 
retrieving geometry, generating threshold texture coordinates, doing a 
scalar warp to get a relief of the data values, so thicker clouds look 
like it and all this good stuff, you get the idea. That code works and 
displays wonderfully. The measely five lines of code that I typed 
above, run completely alone, in their own separate program, crash 
happily.

So it's not like OpenGL doesn't work or something. It works just fine 
on all examples from VTK and all of my own codes, except this one. 
Things that I tried included downloading the vtkDATA and putting in the 
silly dog from beach.tif, I thought maybe my TIFF file is bad or 
something, I tried other images in various formats, like JPEG, BMP. 
Same result, same backtrace.

If anyone else had run into the same problem before, please let me 
know. I did try to download the nightly update and compile it, but it 
won't compile. Here's the error that I get:

c++  -I/VTK/Rendering -I/VTK/Rendering -I/VTK -I/VTK/Common 
-I/VTK/Filtering -I/VTK/Imaging -I/VTK/Graphics -I/VTK/IO 
-I/VTK/Utilities/zlib -I/VTK/Utilities/png -I/VTK/Utilities/jpeg 
-I/VTK/Common/Testing/Cxx -I/usr/X11R6/include   -c 
/VTK/Rendering/vtkAbstractMapper3D.cxx -o vtkAbstractMapper3D.o
In file included from /VTK/Rendering/vtkAbstractMapper3D.cxx:18:
/VTK/Rendering/vtkAbstractMapper3D.h:43: warning: ISO C++ forbids 
declaration
    of `vtkTypeRevisionMacro' with no type
/VTK/Rendering/vtkAbstractMapper3D.cxx:21: type specifier omitted for 
parameter
/VTK/Rendering/vtkAbstractMapper3D.cxx:21: parse error before string 
constant
/VTK/Rendering/vtkAbstractMapper3D.cxx:21: warning: ISO C++ forbids 
declaration
    of `vtkCxxRevisionMacro' with no type
/VTK/Rendering/vtkAbstractMapper3D.cxx: In member function `virtual void
    vtkAbstractMapper3D::PrintSelf(std::ostream&, vtkIndent)':
/VTK/Rendering/vtkAbstractMapper3D.cxx:68: `class vtkAbstractMapper3D' 
has no
    member named `Superclass'
/VTK/Rendering/vtkAbstractMapper3D.cxx:68: parse error before `::' token
make[3]: *** [vtkAbstractMapper3D.o] Error 1
make[2]: *** [default_target] Error 2
make[1]: *** [default_target_Rendering] Error 2
make: *** [default_target] Error 2

I guess there is some kind of incompatibility in my compilers with the 
nightly release.
Here are the versions of my compilers, these are Jaguar compilers, the 
latest version:

[ukiel:/VizCodes] wind% gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs
Thread model: posix
Apple Computer, Inc. GCC version 1151, based on gcc version 3.1 
20020420 (prerelease)

[ukiel:/VizCodes] wind% c++ -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs
Thread model: posix
Apple Computer, Inc. GCC version 1151, based on gcc version 3.1 
20020420 (prerelease)


Any help will be greatly appreciated.



Gala Wind
(301) 614-6221
wind at climate.gsfc.nasa.gov
Code 913, Climate and Radiation
L-3 Comm/ Emergent East
NASA/GSFC
Greenbelt, MD 20771

/*--------------------------------------------------------------------
   -- There's always a way, you just have to find it.
			( B. Hambly "Children of the Jedi" )
----------------------------------------------------------------------*/




More information about the vtkusers mailing list