[vtk-developers] vtkProcrustesAlignmentFilter

David Gobbi dgobbi at irus.rri.ca
Tue Jan 22 14:09:55 EST 2002


Hi Tim,

You're on your own on this one, I would never even attempt to
provide a description of VTK's wonderful update mechanism in
an email.  Pretty much every time I write a filter, I spend a
bit of time worming my way through the source code to remind
myself about how it works.

Just a hint, though.  You should not be calling Execute() in
GetOutput().  The User's Guide might have some useful information,
or you could spend some time looking through vtkProcessObject.cxx,
vtkDataObject.cxx and vtkSource.cxx.

 - David


On Tue, 22 Jan 2002, Tim Hutton wrote:

> Hi David, developers,
>
> I'm having a go at implementing this filter the way David suggested, for
> now. I'm having trouble getting the filter to update itself at the correct
> time without being prompted - I find VTK's pipeline mechanism very
> complicated (though I'm sure it's wonderful).
>
> Here is one part of my current code:
>
> vtkPointSet* vtkProcrustesAlignmentFilter::GetOutput(int idx)
> {
>    if(!this->Outputs)
>        Execute();
>    // (this isn't right, is it?)
>
>    // check that the index is within range
>    if(idx<0 || idx>=this->_nInputs)
>    {
>        vtkErrorMacro(<<"GetOutput request out of bounds!");
>        return NULL;
>    }
>
>    return this->Outputs[idx];
> }
>
> Is there something obvious I should be doing to get Execute to be called by
> itself?
>
> Thanks,
>
> Tim.
>
> At 13:59 07/01/2002 -0500, you wrote:
> >Hi Tim,
> >
> >A general rigid-body alignment class would be a good thing.
> >It would be difficult to base it on transforms, because there
> >is one transform per data set.
> >
> >Also there is the issue that generating a transform as part
> >of a VTK pipeline can be a pain.  This could be fixed if
> >vtkAbstractTransform became a subclass of vtkDataObject so that
> >a transform can have a 'source'.  In this scenario, you could
> >build your class as you have described it but there would
> >be a 'GetTransformCollection' method to get all the transforms.
> >
> >Because the 'vtkDataSetCollectionSource' doesn't yet exist,
> >you might want to just use the usual 'SetInput(i,inputI)'
> >and 'GetOutput(i)' methods (and perhaps later add a
> >GetTransform(i) method).  The inheritance tree would then
> >be
> >
> >vtkSource
> >  |
> >vtkProcrustesAlignmentFilter
> >
> >and could later be expanded to
> >
> >vtkSource
> >  |
> >vtkMultiplePointSetToMultiplePointSetFilter
> >  |
> >vtkProcrustesAlignmentFilter
> >
> >This matches a little better with the existing VTK filters.
> >Also, note that a 'Collection' is not a vtkDataObject so having a
> >method with the signature
> >
> >  vtkDataSetCollection *GetOutput();
> >
> >just isn't right IMHO while
> >
> >  vtkPointSet *GetOutput(int i);
> >
> >looks quite friendly.
> >
> >  - David
> >
> >
> >On Mon, 7 Jan 2002, Tim Hutton wrote:
> >
> > > Hello developers,
> > >
> > > There are a couple of us that are keen to provide an implementation of the
> > > Procrustes algorithm for aligning a set of objects together in a least
> > > squares sense. Its functionality is somewhat similar to
> > > vtkLandmarkTransform except that it would take a collection of datasets
> > > instead of two. This would be useful for building models from collections
> > > of objects and is a core part of many other algorithms.
> > >
> > > I (we) have two questions:
> > >
> > > 1) Would VTK benefit by having such a class? Perhaps Procrustes is not a
> > > pure visualization technique but then neither is
> > > vtkThinPlateSplineTransform which is used by lots of people.
> > >
> > > 2) How would such a class be best implemented? I have envisaged an
> > > inheritance tree like this:
> > >
> > > vtkSource
> > > |
> > > vtkDataSetCollectionSource
> > > |
> > > vtkDataSetCollectionToDataSetCollectionFilter
> > > |
> > > vtkProcrustesAlignmentFilter
> > >
> > > Is this sensible? Maybe it should be based on transforms instead?
> > >
> > > Any comments welcome. Thankyou!
> > >
> > > Tim.
> > > ---------------------------------------------------------------------------
> > > Tim Hutton,                        http://www.eastman.ucl.ac.uk/~dmi/MINORI
> > > Research Fellow & PhD student,                   T.Hutton at eastman.ucl.ac.uk
> > > MINORI Project, Biomedical Informatics Unit,     Tel: [+44] (0)20 7915 2344
> > > Eastman Dental Institute, UCL,                   Fax: [+44] (0)20 7915 2303
> > > 256 Gray's Inn Road, London WC1X 8LD, UK      Mobile: [+44] (0)7748 678 832
> > > ---------------------------------------------------------------------------
> > > This email represents the views of the sender alone and must not be
> > > construed as representing the views of the Eastman Dental Institute. It may
> > > contain confidential information and may be protected by law as a legally
> > > privileged document and copyright work. Its content should not be disclosed
> > > and it should not be given or copied to anyone other than the person(s)
> > > named or referenced above. If you have received this email in error, please
> > > contact the sender.
> > >
> > > _______________________________________________
> > > vtk-developers mailing list
> > > vtk-developers at public.kitware.com
> > > http://public.kitware.com/mailman/listinfo/vtk-developers
> > >
> >
> >_______________________________________________
> >vtk-developers mailing list
> >vtk-developers at public.kitware.com
> >http://public.kitware.com/mailman/listinfo/vtk-developers
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at public.kitware.com
> http://public.kitware.com/mailman/listinfo/vtk-developers
>




More information about the vtk-developers mailing list