[vtkusers] Re: vtkPNGreader

Amy Squillacote amy.squillacote at kitware.com
Fri Mar 25 09:10:45 EST 2005


Hi Yala,

I thought you were having problems using the vtkPNGReader, not problems 
compiling your program.  Did you link your program against the vtkIO 
library?  That's the library containing the vtkPNGReader.

- Amy

At 08:55 AM 3/25/2005, yala kaluma wrote:
>Thanks Amy,
>
>i understand that VTK is a well built program that has been around for 
>quite a long time and that it is really unlikely for a newbie like I am to 
>find a bug...
>
>But it still does not work.
>
>Here is the error message I recieve:
>
>Building dependencies cmake.check_depends...
>-- Loading VTK CMake commands
>-- Loading VTK CMake commands - done
>Building object file read.o...
>
>Building executable /home/yala/VTK/Examples/myshit/vizu/read...
>read.o(.text+0x11): In function `main':
>: undefined reference to `vtkPNGReader::New()'
>
>collect2: ld returned 1 exit status
>make[1]: *** [/home/yala/VTK/Examples/myshit/vizu/read] Erreur 1
>make: *** [default_target] Erreur 2
>
>
>What could I do?
>
>Yala
>
>
>
>
>
>Hi Yala,
>
>The image readers and writers in VTK work fine.  Your 1st problem is that
>fullhead15.png is stores its data as unsigned short, but uses a small
>portion of that range.  (The full range is 0 - 65535, and the maximum value
>in the image is 3714.)  To view the image in this range, you need to use
>the SetColorWindow and SetColorLevel method of the vtkImageViewer.  (Window
>is the difference between the smallest and largest value you want to view,
>and level is the value at the midpoint of that range.)  Add the following
>lines after viewer->SetInput...
>
>viewer->SetColorWindow(3714);
>viewer->SetColorLevel(1857);
>
>Also, tests are run every night that cover most of VTK, so it is unlikely
>that an entire class in a VTK release is completely untested.
>
>- Amy
>
>At 12:33 PM 3/24/2005, yala kaluma wrote:
>>It seems like VTK's PNG,JPEG and PNG reader do not work.
>>Anybody has ever used it???
>>
>>When I run the program below it seems like it toes not recognize the 
>>class vtkPNGReader!
>>
>>And I am having the same problem with the image writers...
>>
>>Am i doing something wrong?
>>
>>#include "vtkPNGReader.h"
>>#include "vtkImageViewer.h"
>>#include "vtkRenderWindow.h"
>>
>>int main( int argc, char *argv[] )
>>{
>>vtkPNGReader *pngReader=vtkPNGReader::New();
>>pngReader->SetFileName("/home/yala/VTKData-release-4-2/Data/fullhead15.png");
>>
>>vtkImageViewer *viewer=vtkImageViewer::New();
>>viewer->SetInput(pngReader->GetOutput());
>>viewer->Render();
>>
>>  int i;
>>  for (i = 0; i < 360; ++i)
>>    {
>>    viewer->Render();
>>    }
>>
>>pngReader->Delete();
>>viewer->Delete();
>>
>>  return 0;
>>}
>>
>>
>>Thanks!!!!!!!!!
>>
>>_____
>
>_________________________________________________________________
>
>





More information about the vtkusers mailing list