[vtkusers] CopyAndCastFrom()
Talita Perciano
talitaperciano at gmail.com
Wed Sep 24 11:17:03 EDT 2008
Hi,
I want to get a slice (35 as in the example bellow) from a DICOM volume
using CopyAndCastFrom(). In this example the extent of the original volume
is (0,511,0,511,0,81). What am I doing wrong here?
image_slice->SetSpacing(reader->GetOutput()->GetSpacing());
image_slice->SetOrigin(reader->GetOutput()->GetOrigin());
image_slice->SetDimensions(512,512,1);
image_slice->SetScalarTypeToShort();
image_slice->SetNumberOfScalarComponents(reader->GetNumberOfComponents());
image_slice->SetWholeExtent(reader->GetOutput()->GetWholeExtent());
image_slice->AllocateScalars();
image_slice->CopyAndCastFrom(reader->GetOutput(), 0,511,0,511,35,35);
Thank you in advance,
Talita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080924/86815379/attachment.htm>
More information about the vtkusers
mailing list