<br>Hello all,<br><br>I am a relatively new VTK user.&nbsp; I am attempting to
visualize an array of floats by displaying each of them as a cube with a gray-scale&nbsp; values spanning the range of the floats.&nbsp; I was thinking about trying to manually enter the data into a vtkImageData class which I have had success in working with before.&nbsp; However, I am having no luck with this, as it appears that
all the values are being mapped to 255 (the highest intensity value).<br><br>Any suggestions as to how I could proceed in this direction, or even suggestions of a different method to try would be extremely helpful.&nbsp; Links to documentation or examples would also help.
<br><br>I&#39;ve attached my code below up through just before rendering.<br><br>Thanks!<br><br>Dave<br><br><span style="font-family: courier new,monospace;">&nbsp; vtkImageData *realData = vtkImageData::New();</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp; //vtkFloatArray *scalars = vtkFloatArray::New();
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; int dim[3];</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp; dim[0] = 255;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; dim[1] = 255;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp; dim[2] = 255;</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; float *temp;</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; realData-&gt;SetDimensions(dim);</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp; realData-&gt;SetScalarTypeToFloat();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; realData-&gt;SetNumberOfScalarComponents(1);</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp; realData-&gt;AllocateScalars();</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp; float *ptr = (float *) realData-&gt;GetScalarPointer();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; for (int i = 0; i&lt;255*255*255 ; i++)</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp; {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; &nbsp; *ptr++ = i;</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp; }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;//scalars-&gt;Delete();</span><br style="font-family: courier new,monospace;">

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">vtkFixedPointVolumeRayCastMapper *volumeMapper = vtkFixedPointVolumeRayCastMapper::New();</span><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">volumeMapper-&gt;SetInput(realData);</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">

&nbsp;vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;volumeProperty-&gt;IndependentComponentsOff();</span>

<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;volumeProperty-&gt;SetScalarOpacity(tfun);</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">

<span style="font-family: courier new,monospace;">&nbsp;vtkVolume *newvol = vtkVolume::New();</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;newvol-&gt;SetMapper(volumeMapper);
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;newvol-&gt;SetProperty(volumeProperty);</span><br>