[vtkusers] Reading a single 3D file?

William R. Oliver oliver at afip.org
Mon Jan 28 16:05:24 EST 2002


Thanks!  I'm playing with that now.  For some reason,
when reading the man pages, I got the impression vtkImageReader
only worked with 2D images, and vtkVolume Reader only
worked with stacks of 2D images.

I modified the script you so kindly gave me to fit
my data (e.g. Short instead of Unsigned char,etc.).

I don't have a clue as to what SetDataMask does, but
it doesn't seem to matter whether I leave it in or out.

Now I have another question -- I think I have some
scaling issues.  When I modified the simple
volume Renderer in the Examples directory, I get
a blank image (no opacity that I can see).

However, when I modify the Examples/ImageProcessing/Histogram.tcl
code, my image looks good on a slice-per-slice basis.  Thus, I 
don't have a permutation, etc. problem when reading the data.  The 
only big thing is that I had to change the windowing in the vtkImageViewer 
dramatically.  I had to change SetColorWindow to 20000, and SetColorLevel 
to 5000.

I would have thought I could have taken care of that in the volume
renderer by setting my opacities right -- I would have thought
that setting, say, a value of 2.0 to have an opacity of 1.0
in the opacity transfer function would make most of the data
cube opaque.  But it does not.  Nothing I do gives me any
opacity.  The color transfer function code in the example 
causes a core dump, though no crash occurs when I remove it.  

Do I have to scale the data to 0 - 255 *before* sending it
to the ray casting renderer?   


Any ideas?

Thanks!

billo


On Mon, 28 Jan 2002 anast.jm at pg.com wrote:

> 
> billo, here's a small tcl snippet that should help
> 
> # Simple volume rendering example.
> vtkImageReader reader
>    reader DebugOn
>    reader SetFileName "uct01.raw"
>    reader SetFileDimensionality 3
>    reader SetDataExtent 0 100 0 50 1 51
>    reader SetDataOrigin 0 0 0
>    reader SetDataScalarTypeToUnsignedChar
>    reader SetDataMask 0x7fff
>    reader SetDataSpacing 0.0301 0.0301 0.0300
>    reader SetDataByteOrderToLittleEndian
>    reader SetHeaderSize 44
> 
> ...john
> 
> 
>                                                                 
>  Internet Mail Message                                          
>  Received from host:      public.kitware.com                    
>  [208.136.18.25]                                                
>                                                                 
> 
> 
> From: "William R. Oliver" <oliver at afip.org>@public.kitware.com on 01/28/2002
> 01:26 PM
>                                                                                            
>                   "William R. Oliver"           To:   vtkusers at public.kitware.com          
>  <oliver at afip.org>@public.kitware.com           Cc:    (bcc: John Anast-JM/PGI)            
>                                         Subject:      [vtkusers] Reading a single 3D file? 
>                                                                                            
>                              Sent by:                                                      
>     vtkusers-admin at public.kitware.com                                                      
>                   01/28/2002 01:26 PM                                                      
>                                                                                            
>                                                                                            
> 
> 
> 
> 
> 
> I have a single file that contains 3D data (32-bit signed integers).
> I know the dimensionality, etc. and I want to read in the file
> to do volume rendering.
> 
> In reading "The Visualization Toolkit User's Guide," I see
> how to read in a volume from a series of 2D images, but nothing
> to read in 3D data from one file of ints.
> 
> Is there a "read raw" command in VTK?
> 
> 
> Thanks!
> 
> 
> billo
> 
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <
> http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
> 
> 
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
> 




More information about the vtkusers mailing list