<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Dear all,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have written an ITK program which gives me errors when I try to compile it. I have copied a small sample of the errors below. All the other errors are similar.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C2039: 'RegionType' : is not a member of '`global namespace''<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C2146: syntax error : missing ';' before identifier 'OutputImageRegionType'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2825: 'itk::ImageSource<TOutputImage>::OutputImageType': must be a class or namespace when
followed by '::'<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2039: 'PixelType' : is not a member of '`global namespace''<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2146: syntax error : missing ';' before identifier 'OutputImagePixelType'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2825: 'TOutputImage': must be a class or namespace when followed by '::'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2039: 'ImageDimension' : is not a member of '`global namespace''<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2275: 'TOutputImage' : illegal use of this type as an expression<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2> c:\program files\itk\include\itk-4.6\itkImageToImageFilter.h(103) : see declaration of 'TOutputImage'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2146: syntax error : missing '}' before identifier 'ImageDimension'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2143: syntax error : missing ';' before '}'<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.0pt;font-family:Consolas">2>c:\program files\itk\include\itk-4.6\itkImageToImageFilter.h(115): error C2039: 'OutputImageRegionType' : is not a member of 'itk::ImageSource<TOutputImage>'<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">When I searched on google, I found that this might happen if header files are included in the ‘wrong’ order. If it helps, I have included them in the following order:<o:p></o:p></p>
<p class="MsoNormal">#include <iostream><o:p></o:p></p>
<p class="MsoNormal">#include "itkImage.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkPoint.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkIndex.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkImageFileReader.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkImageFileWriter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkMedianImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkThresholdImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkBinaryThresholdImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkBinaryFillholeImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkMaskImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkOtsuThresholdImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkAndImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkBinaryShapeOpeningImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkBinaryShapeKeepNObjectsImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkXorImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkConnectedComponentImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal">#include "itkLabelGeometryImageFilter.h"<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have created a separate header file in which I have included all the above header files and also all the typedef’s for the filters. Can anybody give me an idea to why such errors may be occurring? I have not used a ‘using namespace xxxx’
anywhere.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks & Regards,<o:p></o:p></p>
<p class="MsoNormal">Ruturaj<o:p></o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified
that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.<br>
</font>
</body>
</html>