<font size="2"><font face="verdana,sans-serif">Have you tried includeing itkMacro.h?<br></font></font><br><div class="gmail_quote">On Wed, Oct 12, 2011 at 01:41, ivan mantilla <span dir="ltr">&lt;<a href="mailto:ivan_mantilla@hotmail.com">ivan_mantilla@hotmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



<div><div dir="ltr">
hi everyone<br>Im trying to use a header that one of my proffesor gave me, i did make a program but when i compile the header has some problems... next you can see the header text and the error using the function  <font color="#FF0000">itkGetConstObjectMacro</font> how should i put the type of the function?? im really lost about it and i try everthing..<br>

the error that i get is<font style="font-size:12pt" size="3"> ‘TSpatialObject’ does not name a type</font>
in the red line on the text on next, what kind of type?? i cant find anything about that function and im new with itk... thank you<br><br><br>#ifndef __ITKEXT__IMAGE__IMAGEMOMENTS__H__<br>#define __ITKEXT__IMAGE__IMAGEMOMENTS__H__<br>

<br>#include &lt;itkFunctionBase.h&gt;<br>#include &lt;itkImageRegionConstIteratorWithIndex.h&gt;<br>#include &lt;itkMatrix.h&gt;<br>#include &lt;itkSpatialObject.h&gt;<br><br>#include &quot;itkExtMomentsCalculator.h&quot;<br>

<br>namespace itkExt<br>{<br>  /**<br>   */<br>  template&lt; class I, class M = I &gt;<br>  class ImageMoments<br>    : public itk::Object<br>  {<br>  public:<br>    typedef ImageMoments                    Self;<br>    typedef itk::Object                     Superclass;<br>

    typedef itk::SmartPointer&lt; Self &gt;       Pointer;<br>    typedef itk::SmartPointer&lt; const Self &gt; ConstPointer;<br><br>    itkStaticConstMacro( Dimension, unsigned int, I::ImageDimension );<br><br>    typedef I                           TImage;<br>

    typedef M                           TImageMask;<br>    typedef typename TImage::IndexType  TIndex;<br>    typedef typename TImage::PixelType  TPixel;<br>    typedef typename TImage::RegionType TRegion;<br>    typedef typename TImage::ValueType  TScalar;<br>

<br>    typedef itkExt::MomentsCalculator&lt; TScalar, Dimension &gt; TCalculator;<br>    typedef typename TCalculator::THMatrix                  THMatrix;<br>    typedef typename TCalculator::TMatrix                   TMatrix;<br>

    typedef typename TCalculator::TPoint                    TPoint;    <br>    typedef typename TCalculator::TVector                   TVector;<br>    typedef FixedArray &lt;double,TDimension&gt;             TSpatialObject;<br>

<br>    <br> protected:<br>    typedef itk::ImageRegionConstIteratorWithIndex&lt; TImage &gt; _TIterator;<br><br>  public:<br>    itkNewMacro( Self );<br>    itkTypeMacro( ImageMoments, itkObject );<br><br>    itkGetConstObjectMacro( Image, TImage );<br>

    itkGetConstObjectMacro( ImageMask, TImageMask );<br>    <font color="#FF0000">itkGetConstObjectMacro( SpatialMask, TSpatialObject );</font><font color="#FF0000"><br></font><font color="#FF0000">    itkGetObjectMacro( PixelFunction,  PixelFunctionType );</font><br>

<br>    itkSetConstObjectMacro( Image, TImage );<br>    itkSetConstObjectMacro( ImageMask, TImageMask );<br>    itkSetConstObjectMacro( SpatialMask, TSpatialObject );<br>    itkSetObjectMacro( PixelFunction, TPixelFunction );<br>

<br>  public:<br>    const TScalar&amp; GetMass( ) const<br>      { return( this-&gt;m_Calculator.GetMass( ) ); }<br>    const TVector&amp; GetCenter( ) const<br>      { return( this-&gt;m_Calculator.GetCenter( ) ); }<br>

    const TVector&amp; GetOffset( ) const<br>      { return( this-&gt;m_Calculator.GetOffset( ) ); }<br>    const TMatrix&amp; GetInertia( ) const<br>      { return( this-&gt;m_Calculator.GetInertia( ) ); }<br>    const TVector&amp; GetProperValues( ) const<br>

      { return( this-&gt;m_Calculator.GetProperValues( ) ); }<br>    const TMatrix&amp; GetProperMatrix( ) const<br>      { return( this-&gt;m_Calculator.GetProperMatrix( ) ); }<br>    THMatrix GetHomogeneousMatrix( ) const<br>

      { return( this-&gt;m_Calculator.GetHomogeneousMatrix( ) ); }<br><br>    void AlignProperMatrix( const TVector&amp; dir )<br>      { this-&gt;m_Calculator.AlignProperMatrix( dir ); }<br>    void AlignProperMatrix( const TMatrix&amp; rot )<br>

      { this-&gt;m_Calculator.AlignProperMatrix( rot ); }<br><br>    virtual void Compute( )<br>      { this-&gt;Compute( this-&gt;m_Image-&gt;GetRequestedRegion( ) ); }<br>    virtual void Compute( const TRegion&amp; reg );<br>

    virtual void Modified( ) const;<br><br>  protected:<br>    ImageMoments( );<br>    virtual ~ImageMoments( );<br><br>    bool _ComputeValue( TPixel&amp; v, TVector&amp; p, const _TIterator&amp; i ) const;<br><br>  private:<br>

    ImageMoments( const Self&amp; );   // Not impl.<br>    void operator=( const Self&amp; ); // Not impl.<br><br>  protected:<br>    TCalculator m_Calculator;<br><br>    typename TImage::ConstPointer         m_Image;<br>

    typename TImageMask::ConstPointer     m_ImageMask;<br>    typename TSpatialObject::ConstPointer m_SpatialMask;<br>    typename TPixelFunction::Pointer      m_PixelFunction;<br>  };<br><br>} // ecapseman<br><br>#include &quot;itkExtImageMoments.txx&quot;<br>

<br>#endif // __ITKEXT__IMAGE__IMAGEMOMENTS__H__<br><br>// eof - $RCSfile: itkExtImageMoments.h,v $<br><br><br><br><h1><br></h1><h1><br></h1>                                               </div></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>