[Insight-users] error

Luis Ibanez luis.ibanez at kitware.com
Wed May 18 22:19:49 EDT 2005


Hi Tina,

You *cannot* do instantiation of templates at run time.

That is, the numeric arguments of templates *must* be
fully defined at compilation time.


You could do:


A)   typedef enum {  sizeA=1, sizeB, sizeC } sizeType;

      typedef itk::Vector< float, sizeB >  VectorType;


or


B)   const unsigned int sizeB = 4;

      typedef itk::Vector< float, sizeB >  VectorType;



Why do you want to change the size of the measurement ?

You are probably confusing the "number of components"
of the measurement, with the "number of measures".

E.g. if you are doing statistics in a satelite image
that has 7 spectral channels, then the "number of
components" is 7, while the "number of measures" is
the number of pixels in the image.

In typical problems in statistical classification,
you dont need to change the number of component in
the measures.





     Regards,



       Luis




-----------------------------------
Tina Wang wrote:

> hi,
> 
> I am defining a vector type as:
> 
> typedef itk::Vector< float, 3 > MeasurementVectorType;
> 
> Now I want to change 3 with different value by
> repalcing it with a variable such as
> int size = 4;
> typedef itk::Vector< float, size
> 
>>MeasurementVectorType;
> 
> 
> but I always get an error message "error C2973:
> 'Vector' : invalid template argument
> 'NVectorDimension'",
> Could anyone tell me  how to define or change the
> MeasurementVectorType with diefferent size.
> 
> Thanks,
> 
> tina
> 
> 
> 		
> Yahoo! Mail
> Stay connected, organized, and protected. Take the tour:
> http://tour.mail.yahoo.com/mailtour.html
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 





More information about the Insight-users mailing list