[vtkusers] vtkVolumeTextureMapper2D problem

Frank Boettger f.boettger at zeiss.de
Mon Jul 3 07:00:28 EDT 2000


I want to use vtkVolumeTextureMapper2D for volume rendering and encountered the 
following problem:
 
Since the texture data is stored in a compound file, i'm reading my data into a 
data pointer and use the appropriate vtkImageImport - functions to import it to VTK.
In order to prove success, i use a single bitmap as texture and display it using the 
following code:

... (fill in data...)
vtkImageData *outData = vtkImageImporter->GetOutput();
if (outData)
{
	vtkTexture = vtkTexture::New();
	vtkTexture->SetInput(outData);

	vtkPlaneSource = vtkPlaneSource::New();
	vtkDataMapper = vtkPolyDataMapper::New();
	vtkDataMapper->SetInput(vtkPlaneSource->GetOutput());
	vtkActor = vtkActor::New();

	vtkActor->SetMapper(vtkDataMapper);
	vtkActor->SetTexture(vtkTexture);

	vtkRenderer->AddActor(vtkActor);
	vtkRenderer->ResetCamera();
	vtkRenderer->ResetCameraClippingRange();
	// interact with data
	vtkRenderWindow->Render();
}


That's all fine and working as expected. 
Now, when i read the same data the same way as before and pass it to 
vtkVolumeTextureMapper2D, the output isn't what i expect - the image is somewhat
distorted as if the data isn't interpreted as with the above method. See attached
images. Here i use the following code:


... (fill in data...)
vtkImageData *outData = pImporter->GetOutput();
if (outData)
{
	vtkVolMapper = vtkVolumeTextureMapper2D::New();
	vtkVolMapper->SetInput(outData);
	
	// Create the volume and set the mapper
	vtkVolume *volume = vtkVolume::New();
	volume->SetMapper(vtkVolMapper);
	
	// Add this volume to the renderer
	vtkRenderer->AddVolume(volume);
	vtkRenderer->ResetCamera();
	vtkRenderer->ResetCameraClippingRange();
	// interact with data
	vtkRenderWindow->Render();
}


Did i miss something? I'm sure that all dimension/extension etc. settings are right.
Anyone any idea??

Thanks in advance,

Frank


-------------- next part --------------
A non-text attachment was scrubbed...
Name: VolRender.bmp
Type: application/octet-stream
Size: 258390 bytes
Desc: VolRender.bmp
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20000703/58b5b525/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TextRender.bmp
Type: application/octet-stream
Size: 520470 bytes
Desc: TextRender.bmp
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20000703/58b5b525/attachment-0001.obj>


More information about the vtkusers mailing list