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;"> vtkImageData *coral = vtkImageData::New();</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> /* Set up an XML reader object */</span><br style="font-style: italic;"><span style="font-style: italic;"> vtkXMLImageDataReader *reader = vtkXMLImageDataReader::New();</span><br style="font-style: italic;"><span style="font-style: italic;"> /* Put here the file name of the data set */</span><br style="font-style: italic;"><span style="font-style: italic;"> reader->SetFileName("/MadracisMirabilisFirst.vti");</span><br style="font-style: italic;"><br style="font-style:
italic;"><span style="font-style: italic;"> /* With vtkExtractGrid we can choose the volume of interest (VOI) and</span><br style="font-style: italic;"><span style="font-style: italic;"> subsample the data set */</span><br style="font-style: italic;"><span style="font-style: italic;"> vtkExtractVOI *voi = vtkExtractVOI::New();</span><br style="font-style: italic;"><span style="font-style: italic;"> voi->SetInput(reader->GetOutput());</span><br style="font-style: italic;"><span style="font-style: italic;"> reader->Update(); /* Read the data file */</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> /* Choose the volume of interest and do the resampling */</span><br style="font-style: italic;"><span style="font-style: italic;"> voi->SetSampleRate(8, 8, 8);</span><br
style="font-style: italic;"><span style="font-style: italic;"> voi->SetOutput(coral);</span><br style="font-style: italic;"><span style="font-style: italic;"> voi->Update(); /* Apply the update */</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> /* Get the number of points in the data */</span><br style="font-style: italic;"><span style="font-style: italic;"> int extent[6];</span><br style="font-style: italic;"><span style="font-style: italic;"> coral->GetExtent(extent);</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> /* 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;"> coral is in mm, we have to multiply the spacing
with 0.10 */</span><br style="font-style: italic;"><span style="font-style: italic;"> double spacing[3];</span><br style="font-style: italic;"><span style="font-style: italic;"> coral->GetSpacing(spacing);</span><br style="font-style: italic;"><span style="font-style: italic;"> spacing[0] *= 0.10;</span><br style="font-style: italic;"><span style="font-style: italic;"> spacing[1] *= 0.10;</span><br style="font-style: italic;"><span style="font-style: italic;"> spacing[2] *= 0.10;</span><br style="font-style: italic;"><br style="font-style: italic;"><span style="font-style: italic;"> /* Rotate the coral in a way that it stands correct in the computational</span><br style="font-style: italic;"><span style="font-style: italic;"> 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;"> second data set. This is for object 389 and 393! */</span><br style="font-style: italic;"><span style="font-style: italic;"> int X = (extent[1] - extent[0] + 1);</span><br style="font-style: italic;"><span style="font-style: italic;"> int Y = (extent[3] - extent[2] + 1);</span><br style="font-style: italic;"><span style="font-style: italic;"> int Z = (extent[5] - extent[4] + 1);</span><br style="font-style: italic;"><span style="font-style: italic;"> int *compdom;</span><br style="font-style: italic;"><span style="font-style: italic;"> if((compdom = (int *)malloc(sizeof(int) * X*Y*Z)) == NULL) {</span><br style="font-style: italic;"><span style="font-style: italic;"> fprintf(stderr, "failed to allocate memory for computational domain\n");</span><br
style="font-style: italic;"><span style="font-style: italic;"> exit(EXIT_FAILURE);</span><br style="font-style: italic;"><span style="font-style: italic;"> }</span><br style="font-style: italic;"><span style="font-style: italic;"> for(int k = extent[5], c = 0; k >= extent[4]; k--, c++) {</span><br style="font-style: italic;"><span style="font-style: italic;"> for(int j = extent[3], b = 0; j >= extent[2]; j--, b++) {</span><br style="font-style: italic;"><span style="font-style: italic;"> for(int i = extent[0], a = 0; i <= extent[1]; i++, a++) {</span><br style="font-style: italic;"><span style="font-style: italic;"> COMPDOM(a,b,c) =</span><br style="font-style: italic;"><span
style="font-style: italic;"> (int)(coral->GetScalarComponentAsFloat(i,j,k,0));</span><br style="font-style: italic;"><span style="font-style: italic;"> }</span><br style="font-style: italic;"><span style="font-style: italic;"> }</span><br style="font-style: italic;"><span style="font-style: italic;"> }</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> 
<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.