[vtkusers] vtkImageReslice problem...output parameters are reset???
Mathieu Coursolle
mcoursolle at yahoo.ca
Tue Sep 7 17:37:08 EDT 2004
Hi,
I have a vtkImageData representing a volume. I want to
display the image of a single slice.
However, once I set my volume to a vtkImageReslice, the
vtkImageReslice output parameters are not the same as its
input...in fact, the SetInput does not seem to have any effect...
Here is how I do it...
vtkImageData* volume = vtkImageData::New();
volume->SetScalarTypeToFloat();
volume->SetDimensions(74, 25, 8);
volume->AllocateScalars();
volume->SetSpacing(2, 2, 2.5);
volume->SetOrigin(0, 0, 0);
float* data = (float*)(volume->GetScalarPointer());
memcpy(data, source_data; 74 * 25 * 8 * sizeof(float));
vtkImageReslice* slice = vtkImageSlice::New();
slice->SetInput(volume);
int d1[3];
volume->GetDimensions(d);
int d2[3];
slice->GetOutput()->GetDimensions(d);
d should be the same in both cases rigth???
It is always good in the volume but 0 in the slice
output...Any idea why???
Your help would really be appreciated...
Thanx!
MAthieu
---------------------------------
Post your free ad now! Yahoo! Canada Personals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040907/0fa315a2/attachment.htm>
More information about the vtkusers
mailing list