Neil.Burdett | 1 Feb 05:39 2010
Picon
Picon

typedef name cannot follow class/struct/union

Hi,

    I am currently porting an application from Ubuntu to windows. The line of code below compiles on Ubuntu but not on visual studio...

 

  typedef typename itk::UltimateSkeletonImageFilter<TOutputImage, TOutputImage, itk::Connectivity<Dimension, 0>, DistanceImageType > SeedSkeletonFilterType;

 

I receive the error in visual studio 2008 “error C2242: typedef name cannot follow class/struct/union”

 

Any help would be appreciated.

 

Neil

_____________________________________
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
Dan Mueller | 1 Feb 07:01 2010
Picon

Re: typedef name cannot follow class/struct/union

Hi Neil,

Hmm... This error seems strange. Where exactly is the typedef defined?
Maybe you could a bit more of the code to help us diagnose the
problem.

Visual Studio is known to behave differently when the typename keyword
is used *within* the template definition. In that case you can replace
"typename" with "ITK_TYPENAME". This macro is defined in
Code/Common\/itkWin32Header.h (see below). Not sure if this will help
in this case, but perhaps worth a shot...

// typename keyword in default template arguments is not accepted by
// MSVC.  This macro should only be used in such places.
# if !defined(CABLE_CONFIGURATION) && (_MSC_VER < 1310)
#  define ITK_TYPENAME
# else
#  define ITK_TYPENAME typename
# endif
#else
# define ITK_TYPENAME typename
#endif

Cheers, Dan

On 1 February 2010 05:39,  <Neil.Burdett@...> wrote:
> Hi,
>
>     I am currently porting an application from Ubuntu to windows. The line
> of code below compiles on Ubuntu but not on visual studio...
>
>
>
>   typedef typename itk::UltimateSkeletonImageFilter<TOutputImage,
> TOutputImage, itk::Connectivity<Dimension, 0>, DistanceImageType >
> SeedSkeletonFilterType;
>
>
>
> I receive the error in visual studio 2008 “error C2242: typedef name cannot
> follow class/struct/union”
>
>
>
> Any help would be appreciated.
>
>
>
> Neil
_____________________________________
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

Tom Vercauteren | 1 Feb 08:36 2010
Picon

Re: [Insight-developers] Replacing Sparse Matrix Linear Solver : due to Licensing issues

Hi Luis,

Some time ago I started listing potential linear algebra alternatives
on the wiki for ITK 4:
http://www.itk.org/Wiki/ITK_Release_4.0#3rd_Party_Libraries

The best option I found is definitely eigen:
http://eigen.tuxfamily.org/index.php?title=Main_Page

I has almost everything we need:
- Support for both dense and sparse matrix algorithms (including least squares)
- Faster than mkl in some cases
- Actively maintained c++ code written from scratch with no fortran
dependency ;)
- Include wrappers for third party libraries such as superlu mentioned by Arnaud
- compatible with BSD
http://eigen.tuxfamily.org/index.php?title=Licensing_FAQ#Using_Eigen_in_BSD-licensed_software
- Using cmake and ctest for unit testing
- Used by some large projects (e.g. official linear algebra package for kde)
- etc.

It might be a good time to start experiencing with it.

Regards,
Tom

