[vtkusers] Reading standard image types

Bill Lorensen bill.lorensen at gmail.com
Sat Oct 16 14:39:04 EDT 2010


Looks great. I didn't know it existed.

David D, this should solve your problem. We should try it on a few
wiki examples.

Thanks Jim,

Bill

On Sat, Oct 16, 2010 at 2:10 PM, Jim Peterson <jimcp at cox.net> wrote:
> David Doria wrote:
>>
>> Is there a filter that will read png, jpg, etc images based on their
>> file extension (that is, without having to explicitly declare a
>> vtkJPEGReader or vtkPNGReader, etc)? If not, would you use it if it
>> existed?
>>
>>
>
> Does vtkImageReader2Factory fill this bill?
>
> // vtkImageReader2Factory: This class is used to create a vtkImageReader2
> // object given a path name to a file.  It calls CanReadFile on all
> // available readers until one of them returns true.  The available reader
> // list comes from three places.  In the InitializeReaders function of this
> // class, built-in VTK classes are added to the list, users can call
> // RegisterReader, or users can create a vtkObjectFactory that has
> // CreateObject method that returns a new vtkImageReader2 sub class when
> // given the string "vtkImageReaderObject".  This way applications can be
> // extended with new readers via a plugin dll or by calling RegisterReader.
> // Of course all of the readers that are part of the vtk release are made
> // automatically available.
> //
>
> HTH,
> Jim
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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