[Insight-developers] compile problems current (12AM CST sep 9 2005)CVS checkout

Lorensen, William E (Research) lorensen at crd.ge.com
Thu Sep 8 16:12:55 EDT 2005


Within the itk namespace we should not use itk::. I have been pulling these out as I come across them.

Bill
-----Original Message-----
From: insight-developers-bounces+lorensen=crd.ge.com at itk.org
[mailto:insight-developers-bounces+lorensen=crd.ge.com at itk.org]On Behalf
Of Kent Williams
Sent: Thursday, September 08, 2005 3:13 PM
To: Insight Developers List
Subject: [Insight-developers] compile problems current (12AM CST sep 9
2005)CVS checkout


I had to change a couple of files to get the current CVS Insight to 
build -- diff below.

I don't know if the problem is that GCC4.1 is pickier than what people 
generally use, but these problems look like actual errors.

1) in itkOrientImageFilter, the SetDesiredCoordinateOrientationToXXX 
functions use itk:: namesapce prefix on SpatialOrientation flags.  Since 
the definition of OrientImageFilter is IN the itk namespace, gcc 
couldn't find itk::itk::SpatialOrientation.

Also, these functions themselves are suspect. There are 16 possible 
permutations each of Axial, Coronal, and Sagittal spatial orientations, 
and these functions choose one. Does this mean that RAI is the one true 
Axial with respect to ITK?

2) itkDebugMacro refers to itk::Object, which again, if you're already 
in the itk namespace, gcc thinks you're saying itk::itk::Object, which 
it can't find. Either the macro will never be used outside the itk 
namespace (in which case, we should get rid of the itk:: prefix) or it 
will be used outside the itk namespace, in which case the prefix should 
be ::itk::

I've not checked in these changes because I'm not sure I'm right about 
this -- though I suspect I am -- and because I don't want to muddy the 
waters, with respect to getting the dashboards all green, since 
apparently no one else is experiencing these errors.

Index: Code/BasicFilters/itkOrientImageFilter.h
===================================================================
RCS file: 
/cvsroot/Insight/Insight/Code/BasicFilters/itkOrientImageFilter.h,v
retrieving revision 1.4
diff -c -r1.4 itkOrientImageFilter.h
*** Code/BasicFilters/itkOrientImageFilter.h    22 Apr 2005 20:43:28 
-0000    1.4
--- Code/BasicFilters/itkOrientImageFilter.h    8 Sep 2005 18:58:30 -0000
***************
*** 228,242 ****
     */
    void SetDesiredCoordinateOrientationToAxial ()
      {
!    this->SetDesiredCoordinateOrientation 
(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RAI);
      }
    void SetDesiredCoordinateOrientationToCoronal ()
      {
!     this->SetDesiredCoordinateOrientation 
(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_RSA);
      }
    void SetDesiredCoordinateOrientationToSagittal ()
      {
!     this->SetDesiredCoordinateOrientation 
(itk::SpatialOrientation::ITK_COORDINATE_ORIENTATION_ASL);
      }
 
    /** OrientImageFilter produces an image which is a different
--- 228,242 ----
     */
    void SetDesiredCoordinateOrientationToAxial ()
      {
!    this->SetDesiredCoordinateOrientation 
(SpatialOrientation::ITK_COORDINATE_ORIENTATION_RAI);
      }
    void SetDesiredCoordinateOrientationToCoronal ()
      {
!     this->SetDesiredCoordinateOrientation 
(SpatialOrientation::ITK_COORDINATE_ORIENTATION_RSA);
      }
    void SetDesiredCoordinateOrientationToSagittal ()
      {
!     this->SetDesiredCoordinateOrientation 
(SpatialOrientation::ITK_COORDINATE_ORIENTATION_ASL);
      }
 
    /** OrientImageFilter produces an image which is a different
Index: Code/Common/itkMacro.h
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/Common/itkMacro.h,v
retrieving revision 1.55
diff -c -r1.55 itkMacro.h
*** Code/Common/itkMacro.h    28 Aug 2005 11:59:53 -0000    1.55
--- Code/Common/itkMacro.h    8 Sep 2005 18:58:30 -0000
***************
*** 402,408 ****
  #define itkDebugMacro(x)
  #else
  #define itkDebugMacro(x) \
! { if (this->GetDebug() && itk::Object::GetGlobalWarningDisplay()) \
      { ::itk::OStringStream itkmsg; \
        itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
               << this->GetNameOfClass() << " (" << this << "): " x  \
--- 402,408 ----
  #define itkDebugMacro(x)
  #else
  #define itkDebugMacro(x) \
!   { if (this->GetDebug() && ::itk::Object::GetGlobalWarningDisplay())   \
      { ::itk::OStringStream itkmsg; \
        itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n" \
               << this->GetNameOfClass() << " (" << this << "): " x  \

_______________________________________________
Insight-developers mailing list
Insight-developers at itk.org
http://www.itk.org/mailman/listinfo/insight-developers


More information about the Insight-developers mailing list