CreaTools FAQ

Frequently Asked Questions and Answers . . .

 

Development Environment - Linux

c++

1. How start a new project ?

 

BBTK

VTK

 

Known bugs

 


 

Development Environment - Linux   

  1. Using Eclipse as IDE in Linux 

May 2012 Tested versions:   SO: Fedora 14 x86_64   Eclipse: Eclipse Helios CR2 - IDE for C/C++ Developers. http://www.eclipse.org/downloads/packages/release/helios/sr2   ccmake: ccmake version 2.8.4   CreaTools: Last version to May 2012 

1- Create a new Project (Detailed information in http://www.creatis.insa-lyon.fr/~davila/pdl/BBTK_Films/)

  1.1 Open a new console and run creaTools.sh   1.2 Click on DevelTools > C++ > Create New Project   1.3 Select a location to create project folder and set the project name (e.g. Desktop/ProjectTemp)

2a- Generate Eclipse project (option A - Recommended)

  2a.1 Open a console. Create a BIN directory to generate project (e.g. Desktop/ProjectTemp_BIN)   2a.2 Go into the folder and run the following command       cd ProjectTemp_BIN       ccmake -G "Eclipse CDT4 - Unix Makefiles" ../PackageTemp       (set the path to the Eclipse executable in CMAKE_ECLIPSE_EXECUTABLE, e.g. ..Eclipse_cpp/eclipse/eclipse)   2a.3 Go to step 3

2b- Generate Eclipse project (option B - Following http://www.vtk.org/Wiki/CMake:Eclipse_UNIX_Tutorial)

  2b.1 Open a console. Create a BIN directory to generate project (e.g. Desktop/ProjectTemp_BIN)   2b.2 Go into the folder and run the following command       cd ProjectTemp_BIN       ccmake ../PackageTemp       make   2b.3 Open Eclipse IDE. Click on File > New > C++ Project   2b.4 Set a name to the project, uncheck the 'Use default location' option and set the sources folder as location (Desktop/ProjectTemp). Select 'Makefile project'>'Empty project'>'Other toolchain'. Click on Finish.   2b.5 Right click in the created project > Properties > C/C++ Build. Uncheck 'Use default build command' and put as 'Build command': make -C Desktop/ProjectTemp_BIN (according to your project and/or folder names). Leave empty the 'Build directory' textfield.   2b.6 In the same window go into C/C++ Build > Settings. Activate Mach-O 64 Parser and Elf Parser.   2b.7 Go to step 4

2c- Generate Eclipse project (option C - Use Eclipse only as code editor)

  2c.1 Go into the project (Desktop/ProjectTemp) and create a file with name: .project . Put inside the following lines:     <?xml version="1.0" encoding="UTF-8"?>     <projectDescription>          <name>ProjectTempEclipse</name>          <comment></comment>          <projects>          </projects>          <buildSpec>          </buildSpec>          <natures>          </natures>    </projectDescription>

  2c.2 Go to step 3. Import the source project and do 'make' taks in console.

3- Import project into Eclipse IDE

   3.1 Open File > Import > General > Existing Projects into Workspace. In 'Select root directory' search the generated project path(Desktop/ProjectTemp_BIN)    3.2 Click on Finish..

4- Right click on project > 'Build project' (the same to execute a 'make' in console). Plug packages and use bbEditor (More information in http://www.creatis.insa-lyon.fr/~davila/pdl/BBTK_Films/). Normally, everything works at this point :)

Notes:

  - It could be useful to download and use the specific version of Eclipse IDE.   - Remeber to run again ccmake when a new class, package or black box is added to the project. RaC

 


 

C++

 

1. (C++) How start a new project ?
  -> Getting Started
    ->  B. Developer Users Getting Started
      -> II. Starting a new project

 


 

BBTK

 
1. (BBTK) How to Add a project (package) as a BBTK plugin?
-> Getting Started
  ->  B. Developer Users Getting Started
   -> II. Starting a new project
    ->  4. Add your project as a BBTK plugin

 

 
2. (BBTK) How to create a box-bbtk with itk calls ?
See example
creaNewProject
-> bbtk_mySamplePackage_PKG
-> src/bbmySamplePackagemySampleBoxWithITK.cxx/.h
Note: not forget active BUILD_BBTK_PACKAGE_mySamplePackage ON in the ccmake configuration

 

 
3. (BBTK) Error executing a box with itk "bbtk was not built for itk images of type <itk::Image<unsigned short, 3u>*>"
In your .h file of the box not forget the following configuration (respect the order first the "define" and then "include")
// Definition of the DIM and TYPE of the itkImage ..
#define BBTK_ITK_IMAGE_DIM_2
#define BBTK_ITK_IMAGE_DIM_3
#define BBTK_ITK_IMAGE_DIM_4
#define BBTK_ITK_IMAGE_TYPE_int8_t
#define BBTK_ITK_IMAGE_TYPE_uint8_t
#define BBTK_ITK_IMAGE_TYPE_int16_t
#define BBTK_ITK_IMAGE_TYPE_uint16_t
#define BBTK_ITK_IMAGE_TYPE_int32_t
#define BBTK_ITK_IMAGE_TYPE_uint32_t
#define BBTK_ITK_IMAGE_TYPE_float
#define BBTK_ITK_IMAGE_TYPE_double
#include "bbitkImage.h"

 

4. (BBTK) Having VTK problems when running CreaTools applications in a Virtual Machine

Problem: When you try to execute applications such as bbEditor or creaImageIO in a VM (tested only with Fedora 15 x86_64 VM in a Windows 7 host and using VirtualBox), the application is launched and then the console shows a Segmentation fault message.

Solution: Verify that your VM settings have the 3D acceleration option unchecked.

 

 

 

5. (BBTK) How to execute a bbs with arguments ?

-> Create the script

 
Method 1 :
In bbEditor
-> Transform it in a ComplexBox with the button
-> Add requiered Input (s) and connect it (them) to the script
-> Save Diagram
 
In the script.bbs (Edit)
-> Comment lines : #define ...
                               #endefine
-> Move the line "exec Box..." at the end of the bbs file
 
 
Method 2 :
In the script.bbs (Edit)
-> Add before the line "exec Box..." the Input(s) :   input (nameOfInput) connexion " "
          ex : input Input1 Box00.In " "
                 input Input2 Box01.NbPoints " "
                 ...
 
 
Execution
After this steps, execute the script with this following command :
        bbi script Input1=...   Input2=...
  or   bbi script.bbs Input1=...   Input2=...
 

 
6. (BBTK) How to generate a graph within bbEditor under Linux/Windows?
Under Linux and Windows, the drag and drop functionality does not work to create boxes. Instead, select the box of your choice, and click on the button "New bow" in the tool bar.
 
 
 

 


 

VTK

 
 
 
1. (VTK) How to create a vtkImageData from Scratch ?
  vtkImageData *newImage = vtkImageData::New();
   newImage->Initialize();
   newImage->SetScalarTypeToUnsignedChar();
   newImage->SetSpacing( 1,1,1 );
   newImage->SetDimensions(  200,200,200 );
   newImage->SetNumberOfScalarComponents(1);
   newImage->AllocateScalars();
 
 
 
 
2. (VTK) How to fill a vtkImageData ?
Method with 3 loops :
int i,j,k;
  for (i=0; i<sizeX; i++)
  {
   for (j=0; j<sizeY; j++)
   {
    for (k=0; k<sizeZ; k++)
    {
     imageoutput->SetScalarComponentFromDouble(i,j,k, 0, bbGetInputInitialValue() );
    } // for k
   } // for j
  } // for i
 
 

 


 
 
 
 
1. (Known bugs) Documentation is not generated
Even if you set the configuration for the documentation generation to "ON", no documentation is generated. The documentation is not currently available by this way.