[Insight-developers] Best way to concatenate itk Arrays?

Luis Ibanez luis.ibanez at kitware.com
Fri Dec 10 12:21:38 EST 2010


Hi Michael,

As long as the vnl code is not exposed in the ITK API,
it should be fine.

(...we have some places where this rule has note been
respected and probably should clean them up...).

You are also free to use STL inside the implementation
code, if you find that useful for this case.


     Luis


-------------------------------------
On Thu, Dec 9, 2010 at 5:43 PM, Michael Stauffer (Circular Logic)
<mstauff at verizon.net> wrote:
> Thanks Nick. This is what I've used so far, along with copy_out(). I was
> checking to see if it's Kosher with itk best practices, since it's
> relying on the underlying data type.
>
> Cheers,
> Michael
>
>>-----Original Message-----
>>From: Nicholas Tustison [mailto:ntustison at gmail.com]
>>Sent: Thursday, December 09, 2010 4:38 PM
>>To: Michael Stauffer (Circular Logic)
>>Cc: 'ITK-dev-list'
>>Subject: Re: [Insight-developers] Best way to concatenate itk Arrays?
>>
>>Hi Michael,
>>
>>You should look in the BSplineDeformableTransform class where
>>the data_block() function is accessed directly.
>>
>>Nick
>>
>>
>>On Dec 9, 2010, at 4:18 PM, Michael Stauffer (Circular Logic) wrote:
>>
>>> Hi,
>>>
>>> I need to concatenate itk Arrays (Transform::ParameterType objects,
>>> actually) into a single new Array. Is it acceptable to
>>directly use the
>>> underlying public vnl_vector routines like data_block() and
>>copy_out()
>>> to do this efficiently? Or must I copy element-by-element using
>>> Array::GetElement(). Or is there some other way I'm missing?
>>>
>>> I could add an Insert method to Array that allows inserting
>>of another
>>> array at a given index, in order to avoid using the
>>vnl_vector routines
>>> directly.
>>>
>>> This is part of the new CompositeTransform class. We're set-ing and
>>> get-ing concatenated parameter arrays that hold the
>>parameters for all
>>> the constituent transforms in the composite class. We may
>>have dozens of
>>> transforms at once, so element-by-element copying will start
>>to add up
>>> over all the calls to get and set parameters made by the optimizer in
>>> the registration process.
>>>
>>> Cheers,
>>> Michael
>>>
>>> _______________________________________________
>>> 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://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
>


More information about the Insight-developers mailing list