Hello all.<br><br>I'm writing a C/C++ program in which I use VTK 4.4 (on Fedora platform). I'm trying to read a VTK-formated file and store data to an array. This is part of the code:<br><font style="color: rgb(255, 0, 127);" size="1"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; vtkImageData *coral = vtkImageData::New();</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; /* Set up an XML reader object */</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; vtkXMLImageDataReader *reader = vtkXMLImageDataReader::New();</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; /* Put here the file name of the data set */</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; reader-&gt;SetFileName("/MadracisMirabilisFirst.vti");</span><br style="font-style: italic;"><br style="font-style:
 italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; /* With vtkExtractGrid we can choose the volume of interest (VOI) and</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; subsample the data set */</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; vtkExtractVOI *voi = vtkExtractVOI::New();</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; voi-&gt;SetInput(reader-&gt;GetOutput());</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; reader-&gt;Update(); /* Read the data file */</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; /* Choose the volume of interest and do the resampling */</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; voi-&gt;SetSampleRate(8, 8, 8);</span><br
 style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; voi-&gt;SetOutput(coral);</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; voi-&gt;Update(); /* Apply the update */</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; /* Get the number of points in the data */</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; int extent[6];</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; coral-&gt;GetExtent(extent);</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; /* Get the spacing in the data. Because our data is in cm and the data of</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; coral is in mm, we have to multiply the spacing
 with 0.10 */</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; double spacing[3];</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; coral-&gt;GetSpacing(spacing);</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; spacing[0] *= 0.10;</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; spacing[1] *= 0.10;</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; spacing[2] *= 0.10;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; /* Rotate the coral in a way that it stands correct in the computational</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; domain and save it in the array 'compdom'. This is for the fist and</span><br style="font-style:
 italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; second data set. This is for object 389 and 393! */</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; int X = (extent[1] - extent[0] + 1);</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; int Y = (extent[3] - extent[2] + 1);</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; int Z = (extent[5] - extent[4] + 1);</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; int *compdom;</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; if((compdom = (int *)malloc(sizeof(int) * X*Y*Z)) == NULL) {</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fprintf(stderr, "failed to allocate memory for computational domain\n");</span><br
 style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit(EXIT_FAILURE);</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; }</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; for(int k = extent[5], c = 0; k &gt;= extent[4]; k--, c++) {</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int j = extent[3], b = 0; j &gt;= extent[2]; j--, b++) {</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i = extent[0], a = 0; i &lt;= extent[1]; i++, a++) {</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COMPDOM(a,b,c) =</span><br style="font-style: italic;"><span
 style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (int)(coral-&gt;GetScalarComponentAsFloat(i,j,k,0));</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br style="font-style: italic;"><span style="font-style: italic;">&nbsp;&nbsp;&nbsp; }</span><br style="font-style: italic;"></font><br>I'm using CMake to create Makefile and it already created the Makefile. But when I compiled the program by "make" command, it raised the following error:<br><span style="font-style: italic; color: rgb(255, 0, 0);">/ufs/chu/VTK/extract/extract.cxx:82: error: ‘class vtkImageData’ has no member named ‘GetScalarComponentAsFloat’<br><br></span><span style="color: rgb(0, 0, 0);"><font
 size="2">I already checked the help document and found that the method </font></span><font style="color: rgb(255, 0, 127);" size="1"><font style="color: rgb(0, 0, 0);" size="2">GetScalarComponentAsFloat() is used only for TCL. Any of you know how to do replace this method when using C/C++?<br><br>Thank you very much in advance.<br><br>Dzung.<br></font><span style="font-style: italic;"></span></font><p>&#32;
      <hr size=1>Be a better Globetrotter. <a href="http://us.rd.yahoo.com/evt=48254/*http://answers.yahoo.com/dir/_ylc=X3oDMTI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklfMzYwBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545469">Get better travel answers </a>from someone who knows.<br>Yahoo! Answers - Check it out.