Hello, everyone!<br>I am writing my custom reader for my data format.I wrote it and Built it with some errors!<br>So I have some questions to ask for help!<br>Basic information:<br>My output data type is vtkImageData, so my code was deriven form vtkImageAlgorithm<br>
1.Should I use <b>FillInputPortInformation </b>or <b>FillOutputPortInformation </b>like below<br><br>int vtkMyPluginReader::FillOutputPortInformation(int, vtkInformation *info)<br>{<br>    info-&gt;Set(vtkDataObject::DATA_TYPE_NAME(), &quot;vtkImageData&quot;);<br>
    return 1;<br>}<br clear="all"><br><b>or</b><br><br>int vtkMyPluginReader::FillInputPortInformation(int, vtkInformation *info)<br>{<br>  info-&gt;Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), &quot;vtkImageAlgorithm&quot;);<br>
  return 1;<br>}<br><b>Which one is right when I am writing a reader NOT a filter?</b><br><br>2.My header is like that below. Is that enough for a reader?:<br>//----------------------------------------------------------------------------<br>
#ifndef __vtkMyPluginReader_h_<br>#define __vtkMyPluginReader_h_<br><br>#include &quot;vtkImageAlgorithm.h&quot;<br>#include &quot;vtkMyPlugin.h&quot;               //Needed for read actual META_DATA<br><br>class VTK_EXPORT vtkMyPluginReader : public vtkImageAlgorithm<br>
{<br>public:<br>    static vtkMyPluginReader *New();<br>    vtkTypeRevisionMacro(vtkMyPluginReader, vtkImageAlgorithm);<br>    void PrintSelf(ostream&amp; os, vtkIndent indent);<br><br>    vtkSetStringMacro( FileName );<br>
    vtkGetStringMacro( FileName );<br><br>    virtual int ReadMetaData(vtkInformation *outInfo);//Get the actual data from a data file<br><br>protected:<br>    vtkMyPluginReader();<br>    ~vtkMyPluginReader();<br><br>    virtual int RequestData(vtkInformation *, vtkInformationVector **,<br>
                            vtkInformationVector *);<br><br>    virtual int RequestInformation(vtkInformation *, vtkInformationVector **,<br>                                   vtkInformationVector *);<br><br>    virtual int FillOutputPortInformation(int, vtkInformation *);<br>
<br>public:<br>    vtkMyplugin pluginfile;<br>    char *FileName;<br><br>private:<br>    vtkMyPluginReader(const vtkMyPluginReader&amp;);      //Not implemented<br>    void operator=(const vtkMyPluginReader&amp;);   //Not implemented<br>
};<br>#endif<br>//----------------------------------------------------------------------------<br><br><br>Thank you so much for helping me!<br><br>-Seven<br>-- <br><a href="mailto:shenyanwen@gmail.com">shenyanwen@gmail.com</a><br>
Mobile Phone:13476177952<br>Tel: 027-87558144<br>