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

Michael Stauffer (Circular Logic) mstauff at verizon.net
Thu Dec 9 16:18:56 EST 2010


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



More information about the Insight-developers mailing list