[vtkusers] how to isolate slices from a single raw volume file ?

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Mar 25 07:27:12 EST 2004


>>>>> "arpit" == arpit baldeva <abaldeva at yahoo.com> writes:

    arpit> Assuming 256x256 images, if I use
    arpit> SetDataExtent(0,255,0,255,0,49) and
    arpit> SetDataExtent(0,255,0,255,50,149) methods for my
    arpit> vtkImageReader object, it doesnt work for the second
    arpit> case. In the second case, it reads 100 slices but from the
    arpit> begining and not from the 50th slice.

    arpit> Any suggestions on how to do it in vtk ? Or is it that i
    arpit> need to write some code outside vtk ?  thanks a lot. I ll
    arpit> appreciate any help.

Using vtkImageReader2

    reader.SetFileNameSliceOffset(50)
    reader.SetDataExtent(0, 255, 0, 255, 0, 49)

should read slices 50 -> 99.

Hope this helps,
JDH



More information about the vtkusers mailing list