<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"><<a href="mailto:ivan_mantilla@hotmail.com">ivan_mantilla@hotmail.com</a>></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 <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 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& 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><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>