ITK/Examples/SimpleOperations/CreateVector: Difference between revisions
From KitwarePublic
Jump to navigationJump to search
Daviddoria (talk | contribs) |
Daviddoria (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
Create a variable length vector. This is the ITK version of std::vector. | |||
==CreateVector.cxx== | ==CreateVector.cxx== | ||
<source lang="cpp"> | <source lang="cpp"> |
Revision as of 13:48, 18 November 2010
Create a variable length vector. This is the ITK version of std::vector.
CreateVector.cxx
<source lang="cpp">
- include <itkVector.h>
int main(int, char*[]) {
typedef itk::Vector<double, 3> VectorType; VectorType v; v[0] = 1.0; v[1] = 2.0; v[2] = 3.0; std::cout << "v: " << v << std::endl; return EXIT_SUCCESS;
}
</source>
CMakeLists.txt
<source lang="cmake"> cmake_minimum_required(VERSION 2.6)
PROJECT(Vector)
FIND_PACKAGE(ITK REQUIRED) INCLUDE(${ITK_USE_FILE})
ADD_EXECUTABLE(Vector Vector.cxx) TARGET_LINK_LIBRARIES(Vector ITKCommon)
</source>