[vtkusers] Why data value range of volume affects its rendering --->I think it is a bug, please read my reply
Weiguang Guan
guanw at rhpcs.mcmaster.ca
Tue Oct 30 12:21:09 EDT 2007
The intensity of volume is squeezed into 8-bit before being taken as 3D
texture in vtkVolumeTextureMapper3D::UpdateVolumes(...). This explains the
phenomenon in my earlier email.
By reducing data intensity into [0-255] range one may lose details
contained in original data. An extremely worse case is that a
low-intensity volume with just one "bad voxel" that has VERY large
intensity. In this case some useful structures will be washed off from
volume rendering.
My suggestion is to use the low and high in color/opacity transfer
functions as a window of data range of interest for viewing, which are
used in UpdateVolumes() and UpdateColorLookup(). Because users usually
specify transfer function over data range that they are interested.
Weiguang
On Mon, 29 Oct 2007, James Zhou wrote:
> Hi Weiguang,
>
> I am estimating the vtkVolumeTextureMapper3D these days. I found some
> problems (maybe) about this class. This problem does answer your question
> why the rendering is different from two different mappers.
>
> I am using vtk nightly source on Oct.16 2007. Here I present some cues on
> the problem:
>
> First please read function "UpdateColorLookup" in class
> vtkVolumeTextureMapper3D. We may assume our data type is unsigned char. We
> also assume we use rgba color TF. So the the size of color TF write into the
> ColorLookup is arraySizeNeeded as shown in the program. Line 1334 and line
> 1339 gives us that the pipeline how to get the TF table from the TF user
> interface with the scalar range of ( scalarRange[0], scalarRange[1]).
>
> rgbFunc->GetTable( scalarRange[0], scalarRange[1],
> arraySizeNeeded, this->TempArray1 );
>
> scalarOpacityFunc->GetTable( scalarRange[0], scalarRange[1],
> arraySizeNeeded, this->TempArray2 );
>
> Second please read Lines between 1368 to 1401 (we use one component data),
> you can find that the program transfered TF table obtained before to the
> ColorLookup. The problems appear here:
>
> The TF table obtained in Line 1334 and 1339 is used for the scalar range of
> ( scalarRange[0], scalarRange[1]). But between lines 1368 to 1401
> transferring step, the TF table is set to the range of (0, arraySizeNeeded).
> Please be aware that:
> ( arraySizeNeeded = (int)(scalarRange[1] - scalarRange[0] + 1);)
>
> So the transfer function got from the TF user interface is applied to the
> wrong scalar range, that's why the rendering images created from two mappers
> are different.
>
> I hope to get your feedback about this. I also hope that VTK can correct
> this bug. Because the new graphics card supports non-power 2 texture size,
> the vtkVolumeTextureMapper3D should also be updated for this change.
>
> Good luck!
>
> James
>
>
>
>
>
>
> 2007/10/27, Weiguang Guan <guanw at rhpcs.mcmaster.ca>:
>>
>> Hi all,
>>
>> I recently notice an issue (maybe a bug) with volume rendering algorithms
>> (vtkVolumeTextureMapper3D and vtkVolumeRayCastMapper), and cannot find a
>> posting reporting the issue in the mailing list.
>>
>> I have a a scalar volume of vtkImagedata whose value ranges from 0 to
>> 7035. By thresholding it at 255, I generate another volume with value
>> range [0-255]. Then, I do volume renderings (both vtkVolumeTextureMapper3D
>> and vtkVolumeRayCastMapper) of them seperately with the same opacity
>> transfer function:
>>
>> vtkPiecewiseFunction opacityTransferFunction
>> opacityTransferFunction AddPoint 50 0.0
>> opacityTransferFunction AddPoint 255 0.2
>> opacityTransferFunction ClampingOff
>>
>> Should I expect to have exactly the same renderings? Rendering with
>> vtkVolumeTextureMapper3D produces a great difference while rendering with
>> vtkVolumeRayCastMapper produces a slightly difference but still
>> noticeable. Can anybody explain why?
>>
>> I have a tcl script to reproduce the "bug", and can let you have it if
>> you're interested.
>>
>> Weiguang
>>
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>
More information about the vtkusers
mailing list