[vtkusers] how to read in all .tif files one time?

Amy Squillacote amy.squillacote at kitware.com
Fri Mar 30 12:37:11 EDT 2007


Hi Chopinwzc,

Please keep the discussion on the VTK users mailing list. That way other 
people can help answer your questions and the discussion is archived.

The SetFilePattern method expects a format string like is used for 
printf in C++. Here's a reference to it online: 
http://www.cplusplus.com/reference/clibrary/cstdio/printf.html.

In your case, call SetFilePrefix with "F:/tifimage/tiffiles", and call 
SetFilePattern with "%s%02d".

- Amy

chopinwzc wang wrote:
> Dear Amy Squillacote
>    I use the method  SetFilePrefix ("f:/tifimaes")  . I don't know how 
> to use the method SetFilePattern( const  char* ) .the type of  the 
> parameter is const  char* ,it confused me. 
> what is the format of the parameter shoud to be to represent more than a file 
> ?.my tif  files stores in F:/tifimage folder and the tif files named 
> like tiffiles00 tiffiles01 .....tiffiles30  .Thanks
>  
>                                                                              chopinwzc
>
>
>  
> 2007/3/30, Amy Squillacote < amy.squillacote at kitware.com 
> <mailto:amy.squillacote at kitware.com>>:
>
>     The methods you are looking for are in vtkImageReader2, the superclass
>     of vtkTIFFReader. That class has SetFilePrefix and SetFilePattern
>     methods; these methods work if the files you're reading in have
>     similar
>     names (e.g., filename000.tif, filename001.tif, filename002.tif,
>     ...). If
>     your images don't have similar names, try using the SetFileNames
>     method
>     instead.
>
>     The online documentation for vtkTIFFReader can be found here:
>     http://www.vtk.org/doc/release/5.0/html/a02107.html. Click the
>     "List of
>     all members" link to see the methods this class inherits from
>     vtkImageReader2.
>
>     - Amy
>
>     Ocean Spring wrote:
>     > i think u can read whole set of images, no problem. i guess the
>     reader
>     > provides something to set the file pattern,
>     > so that u can read not only one images.. check the manual.
>     >
>     > ========
>     >
>     > Ocean
>     >
>     > www.vislab.cn <http://www.vislab.cn> <http://www.vislab.cn>
>     >
>     >
>     > On 3/30/07, *chopinwzc wang* < chopinwzc at gmail.com
>     <mailto:chopinwzc at gmail.com>
>     > <mailto:chopinwzc at gmail.com <mailto:chopinwzc at gmail.com>>> wrote:
>     >
>     >     Hi
>     >     I  trid to rebuild 3D image and the data from some sequence tif
>     >     files .but the instanace of vtkTIFFReader can't read  all of the
>     >     tif files
>     >     by the method SetFileName() one time ;how to do it ?
>     >     Thanks
>     >     --
>     >     chopinwzc
>     >
>     >     _______________________________________________
>     >     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
>     >     < http://www.vtk.org/mailman/listinfo/vtkusers>
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > 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
>     >
>
>     --
>     Amy Squillacote
>     Kitware, Inc.
>     28 Corporate Drive
>     Clifton Park, NY 12065
>     Phone: (518) 371-3971 x106
>
>
>
>
> -- 
> chopinwzc 

-- 
Amy Squillacote
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
Phone: (518) 371-3971 x106




More information about the vtkusers mailing list