<div>David,</div>
<div>&nbsp;</div>
<div>Looks OK to me. Does aimpack.h contain and strange #define&#39;s? </div>
<div>&nbsp;</div>
<div>Bill<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 10/18/07, <b class="gmail_sendername">David Christen</b> &lt;<a href="mailto:davidchristen@gmail.com">davidchristen@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hi all.<br><br>I wrote an ImageIO-class for a proprietary image file format (AIM).<br>(see&nbsp;&nbsp;itkAIMImageIO.h
 below) For the last few days I was trying to add<br>the possibility of reading/writing a log about the processing done on<br>the image (ProcessingLog). However, if I call the Set- or<br>GetProcessingLog functions, I get a compiler error:
<br><br>AIMReadWrite.cxx:59: error: &#39;class itk::AIMImageIO&#39; has no member<br>named &#39;SetProcessingLog&#39;<br><br>The idea is to get the log from the reader-object, eventually modify<br>it and finally pass it to the writer-object.
<br><br>I&#39;ve been trying many things and I found out, that I can&#39;t declare any<br>additional public functions or members. Well, I can, and I can even<br>find it in the (shared) library, but if I include it in an application
<br>and try to call the method or variable, I get the error above.<br>If I don&#39;t call any of the added functions, the application compiles<br>smoothly and the executable does exactly as expected.<br><br>If I make the member variable m_ProcessingLog public, I still can&#39;t
<br>access it from outside the class. (&quot;... has no member named<br>&#39;m_ProcessingLog&#39; &quot;)<br><br>The output of nm is:<br>[dch@neuron itkUtilities]$ nm -C libvtkmyITKUtility.so | grep AIMImageIO<br>&lt;..&gt;
<br>00000000000f15fa W itk::AIMImageIO::SetProcessingLog(char const*)<br>00000000000f15cc W<br>itk::AIMImageIO::SetProcessingLog(std::basic_string&lt;char,<br>std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)
<br>&lt;..&gt;<br>00000000000f15dc W itk::AIMImageIO::GetProcessingLog() const<br>&lt;..&gt;<br><br>So the macro was correctly expanded (I even tested it in a member<br>function of the class).<br><br>I strongly suspect a namespace problem, but I can&#39;t figure out what I
<br>have to change.<br><br>Any help is very much appreciated,<br>David<br><br><br>/**========================================================================<br>itkAIMImageIO.h<br>=========================================================================*/
<br>#ifndef __itkAIMImageIO_h<br>#define __itkAIMImageIO_h<br><br>#include &quot;itkImageIOBase.h&quot;<br><br>#include &quot;aimpack.h&quot;<br><br>namespace itk<br>{<br>/** \class AIMImageIO<br>*<br>* \brief ImageIO object for reading and writing AIM Files
<br>*<br>*/<br>class ITK_EXPORT AIMImageIO : public ImageIOBase<br>{<br>public:<br>/** Standard class typedefs. */<br>typedef AIMImageIO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Self;<br>typedef ImageIOBase&nbsp;&nbsp;Superclass;<br>typedef SmartPointer&lt;Self&gt;&nbsp;&nbsp;Pointer;
<br>typedef SmartPointer&lt;const Self&gt;&nbsp;&nbsp;ConstPointer;<br><br>/** Method for creation through the object factory. */<br>itkNewMacro(Self);<br><br>/** Run-time type information (and related methods). */<br>itkTypeMacro(AIMImageIO, ImageIOBase);
<br><br>/** Any other get/set options that should be public */<br><br>itkGetStringMacro(ProcessingLog);<br>itkSetStringMacro(ProcessingLog);<br><br>/*-------- This part of the interface deals with reading data. -----*/<br>
<br>/** Determine the file type. Returns true if this ImageIO can read the<br>&nbsp;&nbsp;* file specified. */<br>virtual bool CanReadFile(const char*);<br><br>/** Set the spacing and diemention information for the set filename.*/<br>
virtual void ReadImageInformation();<br><br>/** Reads the data from disk into the memory buffer provided. */<br>virtual void Read(void* buffer);<br><br><br>/*-------- This part of the interfaces deals with writing data. ----*/
<br><br>/** Determine the file type. Returns true if this ImageIO can read the<br>&nbsp;&nbsp;* file specified. */<br>virtual bool CanWriteFile(const char*);<br><br>/** Writes the spacing and dimentions of the image.<br>&nbsp;&nbsp;* Assumes SetFileName has been called with a valid file name. */
<br>virtual void WriteImageInformation();<br><br>/** Writes the data to disk from the memory buffer provided. Make sure<br>&nbsp;&nbsp;* that the IORegion has been set properly. */<br>virtual void Write(const void* buffer);<br><br>
protected:<br>AIMImageIO();<br>~AIMImageIO();<br>void PrintSelf(std::ostream&amp; os, Indent indent) const;<br><br>D3AnyImage030 * m_AIMimage;<br>std::string m_ProcessingLog;<br><br>private:<br>AIMImageIO(const Self&amp;); //purposely not implemented
<br>void operator=(const Self&amp;); //purposely not implemented<br><br>};<br><br>} // end namespace itk<br><br>#endif // __itkAIMImageIO_h<br><br><br>/**========================================================================
<br>AIMReadWrite.cxx<br>=========================================================================*/<br>#include &quot;itkImageFileReader.h&quot;<br>#include &quot;itkImageFileWriter.h&quot;<br>#include &quot;itkAIMImageIO.h
&quot;<br><br>//#include &quot;itkImage.h&quot;<br><br><br>int main( int argc, char ** argv )<br>{<br>// Verify the number of parameters in the command line<br>if( argc &lt; 3 )<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp; std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; std::endl;
<br>&nbsp;&nbsp; std::cerr &lt;&lt; argv[0] &lt;&lt; &quot; inputImageFile&nbsp;&nbsp;outputImageFile &quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;&lt;std::endl;<br>&nbsp;&nbsp; return EXIT_FAILURE;<br>&nbsp;&nbsp; }<br><br>typedef float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PixelType;<br>const&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dimension = 3;
<br>typedef itk::Image&lt; PixelType, Dimension &gt;&nbsp;&nbsp;&nbsp;&nbsp;ImageType;<br><br>typedef itk::ImageFileReader&lt; ImageType &gt;&nbsp;&nbsp;ReaderType;<br>typedef itk::ImageFileWriter&lt; ImageType &gt;&nbsp;&nbsp;WriterType;<br>typedef itk::AIMImageIO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ImageIOType;
<br><br>ReaderType::Pointer reader = ReaderType::New();<br>WriterType::Pointer writer = WriterType::New();<br>ImageIOType::Pointer aimIOwrite = ImageIOType::New();<br>ImageIOType::Pointer aimIOread = ImageIOType::New();<br>
<br>const char * inputFilename&nbsp;&nbsp;= argv[1];<br>const char * outputFilename = argv[2];<br><br>reader-&gt;SetFileName( inputFilename&nbsp;&nbsp;);<br>writer-&gt;SetFileName( outputFilename );<br><br>writer-&gt;SetInput( reader-&gt;GetOutput() );
<br><br>aimIOread-&gt;CanReadFile(inputFilename);<br><br>reader-&gt;SetImageIO( aimIOread );<br>writer-&gt;SetImageIO( aimIOwrite );<br><br>try<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp; reader-&gt;Update();<br>&nbsp;&nbsp; }<br>catch( itk::ExceptionObject &amp; err )
<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp; std::cerr &lt;&lt; &quot;ExceptionObject caught !&quot; &lt;&lt; std::endl;<br>&nbsp;&nbsp; std::cerr &lt;&lt; err &lt;&lt; std::endl;<br>&nbsp;&nbsp; return EXIT_FAILURE;<br>&nbsp;&nbsp; }<br><br>aimIOwrite-&gt;SetProcessingLog( aimIOread-&gt;GetProcessingLog() );
<br><br>try<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp; writer-&gt;Update();<br>&nbsp;&nbsp; }<br>catch( itk::ExceptionObject &amp; err )<br>&nbsp;&nbsp; {<br>&nbsp;&nbsp; std::cerr &lt;&lt; &quot;ExceptionObject caught !&quot; &lt;&lt; std::endl;<br>&nbsp;&nbsp; std::cerr &lt;&lt; err &lt;&lt; std::endl;
<br>&nbsp;&nbsp; return EXIT_FAILURE;<br>&nbsp;&nbsp; }<br><br>return EXIT_SUCCESS;<br>}<br>_______________________________________________<br>Insight-users mailing list<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br>
<a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br></blockquote></div><br>