[Insight-users] using spatialObjects in ManagedITK

Dan Mueller dan.muel at gmail.com
Tue Jul 15 09:29:19 EDT 2008


Hi Shady,

Unfortunately ManagedITK does not yet wrap all SpatialObjects. The
following *are* wrapped:
   itkEllipseSpatialObject
   itkGroupSpatialObject
   itkPlaneSpatialObject
   itkSceneSpatialObject
   itkSpatialObject
   itkSpatialObjectReader
   itkSpatialObjectWriter
   itkTubeSpatialObject
   itkTubeSpatialObjectPoint

Sorry for the bad news.

Regards, dan

2008/7/15 Shady Shidfar <shady_shidfar at yahoo.com>:
> Hi Dan,
>
>
>
> I'm having a problem with spatial objects.I need to draw objects on my image
> so decided to work with itkSpacialObjects. I am trying  to get the following
> C++ code to work with managedITK, but I can't find itkBlobSpatialObject and
> itkSpatialObjectPoint.
>
>
>
> I've added ManagedITK.SpatialObjects and ManagedITK.Common as reference. Are
> they enough?
>
>
>
> Thanks for your help
>
> Shaady
>
>
>
> #if
>
> defined(_MSC_VER)
>
> #pragma
>
> warning ( disable : 4786 )
>
> #endif
>
>
>
> #include
>
> "itkBlobSpatialObject.h"
>
>
>
> #include
>
> "itkSpatialObjectPoint.h"
>
> // Software Guide : EndCodeSnippet
>
> int
>
> main( int, char *[] )
>
> {
>
> typedef itk::BlobSpatialObject<3> BlobType;
>
> typedef BlobType::Pointer BlobPointer;
>
> typedef itk::SpatialObjectPoint<3> BlobPointType;
>
>
>
> BlobType::PointListType list;
>
> for( unsigned int i=0; i<4; i++)
>
> {
>
> BlobPointType p;
>
> p.SetPosition(i,i+1,i+2);
>
> p.SetRed(1);
>
> p.SetGreen(0);
>
> p.SetBlue(0);
>
> p.SetAlpha(1.0);
>
> list.push_back(p);
>
> }
>
>
>
> BlobPointer blob = BlobType::New();
>
> blob->GetProperty()->SetName(
>
> "My Blob");
>
> blob->SetId(1);
>
> blob->SetPoints(list);
>
>
>
> BlobType::PointListType pointList = blob->GetPoints();
>
> std::cout <<
>
> "The blob contains " << pointList.size();
>
> std::cout <<
>
> " points" << std::endl;
>
>
>
> BlobType::PointListType::const_iterator it = blob->GetPoints().begin();
>
> while(it != blob->GetPoints().end())
>
> {
>
> std::cout <<
>
> "Position = " << (*it).GetPosition() << std::endl;
>
> std::cout <<
>
> "Color = " << (*it).GetColor() << std::endl;
>
> it++;
>
> }
>
>
>
> return 0;
>
> }
>
> ________________________________
> Not happy with your email address?
> Get the one you really want - millions of new email addresses available now
> at Yahoo!
> _______________________________________________
> 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