<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><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 style="" 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 <itkFunctionBase.h><br>#include <itkImageRegionConstIteratorWithIndex.h><br>#include <itkMatrix.h><br>#include <itkSpatialObject.h><br><br>#include "itkExtMomentsCalculator.h"<br><br>namespace itkExt<br>{<br> /**<br> */<br> template< class I, class M = I ><br> class ImageMoments<br> : public itk::Object<br> {<br> public:<br> typedef ImageMoments Self;<br> typedef itk::Object Superclass;<br> typedef itk::SmartPointer< Self > Pointer;<br> typedef itk::SmartPointer< const Self > 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< TScalar, Dimension > 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 <double,TDimension> TSpatialObject;<br><br> <br> protected:<br> typedef itk::ImageRegionConstIteratorWithIndex< TImage > _TIterator;<br><br> public:<br> itkNewMacro( Self );<br> itkTypeMacro( ImageMoments, itkObject );<br><br> itkGetConstObjectMacro( Image, TImage );<br> itkGetConstObjectMacro( ImageMask, TImageMask );<br> <font style="" color="#FF0000">itkGetConstObjectMacro( SpatialMask, TSpatialObject );</font><font style="" color="#FF0000"><br></font><font style="" 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& GetMass( ) const<br> { return( this->m_Calculator.GetMass( ) ); }<br> const TVector& GetCenter( ) const<br> { return( this->m_Calculator.GetCenter( ) ); }<br> const TVector& GetOffset( ) const<br> { return( this->m_Calculator.GetOffset( ) ); }<br> const TMatrix& GetInertia( ) const<br> { return( this->m_Calculator.GetInertia( ) ); }<br> const TVector& GetProperValues( ) const<br> { return( this->m_Calculator.GetProperValues( ) ); }<br> const TMatrix& GetProperMatrix( ) const<br> { return( this->m_Calculator.GetProperMatrix( ) ); }<br> THMatrix GetHomogeneousMatrix( ) const<br> { return( this->m_Calculator.GetHomogeneousMatrix( ) ); }<br><br> void AlignProperMatrix( const TVector& dir )<br> { this->m_Calculator.AlignProperMatrix( dir ); }<br> void AlignProperMatrix( const TMatrix& rot )<br> { this->m_Calculator.AlignProperMatrix( rot ); }<br><br> virtual void Compute( )<br> { this->Compute( this->m_Image->GetRequestedRegion( ) ); }<br> virtual void Compute( const TRegion& reg );<br> virtual void Modified( ) const;<br><br> protected:<br> ImageMoments( );<br> virtual ~ImageMoments( );<br><br> bool _ComputeValue( TPixel& v, TVector& p, const _TIterator& i ) const;<br><br> private:<br> ImageMoments( const Self& ); // Not impl.<br> void operator=( const Self& ); // 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 "itkExtImageMoments.txx"<br><br>#endif // __ITKEXT__IMAGE__IMAGEMOMENTS__H__<br><br>// eof - $RCSfile: itkExtImageMoments.h,v $<br><br><br><br><h1 id="ecxtitle_div2200963175"><br></h1><h1 id="ecxtitle_div2200963175"><br></h1>                                            </div></body>
</html>