[Insight-developers] Please help mewithBSplineDeformableTransformation

Henning Meyer tutmann at gmail.com
Tue Apr 11 05:33:35 EDT 2006


Hello,
sorry for the delay, I was on holidays in Paris, France - beautiful town btw.

In the meantime a created a general wrapper, which isn't very
performant, but can hide transformation parameters.
It's a transform taking a transform and a std::vector<bool> mask,
which parameters to show, and which not.

Quite simple and it should work - but it doesnt. Again strange memory
allocation errors, which I don't really understand.

So...here is my code...whats wrong with it?

This is what has to be inserted to the main code:
typedef itk::CroppedTransform< TransformType > CTransformType;
CTransformType::MaskType mask(transform->GetNumberOfParameters(), true );
setupMask(bsplineRegion, 3, mask); // modifies content of mask
ctransform->SetBase( transform );
ctransform->SetMask( mask );

And then use ctransform instead of transform.



Henning


2006/3/31, Luis Ibanez <luis.ibanez at kitware.com>:
>
> Hi Henning,
>
> The BSplineDeformableTransform offers you several different
> mechanisms for passing the values of the BSpline grid nodes.
>
> One is to pass them as an array of Doubles, in which case you
> use the GetNumberOfParamters() methods.
>
> The other is to pass them as pixel values of a set of images,
> whose grid is the same grid of the BSpline grid.
>
> Since you are trying to skip some nodes from the optimization
> process, this is equivalent to try to use *sparse* images for
> the methods that pass the bspline coefficients in the form
> of images. Unfortunately, the code that pass images, was not
> designed for managing sparse images.
>
> Could you please post to the list the code of the wrapped
> Transform  that you are developing ?
>
>
>    Thanks
>
>
>       Luis
>
>
> --------------------
> Henning Meyer wrote:
> > Hello,
> >
> > I tried to make my own version if BSplineDeformableTransform, which
> > just wraps SetParameters, SetParametersByValue, GetParameters,
> > GetNumberOfParameters and GetNumberOfParametersPerDimension.
> > I left the original versions of these methods as
> > SetBloatedParameters,...,GetNumberOfBloatedParametersPerDimension.
> > The new methods just store the parameters in a new private field
> >   ParametersType      m_croppedParameters;
> > And a new private field ParametersType        m_bloatedParameters; is created
> > with zeros on the borders.
> > Now I have a hard crash in WrapAsImages(), there is a SIGSEGV in
> > this->m_Jacobian.set_size( SpaceDimension,
> > this->GetNumberOfBloatedParameters() );
> > The stacktrace looks like this:
> > 11 mallopt()
> > 10 malloc()
> > 9 operator new()
> > 8 operator new[]()
> > 7 vnl_c_vector_alloc()
> > 6 vnl_c_vector<double>::allocate_T()
> > 5 vnl_matrix<double>::set_size()
> > 4 itk::CroppedBSplineDeformableTransform<double, 3u,
> > 3u>::WrapAsImages() at croppedBSplineDeformableTransform.txx.h:461
> > 3 itk::CroppedBSplineDeformableTransform<double, 3u,
> > 3u>::SetBloatedParameters() at
> > croppedBSplineDeformableTransform.txx.h:371
> > 2 itk::CroppedBSplineDeformableTransform<double, 3u,
> > 3u>::SetParameters() at croppedBSplineDeformableTransform.txx.h:326
> > 1 main() at ../registerer.cpp:370
> >
> > Has anybody a hint?
> > The value of SpaceDimension is 3, and
> > this->GetNumberOfBloatedParameters() return 1536. What's wrong with
> > this? Why is mallopt complaining?
> > Please help!
> >
> > Henning
> > _______________________________________________
> > Insight-developers mailing list
> > Insight-developers at itk.org
> > http://www.itk.org/mailman/listinfo/insight-developers
> >
> >
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: croppedTransform.h
Type: text/x-chdr
Size: 4978 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20060411/d16a3d00/croppedTransform.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: croppedTransform.txx.h
Type: text/x-chdr
Size: 2678 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20060411/d16a3d00/croppedTransform.txx.h


More information about the Insight-developers mailing list