Getting Started Coding

From FarsightWiki
Jump to: navigation, search

Contents

Learning Farsight

SVN

CMake

ITK

Learning Coding

The basis of Farsight is the C++ libraries used.

Places to find documentation and example code:

A Simple Main Function

 
//first include some source classes
#include "SomeReaderClass.h"  
#include "SomeWriterClass.h"
//main function takes in arguments from the command line
int main(int argc,  char **argv )
{
  // argc is a int to tell you how many input arguments were included.
  // argv is a char pointer pointer of the input arguments. 
  for ( int i = 0; i < argc; i++)
  {
    // starting from 0, the index variable "i" will increase until it is argc -1
    // c++ counts from 0, so index array[2] is a the third place in array {0,1,2}
    std::cout <<"argument at" << i << " is " <<argv[i] << std::endl;
    // this loop will print out the arguments including the .exe name
  }
  return 0; //the main function exits
}


Some More Detailed Examples

Getting_Started_Coding/ITK/Image

VTK Examples

Personal tools