[vtkusers] Image reader : JPEG,BMP and TIFFReader

Alain SIMAC alain.simac at visioterra.com
Wed Jul 20 05:53:48 EDT 2005


Hi,

 

I wish to open without distinction of the images of format BMP, JPEG, TIFF.
For the moment: I open without problem the BMP but the JPEG and the tiff are
not posted. I do not include/understand why. Would somebody be to modify my
program?

 

Program:

vtkImageData *imageData = vtkImageData::New();

int* dimimage;

 if ((strcmp(GetExtensions(filename2),"bmp")==0) or
(strcmp(GetExtensions(filename2),"BMP")==0))

            {

            vtkBMPReader *bmpreader = vtkBMPReader::New();

            bmpreader->SetFileName(filename2); 

            bmpreader->Update();

            imageData = bmpreader->GetOutput();

            }

 if ((strcmp(GetExtensions(filename2),"jpg")==0) or
(strcmp(GetExtensions(filename2),"JPG")==0))

            {

            vtkJPEGReader *jpgreader = vtkJPEGReader::New();

            jpgreader->SetFileName(filename2); 

            jpgreader->Update();

            imageData = jpgreader->GetOutput();

            }

  if ((strcmp(GetExtensions(filename2),"jpg")==0) or
(strcmp(GetExtensions(filename2),"JPG")==0))

            {

            vtkTIFFReader *tiffreader = vtkTIFFReader::New();

            tiffreader->SetFileName(filename2); 

            //tiffreader->Update();

            imageData = tiffreader->GetOutput();

            }

    dimimage = imageData -> GetDimensions();

  }

 

Thanks

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050720/8b26608c/attachment.htm>


More information about the vtkusers mailing list