[Insight-users] Re: [vtkusers] VISUALIZE raw slices - brainweb -
Luis Ibanez
luis.ibanez at kitware.com
Sat, 21 Feb 2004 10:52:26 -0500
Hi Christos,
If you really want to write the code yourself
you may want to look at the tutorial sessions
http://www.itk.org/HTML/Tutorials.htm
In particular to
http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf
Where the connection between ITK and VTK are
explained.
Note that Andy Cedilnik recently added a MetaImage
reader to VTK. You no longer need to use the raw
readers. This new MetaImage reader is available in
the CVS version of VTK.
The pixel data of the brainweb images is 8bits
represented as 'unsigned char'.
--
If you just need to visualize contours in
this data you can use ParaView or VolView.
A) ParaView is an open source application built
on top of VTK. You can download source code
and binaries from
www.paraview.org
It reads MetaImage formats directly and
have filters for contouring.
ParaView is free (as in 'Freedom' and as
in 'Free Beer')
B) VolView has a free version distributed
in binary that can be downloaded from
http://www.kitware.com/products/volview.html
Regards,
Luis
---------------------------
Christos Panagiotou wrote:
>
> guys i sent this both to itk and vtk maillists as some help can be found
> in both sets of users, as time is running short for me - thanks for your
> time
> i ve go some raw slice data sets from the link shown below (source
> kitware, brainweb)
>
> ftp://public.kitware.com/pub/itk/Data/BrainWeb
>
> does anyone have any code which visualizes the 3D volume?
>
> const char *fname =
> "/home/christos/PhD/Data/raw/SHORT/t1_icbm_normal_1mm_pn0_rf0.raws";
> vtkImageReader2 *v16 = vtkImageReader2::New();
> v16->SetDataExtent(0,180,0,216,0,180 );
> v16->SetDataByteOrderToLittleEndian(); //does this describe the
> endianess of the file or the machine?
> v16->SetDataScalarTypeToShort(); //or UnsignedChar
>
> v16->SetFileName(fname);
> v16->SetFileDimensionality(3);
> v16->SetSwapBytes(2); //if i set the data byte order to a specific
> endianess do i have to set this too?
> v16->SetDataSpacing (1.0,1.0,1.0);
> v16->DebugOn();
> v16->Update();
>
> I later on pass this to contour filter of maching cubes -> poly data
> normals -> mapper -> actor ...
>
> however short or uchar the machine says no data to generate normals
> from...
> i manage to display a number of slices (#45-50) with SHORT but i get 4
> instances of the model so i assume short is not correct ( i tried uchar
> but then no data again)
>
> if anyone has vtk code to visualize this kind of data,i would be
> greatful if they could email it to me at c.panagiotou at cs.ucl.ac.uk
>
> thanks in advance christos
>
>