<div dir="ltr">Depends on where they occur? Cam you share the valgrind report?<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 15, 2013 at 5:47 PM, John Haiducek <span dir="ltr">&lt;<a href="mailto:jhaiduce@gmail.com" target="_blank">jhaiduce@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When I run the following program under valgrind I get lots of warnings<br>
saying &quot;Conditional jump or move depends on uninitialized values.&quot;<br>
Does this indicate that I&#39;m doing something wrong, or are these false<br>
positives?<br>
<br>
John Haiducek<br>
<br>
<br>
#include &quot;vtkImageData.h&quot;<br>
#include &quot;vtkImageViewer2.h&quot;<br>
#include &lt;vtkRenderWindowInteractor.h&gt;<br>
#include &lt;vtkImageMapper.h&gt;<br>
#include &lt;vtkLookupTable.h&gt;<br>
#include &lt;vtkScalarBarActor.h&gt;<br>
#include &lt;vtkRenderer.h&gt;<br>
#include &lt;vtkImageActor.h&gt;<br>
#include &lt;vtkScalarsToColors.h&gt;<br>
#include &lt;vtkImageMapToWindowLevelColors.h&gt;<br>
<br>
int main(int argc, char *argv[]){<br>
<br>
  vtkImageData*intensityImageData = vtkImageData::New();<br>
  vtkImageViewer2*view=vtkImageViewer2::New();<br>
  vtkImageMapper*imageMapper = vtkImageMapper::New();<br>
  int width=400;<br>
  int height=400;<br>
  double*data=new double[width*height];<br>
<br>
  for(int i=0;i&lt;width*height;i++)<br>
    data[i]=0;<br>
<br>
  intensityImageData-&gt;SetDimensions(width,height,1);<br>
  intensityImageData-&gt;SetNumberOfScalarComponents(1);<br>
  intensityImageData-&gt;SetScalarTypeToDouble();<br>
  intensityImageData-&gt;AllocateScalars();<br>
  memcpy(intensityImageData-&gt;GetScalarPointer(),data,width*height*sizeof(double));<br>
  view-&gt;SetInput(intensityImageData);<br>
<br>
  vtkLookupTable*colorMap = vtkLookupTable::New();<br>
  colorMap-&gt;SetHueRange(0.4,1.0);<br>
  colorMap-&gt;SetValueRange(1.0,1.0);<br>
  colorMap-&gt;SetRange(0,1);<br>
  colorMap-&gt;Build();<br>
  vtkImageMapToWindowLevelColors*colorMapper=view-&gt;GetWindowLevel();<br>
  colorMapper-&gt;SetLookupTable(colorMap);<br>
  colorMapper-&gt;SetInput(intensityImageData);<br>
  colorMapper-&gt;SetLevel(10);<br>
  colorMapper-&gt;SetWindow(255);<br>
  vtkScalarBarActor*scalarBar = vtkScalarBarActor::New();<br>
  scalarBar-&gt;S#include &quot;vtkImageData.h&quot;<br>
#include &quot;vtkImageViewer2.h&quot;<br>
#include &lt;vtkRenderWindowInteractor.h&gt;<br>
#include &lt;vtkImageMapper.h&gt;<br>
#include &lt;vtkLookupTable.h&gt;<br>
#include &lt;vtkScalarBarActor.h&gt;<br>
#include &lt;vtkRenderer.h&gt;<br>
#include &lt;vtkImageActor.h&gt;<br>
#include &lt;vtkScalarsToColors.h&gt;<br>
#include &lt;vtkImageMapToWindowLevelColors.h&gt;<br>
<br>
int main(int argc, char *argv[]){<br>
<br>
  vtkImageData*intensityImageData = vtkImageData::New();<br>
  vtkImageViewer2*view=vtkImageViewer2::New();<br>
  vtkImageMapper*imageMapper = vtkImageMapper::New();<br>
  int width=400;<br>
  int height=400;<br>
  double*data=new double[width*height];<br>
<br>
  for(int i=0;i&lt;width*height;i++)<br>
    data[i]=0;<br>
<br>
  intensityImageData-&gt;SetDimensions(width,height,1);<br>
  intensityImageData-&gt;SetNumberOfScalarComponents(1);<br>
  intensityImageData-&gt;SetScalarTypeToDouble();<br>
  intensityImageData-&gt;AllocateScalars();<br>
  memcpy(intensityImageData-&gt;GetScalarPointer(),data,width*height*sizeof(double));<br>
  view-&gt;SetInput(intensityImageData);<br>
<br>
  vtkLookupTable*colorMap = vtkLookupTable::New();<br>
  colorMap-&gt;SetHueRange(0.4,1.0);<br>
  colorMap-&gt;SetValueRange(1.0,1.0);<br>
  colorMap-&gt;SetRange(0,1);<br>
  colorMap-&gt;Build();<br>
  vtkImageMapToWindowLevelColors*colorMapper=view-&gt;GetWindowLevel();<br>
  colorMapper-&gt;SetLookupTable(colorMap);<br>
  colorMapper-&gt;SetInput(intensityImageData);<br>
  colorMapper-&gt;SetLevel(10);<br>
  colorMapper-&gt;SetWindow(255);<br>
  vtkScalarBarActor*scalarBar = vtkScalarBarActor::New();<br>
  scalarBar-&gt;SetLookupTable(colorMap);<br>
  scalarBar-&gt;SetTitle(&quot;Intensity&quot;);<br>
  scalarBar-&gt;SetNumberOfLabels(4);<br>
<br>
  view-&gt;GetRenderer()-&gt;AddActor2D(scalarBar);<br>
<br>
<br>
  view-&gt;Render();<br>
<br>
  intensityImageData-&gt;Delete();<br>
  view-&gt;Delete();<br>
  imageMapper-&gt;Delete();<br>
  scalarBar-&gt;Delete();<br>
  colorMap-&gt;Delete();<br>
<br>
  delete data;<br>
  return 0;<br>
}<br>
etLookupTable(colorMap);<br>
  scalarBar-&gt;SetTitle(&quot;Intensity&quot;);<br>
  scalarBar-&gt;SetNumberOfLabels(4);<br>
<br>
  view-&gt;GetRenderer()-&gt;AddActor2D(scalarBar);<br>
<br>
<br>
  view-&gt;Render();<br>
<br>
  intensityImageData-&gt;Delete();<br>
  view-&gt;Delete();<br>
  imageMapper-&gt;Delete();<br>
  scalarBar-&gt;Delete();<br>
  colorMap-&gt;Delete();<br>
<br>
  delete data;<br>
  return 0;<br>
}<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>