Pb with vtkImageData

Charles Law charles.law at kitware.com
Tue Dec 14 13:36:17 EST 1999


<x-flowed>Wilfred,

I do not know what version VTK you are using, but I guess your problem is 
that you are not setting the "WholeExtent" of the copy.

When VTK3.0 comes out, it should be smart enough to realize the image does 
not have a source.  It will use the "Extent" instead of expecting a 
"WholeExtent". (CopyStructure does set the extent/dimensions.)

Charles.



At 04:09 PM 12/14/99 +0100, you wrote:
>Hi,
>I would like to make a copy of a vtkImageData coming from a TIFFReader
>but actually it does not work (the image I get in the file is blank).
>What is wrong/missing in my piece of code?
>Thanks in advance for your help.
>
>Wilfrid.
>
>
>vtkTIFFReader r
>   r SetFileName file1.tif
>   r Update
>   set scals1 [[[r GetOutput] GetPointData] GetScalars]
>vtkScalars scals2
>   scals2 SetDataType [$scals1 GetDataType]
>   scals2 SetNumberOfComponents [$scals1 GetNumberOfComponents]
>   scals2 SetNumberOfScalars [$scals1 GetNumberOfScalars]
>   scals2 SetData [$scals1 GetData]
>vtkImageData i
>   i CopyStructure [r GetOutput]
>   [i GetPointData] SetScalars scals2
>vtkTIFFWriter w
>   w SetFileName file2.tif
>   w SetInput i
>   w Write
>
>
>--
>  ____________________________________________________________________
>|                          |                                         |
>| Wilfrid LEFER            |  phone: (+33) 3.21.97.00.46             |
>| LIL, B.P. 719            |  fax: (+33) 3.21.19.06.61               |
>| 62 228 CALAIS Cedex      |  e-mail: lefer at lil.univ-littoral.fr     |
>| FRANCE                   |  http://www-lil.univ-littoral.fr/~lefer |
>|__________________________|_________________________________________|
>
>
>
>
>
>-----------------------------------------------------------------------------
>This is the private VTK discussion list.  Please keep messages on-topic.
>Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at gsao.med.ge.com>.  For help, send message body containing
>"info vtkusers" to the same address.     Live long and prosper.
>-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------

</x-flowed>



More information about the vtkusers mailing list