ITK/Examples/SimpleOperations/VariableLengthVector

From KitwarePublic
< ITK‎ | Examples
Revision as of 11:54, 22 October 2010 by Daviddoria (talk | contribs) (Created page with "==VariableLengthVector.cxx== <source lang="cpp"> #include <itkVariableLengthVector.h> int main(int, char*[]) { typedef itk::VariableLengthVector<double> VectorType; VectorTy...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

VariableLengthVector.cxx

<source lang="cpp">

  1. include <itkVariableLengthVector.h>

int main(int, char*[]) {

 typedef itk::VariableLengthVector<double> VectorType;
 VectorType v;
 v.SetSize(2);
 v[0] = 1;
 v[1] = 2;
 std::cout << v << std::endl;
 for(unsigned int i = 0; i < v.Size(); i++)
   {
   std::cout << v[i] << " ";
   }
 std::cout << std::endl;
 
 return EXIT_SUCCESS;

}

</source>

CMakeLists.txt

<source lang="cmake"> cmake_minimum_required(VERSION 2.6)

PROJECT(VariableLengthVector)

FIND_PACKAGE(ITK REQUIRED) INCLUDE(${ITK_USE_FILE})

ADD_EXECUTABLE(VariableLengthVector VariableLengthVector.cxx) TARGET_LINK_LIBRARIES(VariableLengthVector ITKCommon)


</source>