[Insight-users] .h

Dženan Zukić dzenanz at gmail.com
Fri Oct 14 03:43:33 EDT 2011


Have you tried includeing itkMacro.h?

On Wed, Oct 12, 2011 at 01:41, ivan mantilla <ivan_mantilla at hotmail.com>wrote:

>  hi everyone
> 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 itkGetConstObjectMacrohow should i put the type of the function?? im really lost about it and i
> try everthing..
> the error that i get is ‘TSpatialObject’ does not name a type 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
>
>
> #ifndef __ITKEXT__IMAGE__IMAGEMOMENTS__H__
> #define __ITKEXT__IMAGE__IMAGEMOMENTS__H__
>
> #include <itkFunctionBase.h>
> #include <itkImageRegionConstIteratorWithIndex.h>
> #include <itkMatrix.h>
> #include <itkSpatialObject.h>
>
> #include "itkExtMomentsCalculator.h"
>
> namespace itkExt
> {
>   /**
>    */
>   template< class I, class M = I >
>   class ImageMoments
>     : public itk::Object
>   {
>   public:
>     typedef ImageMoments                    Self;
>     typedef itk::Object                     Superclass;
>     typedef itk::SmartPointer< Self >       Pointer;
>     typedef itk::SmartPointer< const Self > ConstPointer;
>
>     itkStaticConstMacro( Dimension, unsigned int, I::ImageDimension );
>
>     typedef I                           TImage;
>     typedef M                           TImageMask;
>     typedef typename TImage::IndexType  TIndex;
>     typedef typename TImage::PixelType  TPixel;
>     typedef typename TImage::RegionType TRegion;
>     typedef typename TImage::ValueType  TScalar;
>
>     typedef itkExt::MomentsCalculator< TScalar, Dimension > TCalculator;
>     typedef typename TCalculator::THMatrix                  THMatrix;
>     typedef typename TCalculator::TMatrix                   TMatrix;
>     typedef typename TCalculator::TPoint                    TPoint;
>     typedef typename TCalculator::TVector                   TVector;
>     typedef FixedArray <double,TDimension>             TSpatialObject;
>
>
>  protected:
>     typedef itk::ImageRegionConstIteratorWithIndex< TImage > _TIterator;
>
>   public:
>     itkNewMacro( Self );
>     itkTypeMacro( ImageMoments, itkObject );
>
>     itkGetConstObjectMacro( Image, TImage );
>     itkGetConstObjectMacro( ImageMask, TImageMask );
>     itkGetConstObjectMacro( SpatialMask, TSpatialObject );
>     itkGetObjectMacro( PixelFunction,  PixelFunctionType );
>
>     itkSetConstObjectMacro( Image, TImage );
>     itkSetConstObjectMacro( ImageMask, TImageMask );
>     itkSetConstObjectMacro( SpatialMask, TSpatialObject );
>     itkSetObjectMacro( PixelFunction, TPixelFunction );
>
>   public:
>     const TScalar& GetMass( ) const
>       { return( this->m_Calculator.GetMass( ) ); }
>     const TVector& GetCenter( ) const
>       { return( this->m_Calculator.GetCenter( ) ); }
>     const TVector& GetOffset( ) const
>       { return( this->m_Calculator.GetOffset( ) ); }
>     const TMatrix& GetInertia( ) const
>       { return( this->m_Calculator.GetInertia( ) ); }
>     const TVector& GetProperValues( ) const
>       { return( this->m_Calculator.GetProperValues( ) ); }
>     const TMatrix& GetProperMatrix( ) const
>       { return( this->m_Calculator.GetProperMatrix( ) ); }
>     THMatrix GetHomogeneousMatrix( ) const
>       { return( this->m_Calculator.GetHomogeneousMatrix( ) ); }
>
>     void AlignProperMatrix( const TVector& dir )
>       { this->m_Calculator.AlignProperMatrix( dir ); }
>     void AlignProperMatrix( const TMatrix& rot )
>       { this->m_Calculator.AlignProperMatrix( rot ); }
>
>     virtual void Compute( )
>       { this->Compute( this->m_Image->GetRequestedRegion( ) ); }
>     virtual void Compute( const TRegion& reg );
>     virtual void Modified( ) const;
>
>   protected:
>     ImageMoments( );
>     virtual ~ImageMoments( );
>
>     bool _ComputeValue( TPixel& v, TVector& p, const _TIterator& i ) const;
>
>   private:
>     ImageMoments( const Self& );   // Not impl.
>     void operator=( const Self& ); // Not impl.
>
>   protected:
>     TCalculator m_Calculator;
>
>     typename TImage::ConstPointer         m_Image;
>     typename TImageMask::ConstPointer     m_ImageMask;
>     typename TSpatialObject::ConstPointer m_SpatialMask;
>     typename TPixelFunction::Pointer      m_PixelFunction;
>   };
>
> } // ecapseman
>
> #include "itkExtImageMoments.txx"
>
> #endif // __ITKEXT__IMAGE__IMAGEMOMENTS__H__
>
> // eof - $RCSfile: itkExtImageMoments.h,v $
>
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20111014/8d3b2695/attachment.htm>


More information about the Insight-users mailing list