[vtkusers] vtkJPEGreader

Amy Squillacote amy.squillacote at kitware.com
Thu Mar 24 12:56:32 EST 2005


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!!!!!!!!!
>
>_________________________________________________________________
>
>
>_______________________________________________
>This is the private VTK discussion list. Please keep messages on-topic. 
>Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list