AW: [vtkusers] volume rendering ImageData after vtkImageReslice

Oliver Burgert burgert at ira.uka.de
Mon Aug 19 03:21:09 EDT 2002


Hi Yuan,

Are you able to volume-render the original data?
If not, you might have to resample your volume:

	//if volume data is not UNSIGNED_CHAR or UNSIGNED_SHORT
	//volume has to be casted to the desired range
	if ((vtk_img->GetScalarType() != VTK_UNSIGNED_CHAR  ) &&
		  (vtk_img->GetScalarType() != VTK_UNSIGNED_SHORT )) 
		{
			vtkImageCast* pImageCast = vtkImageCast::New();
			pImageCast->SetOutputScalarTypeToUnsignedShort();
			pImageCast->ClampOverflowOn(); 
			pImageCast->SetInput(vtk_img);
			
			RenderImage=(pImageCast->GetOutput());
    		}  //resampling    
	else 
		{
			RenderImage = vtk_img;
    }

HTH 

Oliver


Oliver Burgert
IRF / IAIM 
Geb. 07.21 (Technologiefabrik
Universität Karlsruhe (TH)
Kaiserstr. 12
76128 Karlsruhe
burgert at ira.uka.de
 


> -----Ursprüngliche Nachricht-----
> Von: Yuan Jin [mailto:yjin76 at hotmail.com] 
> Gesendet: Montag, 19. August 2002 05:54
> An: vtkusers at public.kitware.com
> Betreff: [vtkusers] volume rendering ImageData after vtkImageReslice
> 
> 
> Hi all,
> 
> I am trying to get more slices from the raw data, ie. 
> interpolate between 
> two adjacent slices to generate more slices. I have 30 slices 
> raw data and 
> want to interpolate addtional 4 slices between each two 
> slices. I use the 
> code below
> 
> reslice = vtkImageReslice()
> reslice.SetInput(reader.GetOutput())
> reslice.GetOutput().SetExtent(0,511,0,511,1,150)
> reslice.InterpolateOn()
> reslice.SetInterpolationModeToCubic()
> reslice.SetOutputSpacing(1,1,0.2)
> reslice.SetOutputExtent(0,511,0,511,1,150)
> reslice.Update()
> 
> I can see the resulting slices (interpolated ones) using 
> vtkImageViewer, but 
> when I volume render the vtkImageData (reslice.GetOutput()), 
> it doesn't 
> work. anyone has experience?
> 
> Thanks a lot
> 
> Yuan
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> _______________________________________________
> 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://public.kitware.com/mailman/listinfo/vtkusers



More information about the vtkusers mailing list