<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=utf-8">
<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:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","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-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.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"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Dear Bill and Cory,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">It was a stupid mistake on my part. Thank you very much for your help. My original code is compiling and working smoothly after fixing that typo.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Cory, thanks for the link on the dangers of using ‘namespace’. I was always a bit wary of using it, though I didn’t know the reasons.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks & Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Ruturaj<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Cory Quammen [mailto:cory.quammen@kitware.com]
<br>
<b>Sent:</b> Wednesday, June 04, 2014 6:37 PM<br>
<b>To:</b> Bill Lorensen<br>
<b>Cc:</b> Girish, Gavaskar Ruturaj; community@itk.org<br>
<b>Subject:</b> Re: [ITK] Compilation errors<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Oops, Bill's right. While my general advice about namespace qualifiers stands, you were already doing that and my specific recommendations were totally wrong. I should have actually looked at your header file to see that you were indeed
qualifying the class names with the itk namespace. The dangers of responding prior to consuming any coffee...<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Cory<o:p></o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Jun 4, 2014 at 9:00 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">In the header, the definition of the median filter should be<br>
typedef itk::MedianImageFilter< GrayscaleImageType, GrayscaleImageType ><br>
MedianFilterType;<br>
<br>
not<br>
typedef itk::MedianImageFilter< GrayscalePixelType, GrayscalePixelType ><br>
MedianFilterType;<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><br>
<br>
On Wed, Jun 4, 2014 at 8:39 AM, Girish, Gavaskar Ruturaj<br>
<<a href="mailto:gavaskar.ruturaj.girish@philips.com">gavaskar.ruturaj.girish@philips.com</a>> wrote:<br>
> Dear Bill,<br>
> Here I have copied a small program which gives the same errors:<br>
><br>
> #include "Filter_Type_Definitions.h"<br>
> int main( int argc, char *argv[])<br>
> {<br>
> ReaderType::Pointer reader = ReaderType::New();<br>
> reader->SetFileName( argv[1] );<br>
> reader->Update();<br>
><br>
> //Apply a median filter<br>
> MedianFilterType::Pointer medianfilter = MedianFilterType::New();<br>
> GrayscaleImageType::SizeType indexradius;<br>
> indexradius[0] = 3; //X radius<br>
> indexradius[1] = 3; //Y radius<br>
> indexradius[2] = 3; //Z radius<br>
> medianfilter->SetRadius( indexradius );<br>
> medianfilter->SetInput( input_image );<br>
> medianfilter->Update();<br>
><br>
> }<br>
><br>
> Now, I have used only itkMedianImageFilter in this example, but in my actual code I am using many more filters. Hence I have kept the file Filter_Type_Definitions.h as it is without deleting the extra filters, in case they are of any help. I have attached
the file with this post. I had written many programs before today in which I had included all the headers in the main source code file, and they all compiled without errors. It was only when I kept the headers and typedef's in a separate file that the errors
began occurring.<br>
><br>
> Thanks & Regards,<br>
> Ruturaj<br>
><br>
> -----Original Message-----<br>
> From: Bill Lorensen [mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>]<br>
> Sent: Wednesday, June 04, 2014 5:41 PM<br>
> To: Girish, Gavaskar Ruturaj<br>
> Cc: <a href="mailto:community@itk.org">community@itk.org</a><br>
> Subject: Re: [ITK] Compilation errors<br>
><br>
> Please post a small, complete program that illustrates the problem.<br>
><br>
><br>
> On Wed, Jun 4, 2014 at 7:58 AM, Girish, Gavaskar Ruturaj <<a href="mailto:gavaskar.ruturaj.girish@philips.com">gavaskar.ruturaj.girish@philips.com</a>> wrote:<br>
>> Dear all,<br>
>><br>
>><br>
>><br>
>> I have written an ITK program which gives me errors when I try to<br>
>> compile it. I have copied a small sample of the errors below. All the<br>
>> other errors are similar.<br>
>><br>
>><br>
>><br>
>> c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C2039:<br>
>> 'RegionType' : is not a member of '`global namespace''<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C2146:<br>
>> syntax error : missing ';' before identifier 'OutputImageRegionType'<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(108): error C4430:<br>
>> missing type specifier - int assumed. Note: C++ does not support<br>
>> default-int<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2825:<br>
>> 'itk::ImageSource<TOutputImage>::OutputImageType': must be a class or<br>
>> namespace when followed by '::'<br>
>><br>
>><br>
>><br>
>> c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2039:<br>
>> 'PixelType' : is not a member of '`global namespace''<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C2146:<br>
>> syntax error : missing ';' before identifier 'OutputImagePixelType'<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(109): error C4430:<br>
>> missing type specifier - int assumed. Note: C++ does not support<br>
>> default-int<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2825:<br>
>> 'TOutputImage': must be a class or namespace when followed by '::'<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2039:<br>
>> 'ImageDimension' : is not a member of '`global namespace''<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2275:<br>
>> 'TOutputImage' : illegal use of this type as an expression<br>
>><br>
>> 2> c:\program<br>
>> files\itk\include\itk-4.6\itkImageToImageFilter.h(103) : see<br>
>> declaration of 'TOutputImage'<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2146:<br>
>> syntax error : missing '}' before identifier 'ImageDimension'<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageSource.h(112): error C2143:<br>
>> syntax error : missing ';' before '}'<br>
>><br>
>> 2>c:\program files\itk\include\itk-4.6\itkImageToImageFilter.h(115):<br>
>> 2>error<br>
>> C2039: 'OutputImageRegionType' : is not a member of<br>
>> 'itk::ImageSource<TOutputImage>'<br>
>><br>
>><br>
>><br>
>> When I searched on google, I found that this might happen if header<br>
>> files are included in the ‘wrong’ order. If it helps, I have included<br>
>> them in the following order:<br>
>><br>
>> #include <iostream><br>
>><br>
>> #include "itkImage.h"<br>
>><br>
>> #include "itkPoint.h"<br>
>><br>
>> #include "itkIndex.h"<br>
>><br>
>> #include "itkImageFileReader.h"<br>
>><br>
>> #include "itkImageFileWriter.h"<br>
>><br>
>> #include "itkMedianImageFilter.h"<br>
>><br>
>> #include "itkThresholdImageFilter.h"<br>
>><br>
>> #include "itkBinaryThresholdImageFilter.h"<br>
>><br>
>> #include "itkBinaryFillholeImageFilter.h"<br>
>><br>
>> #include "itkMaskImageFilter.h"<br>
>><br>
>> #include "itkOtsuThresholdImageFilter.h"<br>
>><br>
>> #include "itkAndImageFilter.h"<br>
>><br>
>> #include "itkBinaryShapeOpeningImageFilter.h"<br>
>><br>
>> #include "itkBinaryShapeKeepNObjectsImageFilter.h"<br>
>><br>
>> #include "itkXorImageFilter.h"<br>
>><br>
>> #include "itkConnectedComponentImageFilter.h"<br>
>><br>
>> #include "itkLabelGeometryImageFilter.h"<br>
>><br>
>><br>
>><br>
>> I have created a separate header file in which I have included all the<br>
>> above header files and also all the typedef’s for the filters. Can<br>
>> anybody give me an idea to why such errors may be occurring? I have<br>
>> not used a ‘using namespace xxxx’ anywhere.<br>
>><br>
>><br>
>><br>
>> Thanks & Regards,<br>
>><br>
>> Ruturaj<br>
>><br>
>><br>
>> ________________________________<br>
>> The information contained in this message may be confidential and<br>
>> legally protected under applicable law. The message is intended solely<br>
>> for the addressee(s). If you are not the intended recipient, you are<br>
>> hereby notified that any use, forwarding, dissemination, or<br>
>> reproduction of this message is strictly prohibited and may be<br>
>> unlawful. If you are not the intended recipient, please contact the<br>
>> sender by return e-mail and destroy all copies of the original message.<br>
>><br>
>> _______________________________________________<br>
>> Community mailing list<br>
>> <a href="mailto:Community@itk.org">Community@itk.org</a><br>
>> <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">
http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Unpaid intern in BillsBasement at noware dot com<br>
><br>
> ________________________________<br>
> 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>
<br>
<br>
<br>
--<br>
Unpaid intern in BillsBasement at noware dot com<br>
_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>