[IGSTK-Developers] igstkVascularNetworkReaderTest Crashing

Patrick Cheng cheng at isis.georgetown.edu
Thu Aug 23 17:31:04 EDT 2007


Hi Luis,

Some recent change to the igstkSpatialObject is causing the 
igstkVascularNetworkObjectTest to fail in the Sandbox.

In igstkVascularNetworkRepresentation class, the 'vessel' variable is a 
invalid pointer, because in igstkSpatialObject.h, the return value of
const Self * GetObject(unsigned long id) const
has been changed to NULL.

Please take look at this problem.

Thank you,

Patrick

Related code:
-----------------------------------------------------------------------
igstkVascularNetworkRepresentation.cxx  line 141

     const_cast<VascularNetworkObjectType*>(
 
m_VascularNetworkObject.GetPointer())->RequestGetVessel(ntube);
     const VesselObjectType* vessel = vesselObserver->GetVessel();

if(vessel->GetNumberOfPoints() < 2)
       {
       igstkLogMacro( CRITICAL, "Not enough points to render a tube.\n");
       return;
       }

-----------------------------------------------------------------------
igstkSpatialObject.h line 103:

   /**
    * DEPRECATED:
    * Return a child object given the id */
   const Self * GetObject(unsigned long id) const
     {
     return NULL; // It used to return the child numbered "id".
     }

-----------------------------------------------------------------------
igstkVascularNetworkObject.cxx line 41

/** This function reports the vessel */
void VascularNetworkObject::ReportVesselProcessing()
{
   const VesselObjectType* vessel =
            dynamic_cast<const 
VesselObjectType*>(this->GetObject(m_VesselId));

   VesselObjectModifiedEvent  event;
   event.Set( const_cast<VesselObjectType*>(vessel)  );
   this->InvokeEvent( event );
}










More information about the IGSTK-Developers mailing list