[vtkusers] vtkVolumeTextureMapper2D problem

Lisa Sobierajski Avila lisa.avila at kitware.com
Wed Jul 5 14:25:28 EDT 2000


Hi Frank,

Does the input data have a single component which is either unsigned char 
or unsigned short? This is all the volume texture mapper can handle at the 
moment...

Lisa


At 03:30 AM 7/4/00, Frank Boettger wrote:
>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
>
>
>
>Content-Type: application/octet-stream; name="Images.zip"
>Content-Disposition: attachment; filename="Images.zip"
>Content-Description: Images.zip
>FTBP-Modification-Date: 04 Jul 2000 09:30:00 +0200
>FTBP-Object-Size: 16361






More information about the vtkusers mailing list