[Insight-users] Problem with the creation of a SpatialObjectSource
base class
Julien Michel
julien.michel at c-s.cnes.fr
Wed Mar 21 04:37:32 EST 2007
Dear ITK users,
Since I am developing a set of filters producing itk::SpatialObject, I
did first implement a SpatialObjectSource, templated by the
SpatialObject type, deriving from itk::ProcessObject and providing the
right GetOutput() method, as well as setting up the ProcessObject in the
constructor (NumberOfRequiredOutputs(), creation of the output pointer).
I derived this base class to implement a filter with no input, producing
a SpatialObject. I implemented the SpatialObject creation into a
GenerateData() method, as I always did for non-threaded filters. Now, no
matted how I put it, my GenerateData() is not called when I Update() my
filter, or some filters later in the pipeline.
After some investigations, I think I found what might be a bug in the
itk::SpatialObject class :
As described in the high level classes itk::ProcessObject and
itk::DataObject, the Update() method on a filter triggers the following
sequence :
- ProcessObject::Update() :
Does some checking and calls the DataObject::Update() on its first output.
- DataObject::Update() :
Calls some function to prepare the update and then calls
DataObject::UpdateOutputData().
- DataObject::UpdateOutputData() :
Check if the DataObject has to be updated (and as a source), and if so
calls ProcessObject::UpdateOutputData(DataObject) on the source.
- ProcessObject::UpdateOutputData(DataObject):
Does some more checking and then calls the GenerateData() method.
However, this sequence is broken when using itk::SpatialObject as output
of our itk::ProcessObject, because itk::SpatialObject reimplements the
DataObject::Update() method, which only calls this->Modified() without
calling the Superclass implementation, nor calling the
DataObject::UpdateOutputData() method.
Does it sound like a bug to you ? If so, I would of course produce a bug
report on BugTracker.
Thanks a lot,
Best regards,
Julien
-------------- next part --------------
A non-text attachment was scrubbed...
Name: julien.michel.vcf
Type: text/x-vcard
Size: 255 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20070321/8211a3c2/julien.michel.vcf
More information about the Insight-users
mailing list