[vtkusers] Re: Help needed using segmented data
Goodwin Lawlor
goodwin.lawlor at ucd.ie
Mon Jul 26 23:48:17 EDT 2004
Vidya,
The problem is with your data... its in ascii format, with characters
(numbers) delimited by spaces. You could use the data mask in the reader to
cut out the spaces and the use vtkImageShiftScale to move "0" down from 48
in the ascii table. Something like this:
vtkImageReader reader
reader SetFilePrefex c:/data/bmp
reader SetDataExtent 0 255 0 255 1 9
#even though data is uchar, read in two bytes
reader SetDataScalarTypeToShort
#chop the space out
reader SetDataMask 0x00FF
reader SetDataByteOrderToLittleEndian
vtkImageShiftScale shift
shift SetInput [reader GetOutput]
shift SetShift -48
...
...
Or you could just use vtkBMPReader on the original images.
Segemented8.tcl, Segemented16.tcl and the frog example (all around vtk 2.0,
I think) used to be good examples but were axed- perhaps they were moved
over to itk...
hth
Goodwin
"Vidya Raghavan" <vidya_raghavan at hotmail.com> wrote in message
news:BAY2-F8D4F8jvj5SxW3000156d7 at hotmail.com...
> Dear VTK users,
>
> I had posted this question earlier, but didn't get any response yet. So,
I'm
> reposting it. Hope someone can help me.
>
> Basically, I am trying to model segmented data in VTK, based on the
tutorial
> provided in:
>
> http://www.crd.ge.com/~lorensen/seg12/, where the input data is described
as
> "a set of slices that have the same resolution as the original data, but
> grayscale values have been replaced with integer segmentation labels.".
>
> There were some errors in the scripts as they used an older verison of
VTK.
> I now have these scripts working for VTK 4.2 and there are at
> http://www.cs.northwestern.edu/~vidya/VTK/scripts
>
> Now I am trying to use my own segmented data with the above scripts, where
> they represent 256 X 256 segmented data, with each pixel represented by an
> integer.
>
> The segmented data I have used is at:
> http://www.cs.northwestern.edu/~vidya/VTK/data
>
> The script I have written to describe these parameters is region1.tcl
>
> When I run region1.tcl I should get a vtk file region1.vtk. Instead it is
> empty and no polygons are generated. I am really trying to understand what
> is wrong, but since I'm new to VTK I still cannot figure it out.
>
> Could someone please help?
>
> Thanks.
>
> _________________________________________________________________
> Marriage? http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Join
> BharatMatrimony.com for free.
>
> _______________________________________________
> 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://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list