Here we go ...<br><br>Replace class by typename in <br><br><pre>template < class TInputImage, class TOutputImage, class TForegroundConnectivity,<br>class TPriorityImage=TInputImage, class TInhibitImage=TInputImage, class TBackgroundConnectivity = class BackgroundConnectivity<TForegroundConnectivity>::Type ><br>
class ITK_EXPORT UltimateSkeletonImageFilter : public ImageToImageFilter< TInputImage, TOutputImage ></pre><br>class TBackgroundConnectivity = typename BackgroundConnectivity<TForegroundConnectivity>::Type<br>
<br>Andreas<br><br><div class="gmail_quote">On Tue, Feb 2, 2010 at 8:07 PM, <span dir="ltr"><Neil.Burdett@csiro.au></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi guys,<br>
I attach the header files for Connectivity.h and UltimateSkeletonImageFilter.h<br>
<br>
Thanks for taking the time<br>
<div class="im"><br>
Neil<br>
<br>
-----Original Message-----<br>
From: Bill Lorensen [mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>]<br>
</div><div><div></div><div class="h5">Sent: Wednesday, 3 February 2010 10:35 AM<br>
To: Andreas Schuh<br>
Cc: Burdett, Neil (ICT Centre, Herston - RBWH); <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
Subject: Re: [Insight-users] typedef name cannot follow class/struct/union<br>
<br>
It is hard to tell without seeing the rest of the code.<br>
<br>
For example, what is itk::Connectivity? Have you included all the proper files?<br>
<br>
Can you reproduce the error with a small compilable program that you can post?<br>
<br>
Bill<br>
<br>
On Tue, Feb 2, 2010 at 7:24 PM, Andreas Schuh<br>
<<a href="mailto:andreas.schuh.84@googlemail.com">andreas.schuh.84@googlemail.com</a>> wrote:<br>
> Well, how does the declaration of itk::UltimateSkeletonImageFilter look<br>
> like? Just the class declaration not all methods ...<br>
><br>
> Andreas<br>
><br>
> On Tue, Feb 2, 2010 at 7:07 PM, <Neil.Burdett@csiro.au> wrote:<br>
>><br>
>> Hi Andreas;<br>
>><br>
>><br>
>> const int Dimension = 3;<br>
>><br>
>> typedef unsigned short DistancePixelType;<br>
>><br>
>> typedef itk::Image< DistancePixelType, Dimension > DistanceImageType;<br>
>><br>
>><br>
>><br>
>> Note that in the same file we have a number of other typedef that<br>
>> compile fine i.e.<br>
>><br>
>> // Prepare the priority function<br>
>><br>
>> typedef typename itk::DanielssonDistanceMapImageFilter<TOutputImage,<br>
>> DistanceImageType> DanielssonDistanceMapImageFilterType;<br>
>><br>
>> typename DanielssonDistanceMapImageFilterType::Pointer<br>
>> danielssonDistanceMapFilter = DanielssonDistanceMapImageFilterType::New();<br>
>><br>
>> ....<br>
>><br>
>> // Compute a surfacic skeleton<br>
>><br>
>> typedef typename itk::ParallelSkeletonImageFilter<TOutputImage,<br>
>> TOutputImage, itk::Connectivity<Dimension, 0> ><br>
>> ParallelSkeletonImageFilterType;<br>
>><br>
>> typename ParallelSkeletonImageFilterType::Pointer parallelSkeletonFilter =<br>
>> ParallelSkeletonImageFilterType::New();<br>
>><br>
>> ...<br>
>><br>
>> // Delete all small components (extract the largest connected component in<br>
>> the image)<br>
>><br>
>> typedef typename itk::LargestConnectedComponentImageFilter<TOutputImage,<br>
>> TOutputImage> LargestConnectedComponentImageFilterType;<br>
>><br>
>> typename LargestConnectedComponentImageFilterType::Pointer<br>
>> largestConnectedComponentFilter =<br>
>> LargestConnectedComponentImageFilterType::New();<br>
>><br>
>> etc...<br>
>><br>
>><br>
>><br>
>> Maybe its an issue with itk::UltimateSkeletonImageFilter ??<br>
>><br>
>> Neil<br>
>><br>
>><br>
>><br>
>> ________________________________<br>
>> From: Andreas Schuh [mailto:<a href="mailto:andreas.schuh.84@googlemail.com">andreas.schuh.84@googlemail.com</a>]<br>
>> Sent: Wednesday, 3 February 2010 9:41 AM<br>
>> To: Burdett, Neil (ICT Centre, Herston - RBWH)<br>
>> Subject: Re: [Insight-users] typedef name cannot follow class/struct/union<br>
>><br>
>> Hi,<br>
>><br>
>> How are TOutputImage, DistanceImageType and Dimension declared/defined?<br>
>> How is the template method/class itself declared?<br>
>><br>
>> Andreas<br>
>><br>
>> On Tue, Feb 2, 2010 at 5:44 PM, <Neil.Burdett@csiro.au> wrote:<br>
>>><br>
>>> Hi Andreas and Bill,<br>
>>> Thanks for the replies. As mentioned in my previous<br>
>>> post if I remove the "typename" I continue to get the same error:<br>
>>><br>
>>> "error C2242: typedef name cannot follow class/struct/union"<br>
>>><br>
>>> You are correct that the second line after this is a cut and paste error<br>
>>> so the actual code is:<br>
>>><br>
>>> // Compute the seed image, by closing cavities and holes with an<br>
>>> ultimate skeleton of the cuboid image<br>
>>> typedef itk::UltimateSkeletonImageFilter<TOutputImage, TOutputImage,<br>
>>> itk::Connectivity<Dimension, 0>, DistanceImageType > SeedSkeletonFilterType;<br>
>>><br>
>>> typename SeedSkeletonFilterType::Pointer seedSkeletonFilter =<br>
>>> SeedSkeletonFilterType::New();<br>
>>> seedSkeletonFilter->SetInput(cuboidImage->GetOutput());<br>
>>><br>
>>> seedSkeletonFilter->SetPriorityImage(distanceInvertIntensityFilter->GetOutput());<br>
>>><br>
>>> seedSkeletonFilter->SetInhibitImage(parallelSkeletonFilter->GetOutput());<br>
>>> try{<br>
>>> seedSkeletonFilter->Update();<br>
>>> } catch(itk::ExceptionObject &ex) {<br>
>>> throw itk::ExceptionObject("milxTopologicalHolesFilling", 0,<br>
>>> std::string("Topological holes filling.. seed ultimate skeleton failed: ") +<br>
>>> ex.GetDescription());<br>
>>> }<br>
>>><br>
>>> Anymore ideas? This error occurs on both VS 2005 and VS 2008<br>
>>><br>
>>> Cheers<br>
>>> Neil<br>
>>><br>
>>> -----Original Message-----<br>
>>> From: Andreas Schuh [mailto:<a href="mailto:andreas.schuh.84@googlemail.com">andreas.schuh.84@googlemail.com</a>]<br>
>>> Sent: Tuesday, 2 February 2010 2:49 PM<br>
>>> To: Burdett, Neil (ICT Centre, Herston - RBWH)<br>
>>> Cc: itk<br>
>>> Subject: Re: [Insight-users] typedef name cannot follow<br>
>>> class/struct/union<br>
>>><br>
>>> Hi Neil,<br>
>>><br>
>>> Try<br>
>>><br>
>>> typedef itk::UltimateSkeletonImageFilter<TOutputImage, TOutputImage,<br>
>>> itk::Connectivity<Dimension, 0>, DistanceImageType > SeedSkeletonFilterType;<br>
>>><br>
>>> There is no typename specified necessary here. Actually, I think it's<br>
>>> wrong to use it.<br>
>>><br>
>>> The second line after this one in your mail might just be a<br>
>>> copy-and-paste relict while you were composing the mail. Because it doesn't<br>
>>> make sense at all ...<br>
>>><br>
>>> The use of the second typename for the pointer type declaration is fine<br>
>>> and for compilers like the VC6 also necessary.<br>
>>><br>
>>> Andreas<br>
>>><br>
>>><br>
>>> On Feb 1, 2010, at 11:20 PM, <Neil.Burdett@csiro.au> wrote:<br>
>>><br>
>>> > Hi Bill and Dan,<br>
>>> > thanks for the reply, but removing typename, or replacing it<br>
>>> > with ITK_TYPENAME gives exactly the same error in visual studio 2008;<br>
>>> ><br>
>>> > "error C2242: typedef name cannot follow class/struct/union"<br>
>>> ><br>
>>> > The full extract of code I'm using is;<br>
>>> ><br>
>>> > // Compute the seed image, by closing cavities and holes with an<br>
>>> > ultimate skeleton of the cuboid image<br>
>>> > typedef typename itk::UltimateSkeletonImageFilter<TOutputImage,<br>
>>> > TOutputImage, itk::Connectivity<Dimension, 0>, DistanceImageType ><br>
>>> > SeedSkeletonFilterType;<br>
>>> > itk::UltimateSkeletonImageFilter<TOutputImage, TOutputImage,<br>
>>> > itk::Connectivity<Dimension, 0>, DistanceImageType > SeedSkeletonFilterType;<br>
>>> ><br>
>>> > typename SeedSkeletonFilterType::Pointer seedSkeletonFilter =<br>
>>> > SeedSkeletonFilterType::New();<br>
>>> > seedSkeletonFilter->SetInput(cuboidImage->GetOutput());<br>
>>> ><br>
>>> > seedSkeletonFilter->SetPriorityImage(distanceInvertIntensityFilter->GetOutput());<br>
>>> ><br>
>>> > seedSkeletonFilter->SetInhibitImage(parallelSkeletonFilter->GetOutput());<br>
>>> > try{<br>
>>> > seedSkeletonFilter->Update();<br>
>>> > } catch(itk::ExceptionObject &ex) {<br>
>>> > throw itk::ExceptionObject("milxTopologicalHolesFilling", 0,<br>
>>> > std::string("Topological holes filling.. seed ultimate skeleton failed: ") +<br>
>>> > ex.GetDescription());<br>
>>> > }<br>
>>> ><br>
>>> > Neil<br>
>>> ><br>
>>> > -----Original Message-----<br>
>>> > From: Bill Lorensen [mailto:<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>]<br>
>>> > Sent: Monday, 1 February 2010 11:46 PM<br>
>>> > To: Burdett, Neil (ICT Centre, Herston - RBWH)<br>
>>> > Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
>>> > Subject: Re: [Insight-users] typedef name cannot follow<br>
>>> > class/struct/union<br>
>>> ><br>
>>> > I think the typename can be removed on both Windows and linux. My<br>
>>> > general rule for typename is that it is required if there are no<br>
>>> > template variables.<br>
>>> ><br>
>>> > For example<br>
>>> ><br>
>>> > typedef Foo<bar> FooBarType;<br>
>>> ><br>
>>> > typedef typename Foo::Pointer FooPointer;<br>
>>> ><br>
>>> > On Sun, Jan 31, 2010 at 11:39 PM, <Neil.Burdett@csiro.au> wrote:<br>
>>> >> Hi,<br>
>>> >><br>
>>> >> I am currently porting an application from Ubuntu to windows. The<br>
>>> >> line<br>
>>> >> of code below compiles on Ubuntu but not on visual studio...<br>
>>> >><br>
>>> >><br>
>>> >><br>
>>> >> typedef typename itk::UltimateSkeletonImageFilter<TOutputImage,<br>
>>> >> TOutputImage, itk::Connectivity<Dimension, 0>, DistanceImageType ><br>
>>> >> SeedSkeletonFilterType;<br>
>>> >><br>
>>> >><br>
>>> >><br>
>>> >> I receive the error in visual studio 2008 "error C2242: typedef name<br>
>>> >> cannot<br>
>>> >> follow class/struct/union"<br>
>>> >><br>
>>> >><br>
>>> >><br>
>>> >> Any help would be appreciated.<br>
>>> >><br>
>>> >><br>
>>> >><br>
>>> >> Neil<br>
>>> >><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>
>>> >><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>
>><br>
><br>
><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>
><br>
</div></div></blockquote></div><br>