1 % ==========================================
2 \documentclass[11pt,final,a4paper]{article}
5 \title{The Black Box Toolkit\\Package Developers' Guide}
7 \author{Laurent Guigues}
9 % ==========================================
11 % ==========================================
14 % ==========================================
16 % ==========================================
18 % ==========================================
19 % ==========================================
21 %\section{Creating your own black boxes}
23 % ==========================================
25 % ==========================================
26 \section{Steps in the creation of new black boxes}
27 % ==========================================
28 Any black box must be included in a \bbtk package,
29 that is in a particular shared library which can be loaded
30 dynamically by \bbtk (hence applications which use \bbtk,
31 such as the interpreter \bbi).
34 \item \textbf{Create a new package. }
35 Before defining any black box you
36 have to create a package, or more precisely
37 the files which will allow you to generate the package
38 (compile and link the shared library) and may be install it.
39 \texttt{bbStudio} does it for you.
44 \item The black boxes you want to create are based on
45 a processing code (\CPP classes or \C functions) which
46 is in an existing project handled by \cmake
47 and you want the new package to be part of your existing project.
48 You will have to create your new package into the source tree of your
50 \item You do not have an already existing project (you want
51 to create the new boxes from scratch) or you want/are imposed
52 that the existing project remain external to the package project.
53 You will have to create your new package in a new location and
54 may be include/link against existing libraries.
57 \item \textbf{Describe your new box. }
58 You can do it either :
60 \item In \CPP code. You will have to write the class for
61 your box, mostly using \bbtk macros.
63 When configuring your project with \cmake,
64 the utility \bbfy will then generate the corresponding \CPP code.
69 % ==========================================
70 \section{Creating a new black box package}
71 % ==========================================
73 Run \texttt{bbStudio}.
75 You''l get something like in fig. \ref{bb-Studio}
78 \caption{\label{bb-Studio} bbStudio}
80 \includegraphics[width=0.6\textwidth]{bbStudio.png}
84 Use the option \texttt{Create package} of the menu \texttt{Tools}.
86 You will be asked to choose the directory where you want to create the package,
87 then you'll get something like in fig. \ref{bbCreatePackage}.
91 \caption{\label{bbCreatePackage} Create Package}
93 \includegraphics[width=0.6\textwidth]{bbCreatePackage.png}
98 That will creates the directory structure and the \texttt{cmake}
99 files necessary to build the project.
101 You must then decide the name of your new package.
102 This name will be used to load the package in \texttt{bbi}.
103 Fill up the form like in fig. \ref{bbFillUpPackageForm}.
107 \caption{\label{bbFillUpPackageForm} Fill up the form}
109 \includegraphics[width=0.6\textwidth]{bbFillUpPackageForm.png}
113 Edit the file \texttt{MyPackage/CMakeLists.txt} to customize your package
116 the file tree obtained is :
119 >tree myPackageFolder
124 |-- PackageConfig.cmake.in
126 |-- UsePackage.cmake.in
138 | | |-- CMakeLists.txt
139 | | `-- header.html.in
142 | |-- DoxyMainPage.txt.in
143 | `-- Doxyfile.txt.in
147 9 directories, 16 files
150 The directory \texttt{MyPackage} is the directory of your new package,
151 in which you will create the files describing your black boxes.
152 But first, you have to customize your new package, by editing the file
153 \texttt{CMakeLists.txt} in the \texttt{MyPackage} directory.
156 \begin{file}{MyPackage/CMakeLists.txt}
159 #===========================================================================
160 # CMAKE SETTINGS FOR BUILDING A BBTK PACKAGE
161 #===========================================================================
163 #===========================================================================
164 # THE NAME OF THE BBTK PACKAGE
165 SET(BBTK_PACKAGE_NAME MyPackage)
166 #===========================================================================
168 #===========================================================================
169 # IF IT IS A STANDALONE PROJECT UNCOMMENT NEXT LINE TO DECLARE YOUR PROJECT
170 # PROJECT(bb${BBTK_PACKAGE_NAME})
171 #===========================================================================
173 #===========================================================================
175 # !!! NO COMMA ALLOWED !!!
176 SET(${BBTK_PACKAGE_NAME}_AUTHOR "myself")
177 #===========================================================================
179 #===========================================================================
180 # PACKAGE DESCRIPTION
181 SET(${BBTK_PACKAGE_NAME}_DESCRIPTION "The kinkiest stuff you ve ever seen.")
182 #===========================================================================
184 #===========================================================================
185 # PACKAGE VERSION NUMBER
186 SET(${BBTK_PACKAGE_NAME}_MAJOR_VERSION 1)
187 SET(${BBTK_PACKAGE_NAME}_MINOR_VERSION 0)
188 SET(${BBTK_PACKAGE_NAME}_BUILD_VERSION 0)
189 #===========================================================================
191 #===========================================================================
192 # UNCOMMENT EACH LIBRARY NEEDED (WILL BE FOUND AND USED AUTOMATICALLY)
193 # SET(${BBTK_PACKAGE_NAME}_USE_VTK ON)
194 # SET(${BBTK_PACKAGE_NAME}_USE_ITK ON)
195 # SET(${BBTK_PACKAGE_NAME}_USE_GDCM ON)
196 # SET(${BBTK_PACKAGE_NAME}_USE_GSMIS ON)
197 # SET(${BBTK_PACKAGE_NAME}_USE_WXWIDGETS ON)
198 #===========================================================================
200 #===========================================================================
201 # LIST HERE THE OTHER bbtk PACKAGES NEEDED
202 # (WILL BE FOUND AND USED AUTOMATICALLY)
203 SET(${BBTK_PACKAGE_NAME}_USE_PACKAGES
210 #===========================================================================
212 #===========================================================================
213 # THE SOURCES OF THE PACKAGE
214 # EITHER UNCOMMENT NEXT LINE TO COMPILE ALL .cxx OF THE src DIRECTORY :
215 SET(${BBTK_PACKAGE_NAME}_COMPILE_ALL_CXX ON)
216 # ... OR LIST THE FILES TO COMPILE MANUALLY :
217 #SET(${BBTK_PACKAGE_NAME}_SOURCES
218 # LIST HERE THE FILES TO COMPILE TO BUILD THE LIB
219 # E.G. TO COMPILE "toto.cxx" ADD "toto" (NO EXTENSION)
220 # THE PATH MUST BE RELATIVE TO THE src FOLDER
222 #===========================================================================
224 #===========================================================================
225 # THE xml SOURCES OF THE PACKAGE
226 # EITHER UNCOMMENT NEXT LINE TO bbfy ALL .xml OF THE src DIRECTORY :
227 SET(${BBTK_PACKAGE_NAME}_COMPILE_ALL_XML ON)
228 # ... OR LIST THE FILES TO COMPILE MANUALLY :
229 #SET(${BBTK_PACKAGE_NAME}_XML_SOURCES
230 # LIST HERE THE FILES TO bbfy TO BUILD THE LIB
231 # E.G. TO bbfy "toto.xml" ADD "toto" (NO EXTENSION)
232 # THE PATH MUST BE RELATIVE TO THE src FOLDER
234 #===========================================================================
236 #===========================================================================
237 # THE SCRIPT-DEFINED BOXES OF THE PACKAGE (bbs)
238 # EITHER UNCOMMENT NEXT LINE TO INCLUDE ALL .bbs OF THE bbs/boxes DIRECTORY :
239 SET(${BBTK_PACKAGE_NAME}_INCLUDE_ALL_BBS_BOXES ON)
240 # ... OR LIST THE FILES TO INCLUDE MANUALLY :
241 # SET(${BBTK_PACKAGE_NAME}_BBS_BOXES
242 # LIST HERE THE bbs FILES TO INCLUDE
243 # E.G. TO INCLUDE "boxes/bbtoto.bbs" ADD "boxes/bbtoto" (NO EXTENSION)
244 # !! THE PATH MUST BE RELATIVE TO THE bbs FOLDER !!
246 #===========================================================================
248 #===========================================================================
249 # THE SCRIPT-DEFINED APPLICATIONS OF THE PACKAGE (bbs)
250 # EITHER UNCOMMENT NEXT LINE TO INCLUDE ALL .bbs OF THE bbs/appli DIRECTORY :
251 SET(${BBTK_PACKAGE_NAME}_INCLUDE_ALL_BBS_APPLI ON)
252 # ... OR LIST THE FILES TO INCLUDE MANUALLY :
253 # SET(${BBTK_PACKAGE_NAME}_BBS_APPLI
254 # LIST HERE THE bbs FILES TO INCLUDE
255 # E.G. TO INCLUDE "appli/testToto.bbs" ADD "appli/testToto" (NO EXTENSION)
256 # !! THE PATH MUST BE RELATIVE TO THE bbs FOLDER !!
258 #===========================================================================
260 #===========================================================================
261 SET(${BBTK_PACKAGE_NAME}_INCLUDE_DIRS
262 # LIST HERE YOUR ADDITIONAL INCLUDE DIRECTORIES
266 # - automatically handled libraries or packages : wx, vtk... (see above)
267 # - the dirs automatically set by other libraries found by FIND_PACKAGE
269 #===========================================================================
271 #===========================================================================
272 SET(${BBTK_PACKAGE_NAME}_LIBS
273 # LIST HERE THE ADDITIONAL LIBS TO LINK AGAINST
274 # EXCEPT : the same libs than for INCLUDE_DIRS
276 #===========================================================================
278 #===========================================================================
279 # IF NEEDED : UNCOMMENT NEXT LINE
280 # AND LIST ADDITIONNAL DIRECTORIES
281 # IN WHICH TO LOOK FOR LIBRARIES TO LINK AGAINST
283 #===========================================================================
285 #===========================================================================
286 # SET TO TRUE TO HAVE INFORMATION ON LIBRARIES FOUND DURING CMAKE CONFIGURE
287 SET(FIND_PACKAGE_VERBOSE TRUE)
288 #===========================================================================
290 #===========================================================================
291 # END OF USER SECTION
292 #===========================================================================
294 #===========================================================================
295 # Include configuration script
296 INCLUDE(Configure.cmake)
297 #===========================================================================
299 #===========================================================================
301 #===========================================================================
306 The comments in the file should be easily understandable !
307 You have to customize the lines which are enclosed
308 between dashed comment lines.
309 In these sections, you can see some of the informations you supplied in previous step:
311 \item The \textbf{name} of your package. This will be the name used to load it in \bbi. The shared library however will be called \texttt{bb}name hence on
312 \lin the object file will be called \texttt{libbb}name\texttt{.so}
313 and on \win it will be called \texttt{bb}name\texttt{.dll}.
314 \item The \textbf{author(s)} of the package. Preferably provide e-mail adresses.
315 \item A \textbf{description} of the package, which will appear in the help of your package or in its html documentation automatically generated by \bbdoc.
318 In these sections, you can set :
321 \item The \textbf{libraries used} by the package : \vtk, \itk, \gdcm, \gsmis, \wx. The mecanisms to find these libraries, their sources and to link against them are automatically handled by the \cmake files installed by \bbCreatePackage. You just have to uncomment a line to use one of these libraries.
323 \item A \textbf{description} of the package, which will appear in the help of your package or in its html documentation automatically generated by \bbdoc.
324 \item The \textbf{version} of the package.
325 \item The \textbf{\xml sources} of the package : you can list each input \xml file explicitly or tell \cmake to include in the project \emph{all} the \xml files of the directory.
326 \item The \textbf{\CPP sources} of the package : you can list each input \CPP file explicitly or tell \cmake to include in the project all the \CPP files of the directory.
327 \item \textbf{Additional include directories}. Set it if your package needs to include source files which are not in the package directory, typically if it depends on another library which is not one the libraries automatically handled (\vtk, \itk...).
328 \item \textbf{Additional libraries} to link against. Set it if your package needs to link against another library which is not one the libraries automatically handled (\vtk, \itk...).
331 Of course, this is only a framework and you can add any other \cmake commands
334 % ==========================================
335 \section{Creating a new box}
336 % ==========================================
338 % ==========================================
339 \subsection{Principles}
340 % ==========================================
342 \subsubsection{\texttt{C++} or \texttt{XML} ?}
343 There are two ways to create a new black box in an existing package :
345 \item Write an \xml description file which will be automatically
346 translated in \CPP by the \bbfy application (recommanded).
347 \item Write the \CPP code of the box using \bbtk macros.
350 \subsubsection{From which \bbtk class inherit ?}
352 Apart from this choice of the description langage to use,
353 there is an important choice to do concerning the implementation of the box.
354 In \CPP, a black box is nothing but a class which has the standard
355 interface of all black boxes : what's its name ? inputs ? outputs ? and so on.
358 The abstract description of this interface is done in the class
359 \texttt{bbtk::BlackBox} and is implemented in its child classes :
360 \texttt{bbtk::AtomicBlackBox} and \texttt{bbtk::WxBlackBox}
361 \footnote{all the classes of the \bbtk library are in a \emph{namespace}
363 and the \CPP header of a class called \texttt{NameOfAClass} is
364 in the file called \texttt{bbtkNameOfAClass.h}}.
365 To create a new black box, you have to inherit one of these two
366 concrete classes in order to inherit the black box interface and a
367 particular implementation of this interface.
368 If your black box is a \emph{Widget} black box,
369 that is a black box which has (or is)
370 a piece of a graphical interface based on the \wx library,
371 then it must inherit the class \texttt{bbtk::WxBlackBox}.
373 Concretely, a \texttt{bbtk::WxBlackBox} is associated to
374 a \texttt{wxWindow} and must be able to return a pointer to it.
375 If your black box is not a widget black box
376 (that is : doesn't returns a pointer to a \emph{Widget}),
377 it must inherit from \texttt{bbtk::AtomicBlackBox}.
379 \subsubsection{Inherit or encapsulate ?}
381 Now, your black box will do something (hopefully !).
382 When you decide to write a new black box,
383 you should be in one of these three cases :
385 \item You already have a \texttt{C}-like function which
386 does the processing that you wish to 'blackboxify'
387 \item You already have a \CPP class which
388 does the processing that you wish to 'blackboxify'
389 \item You start from scratch without any existing code
392 The idea of \BBTK is to embed processing codes into
393 \CPP objects which have a standard and generic interface -
394 namely black boxes - to be able to chain arbitrary
395 processes afterwards.
397 In \CPP, in order to embed an existing processing \emph{class}
398 into a standard interface you only have two possibilities :
400 \item {\bf Inherit} the existing processing class
401 \emph{and} the interface class (e.g. \texttt{bbtk::AtomicBlackBox}).
402 In this case you have to :
404 \item make the link between the inputs and outputs of the black box
405 and the interface of the inherited class
406 \item call the processing
407 method of the inherited class in the processing method of the black box.
409 \item {\bf Encapsulate} the existing processing class
410 in a class inherited from
411 the interface class (e.g. \texttt{bbtk::AtomicBlackBox}).
412 In this case you have to :
414 \item declare it as a member of the black box,
415 \item instantiate it at the right time
416 (either in the constructor or in the processing method of the black box)
417 \item in the processing method of the black box :
419 \item set the inputs of the member procesing class with the inputs of the black box,
420 \item call the processing method of the encapsulated class
421 \item set the ouputs of the black box with the outputs of the encapsulated
427 If you wish to 'blackboxify' a C-like \emph{function},
428 you do not have the choice, you can only use the second mechanism,
429 namely encapsulation.
431 Obviously, the inheritance mechanism is more powerfull
432 and - when it is possible to use it - it demands less effort
433 because, as we will see, in \bbtk you can directly
434 link the accessors to the input and output data of the box
435 to the accessors of the inherited processing class,
436 as well as the procesing method of the black box
437 to the processing method of the inherited processing class,
438 very much like a callback mechanism.
440 \subsubsection{How to generate a Black Box skeleton}
442 Run \texttt{bbStudio}, choose \texttt{Tools} in the menu bar, option
443 \texttt{Create Black Box}.
444 You will be shown something like in fig. \ref{bbCreateBlackbox} :
447 \caption{\label{bbCreateBlackbox}Create Black Box}
449 \includegraphics[width=0.6\textwidth]{bbCreateBackbox.png}
454 \subsubsection{Informations to provide}
456 Finally, to create a new black box, you will have to give :
458 \item The {\bf name} of the box
459 \item The {\bf package} to which the box belongs (can we do it automatically ? LG : think about it)
460 \item The {\bf author}(s) of the box
461 \item A {\bf description} of the box
463 \item Its {\bf type}, either
465 \item a standard one (\texttt{std-template})
466 \item a VTK Polydata Algorithm based box (\texttt{VTK\_PolydataAlgorithm-template}),
467 \item a VTK Image Algorithm based box (\texttt{VTK\_ImageaAlgorithm-template}),
468 \item if it uses the wxWidget Library (\texttt{widget-template})
471 \item The output format of the file, either a C++ file or an XML file.
473 %\item $[$Optional$]$ The additional {\bf include files} which are necessary for the code to compile (classes or functions declarations ...)
474 %\item $[$Optional$]$ The other {\bf parent(s)} of the box (which must be known hence their header included)
475 %\item $[$Optional$]$ The {\bf namespace} to which the box belongs
476 %\item The box {\bf inputs} and {\bf outputs}, and for each one :
478 %\item Its {\bf name} : the string which will identify the input or output
479 %\item Its {\bf type} : any \CPP type, either a basic type or a user defined type (class ...) but which must be known, hence the necessary files must be included.
480 %\item Its {\bf help} : a string describing the input / output
482 %\item Its {\bf processing} code, which can be a simple callback or an arbitrary complex code
486 Under Linux, for reasons we shall not discuss here, you'll get an error message :
488 \texttt{No such file or directory}
490 Have a look at the console, you'll see a shell command (whose syntax is OK although there is is a lot of
491 quotes),something like :
493 \texttt{ "/usr/local/bin/bbCreateBlackBox" "/home/jpr/Desktop/essai" MyPackage
494 myVtkPolydataBlackBox VTK-PolyDataAlgorithm C++ 'author1, author2' 'myVtkPolydataBlackBox description'}
496 Just copy the command, and run it manually.
498 \subsubsection{Input and output accessors}
500 When you encapsulate a processing class or a C function
501 or when you write down a black box from scratch,
502 you must access the inputs and outputs of the black box,
503 in order to interface it manually with your processing method
504 or simply write your processing code
505 (there are other cases in which you also need to access the
506 inputs and outputs, we will talk about them later).
508 The only thing you must know about the \CPP code generated
509 from your \xml or your \CPP macro-based description
510 is that when you declare an input
511 or an output of a black box then
512 two \emph{accessors} for this input or output are generated :
513 one to \emph{get} the value of the input or output and
514 one to \emph{set} it.
515 These accessors have normalized names :
518 \item The declaration of an {\bf input} called \texttt{NAME} and
519 of type \texttt{TYPE} generates the two accessors
520 \footnote{For the sake of simplicity, the parameters and return value are
521 shown here as if they were all passed by value.
522 However the actual code can use references.
523 The same way, the issue of const or non const methods is eluded here.
524 Different cases occur in practice.}:
526 \item \texttt{void bbSetInput<NAME>(<TYPE>);}
527 \item \texttt{<TYPE> bbGetInput<NAME>();}
529 \item The declaration of an {\bf output} called \texttt{NAME} and
530 of type \texttt{TYPE} generates the two accessors:
532 \item \texttt{void bbSetOutput<NAME>(<TYPE>);}
533 \item \texttt{<TYPE> bbGetOutput<NAME>();}
537 For example, declaring an input called \texttt{Image}
538 would generate the two accessors \texttt{bbSetInputImage} and
539 \texttt{bbGetInputImage}.
543 \item All \bbtk methods are prefixed by \texttt{bb}
544 to avoid conflicts with potential inherited methods.
545 \item An input and an output can have the same name (e.g. 'Image').
546 No conflict between accessors occur (e.g.
547 four distinct accessors are created :
548 \texttt{bbSetInputImage},
549 \texttt{bbGetInputImage},
550 \texttt{bbSetOutputImage} and
551 \texttt{bbGetOutputImage}).
554 % ==========================================
555 \subsection{\texttt{XML} description of a box}
556 % ==========================================
558 % ==========================================
559 \subsubsection{General \texttt{xml} tags}
560 % ==========================================
562 Let us examine the \texttt{xml} file
563 describing the \texttt{Add} box of the \texttt{std} package :
565 \begin{file}{\texttt{packages/std/src/bbAdd.xml}}
568 <?xml version="1.0" encoding="iso-8859-1"?>
570 <blackbox name="Add">
572 <author>laurent.guigues@creatis.insa-lyon.fr </author>
573 <description>Adds its inputs </description>
574 <category>math </category>
576 <input name="In1" type="double" description="First number to add"/>
577 <input name="In2" type="double" description="Second number to add"/>
578 <output name="Out" type="double" description="Result"/>
581 bbSetOutputOut( bbGetInputIn1() + bbGetInputIn2() );
594 The tags and their role are easily understandable.
596 As the box is not a widget, we inherit implicitely from
597 \texttt{bbtk::AtomicBlackBox}.
600 The only part of the file which needs a bit of explaination is
601 the body of the \texttt{process} tag, which describes the
602 actual code to execute in the box.
603 This code must be enclosed in a \texttt{<PRE></PRE>} tag
604 to tell the \xml parser not to interpret it as \xml instructions.
605 This is necessary to be able to use any symbol,
606 like the \texttt{<} and \texttt{>} which have a
607 special meaning in \xml.
608 In the case of the \texttt{Add} box, the process code
609 is very simple : remember that
610 \texttt{bbGetInputIn1()} is the
611 accessor to the input \texttt{In1} declared above and
612 \texttt{bbGetInputIn2()} is the
613 accessor to the input \texttt{In2};
614 the code simply adds the values of the two inputs
615 and sets the output \texttt{Out} with the resulting value.
617 To describe your own black boxes in \xml code,
618 you must modify the xml file generated in previous step :
621 \item Complete the description and author tags if you feel like.
622 \item add the \texttt{\#include} directives to be put in the generated \texttt{.h} file
623 \item Create your inputs and outputs
624 \item Fill in the process tag
625 \item Fill in the constructor tag
626 \item Fill in the copyconstructor tag
627 \item Fill in the destructor tag
632 % ==========================================
633 \subsubsection{Specific \texttt{xml} tags for \texttt{itk::ImageToImageFilter} classes bbfication}
634 % ==========================================
636 % ==========================================
637 \subsubsection{Specific \texttt{xml} tags for \texttt{vtkImageAlgorithm} classes bbfication}
638 % ==========================================
641 <blackbox name="..." type="VTK\_ImageAlgorithm">
643 <vtkparent>the vtk ImageAlgorithm class it inherits from</vtkparent>
644 <input name="..." type="double" special="vtk parameter" description="..."/>
645 <input name="..." type="vtkImageData*" special="vtk output" description="..."/>
647 <output name="..." type="double" special="vtk parameter" description="..."/>
648 <output name="..." type="vtkImageData*" special="vtk output" description="..."/>
650 % ==========================================
651 \subsubsection{Specific \texttt{xml} tags for \texttt{vtkPolyDataAlgorithm} classes bbfication}
652 % ==========================================
654 <blackbox name="..." type="VTK\_PolyDataAlgorithm">
656 <vtkparent>the vtk Polydata class it inherits from</vtkparent>
657 <input name="..." type="double" special="vtk parameter" description="..."/>
658 <input name="..." type="vtkPolyData*" special="vtk output" description="..."/>
660 <output name="..." type="double" special="vtk parameter" description="..."/>
661 <output name="..." type="vtkPolyData*" special="vtk output" description="..."/>
664 % ==========================================
665 \subsubsection{\bbfy \texttt{xml} tags reference}
666 % ==========================================
669 % ==========================================
671 \caption{\label{xml_tags}
672 \bbfy \texttt{xml} tags reference}
674 \begin{tabular}{|lcllm{6cm}|}
676 Tag & Attributes & Condition & Multiplicity & Description
679 \texttt{<blackbox>} & \texttt{name} & - & 1 & The name of the box \\ \hline
680 & \texttt{type} & - & 1 & The type of the box. In:
681 \{\texttt{standard} (default),
682 \texttt{ITK\_ImageToImageFilter},
683 \texttt{VTK\_ImageAlgorithm},
684 \texttt{VTK\_PolyDataAlgorithm}\} \\\hline
685 & \texttt{generic} & a) & 0-1 &
686 Generate the generic filter (see text)\\ \hline
688 \texttt{<description>} & - & - & 0-n & The description of the box. Multiple occurrence are concatenated \\\hline
689 \texttt{<author>} & - & - & 0-n & The author of the box. Multiple occurrence are concatenated \\\hline
690 \texttt{<category>} & - & - & 0-1 & The box category (if more than one, they are separated with commas) see Tab \ref{categories}\\\hline
691 \texttt{<parentblackbox>} & - & - & 1 & The parent black box of the box.
692 In: \{\texttt{bbtk::BlackBox, bbtk::WxBlackBox, bbtk::WxContainerBlackBox}\}\\\hline
693 \texttt{<package>} & - & - & 1 & The package of the box \\\hline
694 \texttt{<namespace>} & - & - & 0-1 & The namespace of the box.
695 Use \texttt{bbPACKAGE}, where \texttt{PACKAGE} is the name of the package\\\hline
696 \texttt{<include>} & - & - & 0-n & Additionnal file to include
697 (generates : \texttt{\#include 'value'})\\\hline
699 \texttt{<template>} & - & - & 0-n & Template parameter of the box. The template parameter list is generated in the order of appearance of the tag. \\\hline
701 \texttt{<itkparent>} & - & a) & 1 & The parent itk class (with namespace) \\\hline
703 \texttt{<vtkparent>} & - & b) & 1 & The parent vtk class \\\hline
705 \texttt{<input>} & \texttt{name} & - & 1 & The name of the input \\\hline
706 & \texttt{type} & - & 1 & The type of the input \\\hline
707 & \texttt{special} & - & 0-1 & In: \{\texttt{``itk input'',
708 ``vtk input'', ``itk parameter'', ``vtk parameter''}\} (see below).\\\hline
709 & \texttt{generic\_type} & c) & 0-1 & The ``generic'' type of the input (see text). \\\hline
710 \texttt{<output>} & \texttt{name} & - & 1 & The name of the output \\\hline
711 & \texttt{type} & - & 1 & The type of the output \\\hline
712 & \texttt{special} & - & 0-1 & In: \{\texttt{``itk output'',
713 ``vtk output''}\} (see below).\\\hline
714 & \texttt{generic\_type} & c) & 0-1 & The ``generic'' type of the output (see text).\\\hline
715 & \texttt{nature} & c) & 0-1 & The ``nature'' of the output (used for automatic GUI generation).\\\hline
717 \texttt{<process>} & - & - & 0-1 & The code of the processing method of the box. Must be put between clear tags : \texttt{<PRE></PRE>} \\\hline
718 \texttt{<constructor>} & - & - & 0-1 & The code of the user Constructor of the box (may contains default initialisations). Must be put between clear tags : \texttt{<PRE></PRE>} \\\hline
719 \texttt{<copyconstructor>} & - & - & 0-1 & The code of the user Copy Constructor of the box . Must be put between clear tags : \texttt{<PRE></PRE>} \\\hline
720 \texttt{<destructor>} & - & - & 0-1 & The code of the user Destructor of the box. Must be put between clear tags : \texttt{<PRE></PRE>} \\\hline
723 % ==========================================
725 \caption{\label{xml_tags}
726 \bbfy \texttt{xml} tags conditions}
728 \begin{tabular}{|ll|}
730 a) & \texttt{<blackbox type == ''itkImageToImageFilter''>} \\ \hline
731 b) & \texttt{<blackbox type == ''vtkImageAlgorithm'' or ''vtkPolyDataAlgorithm''>} \\ \hline
732 c) & \texttt{<blackbox type == ''itkImageToImageFilter''>} and
733 \texttt{<blackbox generic>} is present. \\ \hline
739 % ==========================================
741 \caption{\label{categories}
742 \bbfy \texttt{Black Box} categories}
744 \begin{tabular}{|ll|}
746 \texttt{Categ name} & : Meaning \\ \hline \\ \hline
747 \texttt{adaptor} & : Adaptor box \\ \hline
748 \texttt{application} & : Final application, end user intended \\ \hline
749 \texttt{atomic box} & : System category.
750 Automatically assigned to Atomic Black Boxes (c++ defined) \\ \hline
751 \texttt{complex box} & : System category.
752 Automatically assigned to Complex Black Boxes (script defined) \\ \hline
753 \texttt{command line} & : Script which defines a command line application (no embedded GUI, but command line imput parameters) \\ \hline
754 \texttt{demo} & : Demonstration \\ \hline
755 \texttt{devel} & : Developer tool (bbCreatePackage.bbs, ...) \\ \hline
756 \texttt{dicom} & : DICOM aware box \\ \hline
757 \texttt{example} & : Example script showing a box use-case \\ \hline
758 \texttt{filter} & : Image processing box \\ \hline
759 \texttt{image} & : Image processing related box \\ \hline
760 \texttt{interaction} & : \\ \hline
761 \texttt{math} & : Mathematical operations\\ \hline
762 \texttt{mesh} & : Mesh processing related box \\ \hline
763 \texttt{misc} & : A box that cannot be put in other category ! \\ \hline
764 \texttt{read/write} & : Box that read or write data from or to disk \\ \hline
765 \texttt{viewer} & : Box which displays some data \\ \hline
766 \texttt{widget} & : Piece of graphical interface \\ \hline
768 \texttt{3D object creator} & : Sophisticated 3D widget \\ \hline
769 \texttt{toolsbbtk} & : Component of bbStudio \\ \hline
774 % ==========================================
776 \caption{\label{kinds}
777 \bbfy \texttt{Black Box} kinds}
779 \begin{tabular}{|ll|}
781 \texttt{Kind} & Use as : \\ \hline \\ \hline
782 \texttt{ADAPTOR} & \\ \hline
783 \texttt{DEFAULT\_ADAPTOR} & \\ \hline
784 \texttt{ADAPTOR} & \\ \hline
785 \texttt{WIDGET\_ADAPTOR} & \\ \hline
786 \texttt{DEFAULT\_WIDGET\_ADAPTOR} & \\ \hline
787 \texttt{GUI} & \\ \hline
788 \texttt{DEFAULT\_GUI} & \\ \hline
789 \texttt{ALL} & If kind='ALL' then sets the level for all kinds\\ \hline
794 % ==========================================
796 \caption{\label{nature}
797 \bbfy \texttt{nature}}
799 \begin{tabular}{|ll|}
801 \texttt{Nature} & : used for \\ \hline \\ \hline
803 \texttt{file name} & Poping up a File Selector\\ \hline
804 \texttt{directory name} & Poping up a Directory Selector\\ \hline
805 \texttt{file extension} & \\ \hline
806 \texttt{colour} & Poping up a Colour Selector\\ \hline
807 \texttt{pixel type} & \\ \hline
808 \texttt{image dimension} & \\ \hline
809 \texttt{image index} & \\ \hline
810 \texttt{image size} & \\ \hline
811 \texttt{voxel size} & \\ \hline
815 % ==========================================
816 \subsection{\CPP description of a box}
817 % ==========================================
821 Look at the files \texttt{examples/TEMPLATE\_bbPackagenameBoxname.h/cxx}
822 and \texttt{examples/TEMPLATE\_bbPackagenameWXBoxname.h/cxx}
828 %\section{Conclusion}