On Sun, Jan 31, 2010 at 22:28, Arnaud Gelas
<arnaud_gelas <at> hms.harvard.edu> wrote:
> Hi Luis,
> A short term solution would be to replace (if that possible) the code for
> solving sparse linear system with existing sparse direct solution from VNL
> (vnl_sparse_lu). Note that the mesh parameterization can easily change to
> use vnl_sparse_lu by default.
> Is vnl_sparse_lu  ok (in terms of license)?
> Can Code/Numerics/FEM/itkFEMLinearSystemWrapperVNL.h use vnl_sparse_lu
> instead?
> A longer term solution would be to start using specialized sparse libraries
> (which are more efficient than vnl for these problems). Here, I cite some of
> them
>  * SuiteSparse (LGPL): the most complete (and as far as I know the most
> efficient) solution http://www.cise.ufl.edu/research/sparse/SuiteSparse/
>  * TAUCS (MIT License): sparse direct solver http://code.google.com/p/taucs/
>  * SuperLU (License): LU decomposition http://crd.lbl.gov/~xiaoye/SuperLU/
> Arnaud
> On Jan 31, 2010, at 2:50 PM, Luis Ibanez wrote:
>
> The "toms" incident seems to be behind us now.
> The code has been removed from the VXL version
> that is carried by ITK.
>
>
> However, as a secondary effect,
>
> Bill found out that the "lsqr" libraries inside VXL are
> also copyrighted by ACM and therefore subject to
> their non-commercial license.
>
>
>          Therefore,    they must go.
>
>
> As opposed to "toms", however, this code is actually
> used in ITK.
>
> The lsqr code from the directory:
>
>    Utilities/vxl/v3p/netlib/linalg/lsqr.c
>
> is used by VXL in
>
>    Utilities/vxl/core/vnl/algo/vnl_lsqr.h
>
> that in turn is used by ITK in:
>
> Code/Numerics/FEM/itkFEMLinearSystemWrapperVNL.h
> Testing/Code/Review/itkQuadEdgeMeshLinearParameterizationTest.cxx
>
> After a (non exhaustive) Google search for
> open source implementations of sparse matrix
> linear solvers with licenses compatible with
> the BSD license.
>
> We end up with :
>
>     http://sourceforge.net/projects/sparse/files/
>     http://sparse.sourceforge.net/index.html
>
>     "Sparse 1.4"
>     by  Kenneth Kundert.
>     that is distributed under BSD license.
>
>
> It turned out that VXL already carries (a version)
> of this library under:
>
>         Utilities/vxl/v3p/netlib/sparse
>
> Ironically,...
> still under the Evil "netlib" label...
>
> (we will come back to that later...)
>
> ---
>
> We are currently experimenting with replacing
> the vnl_lsqr solver with another one based on
> the Sparse library.
>
> Given that this is an issue of copyright infringement,
> we will have to do the replacement even if the new
> library is not technically better than the lsqr one.
>
>
> At this point, the only places where we anticipate
> to see any effect is the FEM registration algorithm,
> which is the only code in ITK that uses the FEM
> solver classes.
>
>
> If you have any experience with using the Sparse
> library we will appreciate your advice and help.
>
>
> If you are aware of any other options on Open
> Source sparse matrix linear solvers, with BSD
> compatible licenses, please let us know.
>
>
>     Thanks
>
>
>            Luis
> _______________________________________________
> 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://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-developers
>
>
> _____________________________________
> 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
>
>
_____________________________________
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
motes motes | 1 Feb 13:53 2010
Picon

Gradient descent and local minima?

I am currently using the gradient descent optimizer and the
MeanSquaresImageToImageMetric in an image registration apllication
used for CD scans of lungs.

But how do I know that the minima reached is not just a local minima
instead of the global minima?
_____________________________________
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

g c | 1 Feb 14:29 2010

interpolating VariableLengthVectors?

Dear all,


I may have missed this when looking through the itk documentation, but is there a way to interpolate the VariableLengthVectors in a VectorImage?

I've tried:

    typedef float DataType;
    typedef itk::VectorImage< DataType, 3 > VectorImageType;
    typedef itk::VectorLinearInterpolateImageFunction< VectorImageType, DataType > VectorImageInterpolatorType;

but when I instantiate the interpolator using

    VectorImageInterpolatorType::Pointer CoefficientsInterpolator = VectorImageInterpolatorType::New();

I get the error 'Dimension' is not a member of 'itk::VariableLengthVector<mm::DataType>'

So I guess VectorLinearInterpolateImageFunction can only be used for FixedArray pixel types?

Is there an itk interpolator that can deal with VariableLengthVectors? Any suggestions welcome!

Thanks,
George
_____________________________________
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
Bill Lorensen | 1 Feb 14:41 2010
Picon

Re: [Insight-developers] Replacing Sparse Matrix Linear Solver : due to Licensing issues

