[vtkusers] vtkGPUVolumeRayCastMapper Fails

Sergio Aguirre sergio.aguirre at gmail.com
Mon Jan 30 13:54:20 EST 2012


Hi everyone!

In case someone has this issue in the future... its not a problem of the
mapper, its an issue of resolution of the Volume Properties.

You will need to set the appropriate scale for the scalar opacity units. In
my case 0.001 (see below)

Hope it helps.
S

vtkSmartPointer<vtkVolumeProperty> dcmVolProp =
vtkSmartPointer<vtkVolumeProperty>::New();
dcmVolProp->SetScalarOpacityUnitDistance(0.001);

On Mon, Jan 23, 2012 at 8:29 PM, Sergio Aguirre <sergio.aguirre at gmail.com>wrote:

> links to images here
>
> spacing-camera-noauto-1X -
> http://dl.dropbox.com/u/8559744/spacing-camera-noauto-1x.jpg
>
> spacing-camera-auto -
> http://dl.dropbox.com/u/8559744/spacing-camera-auto.jpg
>
> normal - http://dl.dropbox.com/u/8559744/normal.jpg
>
> fixed-additive - http://dl.dropbox.com/u/8559744/fixed-additive.jpg
>
>
>
> On Mon, Jan 23, 2012 at 8:25 PM, Sergio Aguirre <sergio.aguirre at gmail.com>wrote:
>
>> Hi everyone
>>
>> I am trying to render some DICOM volumes using vtkGPUolumeRayCastMapper
>> however it fails and I get the following message:
>>
>> " render clipped 1 ERROR (x501) Invalid value
>> Assertion failed: "pre: valid_current_reduction_range" &&
>> this->ReductionFactor>
>> 0.0 && this->ReductionFactor<=1.0, file
>> ..\..\vtk-5.8.0\VolumeRendering\vtkOpenG
>>  LGPUVolumeRayCastMapper.cxx, line 3906 "
>>
>> I believe this is a problem caused by my pipeline set up. I have a
>> requirement to have the following camera configuration:
>>
>>  vtkSmartPointer<vtkCamera> cam = vtkSmartPointer<vtkCamera>::New();
>> cam->SetPosition(0.0, 0.345, 0.222); // set position to display offset
>> cam->SetFocalPoint(0.0, 0.0, 0.0); // set cam LookAt
>> cam->SetViewUp(0.0, 1.0, 0.0); // set View up
>>
>> Since the camera is looking at a fixed area in space, I need to scale my
>> DICOM images to fit in this space - I do this in ITK using a filter called
>> itkChangeInformationImageFilter. The result is that each voxel has "real"
>> size and spacing (e.g. if the dicom tags say that X,Y spacing is 0.625mm
>> and Z spacing is 1mm then this filter allows me to import voxels of
>> 0.000625, 0.000625, 0.001 size or smaller.
>>
>> My configuration of the vtkGPUolumeRayCastMapper is as follows:
>> dcmMapper->SetMaxMemoryInBytes(536870912);
>> dcmMapper->SetMaxMemoryFraction(0.80); // trigger GPU
>> dcmMapper->SetAutoAdjustSampleDistances(0); // no adjust sample distance
>> dcmMapper->SetImageSampleDistance(0.5);
>> dcmMapper->SetInput(dcmVImage);
>> dcmMapper->SetBlendModeToComposite();
>>
>> The above configuration fails.
>>
>> I tested other configurations with the following results:
>>
>> 1 - With SetAutoAdjustSampleDistances(0), SetImageSampleDistances(1.0)
>> the image is "ghostly-flat" = "spacing-camera-noauto-1x.jpg"
>> 2 - With SetAutoAdjustSampleDistances(1), only higher density values are
>> rendered = "Spacing-camera-auto.jpg"
>>
>> What I would like to have as a rendered image is the attached image
>> "normal.jpg" which I rendered with SetAutoAdjustSampleDistances(1) and no
>> settings on my camera or re-sizing of the images in ITK.
>>
>> I can achieve the desired output with vtkFixedPointVolumeRayCastMapper
>> (see "fixed-additive.jpg") using "additive" blending - but I would rather
>> use the video card for volume rendering.
>>
>> Is this something I can fix or maybe repair modifying some code of
>> vtkOpenGLGPUVolumeRayCastMapper? or do I need a larger video card? I am
>> using a Quadro FX 3700
>>
>> Any suggestions are appreciated.
>>
>> Thank you,
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120130/f8dfc823/attachment.htm>


More information about the vtkusers mailing list