<br clear="all">Hello, everyone!<br>I wrote my own reader plugin for my custom data format.<br>But when I use it, it seems do NOT work!<br>It seems can NOT execute  the function RequetInformation.<br>Should I use the method ProcessRequest()?<br>

May some one can help me out?<br>Thanks so much!<br><br>Here are my some parts of codes:<br><br clear="all">int vtkSgnReader::<div id=":153" class="ii gt">RequestInformation(vtkInformation *vtkNotUsed(request),<br>                                     vtkInformationVector **vtkNotUsed(inputVector),<br>

                                     vtkInformationVector *outputVector)<br>{<br>         vtkInformation *outInfo = outputVector-&gt;GetInformationObject(0);<br>          return this-&gt;ReadMetaData(outInfo);<br>}<br><br>

int vtkSgnReader::ReadMetaData(vtkInformation *outInfo)<br>{<br>    if (!sgnfile-&gt;Readsgn(FileName))<br>    {<br>        return 1;<br>    }<br>    int dim[3];<br>    dim[0]=sgnfile-&gt;GetNx();<br>    dim[1]=sgnfile-&gt;GetNy();<br>

    dim[2]=sgnfile-&gt;GetNz();<br>    //Set the extent<br>    outInfo-&gt;Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),<br>                     0, dim[0]-1, 0, dim[1]-1, 0, dim[2]-1);<br>    return 1;<br>}<br><br>

int vtkSgnReader::RequestData(vtkInformation *vtkNotUsed(request), <br>                              vtkInformationVector **vtkNotUsed(inputVector),<br>                              vtkInformationVector *outputVector)<br>

{<br>    vtkInformation *outInfo = outputVector-&gt;GetInformationObject(0);<br>    vtkImageData *output = vtkImageData::GetData(outInfo);<br>   int *extent = output-&gt;GetUpdateExtent();<br>    int numPts=0;<br>    int L, M, N;<br>

    if (!sgnfile-&gt;Readsgn(FileName))<br>    {<br>        return 1;<br>    }<br>    int dim[3];<br>    dim[0] = sgnfile-&gt;GetNx();<br>    L = dim[0];<br>    dim[1] = sgnfile-&gt;GetNy();<br>    M = dim[1];<br>    dim[2] = sgnfile-&gt;GetNz();<br>

    N = dim[2];<br>    numPts = dim[0]*dim[1]*dim[2];<br>   output-&gt;SetExtent(extent);<br>    output-&gt;SetOrigin(origin);<br>    output-&gt;SetSpacing(ar);<br><br>    //set the scalar data<br>    vtkShortArray *castkey = vtkShortArray::New();<br>

    castkey-&gt;SetName(&quot;casting_type&quot;);<br>    castkey-&gt;SetNumberOfComponents(1);<br>    castkey-&gt;SetNumberOfTuples(numPts);<br>    for (int i=0; i&lt;L; i++)   for (int j=0;j&lt;M; j++)   for (int k=0; k&lt;N; k++)<br>

    {            <br>        int idx = i*M*N+j*N+k;<br>        castkey-&gt;SetTupleValue( idx, &amp;(sgnfile-&gt;GetSGNData()[idx]) );    <br>    }<br>    output-&gt;GetPointData()-&gt;AddArray(castkey);<br>    castkey-&gt;Delete(); <br>

    return 1;<br>}<br><br>Do I have something wrong with my code?<br>Thank you so much for your truly help!<br><br>-Seven</div><br>-- <br><a href="mailto:shenyanwen@gmail.com">shenyanwen@gmail.com</a><br>Mobile Phone:13476177952<br>
Tel: 027-87558144<br>