ITK/Examples/SpatialObjects/BlobSpatialObject: Difference between revisions

From KitwarePublic
< ITK‎ | Examples
Jump to navigationJump to search
(Created page with "==BlobSpatialObject.cxx== <source lang="cpp"> #include "itkBlobSpatialObject.h" int main( int argc, char *argv[] ) { typedef itk::BlobSpatialObject<2> BlobType; // Create a...")
 
(deprecated content that is moved to sphinx)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
==BlobSpatialObject.cxx==
{{warning|1=The media wiki content on this page is no longer maintained. The examples presented on the https://itk.org/Wiki/*  pages likely require ITK version 4.13 or earlier releases.   In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.}}
<source lang="cpp">
#include "itkBlobSpatialObject.h"
 
int main( int argc, char *argv[] )
{
  typedef itk::BlobSpatialObject<2> BlobType;
 
  // Create a list of points
  BlobType::PointListType points;
  for(unsigned int i = 0; i < 20; i++)
    {
    BlobType::BlobPointType point;
    point.SetPosition(i,i);
 
    points.push_back(point);
    }
 
  BlobType::Pointer blob = BlobType::New();
  blob->SetPoints(points);
 
  BlobType::BoundingBoxType::BoundsArrayType bounds = blob->GetBoundingBox()->GetBounds();
  std::cout << "Bounds: " << bounds << std::endl;
 
  return EXIT_SUCCESS;
}
 
</source>
 
==CMakeLists.txt==
<source lang="cmake">
cmake_minimum_required(VERSION 2.6)
 
PROJECT(BlobSpatialObject)
 
FIND_PACKAGE(ITK REQUIRED)
INCLUDE(${ITK_USE_FILE})
 
ADD_EXECUTABLE(BlobSpatialObject BlobSpatialObject.cxx)
TARGET_LINK_LIBRARIES(BlobSpatialObject ITKIO)
 
</source>

Latest revision as of 14:19, 7 June 2019

Warning: The media wiki content on this page is no longer maintained. The examples presented on the https://itk.org/Wiki/* pages likely require ITK version 4.13 or earlier releases. In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.