[vtkusers] vtkImageReslice problem...output parameters are reset???

Veerapuram Varadhan v.varadhan at gmail.com
Wed Sep 8 07:50:35 EDT 2004


Hi,

I think probably you missed to call slice->Update();.  Try calling it
before fetching the dimensions.

Doubt: if slice->Update() is not called, won't the GetOutput() method
returs "NULL" or an improper pointer?????

HTH,

V. Varadhan.


----- Original Message -----
From: Mathieu Coursolle <mcoursolle at yahoo.ca>
Date: Tue, 7 Sep 2004 17:37:08 -0400 (EDT)
Subject: [vtkusers] vtkImageReslice problem...output parameters are reset???
To: vtkusers at vtk.org


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
 



_______________________________________________
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