<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi,<br>
    I'm trying to execute the example presented at<br>
    <br>
    <small><a class="moz-txt-link-freetext" href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/InfoVis/DelimitedTextReader">http://www.vtk.org/Wiki/VTK/Examples/Cxx/InfoVis/DelimitedTextReader</a></small><br>
    <br>
    which read a csv file (x y z n) and visualize it. When i visualize
    my file the image is all black, while it should have the color/value
    expressed in "n" value. In my case n is a GrayScale value. How can i
    modify it? I think i should modify the command<br>
    <br>
    <pre class="de1">actor<span class="sy2">-</span><span class="sy1">&gt;</span>GetProperty<span class="br0">(</span><span class="br0">)</span><span class="sy2">-</span><span class="sy1">&gt;</span>SetColor<span class="br0">(</span><span class="nu0">1</span>,<span class="nu0">0</span>,<span class="nu0">0</span><span class="br0">)</span><span class="sy4">;</span>

</pre>
    bu I don't know how. Can anybody help me? Thanks a lot.<br>
    <br>
    Luca<br>
    <pre class="de1"></pre>
    <br>
    <br>
    The application I created works well, but the image wich appears is
    all black, while i want <br>
    <br>
    Il 27/01/2011 9.25, jimmigoo ha scritto:
    <blockquote cite="mid:1296116719096-3359347.post@n5.nabble.com"
      type="cite">
      <pre wrap="">
Hi David!
Thanks for the fast reply!
I tried to change just these two code lines
      reslice-&gt;SetOutputSpacing(xResolution,yResolution,1); 
      resample-&gt;SetAxisOutputSpacing(2, 1); 
but it didn't work again. 
So, I tried to change other two code lines 
      reslice-&gt;SetOutputExtent(0,XExtent-1,0,YExtent-1,0,1); 
      resample-&gt;SetOutputExtent(0,XExtent-1,0,YExtent-1,0,1); 
but it didn't work again. 

Do you know how I have to change the code to make it workable?
I'm looking for your reply!
Best regards, 
jimmigoo


void ResampleDTM() 

      //------------- open original file ---------------------------------- 
      vtkStructuredPointsReader* imageReader =
vtkStructuredPointsReader::New(); 
      imageReader-&gt;SetFileName(“SaintHelene.vtk”); 
      imageReader-&gt;Update(); 
      //------------- reslice original vtkImageData ------------------------ 
      vtkImageReslice* reslice = vtkImageReslice::New(); 
      reslice-&gt;SetInput(imageReader-&gt;GetOutput()); 
      reslice-&gt;SetOutputOrigin(X0,Y0,0); 
      reslice-&gt;SetOutputSpacing(xResolution,yResolution,1); 
      int XExtent = (int)((Xmax_new- Xmin_new)/xResolution); 
      int YExtent = (int)((Ymax_new- Ymin_new)/yResolution); 
      reslice-&gt;SetOutputExtent(0,XExtent-1,0,YExtent-1,0,1); 
      reslice-&gt;Update(); 
      //------------- resample original vtkImageData
------------------------ 
      vtkImageResample * resample = vtkImageResample::New(); 
      resample-&gt;SetInputConnection(0, reslice-&gt;GetOutputPort()); 
      resample-&gt;SetDimensionality(3); 
      resample-&gt;SetAxisMagnificationFactor(0,1.0); 
      resample-&gt;SetAxisMagnificationFactor(1,1.0); 
      resample-&gt;SetAxisMagnificationFactor(2,1.0); 
  
      XExtent = (int)((Xmax_new- Xmin_new)/xResolution_new); 
      YExtent = (int)((Ymax_new- Ymin_new)/yResolution_new); 
  
      resample-&gt;SetOutputOrigin(X0_new,Y0_new,0); 
      resample-&gt;SetOutputExtent(0,XExtent-1,0,YExtent-1,0,1); 
      resample-&gt;SetAxisOutputSpacing(0, xResolution_new); 
      resample-&gt;SetAxisOutputSpacing(1, yResolution_new); 
      resample-&gt;SetAxisOutputSpacing(2, 1); 
      resample-&gt;Update(); 
      vtkImageData* map = resample-&gt;GetOutput(); 
      map-&gt;GetPointData()-&gt;GetArray(0)-&gt;SetName("cellvar"); 
      //------------- write resampled file
---------------------------------- 
      vtkStructuredPointsWriter* fileWriter =
vtkStructuredPointsWriter::New(); 
      fileWriter-&gt;SetFileTypeToBinary(); 
      fileWriter-&gt;SetInput(resample-&gt;GetOutput()); 
      fileWriter-&gt;SetFileName(“output.vtk”); 
      fileWriter-&gt;Write(); 
      //----------------- clean up
------------------------------------------ 
      fileWriter-&gt;Delete(); 
      resample-&gt;Delete(); 
      reslice-&gt;Delete(); 
      imageReader-&gt;Delete(); 
     
//--------------------------------------------------------------------- 

</pre>
    </blockquote>
    <br>
  </body>
</html>