Ok, I was finally able to resolve this. the problem seems to have
been in how I was combining the 2 datasets. I'm guessing the
FixedPointRayCastMapper must be doing some fancy pointer magic for
speed, but when I used a :<span class="q"><br>
OpacityData->GetPointData()->AddArray(Colordata->GetPointData()->GetArray("colorField"))<br></span>
and then a vtkMergeFields to combine the two arrays, it didn't work.<br>
<br>
I simply switched to using a vtkImageAppendComponents and it works perfectly now.<br>
<br>
(Sorry Lisa, forgot to include the mailing list the first time... Reply vs Reply All :) )<br><br><div><span class="gmail_quote">On 5/25/05, <b class="gmail_sendername">Lisa Avila</b> <<a href="mailto:lisa.avila@kitware.com">
lisa.avila@kitware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Well, the TestFixedPoint*.tcl scripts test all the configurations (single
component, multiple component, independent, not independent, shade on,
shade off, nearest, linear, MIP, composite, etc.) and this test is
passing so there is at least one example of 2 component dependent data
rendering correctly. Can you try this: save the data that you input to
the volume mapper. Can you load this into VolView? The mapper has changed
quite a bit since that released version, but it should at least give us a
clue that your data is what you expect it to be. The fact that you have a
solid black cube when you don't have shading on and your color transfer
function is set to solid red is suspicious. What type is your data? (int,
float, unsigned char,....?) (The test only checks unsigned char for two
component depended - I can change it to your data type if that is
different to see if a problem arises.) Does your color function span the
scalar range of your first component? (Shouldn't matter since Clamping is
on by default, but perhaps you turned it off?) <br><br>
Thanks,<br><span class="sg"><br>
Lisa</span><div><span class="e" id="q_104154efd7d34f89_2"><br><br>
<br>
At 03:04 PM 5/25/2005, Randall Hand wrote:<br>
<blockquote type="cite" cite="http://">Sadly, none of that
worked. <br>
1) Checked, and even if I have them backwards I should see something
other than a blurry black spot.<br>
2) Tried, no difference really.. With shading on I get a few specular
highlights on my blurry black spot, but still isn't right.<br>
3) I'm working with offscreen Mesa rendering, which is why I had this
on. I commented it out, so it would use the default, but still no
dice.<br>
4) I set it to use all-red, and I still got my blurry black spot. I
changed it to be all-red, and all opaque (set my opacity function to a
constant 1) and my blurry black spot become a solid black brick (as
attached).<br>
<br>
Any ideas?<br><br>
On 5/25/05, <b>Lisa Avila</b>
<<a href="mailto:lisa.avila@kitware.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">lisa.avila@kitware.com</a>
> wrote:<br>
<dl><br>
<dd>Looking quickly at your code I don't see anything obviously wrong.
However, I would suggest trying a few things to isolate the
problem:<br><br>
</dd><dd>1) Make sure your first component is the one you want mapped to
color, and the second is the one you want mapped to opacity.<br><br>
</dd><dd>2) Try volProp->ShadeOff(). Perhaps you do not have good gradients
in your data and that is causing the problem (although you have a high
ambient so that shouldn't be the problem...)<br><br>
</dd><dd>3) Leave your ImageSampleDistance at 1.0 (the default). Keep in mind
that a distance of 0.5 means that you cast 4 rays for every pixels on the
screen. I believe when OpenGL maps this texture to the screen, it will
sample it for the pixel value, meaning that you are throwing away 3/4 of
the information you created during ray casting.<br><br>
</dd><dd>4) If all these fail, try using a solid color transfer function (all
values map to red for example) - do you get what you expect?<br><br>
<br>
</dd><dd>Lisa<br><br>
<br><br>
<br>
</dd><dd>At 02:15 PM 5/25/2005, Randall Hand wrote:<br>
<blockquote type="cite" cite="http://">
<dd>I have a long pipeline setup to render a multifield dataset.
one field I want mapped to opacity, and the other one is a vector that I
want magnitude mapped to color.<br>
</dd><dd>My pipeline resembles the following:<br><br>
<br>
</dd><dd>vtkDataSetReader -> vtkArrayCalculator (to calculate magnitude)
-> vtkGaussianSplatter -> vtkImageShiftScale = Dataset with
ColorField single component scalar<br>
</dd><dd> +->
vtkGaussianSplatter -> ImageShiftScale = Dataset with OpacityField
single component scalar.<br><br>
</dd><dd>I then do a
OpacityData->GetPointData()->AddArray(Colordata->GetPointData()->GetArray("colorField")),
and pass the result through a vtkMergeFields to combine the 2 fields into
a single dual-component field, and make the new field the Active
Scalar.<br><br>
<br>
</dd><dd>I then construct my volume parts:<br>
</dd><dd> vtkVolumeProperty *volProp =
vtkVolumeProperty::New();<br>
</dd><dd> volProp->IndependentComponentsOff();<br>
</dd><dd> volProp->SetColor(xf_Color);<br>
</dd><dd> volProp->SetScalarOpacity(xf_Opacity);<br>
</dd><dd> volProp->SetInterpolationTypeToLinear();<br>
</dd><dd> volProp->ShadeOn();<br>
</dd><dd> volProp->SetAmbient(0.7);<br><br>
</dd><dd> // Now setup the Ray Caster<br>
</dd><dd> vtkFixedPointVolumeRayCastMapper *modelMapper =
vtkFixedPointVolumeRayCastMapper::New();<br>
</dd><dd> modelMapper->SetImageSampleDistance(0.5);<br>
</dd><dd> modelMapper->SetSampleDistance(0.1);<br>
</dd><dd>
modelMapper->SetInput(mergeFilter->GetOutput());<br><br>
</dd><dd> // Creating Volume<br>
</dd><dd> vtkVolume *volume = vtkVolume::New();<br>
</dd><dd> volume->SetMapper(modelMapper);<br>
</dd><dd> volume->SetProperty(volProp);<br>
</dd><dd> volume->Update();<br><br>
</dd><dd>When all is said and done, however, I just get a darkish blurry spot
(image Attached). Can anyone see what's wrong, or have I exposed a
bug in the FixedPointVolumeRayCastMapper ? I've been waiting to do
this since I figured out that the old VolumeRayCastMapper couldn't handle
multi-component data, and i'm anxious to see this work for once :)<br>
</dd><dd>-- <br>
</dd><dd>Randall Hand<br>
</dd><dd><a href="http://www.yeraze.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.yeraze.com</a> <br>
</dd><dd>_______________________________________________<br>
</dd><dd>This is the private VTK discussion list. <br>
</dd><dd>Please keep messages on-topic. Check the FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
</dd><dd>Follow this link to subscribe/unsubscribe:<br>
</dd><dd><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/mailman/listinfo/vtkusers</a></dd></blockquote><br>
</dd></dl><br><br>
<br>
-- <br>
Randall Hand<br>
<a href="http://www.yeraze.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.yeraze.com</a> <br>
_______________________________________________<br>
This is the private VTK discussion list. <br>
Please keep messages on-topic. Check the FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://www.vtk.org/mailman/listinfo/vtkusers</a></blockquote>
</span></div></blockquote></div><br><br><br>-- <br>Randall Hand<br><a href="http://www.yeraze.com">http://www.yeraze.com</a>