Eigen is LGPLv3. We just had a long discussion on the VTK developers
list about it. They claim the license is BSD friendly for template
code. They have a special FAQ )(multi-page) just to clarify the
license issues (
http://eigen.tuxfamily.org/index.php?title=Licensing_FAQ ).

I don't agree that the license is BSD and company friendly. I hate to
repeat the VTK discussion here since it's already over 40 e-mail
exchanges in a couple of days.

Bill

On Mon, Feb 1, 2010 at 2:36 AM, Tom Vercauteren
<tom.vercauteren@...> wrote:
> Hi Luis,
>
> Some time ago I started listing potential linear algebra alternatives
> on the wiki for ITK 4:
> http://www.itk.org/Wiki/ITK_Release_4.0#3rd_Party_Libraries
>
> The best option I found is definitely eigen:
> http://eigen.tuxfamily.org/index.php?title=Main_Page
>
> I has almost everything we need:
> - Support for both dense and sparse matrix algorithms (including least squares)
> - Faster than mkl in some cases
> - Actively maintained c++ code written from scratch with no fortran
> dependency ;)
> - Include wrappers for third party libraries such as superlu mentioned by Arnaud
> - compatible with BSD
> http://eigen.tuxfamily.org/index.php?title=Licensing_FAQ#Using_Eigen_in_BSD-licensed_software
> - Using cmake and ctest for unit testing
> - Used by some large projects (e.g. official linear algebra package for kde)
> - etc.
>
> It might be a good time to start experiencing with it.
>
> Regards,
> Tom
>
> On Sun, Jan 31, 2010 at 22:28, Arnaud Gelas
> <arnaud_gelas@...> wrote:
>> Hi Luis,
>> A short term solution would be to replace (if that possible) the code for
>> solving sparse linear system with existing sparse direct solution from VNL
>> (vnl_sparse_lu). Note that the mesh parameterization can easily change to
>> use vnl_sparse_lu by default.
>> Is vnl_sparse_lu  ok (in terms of license)?
>> Can Code/Numerics/FEM/itkFEMLinearSystemWrapperVNL.h use vnl_sparse_lu
>> instead?
>> A longer term solution would be to start using specialized sparse libraries
>> (which are more efficient than vnl for these problems). Here, I cite some of
>> them
>>  * SuiteSparse (LGPL): the most complete (and as far as I know the most
>> efficient) solution http://www.cise.ufl.edu/research/sparse/SuiteSparse/
>>  * TAUCS (MIT License): sparse direct solver http://code.google.com/p/taucs/
>>  * SuperLU (License): LU decomposition http://crd.lbl.gov/~xiaoye/SuperLU/
>> Arnaud
>> On Jan 31, 2010, at 2:50 PM, Luis Ibanez wrote:
>>
>> The "toms" incident seems to be behind us now.
>> The code has been removed from the VXL version
>> that is carried by ITK.
>>
>>
>> However, as a secondary effect,
>>
>> Bill found out that the "lsqr" libraries inside VXL are
>> also copyrighted by ACM and therefore subject to
>> their non-commercial license.
>>
>>
>>          Therefore,    they must go.
>>
>>
>> As opposed to "toms", however, this code is actually
>> used in ITK.
>>
>> The lsqr code from the directory:
>>
>>    Utilities/vxl/v3p/netlib/linalg/lsqr.c
>>
>> is used by VXL in
>>
>>    Utilities/vxl/core/vnl/algo/vnl_lsqr.h
>>
>> that in turn is used by ITK in:
>>
>> Code/Numerics/FEM/itkFEMLinearSystemWrapperVNL.h
>> Testing/Code/Review/itkQuadEdgeMeshLinearParameterizationTest.cxx
>>
>> After a (non exhaustive) Google search for
>> open source implementations of sparse matrix
>> linear solvers with licenses compatible with
>> the BSD license.
>>
>> We end up with :
>>
>>     http://sourceforge.net/projects/sparse/files/
>>     http://sparse.sourceforge.net/index.html
>>
>>     "Sparse 1.4"
>>     by  Kenneth Kundert.
>>     that is distributed under BSD license.
>>
>>
>> It turned out that VXL already carries (a version)
>> of this library under:
>>
>>         Utilities/vxl/v3p/netlib/sparse
>>
>> Ironically,...
>> still under the Evil "netlib" label...
>>
>> (we will come back to that later...)
>>
>> ---
>>
>> We are currently experimenting with replacing
>> the vnl_lsqr solver with another one based on
>> the Sparse library.
>>
>> Given that this is an issue of copyright infringement,
>> we will have to do the replacement even if the new
>> library is not technically better than the lsqr one.
>>
>>
>> At this point, the only places where we anticipate
>> to see any effect is the FEM registration algorithm,
>> which is the only code in ITK that uses the FEM
>> solver classes.
>>
>>
>> If you have any experience with using the Sparse
>> library we will appreciate your advice and help.
>>
>>
>> If you are aware of any other options on Open
>> Source sparse matrix linear solvers, with BSD
>> compatible licenses, please let us know.
>>
>>
>>     Thanks
>>
>>
>>            Luis
>> _______________________________________________
>> 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://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-developers
>>
>>
>> _____________________________________
>> 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
>>
>>
> _______________________________________________
> 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://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-developers
>
_____________________________________
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

