[vtkusers] Why data value range of volume affects its rendering --->I think it is a bug, please read my reply
James Zhou
henryjoye at gmail.com
Mon Oct 29 02:08:43 EDT 2007
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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20071029/afe7db2d/attachment.htm>
More information about the vtkusers
mailing list