[Insight-users] Problem with the creation of a SpatialObjectSource base class

Julien Jomier julien.jomier at kitware.com
Wed Mar 21 04:16:58 EST 2007


Hi Julien,

If you can submit a bug report that would be great.

Also, if you would like to contribute the SpatialObjectSource class to 
ITK, I'd be happy to help you with this.

Julien

Julien Michel wrote:
> 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
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list