Bill Lorensen | 1 Feb 14:46 2010
Picon

Re: typedef name cannot follow class/struct/union

I think the typename can be removed on both Windows and linux. My
general rule for typename is that it is required if there are no
template variables.

For example

typedef Foo<bar> FooBarType;

typedef typename Foo::Pointer FooPointer;

On Sun, Jan 31, 2010 at 11:39 PM,  <Neil.Burdett@...> wrote:
> Hi,
>
>     I am currently porting an application from Ubuntu to windows. The line
> of code below compiles on Ubuntu but not on visual studio...
>
>
>
>   typedef typename itk::UltimateSkeletonImageFilter<TOutputImage,
> TOutputImage, itk::Connectivity<Dimension, 0>, DistanceImageType >
> SeedSkeletonFilterType;
>
>
>
> I receive the error in visual studio 2008 “error C2242: typedef name cannot
> follow class/struct/union”
>
>
>
> Any help would be appreciated.
>
>
>
> Neil
>
> _____________________________________
> 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
>
>
_____________________________________
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

Kevin H. Hobbs | 1 Feb 15:36 2010

Re: Gradient descent and local minima?

On 02/01/2010 07:53 AM, motes motes wrote:
> I am currently using the gradient descent optimizer and the
> MeanSquaresImageToImageMetric in an image registration apllication
> used for CD scans of lungs.
> 
> But how do I know that the minima reached is not just a local minima
> instead of the global minima?

The short answer is that one can never know if a multi-dimensional
optimization has reached the global minimum.

The best you can do is show that repeated optimizations with different
initial conditions reach the "same" final point, and that that point is
no worse than any other point found.

_____________________________________
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
motes motes | 1 Feb 16:26 2010
Picon

Re: Gradient descent and local minima?

On Mon, Feb 1, 2010 at 3:36 PM, Kevin H. Hobbs <hobbsk@...> wrote:
> On 02/01/2010 07:53 AM, motes motes wrote:
>> I am currently using the gradient descent optimizer and the
>> MeanSquaresImageToImageMetric in an image registration apllication
>> used for CD scans of lungs.
>>
>> But how do I know that the minima reached is not just a local minima
>> instead of the global minima?
>
> The short answer is that one can never know if a multi-dimensional
> optimization has reached the global minimum.
>
> The best you can do is show that repeated optimizations with different
> initial conditions reach the "same" final point, and that that point is
> no worse than any other point found.
>
>

Ok but its not possible to argument that if the fixed and moving
images don't differ too much the minima found will most likely be
global? This I have read somewhere but I actually don't understand
why.
_____________________________________
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

Monica Hernandez Gimenez | 1 Feb 17:10 2010
Picon

Help to understand MemoryProbesCollectorBase

Dear ITK users,

I am trying to use the class itk::MemoryProbesCollectorBase in order to
track the memory usage of
my ITK based code. I am getting some weird results, for example, my code
takes 1Gb of memory
usage (using top command). However the report does not provide such
information. In addition
I am getting negative results of memory usage in specific locations of
my code.

I used this code below in order to allocate some memory and see if the
memory collector works fine
for a simpler code. However, the report says that the process takes 0 Kb
of memory usage.
I am working on a Suse 11.0 64 bits machine.

This has taken me to these questions

1) Is there any known bug for 64 bits machine?
2) Does itk::MemoryProbesCollectorBase works only for itk related classes?
3) Does the amount of memory indicate the memory allocated between Start
and Stop orders?
4) Does the negative amount of memory indicate deallocation of objects?

Could somebody help me?
Thank you!

int main( int argc, char **argv )
{  
  itk::MemoryProbesCollectorBase mcollector;

  mcollector.Start( "Update" );

  size_t numberOfBytes = atol(argv[1] );
  char * buffer = new char[numberOfBytes];

  mcollector.Stop( "Update" );
  mcollector.Report();

  delete [] buffer;

  return 0;
}

_____________________________________
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


Gmane