[Insight-users] embarassingly basic question

Bill Lorensen bill.lorensen at gmail.com
Wed Apr 25 18:16:00 EDT 2012


const double[3] dummy={1.1,2.2,3.3};
const itk::Point<double, 3> p(dummy);
might work.

Still a bit verbose.

On Wed, Apr 25, 2012 at 3:44 PM, Rupert Brooks <rupert.brooks at gmail.com> wrote:
> Hi,
>
> Its when I show ITK to other people that I end up with embarassingly
> simple questions that I ought to know the answer to.
>
> When declaring an itk::Point (or vector, etc, anything based on
> FixedArray) there is no constructor that assigns values that i know
> of.  So one always ends up doing something like
> itk::Point<double, 3> p;
> p[0]=1.1;
> p[1]=2.2;
> p[2]=3.3;
>
> or
>
> const double[3] dummy={1.1,2.2,3.3};
> const itk::Point<double, 3>=dummy;  // at least this way we can get a
> const itk::Point
>
> It was pointed out to me that this is quite verbose.  A certain ideal
> would be, eg
>
> const itk::Point<double,3> p(1.1,2.2,3.3);
>
> Is there a better way?  Was this a design choice, or an inevitable
> consequence of variadic constructors not being possible in C++?
>
> Thanks,
> Rupert
>
> --------------------------------------------------------------
> Rupert Brooks
> rupert.brooks at gmail.com
> _____________________________________
> 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.php
>
> 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



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the Insight-users mailing list