https://public.kitware.com/Wiki/api.php?action=feedcontributions&user=Aylward&feedformat=atomKitwarePublic - User contributions [en]2024-03-29T02:24:49ZUser contributionsMediaWiki 1.38.6https://public.kitware.com/Wiki/index.php?title=ITK/MetaIO/Documentation&diff=64647ITK/MetaIO/Documentation2021-10-26T20:38:35Z<p>Aylward: /* Associated transformations */</p>
<hr />
<div>= Abstract =<br />
<br />
MetaImage is the text-based tagged file format for medical images that resulted. We have now extended that file format to support a variety of objects that occur in medicine such a tubes (for vessels, needles, etc.), blobs (for arbitrary shaped objects), cubes, spheres, etc. The complete library is known at MetaIO.<br />
<br />
The central code of MetaImage/MetaIO is quite stable. MetaImage has been in use for several years by a wide range of research at UNC, Chapel Hill. New features are occasionally added, but backward compatibility will always be maintained.<br />
<br />
= Introduction and Installation =<br />
<br />
== Obtaining MetaIO ==<br />
<br />
The upstream MetaIO Git repository:<br />
<br />
* https://github.com/Kitware/MetaIO<br />
<br />
MetaIO is being distributed with the following packages:<br />
<br />
* National Library of Medicine’s Insight Toolkit (ITK) for medical image segmentation and registration:<br />
** http://www.itk.org<br />
* Kitware's Visualization Toolkit (VTK)<br />
** http://www.vtk.org<br />
<br />
== Installing The MetaIO Package ==<br />
<br />
MetaIO is a hierarchy of C++ classes and functions. We have yet to find a modern C++ compiler that does not compile MetaIO. Know compatible compilers include G++ v2.95 and beyond (and probably previous), Microsoft Visual C++ 6.0, Sun’s CC on Solaris 2.6 and beyond, Intel compiler and compilers on other workstations including HPs, SGIs, and Alpha systems. Please contact us (Stephen R. Aylward, stephen.aylward@kitware.com or Julien Jomier, julien.jomier@kitware.com) if you encounter any incompatibilities between our code and your compiler.<br />
<br />
MetaIO should be built as part of the standard ITK and VTK installations. It is also quite easy to use MetaIO from within these toolkits without using the rest of the toolkit. <br />
<br />
=== ITK MetaIO ===<br />
<br />
The hierarchy of the software in the stand-alone MetaIO package is as follows:<br />
* MetaIO/<br />
** doc/<br />
** tests/<br />
<br />
The top level contains the source files, the header files, and the CMakeLists.txt file that is used by the CMake program to compile MetaIO. This document and the MetaObjects www pages are in the doc directory. A sequence of simple tests is available in the tests directory.<br />
<br />
The hierarchy of the software in the Insight and InsightApplications distributions is as follows:<br />
* Insight<br />
** Code/Utilities/MetaIO/<br />
*** doc/<br />
*** tests/<br />
* InsightApplications<br />
** MetaImageImporter<br />
** ImageViewer (formerly MetaImageViewer)<br />
** ColorImageViewer (formerly MetaColorImageViewer)<br />
** MetaImageReadWrite<br />
<br />
Routines that wrap MetaIO for ITK's image IO object factory are in<br />
* Insight/Code/IO/<br />
** itkMetaImageReader, itkMetaImageWriter<br />
<br />
Routines that wrap MetaIO for reading and writing ITKS's Spatial Objects (tubes, blobs, ellipses, meshes, etc.) are in<br />
* Insight/Code/SpatialObject<br />
<br />
Certain examples, such as the MetaImageViewer, also require FLTK (a cross-platform user interface library available from http://fltk.org). Install FLTK and then ITK and then InsightApplications to have every MetaIO example built. Numerous other examples and applications in InsightApplications also rely on FLTK.<br />
<br />
See the file /Insight/Examples/MetaImageReadWrite for a working example on how to develop a program using MetaImage for IO.<br />
<br />
=== VTK MetaIO ===<br />
<br />
The hierarchy of the software in the Visualization toolkit is as follows:<br />
* VTK/Utilitites<br />
** vtkmetaio<br />
* VTK/IO<br />
<br />
=== Stand Alone MetaIO ===<br />
MetaIO can also be compiled outside of these toolkits. This is left as an exercise to the user (hint: requires the kwsys and zlib libraries). Instead of a stand-alone installation, we highly recommend using the distribution in ITK - if you build ITK, you get MetaIO for free!<br />
<br />
== Quick Start ==<br />
<br />
=== Data conversion via MetaHeaders ===<br />
<br />
This section assumes that you have data that you wish to process using an application that reads MetaImages. This section gives examples on how “convert” your data to the MetaImage format.<br />
<br />
For uncompressed data, “conversion” to MetaImage is actually just a matter of specifying a MetaImage Headerfile (a “MetaHeader”) that describes and points to the file(s) containing your data.<br />
* Uncompressed data is data stored in a raw format, possibly with a header, as is often the case for DICOM, BMP, and PNG formatted images.<br />
<br />
For compressed data, you must first convert your data to a non-compressed format. One of the most robust image conversion software packages is ImageMagick (http://www.imagemagick.org/; Unix and PC versions available). It has an application called “convert” that handles most of the popular 2D image formats.<br />
* Compressed data is includes JPEG or GIF formats as well as select PNG and TIFF images.<br />
<br />
=== Using MetaImageImporter ===<br />
<br />
MetaImageImporter asks a series of questions about your data and then produces a MetaImage header file that points to your data and allows the MetaIO library to read your data.<br />
<br />
MetaImageImporter is part of the InsightApplications repository. See http://www.itk.org for information on downloading and installing InsightApplications - the companion to the Insight repository.<br />
<br />
MetaImageImporter now has a QT graphical user interface. Please see the [[KWPublic/Applications/MetaImageImporter|documentation]].<br />
<br />
Otherwise, the following two sub-sections will step you through the conversion process. The first sub-section applies if all of your data is in one file, i.e., is a "brick-of-bytes". The second sub-section applies if your data is spread across files, e.g., is dicom or a tiff sequence.<br />
<br />
=== Reading a Brick-of-Bytes (an N-Dimensional volume in a single file) ===<br />
<br />
A “brick of bytes” is a volume of image data stored in a single file possibly with preceding and trailing non-image data. A volume can be of any dimension (1 dimensional to N dimensional).<br />
<br />
To correctly load these images, the minimal information that you need to know is:<br />
# Number of dimensions<br />
# Size of each dimension<br />
# Data type<br />
# Name of the data file<br />
<br />
For example, let’s say the data was 3 dimensional, had 256 x 256 x 64 voxels, used an unsigned short to represent the value at each voxel, and was stored in the file “image.raw”. The resulting MetaHeader (our naming convention would call this file “image.mhd”) file would read<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
ElementDataFile = image.raw (this tag must be last in a MetaImageHeader)<br />
<br />
That’s it, but this assumes quite a bit about the image data. Specifically, it assumes<br />
# There are not any non-image data bytes (header data) at the beginning of the image data file “image.raw”.<br />
# The voxels are cubes – the distance spanned by and between a voxel in each coordinate direction is 1 “unit”, e.g., 1x1x1mm voxel size and voxel spacing<br />
# The byte-order of the data in image.raw matches the byte ordering native to the machine the application is running on (e.g., PC’s use LSB ordering and Suns/Macs use MSB ordering).<br />
<br />
If these assumptions are false, the data will not be loaded correctly by the application. To fix these problems, MetaIO allows you to specify additional tag/value pairs in the header:<br />
# To skip the header bytes in the image data file, use<br />
HeaderSize = X<br />
where X is the number of bytes to skip at the beginning of the file before reading image data. If you know there are no trailing bytes (extra bytes at the end of the file) you can specify<br />
HeaderSize = -1<br />
and MetaImage will automatically calculate the number of extract bytes in the data file, assume they those bytes are at the head of the data file, and automatically skip them before beginning to read the image data.<br />
<br />
# To specify the spacing of the voxels, use<br />
ElementSpacing = X Y Z<br />
where X is the distance between of the centers of the voxels along the x-dimension, Y is the spacing in the y-dimension, and Z is the spacing in the z-dimension. Therefore, to specify a 1x1x3mm voxel spacing, use<br />
ElementSpacing = 1 1 3<br />
<br />
NOTE: If ElementSpacing is not specified, it is assumed to be equal to ElementSize. If neither is specified, both are assumed to be 1.<br />
<br />
# To specify a voxel size, use <br />
ElementSize = X Y Z<br />
where X Y Z represent the size in the x, y, and z-dimensions respectively.<br />
<br />
NOTE: If ElementSize is not specified, it is assumed to be equal to ElementSpacing. If neither is specified, both are assumed to be 1.<br />
<br />
# To specify a particular byte ordering, use<br />
ElementByteOrderMSB = True<br />
or<br />
ElementByteOrderMSB = False<br />
MSB (aka big-endian) ordering is common to SPARC and Motorola processors (e.g., Macintoshes). LSB (aka little-endian) ordering is common to Intel processors (e.g., PC compatibles).<br />
<br />
Putting it all together, to “convert” a file containing the image data in a continuous block at the end of the file, specify the header<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = image.raw<br />
<br />
=== Reading DICOM and Other One-Slice-Per-File Data Formats ===<br />
<br />
If the data is split into one slice per file, as is done with most DICOM object files, only the ElementDataFile tag’s option needs to change. Note that 3D DICOM object files are becoming popular, and some such DICOM files can be read using the above, volume, technique.<br />
<br />
Since the MetaLibrary cannot directly parse DICOM headers, those headers must be skipped and the user must specify the image dimensions and other essential image information. For DICOM files, the MetaLibrary must automatically calculate the header size of each file (luckily for almost every DICOM object the image data is stored at the end of the file). For this reason, this method only works for uncompressed files.<br />
<br />
To specify which files comprise the volume, they can be specified as an ordered list in the MetaHeader using the ElementDataFile=LIST option. The filenames should be listed at the end of the MetaHeader, after the ElementDataFile option, and the filenames should be separated by whitespace:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 100<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = LIST<br />
filenameOfSlice1<br />
filenameOfSlice2<br />
filenameOfSlice3<br />
filenameOfSlice4<br />
.<br />
. (one hundred filenames must be specified to specify the 100 slices in the volume)<br />
.<br />
<br />
This method works even if there are spaces in the file paths and file names.<br />
<br />
Notice that this method can become tedious if a large number of files need to be read. To alleviate this, a second way of specifying a series of files can be used if the filenames are numerically distinguished. That is, the file names should be able to be specified using a numeric substitution into a c-style printf-string, for a range of values. In pseudo-code:<br />
<br />
for i=numBegin to numEnd step numStep<br />
sprintf(sliceName, “baseName.%03d”, i);<br />
end<br />
<br />
The parameters of this system are numBegin, numEnd, numStep, and the c-style printf string (e.g., “baseName.%03d”). The begin, end, and step parameters appear in order after the c-style printf string:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 100<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = baseName.%03d 1 100 1<br />
<br />
The above MetaImage header will cause the files “baseName.001” to “baseName.100” to be read to create a 100-slice volume. This method works even if there are spaces in the file paths and file names. However, when spaces are present in the file path and/or file name, all three parameters (begin, end, and step) need to be specified as the last parameters. The remaining parameters (initially parsed based on spaces) are then joined back together (including spaces) to generate the file name.<br />
<br />
In some cases, it may be helpful to skip slices in the volume. Changing the slice spacing and the ElementDataFileNumStep enacts this…<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 50<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 2<br />
ElementByteOrderMSB = False<br />
ElementDataFile = baseName.%03d 1 100 2<br />
<br />
The complete set of MetaImage Tags are given in the Reference section of this document. The next section discusses how to use the MetaImage Library for image reading and writing in your own programs.<br />
<br />
== MetaIO Library Architecture ==<br />
<br />
The base class of the MetaIO library is the MetaObject class. It defines a base set of tags that are common to all metaObjects such as MetaImages, MetaTubes, etc.<br />
<br />
The tags are defined using the protected member functions SetupReadFields and SetupWriteFields. These functions create a list of MetaFieldRecords to define the name, type, interdependence, and necessity of each tag. Helper functions for defining the fields are in MetaUtils.cxx. The types are defined via enums in MetaTypes.h<br />
<br />
The derived classes add tags to the list via their own SetupReadFields and SetupWriteFields member functions. The MetaImage subclass also re-implements the Read and Write methods since non tag data (i.e., the pixel values) must also be read. Compare the derived classes for MetaCube and MetaImage.<br />
<br />
=== MetaObjects ===<br />
<br />
In this section we describe the metaObjects which have been implemented already. If you want to implement other objects, you can easily derive these classes. metaObject is the base class for metaIO. metaScene and metaGroup are also a useful objects that support multiple metaObjects.<br />
All these objects are described in details next.<br />
<br />
==== Constructors ====<br />
<br />
Simple constructor<br />
MetaObject(void);<br />
<br />
Read a metafile and store the result in the current object<br />
MetaObject(const char * _fileName);<br />
<br />
Define the dimension of the object at construction time.<br />
MetaObject(unsigned int dim);<br />
<br />
==== Member functions ====<br />
<br />
Specify the filename to read (Optional)<br />
void FileName(const char *_fileName);<br />
const char * FileName(void) const;<br />
<br />
Read a MetaFile<br />
bool Read(const char * _fileName=NULL);<br />
<br />
Write a MetaFile <br />
bool Write(const char * _fileName=NULL);<br />
virtual bool Append(const char *_headName=NULL);<br />
<br />
Print the info about the metaObject<br />
virtual void PrintInfo(void) const;<br />
<br />
Clear the information as well as the data of the metObject<br />
virtual void Clear(void);<br />
<br />
==== Field descriptions ====<br />
<br />
Name:<br />
void Name(const char *_Name);<br />
const char * Name(void) const;<br />
<br />
Color: <br />
const float * Color(void) const;<br />
void Color(float _r, float _g, float _b, float _a);<br />
void Color(const float * _color);<br />
<br />
ID:<br />
ID number of the current metaObject<br />
void ID(int _id);<br />
int ID(void) const;<br />
<br />
Parent ID:<br />
ID number of the parent metaObject<br />
void ParentID(int _parentId);<br />
int ParentID(void) const;<br />
<br />
Binary Data:<br />
Specify if the data is binary or not<br />
void BinaryData(bool _binaryData);<br />
bool BinaryData(void) const;<br />
<br />
Binary Data Byte Order:<br />
void BinaryDataByteOrderMSB(bool _binaryDataByteOrderMSB);<br />
bool BinaryDataByteOrderMSB(void) const;<br />
<br />
Comments:<br />
const char * Comment(void) const;<br />
void Comment(const char * _comment);<br />
<br />
Object Typename and optional subtype (i.e. the type of the object)<br />
const char * ObjectTypeName(void) const;<br />
void ObjectTypeName(const char * _objectTypeName);<br />
const char * ObjectSubTypeName(void) const;<br />
void ObjectSubTypeName(const char * _objectSubTypeName);<br />
<br />
==== Associated transformations ====<br />
<br />
Physical location (in millimeters and with respect to machine coordinate system or the patient) of the first element in the image. Physical orientation of the object is defined as an NDims x NDims matrix that is serialized in a column-major format in MetaIO files.<br />
<br />
Offset: (equiv. to position and origin)<br />
const float * Offset(void) const;<br />
float Offset(int _i) const;<br />
void Offset(const float * _position);<br />
void Offset(int _i, float _value);<br />
<br />
Position: (equiv. to offset and origin)<br />
const float * Position(void) const;<br />
float Position(int _i) const;<br />
void Position(const float * _position);<br />
void Position(int _i, float _value);<br />
<br />
Origin: (equiv. to offset and position)<br />
const float * Origin(void) const;<br />
float Origin(int _i) const;<br />
void Origin(const float * _position);<br />
void Origin(int _i, float _value);<br />
<br />
<br />
Rotation: (equiv. to orientation and transformMatrix)<br />
const float * Rotation(void) const;<br />
float Rotation(int _i, int _j) const;<br />
void Rotation(const float * _orientation);<br />
void Rotation(int _i, int _j, float _value);<br />
<br />
Orientation: (equiv. to rotation and transformMatrix)<br />
const float * Orientation(void) const;<br />
float Orientation(int _i, int _j) const;<br />
void Orientation(const float * _orientation);<br />
void Orientation(int _i, int _j, float _value);<br />
<br />
TransformMatrix: (equiv. to rotation and orientation)<br />
const float * TransformMatrix(void) const;<br />
float TransformMatrix(int _i, int _j) const;<br />
void TransformMatrix(const float * _transformMatrix);<br />
void TransformMatrix(int _i, int _j, float _value);<br />
<br />
Center of rotation of the object:<br />
const float * CenterOfRotation(void) const;<br />
float CenterOfRotation(int _i) const;<br />
void CenterOfRotation(const float * _position);<br />
void CenterOfRotation(int _i, float _value);<br />
<br />
Anatomical Orientation:<br />
const char * AnatomicalOrientationAcronym(void) const;<br />
const MET_OrientationEnumType * AnatomicalOrientation(void) const;<br />
MET_OrientationEnumType AnatomicalOrientation(int _dim) const;<br />
void AnatomicalOrientation(const char *_ao);<br />
void AnatomicalOrientation(const MET_OrientationEnumType *_ao);<br />
void AnatomicalOrientation(int _dim, MET_OrientationEnumType _ao);<br />
void AnatomicalOrientation(int _dim, char ao);<br />
<br />
<br />
Element Spacing:<br />
Physical Spacing (in same units as position)<br />
const float * ElementSpacing(void) const;<br />
float ElementSpacing(int _i) const;<br />
void ElementSpacing(const float * _elementSpacing);<br />
void ElementSpacing(int _i, float _value);<br />
<br />
<br />
<br />
For simplicity, some dynamic functions have been recently added. They allow the user to add fields dynamically.<br />
<br />
The function AddUserField is defined by:<br />
<br />
template <class T><br />
bool AddUserField(const char* _fieldName,MET_ValueEnumType _type, int _length,<br />
T *_v,bool _required=true,int _dependsOn=-1 )<br />
<br />
The user may also want to clear the fields created by using <br />
<br />
ClearUserFields().<br />
<br />
To determine the value of a field<br />
<br />
void* GetUserField(const char* _name);<br />
<br />
Note: When using GetUserField() function, the user is responsible for the deletion of the pointer created. See the following example for details.<br />
<br />
==== Example ====<br />
<br />
/** We create a simple 3D metaObject with some properties */<br />
MetaObject tObj(3); // Create a 3D metaObject<br />
tObj.FileName("testObject.txt"); // Define the name of the file<br />
tObj.Comment("TestObject"); // Add some comments<br />
tObj.ObjectTypeName("Object"); // Define the type of the object<br />
tObj.ObjectSubTypeName("MinorObject"); // and the subtype as well<br />
<br />
/** We now define the position and the orientation as well as the spacing of the created object */<br />
// The position part<br />
tObj.Position(0, 1);<br />
tObj.Position(1, 2);<br />
tObj.Position(2, 3);<br />
<br />
// The orientation part<br />
float orient[9];<br />
int i;<br />
for(i=0; i<9; i++)<br />
{<br />
orient[i] = 0;<br />
}<br />
orient[0] = 1;<br />
orient[5] = 1;<br />
orient[7] = 1;<br />
tObj.Orientation(orient);<br />
<br />
// The element spacing part<br />
tObj.ElementSpacing(0, 1);<br />
tObj.ElementSpacing(1, 2);<br />
tObj.ElementSpacing(2, 1);<br />
<br />
<br />
/** Add user's defined fields */<br />
tObj.AddUserField("MyName", MET_STRING, strlen("JulienAndStephen"), "JulienAndStephen");<br />
<br />
/** Write the object */<br />
tObj.Write();<br />
<br />
/** Clear completely the object */<br />
tObj.Clear();<br />
tObj.ClearUserFields();<br />
<br />
/** Specify that we want to read the field ‘MyName’ */<br />
tObj.AddUserField("MyName", MET_STRING);<br />
<br />
/** Read the object */<br />
tObj.Read("testObject.txt");<br />
<br />
/** Print the object */<br />
tObj.PrintInfo();<br />
<br />
/** Get the name in the file */<br />
char* name = static_cast<char*>(tObj.GetUserField("MyName"));<br />
std::cout << name << std::endl;<br />
<br />
/** delete the allocated pointer */<br />
delete [] name;<br />
<br />
== Types of MetaObjects ==<br />
<br />
All of the following objects derive from metaObject.<br />
<br />
=== MetaBlob ===<br />
<br />
A blob is defined by a list of points that describe the object. The points can be inside the object (if obtained by connected-component for instance) or only on the surface. Note that a color (RGBA) can be associated which each point.<br />
<br />
The required fields are:<br />
* The number of points defining the object:<br />
NPoints(int npnt);<br />
* How the position of the points is stored in the file. By default the configuration is x y z red green blue alpha<br />
PointDim(const char* pointDim);<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D blob */<br />
MetaBlob blob(3);<br />
blob.ID(0); // define the ID of the blob<br />
<br />
/** Add 10 points to the blob */<br />
BlobPnt* pnt;<br />
<br />
unsigned int i;<br />
for(i=0;i<10;i++)<br />
{<br />
pnt = new BlobPnt(3);<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
blob.GetPoints().push_back(pnt); // push the created point into the list of points<br />
}<br />
<br />
/** Write the blob in binary format */<br />
blob.BinaryData(true);<br />
blob.ElementType(MET_FLOAT);<br />
blob.Write("myBlob.meta");<br />
<br />
/** Read the file */<br />
blob.Read("myBlob.meta"); <br />
blob.PrintInfo();<br />
<br />
/** Access the list of points */<br />
std::cout << "Accessing pointlist..." << std::endl;<br />
<br />
MetaBlob::PointListType plist = blob.GetPoints();<br />
MetaBlob::PointListType::const_iterator it = plist.begin();<br />
<br />
while(it != plist.end())<br />
{<br />
for(unsigned int d = 0; d < 3; d++)<br />
{<br />
std::cout << (*it)->m_X[d] << " ";<br />
}<br />
std::cout << std::endl;<br />
it++;<br />
}<br />
<br />
=== MetaEllipse ===<br />
<br />
MetaEllipse is an N-Dimensional object to define ellipsoids like circles, spheres or even hyper-ellipsoids.<br />
The only field you need to provide is the Radius.<br />
<br />
There are several ways to input the radius:<br />
# As an array of floats: void Radius(const float* radius);<br />
# As a single value which means that we are defining an hyper-sphere: void Radius(float radius);<br />
# A convenient way to define a 2D ellipse: void Radius(float r1,float r2);<br />
# A convenient way to define a 3D ellipse: void Radius(float r1,float r2, float r3);<br />
<br />
==== Example ====<br />
<br />
/** Create a sphere */<br />
MetaEllipse myEllipse (3);<br />
myEllipse ->Radius(3); // radius of 3<br />
<br />
=== MetaGroup ===<br />
<br />
MetaGroup does not have added functionalities compared to metaObject. It allows to group object in a metafile.<br />
<br />
=== MetaImage ===<br />
<br />
==== Constructors ====<br />
<br />
Simple constructor by specifying the filename<br />
MetaImage(const char *_headerName); <br />
<br />
Constructor by shared memory <br />
MetaImage(MetaImage *_im); <br />
<br />
Other constructors<br />
MetaImage(int _nDims, <br />
const int * _dimSize,<br />
const float *_elementSpacing,<br />
MET_ValueEnumType _elementType,<br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
MetaImage(int _x, int _y, <br />
float _elementSpacingX, <br />
float _elementSpacingY,<br />
MET_ValueEnumType _elementType, <br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
MetaImage(int _x, int _y, int _z, <br />
float _elementSpacingX,<br />
float _elementSpacingY,<br />
float _elementSpacingZ, <br />
MET_ValueEnumType _elementType,<br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
==== Member functions ====<br />
<br />
HeaderSize: Return the size of the header.<br />
int HeaderSize(void) const;<br />
<br />
Quantity: Total number of elements in the image.<br />
int Quantity(void) const;<br />
<br />
SubQuantity: Number of elements in image spanning sub-dimensions. E.g., elements per line, 2D sub-image, 3D sub-volume.<br />
const int * SubQuantity(void) const; <br />
int SubQuantity(int _i) const; <br />
<br />
ElementMin/Max: The default max returned is the largest allowed by ElemNBytes (12 bit uint16_t will give 4096 max). This may not represent the true max. Use _reCalc=true to force a calcuation of the actual max element value.<br />
bool ElementMinMaxValid(void) const;<br />
void ElementMinMaxValid(bool _elementMinMaxValid);<br />
void ElementMinMaxRecalc(void);<br />
double ElementMin(void) const; <br />
void ElementMin(double _elementMin);<br />
double ElementMax(void) const;<br />
void ElementMax(double _elementMax);<br />
<br />
ElementByteOrderSwap: These functions are available only after ReadImageData() or if _read_and_close=TRUE when read<br />
void ElementByteOrderSwap(void);<br />
bool ElementByteOrderFix(void);<br />
<br />
<br />
ConverTo: Converts to a new data type. Rescales using Min and Max.<br />
bool ConvertElementDataTo(MET_ValueEnumType _elementType=MET_UCHAR,<br />
double _toMin=0, double _toMax=0);<br />
<br />
==== Field descriptions ====<br />
<br />
Modality: Specify the modality of the image<br />
MET_ImageModalityEnumType Modality(void) const;<br />
void Modality(MET_ImageModalityEnumType _modality);<br />
<br />
Dimension size: Specify the size of the image in each dimension<br />
void DimSize(const int * _dimSize);<br />
void DimSize(int _i, int _value);<br />
<br />
SequenceID: DICOM designation of this image relative to other images acquired at the same time<br />
const float * SequenceID(void) const;<br />
float SequenceID(int _i) const;<br />
void SequenceID(const float * _sequenceID);<br />
void SequenceID(int _i, float _value);<br />
<br />
ElementSize: Optional Field. Physical size (in MM) of each element in the image (0 = xSize, 1 = ySize, 2 = zSize)<br />
const float * ElementSize(void) const;<br />
float ElementSize(int i) const;<br />
void ElementSize(const float * _pointSize);<br />
void ElementSize(int _i, float _value);<br />
<br />
ElementType: Pixel type<br />
MET_ValueEnumType ElementType(void) const;<br />
void ElementType(MET_ValueEnumType _elementType);<br />
<br />
ElementNumberOfChannels: Number of channels<br />
int ElementNumberOfChannels(void) const;<br />
void ElementNumberOfChannels(int _elementNumberOfChannels);<br />
<br />
ElementData: Returns a pointer to the data. <br />
void * ElementData(void);<br />
double ElementData(int _i) const;<br />
void ElementData(void * _data);<br />
bool ElementData(int _i, double _v);<br />
<br />
ElementDataFileName: Set/Get the filename<br />
const char * ElementDataFileName(void) const;<br />
void ElementDataFileName(const char * _dataFileName);<br />
<br />
==== Example ====<br />
<br />
ObjectType = Image<br />
NDims = 2<br />
BinaryData = True<br />
BinaryDataByteOrderMSB = False<br />
ElementSpacing = 1 2<br />
DimSize = 8 8<br />
ElementType = MET_CHAR<br />
ElementDataFile = LOCAL<br />
[Pixel Data]<br />
<br />
=== MetaLandmark ===<br />
<br />
MetaLandmark is a simple list of landmarks.<br />
<br />
The number of landmarks defining the object is set using the function<br />
NPoints(int npnt);<br />
<br />
How the position of the points is stored in the file: By default the configuration is x y z red green blue alpha<br />
PointDim(const char* pointDim);<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D Landmark */<br />
MetaLandmark Landmark(3);<br />
Landmark.ID(0);<br />
LandmarkPnt* pnt;<br />
<br />
/** Add some landmarks to the list of landmark points*/<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new LandmarkPnt(3);<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
Landmark.GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaLine ===<br />
<br />
A metaLine is actually a polyline defined by a list of connected points.<br />
A point on the line has a given position, a normal and a color.<br />
<br />
To set the position the local variable m_X should be filled in the point structure. The variable m_V which is a double pointer to a float is used to assess the normal. The normal has the dimension of the object minus one since a metaLine in a 3D space will have two normals (a plane).<br />
<br />
Note that the user does not need to allocate the memory for those variables, this is done automatically in the constructor of the point.<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
/** Create a 3D MetaLine */<br />
MetaLine Line(3);<br />
LinePnt* pnt;<br />
<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new LinePnt(3);<br />
<br />
/** Define the position */<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
<br />
/** Define the normals */<br />
pnt->m_V[0][0]=(float)0.3;<br />
pnt->m_V[0][1]=i;<br />
pnt->m_V[0][2]=i;<br />
pnt->m_V[1][0]=(float)0.4;<br />
pnt->m_V[1][1]=i+1;<br />
pnt->m_V[1][2]=i+1;<br />
Line->GetPoints().push_back(pnt);<br />
}<br />
<br />
/** Write the result */<br />
Line.BinaryData(true);<br />
Line.Write("myLine.meta");<br />
<br />
=== MetaSurface ===<br />
<br />
The definition of a metaSurface is quite similar to the metaLine’s, except for the normal which is only a NDim vector (i.e. an array of floats) where NDim is the dimension of the metaObject.<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
MetaSurface surface(3);<br />
SurfacePnt* pnt;<br />
<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new SurfacePnt(3);<br />
<br />
/** Position */<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
<br />
/* Normal */<br />
pnt->m_V[0]=(float)0.8;<br />
pnt->m_V[1]=i;<br />
pnt->m_V[2]=i;<br />
surface->GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaTube ===<br />
<br />
A metaTube is a tubular structure defined by a list of connected points (like a metaLine) but more fields have been added for a complete representation, especially the one of blood vessels.<br />
To specify a point that belongs to the tube, the user can define: the position, the radius at that point, the normal(s), the tangent, the color, the Identification number, the medialness, the branchness, the ridgeness, and three alpha values that represents the ratio of the eigen values at that points. <br />
<br />
Note that metaTube supports only 2D and 3D tubes.<br />
<br />
Also for a metaTube, the ID of the root can be specified by the command Root(int rootID) and the ID of the parent point can also be assessed using ParentPoint(int parentpoint).<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D tube*/<br />
MetaTube* tube1 = new MetaTube(3);<br />
tube1->ID(0);<br />
<br />
/** Add 10 points to the list of tubePoints */<br />
TubePnt* pnt;<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new TubePnt(3);<br />
<br />
pnt->m_X[0]=i; // position<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
pnt->m_R=i; // radius<br />
tube1->GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaScene ===<br />
<br />
A metaScene is a metaObject that contains a flat list of metaObjects.<br />
<br />
==== Member functions ====<br />
<br />
Add an object to the scene:<br />
void AddObject(MetaObject* object);<br />
<br />
Return the number of objects in the scene:<br />
int NObjects(void) const;<br />
<br />
Get a list of objects present in the scene:<br />
ObjectListType * GetObjectList(void) {return & m_ObjectList;}<br />
<br />
==== Example ====<br />
<br />
/** Define a 3D Scene */<br />
MetaScene scene(3);<br />
<br />
MetaEllipse * e1 = new MetaEllipse(3);<br />
e1->ID(0);<br />
e1->Radius(3);<br />
<br />
MetaGroup g0;<br />
MetaGroup * g1 = new MetaGroup(3);<br />
g1->ID(2);<br />
<br />
s->AddObject(g1);<br />
s->AddObject(e1);<br />
<br />
s->Write("scene.scn");<br />
scene.Clear();<br />
<br />
s->Read("scene.scn");<br />
<br />
==== Output File Example ====<br />
<br />
Here is the example of a metafile with a scene that contains metaObjects<br />
<br />
ObjectType = Scene<br />
NDims = 3<br />
NObjects = 3<br />
ObjectType = Group<br />
NDims = 3<br />
ID = 2<br />
EndGroup = <br />
ObjectType = Ellipse<br />
NDims = 3<br />
ID = 0<br />
ParentID = 2<br />
Radius = 1 2 3<br />
ObjectType = Line<br />
NDims = 3<br />
ID = 0<br />
BinaryData = False<br />
BinaryDataByteOrderMSB = False<br />
ElementType = MET_FLOAT<br />
PointDim = x y z v1x v1y v1z<br />
NPoints = 3<br />
Points = <br />
1 2 3 0 0 0<br />
1 2 3 0 0 0<br />
1 2 3 0 0 0<br />
ObjectType = Landmark<br />
NDims = 3<br />
ID = 0<br />
BinaryData = True<br />
BinaryDataByteOrderMSB = False<br />
ElementType = MET_FLOAT<br />
PointDim = x y z red green blue alpha<br />
NPoints = 2<br />
Points = <br />
1 2 3 1.0 0.0 0.0 1.0<br />
1 2 3 1.0 0.0 0.0 1.0<br />
1 2 3 1.0 0.0 0.0 1.0 <br />
<br />
== Spatial Objects ==<br />
<br />
MetaIO has also been chosen to support Spatial Objects IO. To obtain a complete documentation of Spatial Objects and how to read/write them out please see the Insight user’s manual available at www.itk.org.<br />
<br />
== Reference: Tags of MetaImage ==<br />
<br />
=== MetaObject Tags ===<br />
<br />
The tags of MetaObject are:<br />
<br />
* Comment<br />
** MET_STRING<br />
** User defined - arbitrary<br />
* ObjectType<br />
** MET_STRING<br />
** Defined by derived objects – e.g., Tube, Image<br />
* ObjectSubType<br />
** MET_STRING<br />
** Defined by derived objects – currently not used<br />
* TransformType<br />
** MET_STRING<br />
** Defined by derived objects – e.g., Rigid<br />
* NDims<br />
** MET_INT<br />
** Defined at object instantiation<br />
* Name<br />
** MET_STRING<br />
** User defined<br />
* ID<br />
** MET_INT<br />
** User defined else -1<br />
* ParentID<br />
** MET_INT<br />
** User defined else -1<br />
* BinaryData<br />
** MET_STRING<br />
** Are the data associated with this object stored at Binary or ASCII<br />
** Defined by derived objects<br />
* ElementByteOrderMSB<br />
** MET_STRING<br />
* BinaryDataByteOrderMSB<br />
** MET_STRING<br />
* Color<br />
** MET_FLOAT_ARRAY[4]<br />
** R, G, B, alpha (opacity)<br />
* Position<br />
** MET_FLOAT_ARRAY[NDims]<br />
** X, Y, Z,… of real-world coordinate of 0,0,0 index of image)<br />
* Orientation<br />
** MET_FLOAT_MATRIX[NDims][NDims]<br />
** [0][0],[0][1],[0][2] specify X, Y, Z… direction in real-world of X-axis of image<br />
** [1][0],[1][1],[1][2] specify X, Y, Z… direction in real-world of Y-axis of image, etc. <br />
* AnatomicalOrientation<br />
** MET_STRING<br />
** This is a convenience tag, to be used and maintained by applications. Changing this tag in a MetaIO file or via the MetaIO API will not cause the MetaIO library to resample or change the direction matrix of an image. It is up to an application to correctly read, write, and maintain this tag.<br />
** The history of the interpretation of this tag is as follows:<br />
*** Labels: The labels used to define a space can be "from" labels or "to" labels, where "from" labels define the relative physical location of the origin of a space and "to" labels define the physical direction of movement of a space - thereby RAI "from" space is the same as LPS "to" space. DICOM, ITK, and nearly every application consider label space to be "to" labels.<br />
*** In an LPS "to" space ("to" space will be assumed in the remainder of this discussion), when moving in the x,y,z-directions of space, then you are physically moving to the left. <br />
*** The direction matrix specifies how "index" i,j,k-directions (sometimes referred to as the in-memory directions of an image) map into x,y,z-directions. Changing the direction matrix will never change the fact that you're in an LPS space, but changing a direction matrix will change how moving along the i-index direction maps to a movement in the LPS space.<br />
*** Originally, AnatomicalOrientation was intended to define the space (LPS, RAS, etc) of an image; however, in early 2000s, its implementation was changed (and its documentation became unclear) to define how a patient was oriented in index space (it assumed an LPS space, and thus it became redundant with the direction matrix). These changes seem to have coincided with ITK's introduction of a direction matrix (thanks goes to Alexis Girault for hunting down this history!). For the past fifteen years++, ITK writes AnatomicOrientation based on the direction matrix and assumes an LPS space. See the code in itkSpatialOrientation.h that specifies a 3-letter code derived from an image's direction matrix and that 3-letter code is then used to specify the AnatomicalOrientation tag in MetaIO.<br />
*** Moving forward, when implementing new applications, it is recommended that developers use the definition currently implemented by ITK. It represents the most common use of MetaIO.<br />
* ElementSpacing<br />
** MET_FLOAT_ARRAY[NDims]<br />
** The distance between voxel centers<br />
<br />
=== Tags Added by MetaImage ===<br />
<br />
In addition to the above tags, MetaImage provides the following tags:<br />
<br />
* DimSize <br />
** MET_INT_ARRAY[NDims]<br />
** Number of elements per axis in data<br />
* HeaderSize<br />
** MET_INT<br />
** Number of Bytes to skip at the head of each data file.<br />
** Specify –1 to have MetaImage calculate the header size based on the assumption that the data occurs at the end of the file.<br />
** Specify 0 if the data occurs at the begining of the file.<br />
* Modality<br />
** MET_STRING<br />
** One of enum type: MET_MOD_CT, MET_MOD_MR, MET_MOD_US… See [https://github.com/Kitware/MetaIO/blob/ffe3ce141c5a2394e40a0ecbe2a667cc0566baf5/src/metaImageTypes.h#L21 metaImageTypes.h]<br />
* SequenceID<br />
** MET_INT_ARRAY[4]<br />
** Four values comprising a DICOM sequence: Study, Series, Image numbers<br />
* ElementMin<br />
** MET_FLOAT<br />
** Minimum value in the data<br />
* ElementMax<br />
** MET_FLOAT<br />
** Maximum value in the data<br />
* ElementNumberOfChannels<br />
** MET_INT<br />
** Number of values (of type ElementType) per voxel<br />
* ElementSize<br />
** MET_FLOAT_ARRAY[NDims]<br />
** Physical size of each voxel<br />
* ElementType<br />
** MET_STRING<br />
** One of enum type: MET_UCHAR, MET_CHAR… See [https://github.com/Kitware/MetaIO/blob/ffe3ce141c5a2394e40a0ecbe2a667cc0566baf5/src/metaTypes.h#L63-94 metaTypes.h]<br />
* ElementDataFile<br />
** MET_STRING<br />
** One of the following:<br />
*** Name of the file to be loaded<br />
*** A printf-style string followed by the min, max, and step values to be used to pass an argument to the string to create list of file names to be loaded (must be (N-1)D blocks of data per file).<br />
*** LIST [X] – This specifies that starting on the next line is a list of files (one filename per line) in which the data is stored. Each file (by default) contains an (N-1)D block of data. If a second argument is given, its first character must be a number that specifies the dimension of the data in each file. For example ElementDataFile = LIST 2D means that there will be a 2D block of data per file.<br />
*** LOCAL – Indicates that the data begins at the beginning of the next line.</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=ITK/MetaIO/Documentation&diff=63999ITK/MetaIO/Documentation2019-12-23T15:58:59Z<p>Aylward: /* MetaObject Tags */</p>
<hr />
<div>= Abstract =<br />
<br />
MetaImage is the text-based tagged file format for medical images that resulted. We have now extended that file format to support a variety of objects that occur in medicine such a tubes (for vessels, needles, etc.), blobs (for arbitrary shaped objects), cubes, spheres, etc. The complete library is known at MetaIO.<br />
<br />
The central code of MetaImage/MetaIO is quite stable. MetaImage has been in use for several years by a wide range of research at UNC, Chapel Hill. New features are occasionally added, but backward compatibility will always be maintained.<br />
<br />
= Introduction and Installation =<br />
<br />
== Obtaining MetaIO ==<br />
<br />
The upstream MetaIO Git repository:<br />
<br />
* https://github.com/Kitware/MetaIO<br />
<br />
MetaIO is being distributed with the following packages:<br />
<br />
* National Library of Medicine’s Insight Toolkit (ITK) for medical image segmentation and registration:<br />
** http://www.itk.org<br />
* Kitware's Visualization Toolkit (VTK)<br />
** http://www.vtk.org<br />
<br />
== Installing The MetaIO Package ==<br />
<br />
MetaIO is a hierarchy of C++ classes and functions. We have yet to find a modern C++ compiler that does not compile MetaIO. Know compatible compilers include G++ v2.95 and beyond (and probably previous), Microsoft Visual C++ 6.0, Sun’s CC on Solaris 2.6 and beyond, Intel compiler and compilers on other workstations including HPs, SGIs, and Alpha systems. Please contact us (Stephen R. Aylward, stephen.aylward@kitware.com or Julien Jomier, julien.jomier@kitware.com) if you encounter any incompatibilities between our code and your compiler.<br />
<br />
MetaIO should be built as part of the standard ITK and VTK installations. It is also quite easy to use MetaIO from within these toolkits without using the rest of the toolkit. <br />
<br />
=== ITK MetaIO ===<br />
<br />
The hierarchy of the software in the stand-alone MetaIO package is as follows:<br />
* MetaIO/<br />
** doc/<br />
** tests/<br />
<br />
The top level contains the source files, the header files, and the CMakeLists.txt file that is used by the CMake program to compile MetaIO. This document and the MetaObjects www pages are in the doc directory. A sequence of simple tests is available in the tests directory.<br />
<br />
The hierarchy of the software in the Insight and InsightApplications distributions is as follows:<br />
* Insight<br />
** Code/Utilities/MetaIO/<br />
*** doc/<br />
*** tests/<br />
* InsightApplications<br />
** MetaImageImporter<br />
** ImageViewer (formerly MetaImageViewer)<br />
** ColorImageViewer (formerly MetaColorImageViewer)<br />
** MetaImageReadWrite<br />
<br />
Routines that wrap MetaIO for ITK's image IO object factory are in<br />
* Insight/Code/IO/<br />
** itkMetaImageReader, itkMetaImageWriter<br />
<br />
Routines that wrap MetaIO for reading and writing ITKS's Spatial Objects (tubes, blobs, ellipses, meshes, etc.) are in<br />
* Insight/Code/SpatialObject<br />
<br />
Certain examples, such as the MetaImageViewer, also require FLTK (a cross-platform user interface library available from http://fltk.org). Install FLTK and then ITK and then InsightApplications to have every MetaIO example built. Numerous other examples and applications in InsightApplications also rely on FLTK.<br />
<br />
See the file /Insight/Examples/MetaImageReadWrite for a working example on how to develop a program using MetaImage for IO.<br />
<br />
=== VTK MetaIO ===<br />
<br />
The hierarchy of the software in the Visualization toolkit is as follows:<br />
* VTK/Utilitites<br />
** vtkmetaio<br />
* VTK/IO<br />
<br />
=== Stand Alone MetaIO ===<br />
MetaIO can also be compiled outside of these toolkits. This is left as an exercise to the user (hint: requires the kwsys and zlib libraries). Instead of a stand-alone installation, we highly recommend using the distribution in ITK - if you build ITK, you get MetaIO for free!<br />
<br />
== Quick Start ==<br />
<br />
=== Data conversion via MetaHeaders ===<br />
<br />
This section assumes that you have data that you wish to process using an application that reads MetaImages. This section gives examples on how “convert” your data to the MetaImage format.<br />
<br />
For uncompressed data, “conversion” to MetaImage is actually just a matter of specifying a MetaImage Headerfile (a “MetaHeader”) that describes and points to the file(s) containing your data.<br />
* Uncompressed data is data stored in a raw format, possibly with a header, as is often the case for DICOM, BMP, and PNG formatted images.<br />
<br />
For compressed data, you must first convert your data to a non-compressed format. One of the most robust image conversion software packages is ImageMagick (http://www.imagemagick.org/; Unix and PC versions available). It has an application called “convert” that handles most of the popular 2D image formats.<br />
* Compressed data is includes JPEG or GIF formats as well as select PNG and TIFF images.<br />
<br />
=== Using MetaImageImporter ===<br />
<br />
MetaImageImporter asks a series of questions about your data and then produces a MetaImage header file that points to your data and allows the MetaIO library to read your data.<br />
<br />
MetaImageImporter is part of the InsightApplications repository. See http://www.itk.org for information on downloading and installing InsightApplications - the companion to the Insight repository.<br />
<br />
MetaImageImporter now has a QT graphical user interface. Please see the [[KWPublic/Applications/MetaImageImporter|documentation]].<br />
<br />
Otherwise, the following two sub-sections will step you through the conversion process. The first sub-section applies if all of your data is in one file, i.e., is a "brick-of-bytes". The second sub-section applies if your data is spread across files, e.g., is dicom or a tiff sequence.<br />
<br />
=== Reading a Brick-of-Bytes (an N-Dimensional volume in a single file) ===<br />
<br />
A “brick of bytes” is a volume of image data stored in a single file possibly with preceding and trailing non-image data. A volume can be of any dimension (1 dimensional to N dimensional).<br />
<br />
To correctly load these images, the minimal information that you need to know is:<br />
# Number of dimensions<br />
# Size of each dimension<br />
# Data type<br />
# Name of the data file<br />
<br />
For example, let’s say the data was 3 dimensional, had 256 x 256 x 64 voxels, used an unsigned short to represent the value at each voxel, and was stored in the file “image.raw”. The resulting MetaHeader (our naming convention would call this file “image.mhd”) file would read<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
ElementDataFile = image.raw (this tag must be last in a MetaImageHeader)<br />
<br />
That’s it, but this assumes quite a bit about the image data. Specifically, it assumes<br />
# There are not any non-image data bytes (header data) at the beginning of the image data file “image.raw”.<br />
# The voxels are cubes – the distance spanned by and between a voxel in each coordinate direction is 1 “unit”, e.g., 1x1x1mm voxel size and voxel spacing<br />
# The byte-order of the data in image.raw matches the byte ordering native to the machine the application is running on (e.g., PC’s use LSB ordering and Suns/Macs use MSB ordering).<br />
<br />
If these assumptions are false, the data will not be loaded correctly by the application. To fix these problems, MetaIO allows you to specify additional tag/value pairs in the header:<br />
# To skip the header bytes in the image data file, use<br />
HeaderSize = X<br />
where X is the number of bytes to skip at the beginning of the file before reading image data. If you know there are no trailing bytes (extra bytes at the end of the file) you can specify<br />
HeaderSize = -1<br />
and MetaImage will automatically calculate the number of extract bytes in the data file, assume they those bytes are at the head of the data file, and automatically skip them before beginning to read the image data.<br />
<br />
# To specify the spacing of the voxels, use<br />
ElementSpacing = X Y Z<br />
where X is the distance between of the centers of the voxels along the x-dimension, Y is the spacing in the y-dimension, and Z is the spacing in the z-dimension. Therefore, to specify a 1x1x3mm voxel spacing, use<br />
ElementSpacing = 1 1 3<br />
<br />
NOTE: If ElementSpacing is not specified, it is assumed to be equal to ElementSize. If neither is specified, both are assumed to be 1.<br />
<br />
# To specify a voxel size, use <br />
ElementSize = X Y Z<br />
where X Y Z represent the size in the x, y, and z-dimensions respectively.<br />
<br />
NOTE: If ElementSize is not specified, it is assumed to be equal to ElementSpacing. If neither is specified, both are assumed to be 1.<br />
<br />
# To specify a particular byte ordering, use<br />
ElementByteOrderMSB = True<br />
or<br />
ElementByteOrderMSB = False<br />
MSB (aka big-endian) ordering is common to SPARC and Motorola processors (e.g., Macintoshes). LSB (aka little-endian) ordering is common to Intel processors (e.g., PC compatibles).<br />
<br />
Putting it all together, to “convert” a file containing the image data in a continuous block at the end of the file, specify the header<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = image.raw<br />
<br />
=== Reading DICOM and Other One-Slice-Per-File Data Formats ===<br />
<br />
If the data is split into one slice per file, as is done with most DICOM object files, only the ElementDataFile tag’s option needs to change. Note that 3D DICOM object files are becoming popular, and some such DICOM files can be read using the above, volume, technique.<br />
<br />
Since the MetaLibrary cannot directly parse DICOM headers, those headers must be skipped and the user must specify the image dimensions and other essential image information. For DICOM files, the MetaLibrary must automatically calculate the header size of each file (luckily for almost every DICOM object the image data is stored at the end of the file). For this reason, this method only works for uncompressed files.<br />
<br />
To specify which files comprise the volume, they can be specified as an ordered list in the MetaHeader using the ElementDataFile=LIST option. The filenames should be listed at the end of the MetaHeader, after the ElementDataFile option, and the filenames should be separated by whitespace:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 100<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = LIST<br />
filenameOfSlice1<br />
filenameOfSlice2<br />
filenameOfSlice3<br />
filenameOfSlice4<br />
.<br />
. (one hundred filenames must be specified to specify the 100 slices in the volume)<br />
.<br />
<br />
This method works even if there are spaces in the file paths and file names.<br />
<br />
Notice that this method can become tedious if a large number of files need to be read. To alleviate this, a second way of specifying a series of files can be used if the filenames are numerically distinguished. That is, the file names should be able to be specified using a numeric substitution into a c-style printf-string, for a range of values. In pseudo-code:<br />
<br />
for i=numBegin to numEnd step numStep<br />
sprintf(sliceName, “baseName.%03d”, i);<br />
end<br />
<br />
The parameters of this system are numBegin, numEnd, numStep, and the c-style printf string (e.g., “baseName.%03d”). The begin, end, and step parameters appear in order after the c-style printf string:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 100<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = baseName.%03d 1 100 1<br />
<br />
The above MetaImage header will cause the files “baseName.001” to “baseName.100” to be read to create a 100-slice volume. This method works even if there are spaces in the file paths and file names. However, when spaces are present in the file path and/or file name, all three parameters (begin, end, and step) need to be specified as the last parameters. The remaining parameters (initially parsed based on spaces) are then joined back together (including spaces) to generate the file name.<br />
<br />
In some cases, it may be helpful to skip slices in the volume. Changing the slice spacing and the ElementDataFileNumStep enacts this…<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 50<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 2<br />
ElementByteOrderMSB = False<br />
ElementDataFile = baseName.%03d 1 100 2<br />
<br />
The complete set of MetaImage Tags are given in the Reference section of this document. The next section discusses how to use the MetaImage Library for image reading and writing in your own programs.<br />
<br />
== MetaIO Library Architecture ==<br />
<br />
The base class of the MetaIO library is the MetaObject class. It defines a base set of tags that are common to all metaObjects such as MetaImages, MetaTubes, etc.<br />
<br />
The tags are defined using the protected member functions SetupReadFields and SetupWriteFields. These functions create a list of MetaFieldRecords to define the name, type, interdependence, and necessity of each tag. Helper functions for defining the fields are in MetaUtils.cxx. The types are defined via enums in MetaTypes.h<br />
<br />
The derived classes add tags to the list via their own SetupReadFields and SetupWriteFields member functions. The MetaImage subclass also re-implements the Read and Write methods since non tag data (i.e., the pixel values) must also be read. Compare the derived classes for MetaCube and MetaImage.<br />
<br />
=== MetaObjects ===<br />
<br />
In this section we describe the metaObjects which have been implemented already. If you want to implement other objects, you can easily derive these classes. metaObject is the base class for metaIO. metaScene and metaGroup are also a useful objects that support multiple metaObjects.<br />
All these objects are described in details next.<br />
<br />
==== Constructors ====<br />
<br />
Simple constructor<br />
MetaObject(void);<br />
<br />
Read a metafile and store the result in the current object<br />
MetaObject(const char * _fileName);<br />
<br />
Define the dimension of the object at construction time.<br />
MetaObject(unsigned int dim);<br />
<br />
==== Member functions ====<br />
<br />
Specify the filename to read (Optional)<br />
void FileName(const char *_fileName);<br />
const char * FileName(void) const;<br />
<br />
Read a MetaFile<br />
bool Read(const char * _fileName=NULL);<br />
<br />
Write a MetaFile <br />
bool Write(const char * _fileName=NULL);<br />
virtual bool Append(const char *_headName=NULL);<br />
<br />
Print the info about the metaObject<br />
virtual void PrintInfo(void) const;<br />
<br />
Clear the information as well as the data of the metObject<br />
virtual void Clear(void);<br />
<br />
==== Field descriptions ====<br />
<br />
Name:<br />
void Name(const char *_Name);<br />
const char * Name(void) const;<br />
<br />
Color: <br />
const float * Color(void) const;<br />
void Color(float _r, float _g, float _b, float _a);<br />
void Color(const float * _color);<br />
<br />
ID:<br />
ID number of the current metaObject<br />
void ID(int _id);<br />
int ID(void) const;<br />
<br />
Parent ID:<br />
ID number of the parent metaObject<br />
void ParentID(int _parentId);<br />
int ParentID(void) const;<br />
<br />
Binary Data:<br />
Specify if the data is binary or not<br />
void BinaryData(bool _binaryData);<br />
bool BinaryData(void) const;<br />
<br />
Binary Data Byte Order:<br />
void BinaryDataByteOrderMSB(bool _binaryDataByteOrderMSB);<br />
bool BinaryDataByteOrderMSB(void) const;<br />
<br />
Comments:<br />
const char * Comment(void) const;<br />
void Comment(const char * _comment);<br />
<br />
Object Typename and optional subtype (i.e. the type of the object)<br />
const char * ObjectTypeName(void) const;<br />
void ObjectTypeName(const char * _objectTypeName);<br />
const char * ObjectSubTypeName(void) const;<br />
void ObjectSubTypeName(const char * _objectSubTypeName);<br />
<br />
==== Associated transformations ====<br />
<br />
Physical location (in millimeters and with respect to machine coordinate system or the patient) of the first element in the image. Physical orientation of the object is defined as an NDims x NDims matrix.<br />
<br />
Offset: (equiv. to position and origin)<br />
const float * Offset(void) const;<br />
float Offset(int _i) const;<br />
void Offset(const float * _position);<br />
void Offset(int _i, float _value);<br />
<br />
Position: (equiv. to offset and origin)<br />
const float * Position(void) const;<br />
float Position(int _i) const;<br />
void Position(const float * _position);<br />
void Position(int _i, float _value);<br />
<br />
Origin: (equiv. to offset and position)<br />
const float * Origin(void) const;<br />
float Origin(int _i) const;<br />
void Origin(const float * _position);<br />
void Origin(int _i, float _value);<br />
<br />
<br />
Rotation: (equiv. to orientation and transformMatrix)<br />
const float * Rotation(void) const;<br />
float Rotation(int _i, int _j) const;<br />
void Rotation(const float * _orientation);<br />
void Rotation(int _i, int _j, float _value);<br />
<br />
Orientation: (equiv. to rotation and transformMatrix)<br />
const float * Orientation(void) const;<br />
float Orientation(int _i, int _j) const;<br />
void Orientation(const float * _orientation);<br />
void Orientation(int _i, int _j, float _value);<br />
<br />
TransformMatrix: (equiv. to rotation and orientation)<br />
const float * TransformMatrix(void) const;<br />
float TransformMatrix(int _i, int _j) const;<br />
void TransformMatrix(const float * _transformMatrix);<br />
void TransformMatrix(int _i, int _j, float _value);<br />
<br />
Center of rotation of the object:<br />
const float * CenterOfRotation(void) const;<br />
float CenterOfRotation(int _i) const;<br />
void CenterOfRotation(const float * _position);<br />
void CenterOfRotation(int _i, float _value);<br />
<br />
Anatomical Orientation:<br />
const char * AnatomicalOrientationAcronym(void) const;<br />
const MET_OrientationEnumType * AnatomicalOrientation(void) const;<br />
MET_OrientationEnumType AnatomicalOrientation(int _dim) const;<br />
void AnatomicalOrientation(const char *_ao);<br />
void AnatomicalOrientation(const MET_OrientationEnumType *_ao);<br />
void AnatomicalOrientation(int _dim, MET_OrientationEnumType _ao);<br />
void AnatomicalOrientation(int _dim, char ao);<br />
<br />
<br />
Element Spacing:<br />
Physical Spacing (in same units as position)<br />
const float * ElementSpacing(void) const;<br />
float ElementSpacing(int _i) const;<br />
void ElementSpacing(const float * _elementSpacing);<br />
void ElementSpacing(int _i, float _value);<br />
<br />
<br />
<br />
For simplicity, some dynamic functions have been recently added. They allow the user to add fields dynamically.<br />
<br />
The function AddUserField is defined by:<br />
<br />
template <class T><br />
bool AddUserField(const char* _fieldName,MET_ValueEnumType _type, int _length,<br />
T *_v,bool _required=true,int _dependsOn=-1 )<br />
<br />
The user may also want to clear the fields created by using <br />
<br />
ClearUserFields().<br />
<br />
To determine the value of a field<br />
<br />
void* GetUserField(const char* _name);<br />
<br />
Note: When using GetUserField() function, the user is responsible for the deletion of the pointer created. See the following example for details.<br />
<br />
==== Example ====<br />
<br />
/** We create a simple 3D metaObject with some properties */<br />
MetaObject tObj(3); // Create a 3D metaObject<br />
tObj.FileName("testObject.txt"); // Define the name of the file<br />
tObj.Comment("TestObject"); // Add some comments<br />
tObj.ObjectTypeName("Object"); // Define the type of the object<br />
tObj.ObjectSubTypeName("MinorObject"); // and the subtype as well<br />
<br />
/** We now define the position and the orientation as well as the spacing of the created object */<br />
// The position part<br />
tObj.Position(0, 1);<br />
tObj.Position(1, 2);<br />
tObj.Position(2, 3);<br />
<br />
// The orientation part<br />
float orient[9];<br />
int i;<br />
for(i=0; i<9; i++)<br />
{<br />
orient[i] = 0;<br />
}<br />
orient[0] = 1;<br />
orient[5] = 1;<br />
orient[7] = 1;<br />
tObj.Orientation(orient);<br />
<br />
// The element spacing part<br />
tObj.ElementSpacing(0, 1);<br />
tObj.ElementSpacing(1, 2);<br />
tObj.ElementSpacing(2, 1);<br />
<br />
<br />
/** Add user's defined fields */<br />
tObj.AddUserField("MyName", MET_STRING, strlen("JulienAndStephen"), "JulienAndStephen");<br />
<br />
/** Write the object */<br />
tObj.Write();<br />
<br />
/** Clear completely the object */<br />
tObj.Clear();<br />
tObj.ClearUserFields();<br />
<br />
/** Specify that we want to read the field ‘MyName’ */<br />
tObj.AddUserField("MyName", MET_STRING);<br />
<br />
/** Read the object */<br />
tObj.Read("testObject.txt");<br />
<br />
/** Print the object */<br />
tObj.PrintInfo();<br />
<br />
/** Get the name in the file */<br />
char* name = static_cast<char*>(tObj.GetUserField("MyName"));<br />
std::cout << name << std::endl;<br />
<br />
/** delete the allocated pointer */<br />
delete [] name;<br />
<br />
== Types of MetaObjects ==<br />
<br />
All of the following objects derive from metaObject.<br />
<br />
=== MetaBlob ===<br />
<br />
A blob is defined by a list of points that describe the object. The points can be inside the object (if obtained by connected-component for instance) or only on the surface. Note that a color (RGBA) can be associated which each point.<br />
<br />
The required fields are:<br />
* The number of points defining the object:<br />
NPoints(int npnt);<br />
* How the position of the points is stored in the file. By default the configuration is x y z red green blue alpha<br />
PointDim(const char* pointDim);<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D blob */<br />
MetaBlob blob(3);<br />
blob.ID(0); // define the ID of the blob<br />
<br />
/** Add 10 points to the blob */<br />
BlobPnt* pnt;<br />
<br />
unsigned int i;<br />
for(i=0;i<10;i++)<br />
{<br />
pnt = new BlobPnt(3);<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
blob.GetPoints().push_back(pnt); // push the created point into the list of points<br />
}<br />
<br />
/** Write the blob in binary format */<br />
blob.BinaryData(true);<br />
blob.ElementType(MET_FLOAT);<br />
blob.Write("myBlob.meta");<br />
<br />
/** Read the file */<br />
blob.Read("myBlob.meta"); <br />
blob.PrintInfo();<br />
<br />
/** Access the list of points */<br />
std::cout << "Accessing pointlist..." << std::endl;<br />
<br />
MetaBlob::PointListType plist = blob.GetPoints();<br />
MetaBlob::PointListType::const_iterator it = plist.begin();<br />
<br />
while(it != plist.end())<br />
{<br />
for(unsigned int d = 0; d < 3; d++)<br />
{<br />
std::cout << (*it)->m_X[d] << " ";<br />
}<br />
std::cout << std::endl;<br />
it++;<br />
}<br />
<br />
=== MetaEllipse ===<br />
<br />
MetaEllipse is an N-Dimensional object to define ellipsoids like circles, spheres or even hyper-ellipsoids.<br />
The only field you need to provide is the Radius.<br />
<br />
There are several ways to input the radius:<br />
# As an array of floats: void Radius(const float* radius);<br />
# As a single value which means that we are defining an hyper-sphere: void Radius(float radius);<br />
# A convenient way to define a 2D ellipse: void Radius(float r1,float r2);<br />
# A convenient way to define a 3D ellipse: void Radius(float r1,float r2, float r3);<br />
<br />
==== Example ====<br />
<br />
/** Create a sphere */<br />
MetaEllipse myEllipse (3);<br />
myEllipse ->Radius(3); // radius of 3<br />
<br />
=== MetaGroup ===<br />
<br />
MetaGroup does not have added functionalities compared to metaObject. It allows to group object in a metafile.<br />
<br />
=== MetaImage ===<br />
<br />
==== Constructors ====<br />
<br />
Simple constructor by specifying the filename<br />
MetaImage(const char *_headerName); <br />
<br />
Constructor by shared memory <br />
MetaImage(MetaImage *_im); <br />
<br />
Other constructors<br />
MetaImage(int _nDims, <br />
const int * _dimSize,<br />
const float *_elementSpacing,<br />
MET_ValueEnumType _elementType,<br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
MetaImage(int _x, int _y, <br />
float _elementSpacingX, <br />
float _elementSpacingY,<br />
MET_ValueEnumType _elementType, <br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
MetaImage(int _x, int _y, int _z, <br />
float _elementSpacingX,<br />
float _elementSpacingY,<br />
float _elementSpacingZ, <br />
MET_ValueEnumType _elementType,<br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
==== Member functions ====<br />
<br />
HeaderSize: Return the size of the header.<br />
int HeaderSize(void) const;<br />
<br />
Quantity: Total number of elements in the image.<br />
int Quantity(void) const;<br />
<br />
SubQuantity: Number of elements in image spanning sub-dimensions. E.g., elements per line, 2D sub-image, 3D sub-volume.<br />
const int * SubQuantity(void) const; <br />
int SubQuantity(int _i) const; <br />
<br />
ElementMin/Max: The default max returned is the largest allowed by ElemNBytes (12 bit uint16_t will give 4096 max). This may not represent the true max. Use _reCalc=true to force a calcuation of the actual max element value.<br />
bool ElementMinMaxValid(void) const;<br />
void ElementMinMaxValid(bool _elementMinMaxValid);<br />
void ElementMinMaxRecalc(void);<br />
double ElementMin(void) const; <br />
void ElementMin(double _elementMin);<br />
double ElementMax(void) const;<br />
void ElementMax(double _elementMax);<br />
<br />
ElementByteOrderSwap: These functions are available only after ReadImageData() or if _read_and_close=TRUE when read<br />
void ElementByteOrderSwap(void);<br />
bool ElementByteOrderFix(void);<br />
<br />
<br />
ConverTo: Converts to a new data type. Rescales using Min and Max.<br />
bool ConvertElementDataTo(MET_ValueEnumType _elementType=MET_UCHAR,<br />
double _toMin=0, double _toMax=0);<br />
<br />
==== Field descriptions ====<br />
<br />
Modality: Specify the modality of the image<br />
MET_ImageModalityEnumType Modality(void) const;<br />
void Modality(MET_ImageModalityEnumType _modality);<br />
<br />
Dimension size: Specify the size of the image in each dimension<br />
void DimSize(const int * _dimSize);<br />
void DimSize(int _i, int _value);<br />
<br />
SequenceID: DICOM designation of this image relative to other images acquired at the same time<br />
const float * SequenceID(void) const;<br />
float SequenceID(int _i) const;<br />
void SequenceID(const float * _sequenceID);<br />
void SequenceID(int _i, float _value);<br />
<br />
ElementSize: Optional Field. Physical size (in MM) of each element in the image (0 = xSize, 1 = ySize, 2 = zSize)<br />
const float * ElementSize(void) const;<br />
float ElementSize(int i) const;<br />
void ElementSize(const float * _pointSize);<br />
void ElementSize(int _i, float _value);<br />
<br />
ElementType: Pixel type<br />
MET_ValueEnumType ElementType(void) const;<br />
void ElementType(MET_ValueEnumType _elementType);<br />
<br />
ElementNumberOfChannels: Number of channels<br />
int ElementNumberOfChannels(void) const;<br />
void ElementNumberOfChannels(int _elementNumberOfChannels);<br />
<br />
ElementData: Returns a pointer to the data. <br />
void * ElementData(void);<br />
double ElementData(int _i) const;<br />
void ElementData(void * _data);<br />
bool ElementData(int _i, double _v);<br />
<br />
ElementDataFileName: Set/Get the filename<br />
const char * ElementDataFileName(void) const;<br />
void ElementDataFileName(const char * _dataFileName);<br />
<br />
==== Example ====<br />
<br />
ObjectType = Image<br />
NDims = 2<br />
BinaryData = True<br />
BinaryDataByteOrderMSB = False<br />
ElementSpacing = 1 2<br />
DimSize = 8 8<br />
ElementType = MET_CHAR<br />
ElementDataFile = LOCAL<br />
[Pixel Data]<br />
<br />
=== MetaLandmark ===<br />
<br />
MetaLandmark is a simple list of landmarks.<br />
<br />
The number of landmarks defining the object is set using the function<br />
NPoints(int npnt);<br />
<br />
How the position of the points is stored in the file: By default the configuration is x y z red green blue alpha<br />
PointDim(const char* pointDim);<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D Landmark */<br />
MetaLandmark Landmark(3);<br />
Landmark.ID(0);<br />
LandmarkPnt* pnt;<br />
<br />
/** Add some landmarks to the list of landmark points*/<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new LandmarkPnt(3);<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
Landmark.GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaLine ===<br />
<br />
A metaLine is actually a polyline defined by a list of connected points.<br />
A point on the line has a given position, a normal and a color.<br />
<br />
To set the position the local variable m_X should be filled in the point structure. The variable m_V which is a double pointer to a float is used to assess the normal. The normal has the dimension of the object minus one since a metaLine in a 3D space will have two normals (a plane).<br />
<br />
Note that the user does not need to allocate the memory for those variables, this is done automatically in the constructor of the point.<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
/** Create a 3D MetaLine */<br />
MetaLine Line(3);<br />
LinePnt* pnt;<br />
<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new LinePnt(3);<br />
<br />
/** Define the position */<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
<br />
/** Define the normals */<br />
pnt->m_V[0][0]=(float)0.3;<br />
pnt->m_V[0][1]=i;<br />
pnt->m_V[0][2]=i;<br />
pnt->m_V[1][0]=(float)0.4;<br />
pnt->m_V[1][1]=i+1;<br />
pnt->m_V[1][2]=i+1;<br />
Line->GetPoints().push_back(pnt);<br />
}<br />
<br />
/** Write the result */<br />
Line.BinaryData(true);<br />
Line.Write("myLine.meta");<br />
<br />
=== MetaSurface ===<br />
<br />
The definition of a metaSurface is quite similar to the metaLine’s, except for the normal which is only a NDim vector (i.e. an array of floats) where NDim is the dimension of the metaObject.<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
MetaSurface surface(3);<br />
SurfacePnt* pnt;<br />
<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new SurfacePnt(3);<br />
<br />
/** Position */<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
<br />
/* Normal */<br />
pnt->m_V[0]=(float)0.8;<br />
pnt->m_V[1]=i;<br />
pnt->m_V[2]=i;<br />
surface->GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaTube ===<br />
<br />
A metaTube is a tubular structure defined by a list of connected points (like a metaLine) but more fields have been added for a complete representation, especially the one of blood vessels.<br />
To specify a point that belongs to the tube, the user can define: the position, the radius at that point, the normal(s), the tangent, the color, the Identification number, the medialness, the branchness, the ridgeness, and three alpha values that represents the ratio of the eigen values at that points. <br />
<br />
Note that metaTube supports only 2D and 3D tubes.<br />
<br />
Also for a metaTube, the ID of the root can be specified by the command Root(int rootID) and the ID of the parent point can also be assessed using ParentPoint(int parentpoint).<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D tube*/<br />
MetaTube* tube1 = new MetaTube(3);<br />
tube1->ID(0);<br />
<br />
/** Add 10 points to the list of tubePoints */<br />
TubePnt* pnt;<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new TubePnt(3);<br />
<br />
pnt->m_X[0]=i; // position<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
pnt->m_R=i; // radius<br />
tube1->GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaScene ===<br />
<br />
A metaScene is a metaObject that contains a flat list of metaObjects.<br />
<br />
==== Member functions ====<br />
<br />
Add an object to the scene:<br />
void AddObject(MetaObject* object);<br />
<br />
Return the number of objects in the scene:<br />
int NObjects(void) const;<br />
<br />
Get a list of objects present in the scene:<br />
ObjectListType * GetObjectList(void) {return & m_ObjectList;}<br />
<br />
==== Example ====<br />
<br />
/** Define a 3D Scene */<br />
MetaScene scene(3);<br />
<br />
MetaEllipse * e1 = new MetaEllipse(3);<br />
e1->ID(0);<br />
e1->Radius(3);<br />
<br />
MetaGroup g0;<br />
MetaGroup * g1 = new MetaGroup(3);<br />
g1->ID(2);<br />
<br />
s->AddObject(g1);<br />
s->AddObject(e1);<br />
<br />
s->Write("scene.scn");<br />
scene.Clear();<br />
<br />
s->Read("scene.scn");<br />
<br />
==== Output File Example ====<br />
<br />
Here is the example of a metafile with a scene that contains metaObjects<br />
<br />
ObjectType = Scene<br />
NDims = 3<br />
NObjects = 3<br />
ObjectType = Group<br />
NDims = 3<br />
ID = 2<br />
EndGroup = <br />
ObjectType = Ellipse<br />
NDims = 3<br />
ID = 0<br />
ParentID = 2<br />
Radius = 1 2 3<br />
ObjectType = Line<br />
NDims = 3<br />
ID = 0<br />
BinaryData = False<br />
BinaryDataByteOrderMSB = False<br />
ElementType = MET_FLOAT<br />
PointDim = x y z v1x v1y v1z<br />
NPoints = 3<br />
Points = <br />
1 2 3 0 0 0<br />
1 2 3 0 0 0<br />
1 2 3 0 0 0<br />
ObjectType = Landmark<br />
NDims = 3<br />
ID = 0<br />
BinaryData = True<br />
BinaryDataByteOrderMSB = False<br />
ElementType = MET_FLOAT<br />
PointDim = x y z red green blue alpha<br />
NPoints = 2<br />
Points = <br />
1 2 3 1.0 0.0 0.0 1.0<br />
1 2 3 1.0 0.0 0.0 1.0<br />
1 2 3 1.0 0.0 0.0 1.0 <br />
<br />
== Spatial Objects ==<br />
<br />
MetaIO has also been chosen to support Spatial Objects IO. To obtain a complete documentation of Spatial Objects and how to read/write them out please see the Insight user’s manual available at www.itk.org.<br />
<br />
== Reference: Tags of MetaImage ==<br />
<br />
=== MetaObject Tags ===<br />
<br />
The tags of MetaObject are:<br />
<br />
* Comment<br />
** MET_STRING<br />
** User defined - arbitrary<br />
* ObjectType<br />
** MET_STRING<br />
** Defined by derived objects – e.g., Tube, Image<br />
* ObjectSubType<br />
** MET_STRING<br />
** Defined by derived objects – currently not used<br />
* TransformType<br />
** MET_STRING<br />
** Defined by derived objects – e.g., Rigid<br />
* NDims<br />
** MET_INT<br />
** Defined at object instantiation<br />
* Name<br />
** MET_STRING<br />
** User defined<br />
* ID<br />
** MET_INT<br />
** User defined else -1<br />
* ParentID<br />
** MET_INT<br />
** User defined else -1<br />
* BinaryData<br />
** MET_STRING<br />
** Are the data associated with this object stored at Binary or ASCII<br />
** Defined by derived objects<br />
* ElementByteOrderMSB<br />
** MET_STRING<br />
* BinaryDataByteOrderMSB<br />
** MET_STRING<br />
* Color<br />
** MET_FLOAT_ARRAY[4]<br />
** R, G, B, alpha (opacity)<br />
* Position<br />
** MET_FLOAT_ARRAY[NDims]<br />
** X, Y, Z,… of real-world coordinate of 0,0,0 index of image)<br />
* Orientation<br />
** MET_FLOAT_MATRIX[NDims][NDims]<br />
** [0][0],[0][1],[0][2] specify X, Y, Z… direction in real-world of X-axis of image<br />
** [1][0],[1][1],[1][2] specify X, Y, Z… direction in real-world of Y-axis of image, etc. <br />
* AnatomicalOrientation<br />
** MET_STRING<br />
** This is a convenience tag, to be used and maintained by applications. Changing this tag in a MetaIO file or via the MetaIO API will not cause the MetaIO library to resample or change the direction matrix of an image. It is up to an application to correctly read, write, and maintain this tag.<br />
** The history of the interpretation of this tag is as follows:<br />
*** Labels: The labels used to define a space can be "from" labels or "to" labels, where "from" labels define the relative physical location of the origin of a space and "to" labels define the physical direction of movement of a space - thereby RAI "from" space is the same as LPS "to" space. DICOM, ITK, and nearly every application consider label space to be "to" labels.<br />
*** In an LPS "to" space ("to" space will be assumed in the remainder of this discussion), when moving in the x,y,z-directions of space, then you are physically moving to the left. <br />
*** The direction matrix specifies how "index" i,j,k-directions (sometimes referred to as the in-memory directions of an image) map into x,y,z-directions. Changing the direction matrix will never change the fact that you're in an LPS space, but changing a direction matrix will change how moving along the i-index direction maps to a movement in the LPS space.<br />
*** Originally, AnatomicalOrientation was intended to define the space (LPS, RAS, etc) of an image; however, in early 2000s, its implementation was changed (and its documentation became unclear) to define how a patient was oriented in index space (it assumed an LPS space, and thus it became redundant with the direction matrix). These changes seem to have coincided with ITK's introduction of a direction matrix (thanks goes to Alexis Girault for hunting down this history!). For the past fifteen years++, ITK writes AnatomicOrientation based on the direction matrix and assumes an LPS space. See the code in itkSpatialOrientation.h that specifies a 3-letter code derived from an image's direction matrix and that 3-letter code is then used to specify the AnatomicalOrientation tag in MetaIO.<br />
*** Moving forward, when implementing new applications, it is recommended that developers use the definition currently implemented by ITK. It represents the most common use of MetaIO.<br />
* ElementSpacing<br />
** MET_FLOAT_ARRAY[NDims]<br />
** The distance between voxel centers<br />
<br />
=== Tags Added by MetaImage ===<br />
<br />
In addition to the above tags, MetaImage provides the following tags:<br />
<br />
* DimSize <br />
** MET_INT_ARRAY[NDims]<br />
** Number of elements per axis in data<br />
* HeaderSize<br />
** MET_INT<br />
** Number of Bytes to skip at the head of each data file.<br />
** Specify –1 to have MetaImage calculate the header size based on the assumption that the data occurs at the end of the file.<br />
** Specify 0 if the data occurs at the begining of the file.<br />
* Modality<br />
** MET_STRING<br />
** One of enum type: MET_MOD_CT, MET_MOD_MR, MET_MOD_US… See [https://github.com/Kitware/MetaIO/blob/ffe3ce141c5a2394e40a0ecbe2a667cc0566baf5/src/metaImageTypes.h#L21 metaImageTypes.h]<br />
* SequenceID<br />
** MET_INT_ARRAY[4]<br />
** Four values comprising a DICOM sequence: Study, Series, Image numbers<br />
* ElementMin<br />
** MET_FLOAT<br />
** Minimum value in the data<br />
* ElementMax<br />
** MET_FLOAT<br />
** Maximum value in the data<br />
* ElementNumberOfChannels<br />
** MET_INT<br />
** Number of values (of type ElementType) per voxel<br />
* ElementSize<br />
** MET_FLOAT_ARRAY[NDims]<br />
** Physical size of each voxel<br />
* ElementType<br />
** MET_STRING<br />
** One of enum type: MET_UCHAR, MET_CHAR… See [https://github.com/Kitware/MetaIO/blob/ffe3ce141c5a2394e40a0ecbe2a667cc0566baf5/src/metaTypes.h#L63-94 metaTypes.h]<br />
* ElementDataFile<br />
** MET_STRING<br />
** One of the following:<br />
*** Name of the file to be loaded<br />
*** A printf-style string followed by the min, max, and step values to be used to pass an argument to the string to create list of file names to be loaded (must be (N-1)D blocks of data per file).<br />
*** LIST [X] – This specifies that starting on the next line is a list of files (one filename per line) in which the data is stored. Each file (by default) contains an (N-1)D block of data. If a second argument is given, its first character must be a number that specifies the dimension of the data in each file. For example ElementDataFile = LIST 2D means that there will be a 2D block of data per file.<br />
*** LOCAL – Indicates that the data begins at the beginning of the next line.</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=ITK/MetaIO/Documentation&diff=63998ITK/MetaIO/Documentation2019-12-23T15:43:21Z<p>Aylward: ``</p>
<hr />
<div>= Abstract =<br />
<br />
MetaImage is the text-based tagged file format for medical images that resulted. We have now extended that file format to support a variety of objects that occur in medicine such a tubes (for vessels, needles, etc.), blobs (for arbitrary shaped objects), cubes, spheres, etc. The complete library is known at MetaIO.<br />
<br />
The central code of MetaImage/MetaIO is quite stable. MetaImage has been in use for several years by a wide range of research at UNC, Chapel Hill. New features are occasionally added, but backward compatibility will always be maintained.<br />
<br />
= Introduction and Installation =<br />
<br />
== Obtaining MetaIO ==<br />
<br />
The upstream MetaIO Git repository:<br />
<br />
* https://github.com/Kitware/MetaIO<br />
<br />
MetaIO is being distributed with the following packages:<br />
<br />
* National Library of Medicine’s Insight Toolkit (ITK) for medical image segmentation and registration:<br />
** http://www.itk.org<br />
* Kitware's Visualization Toolkit (VTK)<br />
** http://www.vtk.org<br />
<br />
== Installing The MetaIO Package ==<br />
<br />
MetaIO is a hierarchy of C++ classes and functions. We have yet to find a modern C++ compiler that does not compile MetaIO. Know compatible compilers include G++ v2.95 and beyond (and probably previous), Microsoft Visual C++ 6.0, Sun’s CC on Solaris 2.6 and beyond, Intel compiler and compilers on other workstations including HPs, SGIs, and Alpha systems. Please contact us (Stephen R. Aylward, stephen.aylward@kitware.com or Julien Jomier, julien.jomier@kitware.com) if you encounter any incompatibilities between our code and your compiler.<br />
<br />
MetaIO should be built as part of the standard ITK and VTK installations. It is also quite easy to use MetaIO from within these toolkits without using the rest of the toolkit. <br />
<br />
=== ITK MetaIO ===<br />
<br />
The hierarchy of the software in the stand-alone MetaIO package is as follows:<br />
* MetaIO/<br />
** doc/<br />
** tests/<br />
<br />
The top level contains the source files, the header files, and the CMakeLists.txt file that is used by the CMake program to compile MetaIO. This document and the MetaObjects www pages are in the doc directory. A sequence of simple tests is available in the tests directory.<br />
<br />
The hierarchy of the software in the Insight and InsightApplications distributions is as follows:<br />
* Insight<br />
** Code/Utilities/MetaIO/<br />
*** doc/<br />
*** tests/<br />
* InsightApplications<br />
** MetaImageImporter<br />
** ImageViewer (formerly MetaImageViewer)<br />
** ColorImageViewer (formerly MetaColorImageViewer)<br />
** MetaImageReadWrite<br />
<br />
Routines that wrap MetaIO for ITK's image IO object factory are in<br />
* Insight/Code/IO/<br />
** itkMetaImageReader, itkMetaImageWriter<br />
<br />
Routines that wrap MetaIO for reading and writing ITKS's Spatial Objects (tubes, blobs, ellipses, meshes, etc.) are in<br />
* Insight/Code/SpatialObject<br />
<br />
Certain examples, such as the MetaImageViewer, also require FLTK (a cross-platform user interface library available from http://fltk.org). Install FLTK and then ITK and then InsightApplications to have every MetaIO example built. Numerous other examples and applications in InsightApplications also rely on FLTK.<br />
<br />
See the file /Insight/Examples/MetaImageReadWrite for a working example on how to develop a program using MetaImage for IO.<br />
<br />
=== VTK MetaIO ===<br />
<br />
The hierarchy of the software in the Visualization toolkit is as follows:<br />
* VTK/Utilitites<br />
** vtkmetaio<br />
* VTK/IO<br />
<br />
=== Stand Alone MetaIO ===<br />
MetaIO can also be compiled outside of these toolkits. This is left as an exercise to the user (hint: requires the kwsys and zlib libraries). Instead of a stand-alone installation, we highly recommend using the distribution in ITK - if you build ITK, you get MetaIO for free!<br />
<br />
== Quick Start ==<br />
<br />
=== Data conversion via MetaHeaders ===<br />
<br />
This section assumes that you have data that you wish to process using an application that reads MetaImages. This section gives examples on how “convert” your data to the MetaImage format.<br />
<br />
For uncompressed data, “conversion” to MetaImage is actually just a matter of specifying a MetaImage Headerfile (a “MetaHeader”) that describes and points to the file(s) containing your data.<br />
* Uncompressed data is data stored in a raw format, possibly with a header, as is often the case for DICOM, BMP, and PNG formatted images.<br />
<br />
For compressed data, you must first convert your data to a non-compressed format. One of the most robust image conversion software packages is ImageMagick (http://www.imagemagick.org/; Unix and PC versions available). It has an application called “convert” that handles most of the popular 2D image formats.<br />
* Compressed data is includes JPEG or GIF formats as well as select PNG and TIFF images.<br />
<br />
=== Using MetaImageImporter ===<br />
<br />
MetaImageImporter asks a series of questions about your data and then produces a MetaImage header file that points to your data and allows the MetaIO library to read your data.<br />
<br />
MetaImageImporter is part of the InsightApplications repository. See http://www.itk.org for information on downloading and installing InsightApplications - the companion to the Insight repository.<br />
<br />
MetaImageImporter now has a QT graphical user interface. Please see the [[KWPublic/Applications/MetaImageImporter|documentation]].<br />
<br />
Otherwise, the following two sub-sections will step you through the conversion process. The first sub-section applies if all of your data is in one file, i.e., is a "brick-of-bytes". The second sub-section applies if your data is spread across files, e.g., is dicom or a tiff sequence.<br />
<br />
=== Reading a Brick-of-Bytes (an N-Dimensional volume in a single file) ===<br />
<br />
A “brick of bytes” is a volume of image data stored in a single file possibly with preceding and trailing non-image data. A volume can be of any dimension (1 dimensional to N dimensional).<br />
<br />
To correctly load these images, the minimal information that you need to know is:<br />
# Number of dimensions<br />
# Size of each dimension<br />
# Data type<br />
# Name of the data file<br />
<br />
For example, let’s say the data was 3 dimensional, had 256 x 256 x 64 voxels, used an unsigned short to represent the value at each voxel, and was stored in the file “image.raw”. The resulting MetaHeader (our naming convention would call this file “image.mhd”) file would read<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
ElementDataFile = image.raw (this tag must be last in a MetaImageHeader)<br />
<br />
That’s it, but this assumes quite a bit about the image data. Specifically, it assumes<br />
# There are not any non-image data bytes (header data) at the beginning of the image data file “image.raw”.<br />
# The voxels are cubes – the distance spanned by and between a voxel in each coordinate direction is 1 “unit”, e.g., 1x1x1mm voxel size and voxel spacing<br />
# The byte-order of the data in image.raw matches the byte ordering native to the machine the application is running on (e.g., PC’s use LSB ordering and Suns/Macs use MSB ordering).<br />
<br />
If these assumptions are false, the data will not be loaded correctly by the application. To fix these problems, MetaIO allows you to specify additional tag/value pairs in the header:<br />
# To skip the header bytes in the image data file, use<br />
HeaderSize = X<br />
where X is the number of bytes to skip at the beginning of the file before reading image data. If you know there are no trailing bytes (extra bytes at the end of the file) you can specify<br />
HeaderSize = -1<br />
and MetaImage will automatically calculate the number of extract bytes in the data file, assume they those bytes are at the head of the data file, and automatically skip them before beginning to read the image data.<br />
<br />
# To specify the spacing of the voxels, use<br />
ElementSpacing = X Y Z<br />
where X is the distance between of the centers of the voxels along the x-dimension, Y is the spacing in the y-dimension, and Z is the spacing in the z-dimension. Therefore, to specify a 1x1x3mm voxel spacing, use<br />
ElementSpacing = 1 1 3<br />
<br />
NOTE: If ElementSpacing is not specified, it is assumed to be equal to ElementSize. If neither is specified, both are assumed to be 1.<br />
<br />
# To specify a voxel size, use <br />
ElementSize = X Y Z<br />
where X Y Z represent the size in the x, y, and z-dimensions respectively.<br />
<br />
NOTE: If ElementSize is not specified, it is assumed to be equal to ElementSpacing. If neither is specified, both are assumed to be 1.<br />
<br />
# To specify a particular byte ordering, use<br />
ElementByteOrderMSB = True<br />
or<br />
ElementByteOrderMSB = False<br />
MSB (aka big-endian) ordering is common to SPARC and Motorola processors (e.g., Macintoshes). LSB (aka little-endian) ordering is common to Intel processors (e.g., PC compatibles).<br />
<br />
Putting it all together, to “convert” a file containing the image data in a continuous block at the end of the file, specify the header<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 256 256 64<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = image.raw<br />
<br />
=== Reading DICOM and Other One-Slice-Per-File Data Formats ===<br />
<br />
If the data is split into one slice per file, as is done with most DICOM object files, only the ElementDataFile tag’s option needs to change. Note that 3D DICOM object files are becoming popular, and some such DICOM files can be read using the above, volume, technique.<br />
<br />
Since the MetaLibrary cannot directly parse DICOM headers, those headers must be skipped and the user must specify the image dimensions and other essential image information. For DICOM files, the MetaLibrary must automatically calculate the header size of each file (luckily for almost every DICOM object the image data is stored at the end of the file). For this reason, this method only works for uncompressed files.<br />
<br />
To specify which files comprise the volume, they can be specified as an ordered list in the MetaHeader using the ElementDataFile=LIST option. The filenames should be listed at the end of the MetaHeader, after the ElementDataFile option, and the filenames should be separated by whitespace:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 100<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = LIST<br />
filenameOfSlice1<br />
filenameOfSlice2<br />
filenameOfSlice3<br />
filenameOfSlice4<br />
.<br />
. (one hundred filenames must be specified to specify the 100 slices in the volume)<br />
.<br />
<br />
This method works even if there are spaces in the file paths and file names.<br />
<br />
Notice that this method can become tedious if a large number of files need to be read. To alleviate this, a second way of specifying a series of files can be used if the filenames are numerically distinguished. That is, the file names should be able to be specified using a numeric substitution into a c-style printf-string, for a range of values. In pseudo-code:<br />
<br />
for i=numBegin to numEnd step numStep<br />
sprintf(sliceName, “baseName.%03d”, i);<br />
end<br />
<br />
The parameters of this system are numBegin, numEnd, numStep, and the c-style printf string (e.g., “baseName.%03d”). The begin, end, and step parameters appear in order after the c-style printf string:<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 100<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 1<br />
ElementByteOrderMSB = False<br />
ElementDataFile = baseName.%03d 1 100 1<br />
<br />
The above MetaImage header will cause the files “baseName.001” to “baseName.100” to be read to create a 100-slice volume. This method works even if there are spaces in the file paths and file names. However, when spaces are present in the file path and/or file name, all three parameters (begin, end, and step) need to be specified as the last parameters. The remaining parameters (initially parsed based on spaces) are then joined back together (including spaces) to generate the file name.<br />
<br />
In some cases, it may be helpful to skip slices in the volume. Changing the slice spacing and the ElementDataFileNumStep enacts this…<br />
<br />
ObjectType = Image<br />
NDims = 3<br />
DimSize = 512 512 50<br />
ElementType = MET_USHORT<br />
HeaderSize = -1<br />
ElementSize = 1 1 3<br />
ElementSpacing = 1 1 2<br />
ElementByteOrderMSB = False<br />
ElementDataFile = baseName.%03d 1 100 2<br />
<br />
The complete set of MetaImage Tags are given in the Reference section of this document. The next section discusses how to use the MetaImage Library for image reading and writing in your own programs.<br />
<br />
== MetaIO Library Architecture ==<br />
<br />
The base class of the MetaIO library is the MetaObject class. It defines a base set of tags that are common to all metaObjects such as MetaImages, MetaTubes, etc.<br />
<br />
The tags are defined using the protected member functions SetupReadFields and SetupWriteFields. These functions create a list of MetaFieldRecords to define the name, type, interdependence, and necessity of each tag. Helper functions for defining the fields are in MetaUtils.cxx. The types are defined via enums in MetaTypes.h<br />
<br />
The derived classes add tags to the list via their own SetupReadFields and SetupWriteFields member functions. The MetaImage subclass also re-implements the Read and Write methods since non tag data (i.e., the pixel values) must also be read. Compare the derived classes for MetaCube and MetaImage.<br />
<br />
=== MetaObjects ===<br />
<br />
In this section we describe the metaObjects which have been implemented already. If you want to implement other objects, you can easily derive these classes. metaObject is the base class for metaIO. metaScene and metaGroup are also a useful objects that support multiple metaObjects.<br />
All these objects are described in details next.<br />
<br />
==== Constructors ====<br />
<br />
Simple constructor<br />
MetaObject(void);<br />
<br />
Read a metafile and store the result in the current object<br />
MetaObject(const char * _fileName);<br />
<br />
Define the dimension of the object at construction time.<br />
MetaObject(unsigned int dim);<br />
<br />
==== Member functions ====<br />
<br />
Specify the filename to read (Optional)<br />
void FileName(const char *_fileName);<br />
const char * FileName(void) const;<br />
<br />
Read a MetaFile<br />
bool Read(const char * _fileName=NULL);<br />
<br />
Write a MetaFile <br />
bool Write(const char * _fileName=NULL);<br />
virtual bool Append(const char *_headName=NULL);<br />
<br />
Print the info about the metaObject<br />
virtual void PrintInfo(void) const;<br />
<br />
Clear the information as well as the data of the metObject<br />
virtual void Clear(void);<br />
<br />
==== Field descriptions ====<br />
<br />
Name:<br />
void Name(const char *_Name);<br />
const char * Name(void) const;<br />
<br />
Color: <br />
const float * Color(void) const;<br />
void Color(float _r, float _g, float _b, float _a);<br />
void Color(const float * _color);<br />
<br />
ID:<br />
ID number of the current metaObject<br />
void ID(int _id);<br />
int ID(void) const;<br />
<br />
Parent ID:<br />
ID number of the parent metaObject<br />
void ParentID(int _parentId);<br />
int ParentID(void) const;<br />
<br />
Binary Data:<br />
Specify if the data is binary or not<br />
void BinaryData(bool _binaryData);<br />
bool BinaryData(void) const;<br />
<br />
Binary Data Byte Order:<br />
void BinaryDataByteOrderMSB(bool _binaryDataByteOrderMSB);<br />
bool BinaryDataByteOrderMSB(void) const;<br />
<br />
Comments:<br />
const char * Comment(void) const;<br />
void Comment(const char * _comment);<br />
<br />
Object Typename and optional subtype (i.e. the type of the object)<br />
const char * ObjectTypeName(void) const;<br />
void ObjectTypeName(const char * _objectTypeName);<br />
const char * ObjectSubTypeName(void) const;<br />
void ObjectSubTypeName(const char * _objectSubTypeName);<br />
<br />
==== Associated transformations ====<br />
<br />
Physical location (in millimeters and with respect to machine coordinate system or the patient) of the first element in the image. Physical orientation of the object is defined as an NDims x NDims matrix.<br />
<br />
Offset: (equiv. to position and origin)<br />
const float * Offset(void) const;<br />
float Offset(int _i) const;<br />
void Offset(const float * _position);<br />
void Offset(int _i, float _value);<br />
<br />
Position: (equiv. to offset and origin)<br />
const float * Position(void) const;<br />
float Position(int _i) const;<br />
void Position(const float * _position);<br />
void Position(int _i, float _value);<br />
<br />
Origin: (equiv. to offset and position)<br />
const float * Origin(void) const;<br />
float Origin(int _i) const;<br />
void Origin(const float * _position);<br />
void Origin(int _i, float _value);<br />
<br />
<br />
Rotation: (equiv. to orientation and transformMatrix)<br />
const float * Rotation(void) const;<br />
float Rotation(int _i, int _j) const;<br />
void Rotation(const float * _orientation);<br />
void Rotation(int _i, int _j, float _value);<br />
<br />
Orientation: (equiv. to rotation and transformMatrix)<br />
const float * Orientation(void) const;<br />
float Orientation(int _i, int _j) const;<br />
void Orientation(const float * _orientation);<br />
void Orientation(int _i, int _j, float _value);<br />
<br />
TransformMatrix: (equiv. to rotation and orientation)<br />
const float * TransformMatrix(void) const;<br />
float TransformMatrix(int _i, int _j) const;<br />
void TransformMatrix(const float * _transformMatrix);<br />
void TransformMatrix(int _i, int _j, float _value);<br />
<br />
Center of rotation of the object:<br />
const float * CenterOfRotation(void) const;<br />
float CenterOfRotation(int _i) const;<br />
void CenterOfRotation(const float * _position);<br />
void CenterOfRotation(int _i, float _value);<br />
<br />
Anatomical Orientation:<br />
const char * AnatomicalOrientationAcronym(void) const;<br />
const MET_OrientationEnumType * AnatomicalOrientation(void) const;<br />
MET_OrientationEnumType AnatomicalOrientation(int _dim) const;<br />
void AnatomicalOrientation(const char *_ao);<br />
void AnatomicalOrientation(const MET_OrientationEnumType *_ao);<br />
void AnatomicalOrientation(int _dim, MET_OrientationEnumType _ao);<br />
void AnatomicalOrientation(int _dim, char ao);<br />
<br />
<br />
Element Spacing:<br />
Physical Spacing (in same units as position)<br />
const float * ElementSpacing(void) const;<br />
float ElementSpacing(int _i) const;<br />
void ElementSpacing(const float * _elementSpacing);<br />
void ElementSpacing(int _i, float _value);<br />
<br />
<br />
<br />
For simplicity, some dynamic functions have been recently added. They allow the user to add fields dynamically.<br />
<br />
The function AddUserField is defined by:<br />
<br />
template <class T><br />
bool AddUserField(const char* _fieldName,MET_ValueEnumType _type, int _length,<br />
T *_v,bool _required=true,int _dependsOn=-1 )<br />
<br />
The user may also want to clear the fields created by using <br />
<br />
ClearUserFields().<br />
<br />
To determine the value of a field<br />
<br />
void* GetUserField(const char* _name);<br />
<br />
Note: When using GetUserField() function, the user is responsible for the deletion of the pointer created. See the following example for details.<br />
<br />
==== Example ====<br />
<br />
/** We create a simple 3D metaObject with some properties */<br />
MetaObject tObj(3); // Create a 3D metaObject<br />
tObj.FileName("testObject.txt"); // Define the name of the file<br />
tObj.Comment("TestObject"); // Add some comments<br />
tObj.ObjectTypeName("Object"); // Define the type of the object<br />
tObj.ObjectSubTypeName("MinorObject"); // and the subtype as well<br />
<br />
/** We now define the position and the orientation as well as the spacing of the created object */<br />
// The position part<br />
tObj.Position(0, 1);<br />
tObj.Position(1, 2);<br />
tObj.Position(2, 3);<br />
<br />
// The orientation part<br />
float orient[9];<br />
int i;<br />
for(i=0; i<9; i++)<br />
{<br />
orient[i] = 0;<br />
}<br />
orient[0] = 1;<br />
orient[5] = 1;<br />
orient[7] = 1;<br />
tObj.Orientation(orient);<br />
<br />
// The element spacing part<br />
tObj.ElementSpacing(0, 1);<br />
tObj.ElementSpacing(1, 2);<br />
tObj.ElementSpacing(2, 1);<br />
<br />
<br />
/** Add user's defined fields */<br />
tObj.AddUserField("MyName", MET_STRING, strlen("JulienAndStephen"), "JulienAndStephen");<br />
<br />
/** Write the object */<br />
tObj.Write();<br />
<br />
/** Clear completely the object */<br />
tObj.Clear();<br />
tObj.ClearUserFields();<br />
<br />
/** Specify that we want to read the field ‘MyName’ */<br />
tObj.AddUserField("MyName", MET_STRING);<br />
<br />
/** Read the object */<br />
tObj.Read("testObject.txt");<br />
<br />
/** Print the object */<br />
tObj.PrintInfo();<br />
<br />
/** Get the name in the file */<br />
char* name = static_cast<char*>(tObj.GetUserField("MyName"));<br />
std::cout << name << std::endl;<br />
<br />
/** delete the allocated pointer */<br />
delete [] name;<br />
<br />
== Types of MetaObjects ==<br />
<br />
All of the following objects derive from metaObject.<br />
<br />
=== MetaBlob ===<br />
<br />
A blob is defined by a list of points that describe the object. The points can be inside the object (if obtained by connected-component for instance) or only on the surface. Note that a color (RGBA) can be associated which each point.<br />
<br />
The required fields are:<br />
* The number of points defining the object:<br />
NPoints(int npnt);<br />
* How the position of the points is stored in the file. By default the configuration is x y z red green blue alpha<br />
PointDim(const char* pointDim);<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D blob */<br />
MetaBlob blob(3);<br />
blob.ID(0); // define the ID of the blob<br />
<br />
/** Add 10 points to the blob */<br />
BlobPnt* pnt;<br />
<br />
unsigned int i;<br />
for(i=0;i<10;i++)<br />
{<br />
pnt = new BlobPnt(3);<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
blob.GetPoints().push_back(pnt); // push the created point into the list of points<br />
}<br />
<br />
/** Write the blob in binary format */<br />
blob.BinaryData(true);<br />
blob.ElementType(MET_FLOAT);<br />
blob.Write("myBlob.meta");<br />
<br />
/** Read the file */<br />
blob.Read("myBlob.meta"); <br />
blob.PrintInfo();<br />
<br />
/** Access the list of points */<br />
std::cout << "Accessing pointlist..." << std::endl;<br />
<br />
MetaBlob::PointListType plist = blob.GetPoints();<br />
MetaBlob::PointListType::const_iterator it = plist.begin();<br />
<br />
while(it != plist.end())<br />
{<br />
for(unsigned int d = 0; d < 3; d++)<br />
{<br />
std::cout << (*it)->m_X[d] << " ";<br />
}<br />
std::cout << std::endl;<br />
it++;<br />
}<br />
<br />
=== MetaEllipse ===<br />
<br />
MetaEllipse is an N-Dimensional object to define ellipsoids like circles, spheres or even hyper-ellipsoids.<br />
The only field you need to provide is the Radius.<br />
<br />
There are several ways to input the radius:<br />
# As an array of floats: void Radius(const float* radius);<br />
# As a single value which means that we are defining an hyper-sphere: void Radius(float radius);<br />
# A convenient way to define a 2D ellipse: void Radius(float r1,float r2);<br />
# A convenient way to define a 3D ellipse: void Radius(float r1,float r2, float r3);<br />
<br />
==== Example ====<br />
<br />
/** Create a sphere */<br />
MetaEllipse myEllipse (3);<br />
myEllipse ->Radius(3); // radius of 3<br />
<br />
=== MetaGroup ===<br />
<br />
MetaGroup does not have added functionalities compared to metaObject. It allows to group object in a metafile.<br />
<br />
=== MetaImage ===<br />
<br />
==== Constructors ====<br />
<br />
Simple constructor by specifying the filename<br />
MetaImage(const char *_headerName); <br />
<br />
Constructor by shared memory <br />
MetaImage(MetaImage *_im); <br />
<br />
Other constructors<br />
MetaImage(int _nDims, <br />
const int * _dimSize,<br />
const float *_elementSpacing,<br />
MET_ValueEnumType _elementType,<br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
MetaImage(int _x, int _y, <br />
float _elementSpacingX, <br />
float _elementSpacingY,<br />
MET_ValueEnumType _elementType, <br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
MetaImage(int _x, int _y, int _z, <br />
float _elementSpacingX,<br />
float _elementSpacingY,<br />
float _elementSpacingZ, <br />
MET_ValueEnumType _elementType,<br />
int _elementNumberOfChannels=1,<br />
void *_elementData=NULL);<br />
<br />
==== Member functions ====<br />
<br />
HeaderSize: Return the size of the header.<br />
int HeaderSize(void) const;<br />
<br />
Quantity: Total number of elements in the image.<br />
int Quantity(void) const;<br />
<br />
SubQuantity: Number of elements in image spanning sub-dimensions. E.g., elements per line, 2D sub-image, 3D sub-volume.<br />
const int * SubQuantity(void) const; <br />
int SubQuantity(int _i) const; <br />
<br />
ElementMin/Max: The default max returned is the largest allowed by ElemNBytes (12 bit uint16_t will give 4096 max). This may not represent the true max. Use _reCalc=true to force a calcuation of the actual max element value.<br />
bool ElementMinMaxValid(void) const;<br />
void ElementMinMaxValid(bool _elementMinMaxValid);<br />
void ElementMinMaxRecalc(void);<br />
double ElementMin(void) const; <br />
void ElementMin(double _elementMin);<br />
double ElementMax(void) const;<br />
void ElementMax(double _elementMax);<br />
<br />
ElementByteOrderSwap: These functions are available only after ReadImageData() or if _read_and_close=TRUE when read<br />
void ElementByteOrderSwap(void);<br />
bool ElementByteOrderFix(void);<br />
<br />
<br />
ConverTo: Converts to a new data type. Rescales using Min and Max.<br />
bool ConvertElementDataTo(MET_ValueEnumType _elementType=MET_UCHAR,<br />
double _toMin=0, double _toMax=0);<br />
<br />
==== Field descriptions ====<br />
<br />
Modality: Specify the modality of the image<br />
MET_ImageModalityEnumType Modality(void) const;<br />
void Modality(MET_ImageModalityEnumType _modality);<br />
<br />
Dimension size: Specify the size of the image in each dimension<br />
void DimSize(const int * _dimSize);<br />
void DimSize(int _i, int _value);<br />
<br />
SequenceID: DICOM designation of this image relative to other images acquired at the same time<br />
const float * SequenceID(void) const;<br />
float SequenceID(int _i) const;<br />
void SequenceID(const float * _sequenceID);<br />
void SequenceID(int _i, float _value);<br />
<br />
ElementSize: Optional Field. Physical size (in MM) of each element in the image (0 = xSize, 1 = ySize, 2 = zSize)<br />
const float * ElementSize(void) const;<br />
float ElementSize(int i) const;<br />
void ElementSize(const float * _pointSize);<br />
void ElementSize(int _i, float _value);<br />
<br />
ElementType: Pixel type<br />
MET_ValueEnumType ElementType(void) const;<br />
void ElementType(MET_ValueEnumType _elementType);<br />
<br />
ElementNumberOfChannels: Number of channels<br />
int ElementNumberOfChannels(void) const;<br />
void ElementNumberOfChannels(int _elementNumberOfChannels);<br />
<br />
ElementData: Returns a pointer to the data. <br />
void * ElementData(void);<br />
double ElementData(int _i) const;<br />
void ElementData(void * _data);<br />
bool ElementData(int _i, double _v);<br />
<br />
ElementDataFileName: Set/Get the filename<br />
const char * ElementDataFileName(void) const;<br />
void ElementDataFileName(const char * _dataFileName);<br />
<br />
==== Example ====<br />
<br />
ObjectType = Image<br />
NDims = 2<br />
BinaryData = True<br />
BinaryDataByteOrderMSB = False<br />
ElementSpacing = 1 2<br />
DimSize = 8 8<br />
ElementType = MET_CHAR<br />
ElementDataFile = LOCAL<br />
[Pixel Data]<br />
<br />
=== MetaLandmark ===<br />
<br />
MetaLandmark is a simple list of landmarks.<br />
<br />
The number of landmarks defining the object is set using the function<br />
NPoints(int npnt);<br />
<br />
How the position of the points is stored in the file: By default the configuration is x y z red green blue alpha<br />
PointDim(const char* pointDim);<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D Landmark */<br />
MetaLandmark Landmark(3);<br />
Landmark.ID(0);<br />
LandmarkPnt* pnt;<br />
<br />
/** Add some landmarks to the list of landmark points*/<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new LandmarkPnt(3);<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
Landmark.GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaLine ===<br />
<br />
A metaLine is actually a polyline defined by a list of connected points.<br />
A point on the line has a given position, a normal and a color.<br />
<br />
To set the position the local variable m_X should be filled in the point structure. The variable m_V which is a double pointer to a float is used to assess the normal. The normal has the dimension of the object minus one since a metaLine in a 3D space will have two normals (a plane).<br />
<br />
Note that the user does not need to allocate the memory for those variables, this is done automatically in the constructor of the point.<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
/** Create a 3D MetaLine */<br />
MetaLine Line(3);<br />
LinePnt* pnt;<br />
<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new LinePnt(3);<br />
<br />
/** Define the position */<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
<br />
/** Define the normals */<br />
pnt->m_V[0][0]=(float)0.3;<br />
pnt->m_V[0][1]=i;<br />
pnt->m_V[0][2]=i;<br />
pnt->m_V[1][0]=(float)0.4;<br />
pnt->m_V[1][1]=i+1;<br />
pnt->m_V[1][2]=i+1;<br />
Line->GetPoints().push_back(pnt);<br />
}<br />
<br />
/** Write the result */<br />
Line.BinaryData(true);<br />
Line.Write("myLine.meta");<br />
<br />
=== MetaSurface ===<br />
<br />
The definition of a metaSurface is quite similar to the metaLine’s, except for the normal which is only a NDim vector (i.e. an array of floats) where NDim is the dimension of the metaObject.<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
MetaSurface surface(3);<br />
SurfacePnt* pnt;<br />
<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new SurfacePnt(3);<br />
<br />
/** Position */<br />
pnt->m_X[0]=(float)0.2;<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
<br />
/* Normal */<br />
pnt->m_V[0]=(float)0.8;<br />
pnt->m_V[1]=i;<br />
pnt->m_V[2]=i;<br />
surface->GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaTube ===<br />
<br />
A metaTube is a tubular structure defined by a list of connected points (like a metaLine) but more fields have been added for a complete representation, especially the one of blood vessels.<br />
To specify a point that belongs to the tube, the user can define: the position, the radius at that point, the normal(s), the tangent, the color, the Identification number, the medialness, the branchness, the ridgeness, and three alpha values that represents the ratio of the eigen values at that points. <br />
<br />
Note that metaTube supports only 2D and 3D tubes.<br />
<br />
Also for a metaTube, the ID of the root can be specified by the command Root(int rootID) and the ID of the parent point can also be assessed using ParentPoint(int parentpoint).<br />
<br />
To access the internal list of points user should use the GetPoints() function which returns the internal list by reference. Note that the list is a list of pointers to point and is deleted automatically by the object itself so the user does not need to free the allocated memory.<br />
<br />
==== Example ====<br />
<br />
/** Create a 3D tube*/<br />
MetaTube* tube1 = new MetaTube(3);<br />
tube1->ID(0);<br />
<br />
/** Add 10 points to the list of tubePoints */<br />
TubePnt* pnt;<br />
for(unsigned int i=0;i<10;i++)<br />
{<br />
pnt = new TubePnt(3);<br />
<br />
pnt->m_X[0]=i; // position<br />
pnt->m_X[1]=i;<br />
pnt->m_X[2]=i;<br />
pnt->m_R=i; // radius<br />
tube1->GetPoints().push_back(pnt);<br />
}<br />
<br />
=== MetaScene ===<br />
<br />
A metaScene is a metaObject that contains a flat list of metaObjects.<br />
<br />
==== Member functions ====<br />
<br />
Add an object to the scene:<br />
void AddObject(MetaObject* object);<br />
<br />
Return the number of objects in the scene:<br />
int NObjects(void) const;<br />
<br />
Get a list of objects present in the scene:<br />
ObjectListType * GetObjectList(void) {return & m_ObjectList;}<br />
<br />
==== Example ====<br />
<br />
/** Define a 3D Scene */<br />
MetaScene scene(3);<br />
<br />
MetaEllipse * e1 = new MetaEllipse(3);<br />
e1->ID(0);<br />
e1->Radius(3);<br />
<br />
MetaGroup g0;<br />
MetaGroup * g1 = new MetaGroup(3);<br />
g1->ID(2);<br />
<br />
s->AddObject(g1);<br />
s->AddObject(e1);<br />
<br />
s->Write("scene.scn");<br />
scene.Clear();<br />
<br />
s->Read("scene.scn");<br />
<br />
==== Output File Example ====<br />
<br />
Here is the example of a metafile with a scene that contains metaObjects<br />
<br />
ObjectType = Scene<br />
NDims = 3<br />
NObjects = 3<br />
ObjectType = Group<br />
NDims = 3<br />
ID = 2<br />
EndGroup = <br />
ObjectType = Ellipse<br />
NDims = 3<br />
ID = 0<br />
ParentID = 2<br />
Radius = 1 2 3<br />
ObjectType = Line<br />
NDims = 3<br />
ID = 0<br />
BinaryData = False<br />
BinaryDataByteOrderMSB = False<br />
ElementType = MET_FLOAT<br />
PointDim = x y z v1x v1y v1z<br />
NPoints = 3<br />
Points = <br />
1 2 3 0 0 0<br />
1 2 3 0 0 0<br />
1 2 3 0 0 0<br />
ObjectType = Landmark<br />
NDims = 3<br />
ID = 0<br />
BinaryData = True<br />
BinaryDataByteOrderMSB = False<br />
ElementType = MET_FLOAT<br />
PointDim = x y z red green blue alpha<br />
NPoints = 2<br />
Points = <br />
1 2 3 1.0 0.0 0.0 1.0<br />
1 2 3 1.0 0.0 0.0 1.0<br />
1 2 3 1.0 0.0 0.0 1.0 <br />
<br />
== Spatial Objects ==<br />
<br />
MetaIO has also been chosen to support Spatial Objects IO. To obtain a complete documentation of Spatial Objects and how to read/write them out please see the Insight user’s manual available at www.itk.org.<br />
<br />
== Reference: Tags of MetaImage ==<br />
<br />
=== MetaObject Tags ===<br />
<br />
The tags of MetaObject are:<br />
<br />
* Comment<br />
** MET_STRING<br />
** User defined - arbitrary<br />
* ObjectType<br />
** MET_STRING<br />
** Defined by derived objects – e.g., Tube, Image<br />
* ObjectSubType<br />
** MET_STRING<br />
** Defined by derived objects – currently not used<br />
* TransformType<br />
** MET_STRING<br />
** Defined by derived objects – e.g., Rigid<br />
* NDims<br />
** MET_INT<br />
** Defined at object instantiation<br />
* Name<br />
** MET_STRING<br />
** User defined<br />
* ID<br />
** MET_INT<br />
** User defined else -1<br />
* ParentID<br />
** MET_INT<br />
** User defined else -1<br />
* BinaryData<br />
** MET_STRING<br />
** Are the data associated with this object stored at Binary or ASCII<br />
** Defined by derived objects<br />
* ElementByteOrderMSB<br />
** MET_STRING<br />
* BinaryDataByteOrderMSB<br />
** MET_STRING<br />
* Color<br />
** MET_FLOAT_ARRAY[4]<br />
** R, G, B, alpha (opacity)<br />
* Position<br />
** MET_FLOAT_ARRAY[NDims]<br />
** X, Y, Z,… of real-world coordinate of 0,0,0 index of image)<br />
* Orientation<br />
** MET_FLOAT_MATRIX[NDims][NDims]<br />
** [0][0],[0][1],[0][2] specify X, Y, Z… direction in real-world of X-axis of image<br />
** [1][0],[1][1],[1][2] specify X, Y, Z… direction in real-world of Y-axis of image, etc. <br />
* AnatomicalOrientation<br />
** MET_STRING<br />
** This is a convenience tag, to be used and maintained by applications. Changing this tag in a MetaIO file or via the MetaIO API will not cause an image to be resampled or the direction matrix to change. It is up to an application to correctly read, write, and maintain this tag.<br />
** The history of the interpretation of this tag is as follows:<br />
*** Labels: The labels used to define a space can be "from" labels or "to" labels, where "from" labels define the relative physical location of the origin of a space and "to" labels define the physical direction of movement of a space - thereby RAI "from" space is the same as LPS "to" space. DICOM, ITK, and nearly every other application consider label space to be "to" labels.<br />
*** In an LPS "to" space ("to" space will be assumed in the remainder of this discussion), when moving in the "physical" x,y,z-directions, then you are physically going to the left. <br />
*** The direction matrix specifies how "index" i,j,k-directions map into x,y,z-directions. Changing the direction matrix will never change the fact that you're in an LPS space, but changing a direction matrix will change how moving along the i-index direction maps to a movement in the LPS space.<br />
*** Originally, AnatomicalOrientation was intended to define the space (LPS, RAS, etc) of an image; however, in early 2000s, its implementation was changed (and its documentation became unclear) to define how a patient was oriented in index space (it assumed an LPS space, and thus it became redundant with the direction matrix). These changes seem to have coincided with ITK's introduction of a direction matrix (thanks goes to Alexis Girault for hunting down this history!). As of June 2019, ITK writes AnatomicOrientation based on the direction matrix and assumes an LPS space. See the code in itkSpatialOrientation.h that specifies a 3-letter code derived from an image's direction matrix and that 3-letter code is then used to specify the AnatomicalOrientation tag in MetaIO.<br />
*** Moving forward, when implementing new applications, it is recommended that developers use the definition currently implemented by ITK. It represents the most common use of MetaIO.<br />
* ElementSpacing<br />
** MET_FLOAT_ARRAY[NDims]<br />
** The distance between voxel centers<br />
<br />
=== Tags Added by MetaImage ===<br />
<br />
In addition to the above tags, MetaImage provides the following tags:<br />
<br />
* DimSize <br />
** MET_INT_ARRAY[NDims]<br />
** Number of elements per axis in data<br />
* HeaderSize<br />
** MET_INT<br />
** Number of Bytes to skip at the head of each data file.<br />
** Specify –1 to have MetaImage calculate the header size based on the assumption that the data occurs at the end of the file.<br />
** Specify 0 if the data occurs at the begining of the file.<br />
* Modality<br />
** MET_STRING<br />
** One of enum type: MET_MOD_CT, MET_MOD_MR, MET_MOD_US… See [https://github.com/Kitware/MetaIO/blob/ffe3ce141c5a2394e40a0ecbe2a667cc0566baf5/src/metaImageTypes.h#L21 metaImageTypes.h]<br />
* SequenceID<br />
** MET_INT_ARRAY[4]<br />
** Four values comprising a DICOM sequence: Study, Series, Image numbers<br />
* ElementMin<br />
** MET_FLOAT<br />
** Minimum value in the data<br />
* ElementMax<br />
** MET_FLOAT<br />
** Maximum value in the data<br />
* ElementNumberOfChannels<br />
** MET_INT<br />
** Number of values (of type ElementType) per voxel<br />
* ElementSize<br />
** MET_FLOAT_ARRAY[NDims]<br />
** Physical size of each voxel<br />
* ElementType<br />
** MET_STRING<br />
** One of enum type: MET_UCHAR, MET_CHAR… See [https://github.com/Kitware/MetaIO/blob/ffe3ce141c5a2394e40a0ecbe2a667cc0566baf5/src/metaTypes.h#L63-94 metaTypes.h]<br />
* ElementDataFile<br />
** MET_STRING<br />
** One of the following:<br />
*** Name of the file to be loaded<br />
*** A printf-style string followed by the min, max, and step values to be used to pass an argument to the string to create list of file names to be loaded (must be (N-1)D blocks of data per file).<br />
*** LIST [X] – This specifies that starting on the next line is a list of files (one filename per line) in which the data is stored. Each file (by default) contains an (N-1)D block of data. If a second argument is given, its first character must be a number that specifies the dimension of the data in each file. For example ElementDataFile = LIST 2D means that there will be a 2D block of data per file.<br />
*** LOCAL – Indicates that the data begins at the beginning of the next line.</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Data&diff=61831TubeTK/Data2017-05-31T22:01:13Z<p>Aylward: /* 100 Healthy Normal MRIs and MRAs from UNC */</p>
<hr />
<div>__NOTITLE__<br />
__NOTOC__<br />
<br />
{| border="1" cellpadding="10" cellspacing="0"<br />
|+ [[image:TubeTK_Header.jpg|1000px]]<br />
|-<br />
| style="background:#efefef;" align="left" valign="top" width="150px" | <br />
<br />
'''[[TubeTK|Home]]'''<br />
*[[TubeTK/About|About]]<br />
*[[TubeTK/Images|Image Gallery]]<br />
*[[TubeTK/Data|Data and Publications]]<br />
<br><br />
----<br />
<br><br />
'''For Users'''<br />
* [[TubeTK/Installation|Installation]]<br />
* [[TubeTK/Documentation|Methods & Apps]]<br />
* [[TubeTK/Slicer|TubeTK with 3D Slicer]]<br />
* [[TubeTK/OsiriX|TubeTK with OsiriX]]<br />
<br><br />
----<br />
<br><br />
'''For Developers'''<br />
* [[TubeTK/Development|Development Docs]]<br />
<br><br />
----<br />
<br><br />
'''[https://github.com/TubeTK/TubeTK/issues Report Bugs<br>Request Features]'''<br />
<br><br />
<br><br />
----<br />
<br><br />
'''[[TubeTK/Contact|Contact Us]]'''<br />
<br />
| width="800px" align="left" |<br />
<br />
= Data = <br />
<br />
=== 100 Healthy Normal MRIs and MRAs from UNC ===<br />
{|width="100%"<br />
|[[File:Intracranial-Teaser.jpg|300px|link=https://data.kitware.com/#collection/591086ee8d777f16d01e0724/folder/58a372e38d777f0721a64dc6]]<br />
|This dataset contains 100 (T1, MRA) image pairs from healthy patients, acquired by a Siemens Allegra head-only 3T MR system. The voxel spacing for the MRA images is (0.5x0.5x0.8mm) with a volume size of (448x448x128voxel); The voxel spacing for the T1 images is 1mm isotropic with a volume size of (176x256x176voxel).<br />
<br />
The full dataset can be downloaded [https://data.kitware.com/#collection/591086ee8d777f16d01e0724/folder/58a372e38d777f0721a64dc6 here]. A subset of this dataset also includes intra-cranial vasculature (centerline + radius), extracted from the MRA images. These models are found in each patient's "Auxillary Data" folder, such as [https://data.kitware.com/#collection/591086ee8d777f16d01e0724/folder/58a372fa8d777f0721a64dfb here].<br />
|}<br />
<br />
<br />
<br />
----<br />
<br />
=== Recognition in Ultrasound (REUS) Database ===<br />
<br />
{|width="100%"<br />
|[[File:REUS-Teaser.jpg|300px|link=http://midas3.kitware.com/midas/folder/10255]]<br />
|This dataset contains Ultrasound (US) videos, acquired on a (hand-made) noodle phantom. The database is split into template videos and search path videos and is designed to evaluate recognition algorithms. It can be downloaded from [http://midas3.kitware.com/midas/folder/10255 here].<br />
<br />
In summary (see included README file for details), the database contains videos from 9 different ''noodle'' structures. We provide 10 templates videos per structure (i.e., 90 templates in total) and 9 ''search path'' videos (i.e., 1 search path video per structure). One task could be, for instance, to localize (temporally) the templates in the corresponding search path videos. Currently, the videos are available in (64x64pixel) and (128x128pixel) spatial resolution.<br />
<br />
To evaluate recognition algorithms, we further provide human ground truth locations for the search paths, indicating when a structure moves "in" and "out" of the US imaging plane (These annotations were averaged over 5 different persons). <br />
|}<br />
----<br />
<br />
=== TubeTK Testing Data ===<br />
Another good resource to download data material for experimenting with TubeTK is our testing data, available from [http://midas3.kitware.com/midas/community/7 here].<br />
<br />
= Patents =<br />
* 6,690,816 : "Systems and methods for tubular object processing" Stephen R. Aylward, Elizabeth Bullitt, Daniel Fritsch, Stephen M. Pizer, February 2004<br />
** Patent is held by UNC. A world-wide, unrestricted, free license has been granted.<br />
<br />
= Books =<br />
S. Aylward and E. Bullitt, '''Chapter 11: Clinical Applications Involving Vascular Image Segmentation and Registration'''. Angiography and Plaque Imaging: Advanced Segmentation Tequniques, Academic Press, 2002 pp. 529-579<br />
<br />
= Journal Articles =<br />
* R. Kwitt, N. Vasconcelos, S. Razzaque and S.R. Aylard: '''Localizing Target Structures in Ultrasound Video - A Phantom Study''', Medical Image Analysis, vol. 17, no 7., pp. 7127-22, 2013 [http://www.medicalimageanalysisjournal.com/article/S1361-8415(13)00069-8/abstract Publisher Link] [http://public.kitware.com/Wiki/images/3/33/Kwitt13aMedIA.pdf Preprint]<br />
* R. C. Gessner, S. R. Aylward, and P. A. Dayton: '''Mapping Microvasculature with Acoustic Angiography Yields Quantifiable Differences between Healthy and Tumor-bearing Tissue Volumes in a Rodent Model''', Radiology, vol. 264, no. 3, pp. 733–740, 2012. <br />
* E. Bullitt, D. Zeng, B. Mortamet, A. Ghosh, S. Aylward, W. Lin, B. L. Marks, and K. Smith: '''The effects of healthy aging on intracerebral blood vessels visualized by magnetic resonance angiography'''. Neurobiology of Aging, vol. 31, no. 2, pp. 290–300, 2010. <br />
* E. Bullitt, M. Ewend, J. Vredenburgh, A. Friedman, W. Lin, K. Wilber, D. Zeng, S. Aylward, and D. Reardon: '''Computerized assessment of vessel morphological changes during treatment of glioblastoma multiforme: Report of a case imaged serially by MRA over four years'''. NeuroImage, vol. 47, pp. T143–T151, 2009. <br />
* G. Piliere, M. H. Van Horn, R. Dixon, J. Stavas, S. Aylward, and E. Bullitt: '''Vessel target location estimation during the TIPS procedure'''. Medical Image Analysis, vol. 13, no. 3, pp. 519–529, 2009. <br />
* E. Bullitt, S. R. Aylward, T. Van Dyke, and W. Lin: '''Computer-assisted measurement of vessel shape from 3T magnetic resonance angiography of mouse brain''', Methods, vol. 43, no. 1, pp. 29–34, 2007. <br />
* S. Aylward, K. Cleary, and D. Hawkes: '''Intraoperative image processing for surgical guidance'''. IEEE Transactions on Medical Imaging, vol. 24, no. 11, pp. 1401–1404, 2005. <br />
* E. Bullitt, D. Zeng, G. Gerig, S. Aylward, S. Joshi, J. Smith, W. Lin, and M. Ewend: '''Vessel tortuosity and brain tumor malignancy: A blinded study'''. Academic Radiology, vol. 12, no. 10, pp. 1232–1240, 2005 (''Winner 2006 Herbert M. Stauffer Award by the Association of University Radiologists PMID: 16179200'')<br />
* E. Bullitt, K. Muller, I. Jung, W. Lin, and S. Aylward: '''Analyzing attributes of vessel populations'''. Medical Image Analysis, vol. 9, no. 1, pp. 39–49, 2005. <br />
* E. Bullitt, M. Ewend, S. Aylward, W. Lin, G. Gerig, S. Joshi, I. Jung, K. Muller, and J. Smith: '''Abnormal vessel tortuosity as a marker of treatment response of malignant gliomas: Preliminary report'''. Technology in Cancer Research & Treatment, vol. 3, no. 6, pp. 577–584, 2004. <br />
* Y. Fridman, S. Pizer, S. Aylward, and E. Bullitt: '''Extracting branching tubular object geometry via cores'''. Medical Image Analysis, vol. 8, no. 3, pp. 169–176, 2004. <br />
* J. Jomier, S. Weeks, and S. R. Aylward: '''Vascular image registration for intra-operative 3D ultrasound annotation'''. International Congress Series, vol. 1268, pp. 1308–1308, 2004. <br />
* S. Aylward, J. Jomier, S. Weeks, and E. Bullitt: '''Registration and analysis of vascular images'''. International Journal of Computer Vision, vol. 55, no. 2–3, pp. 123–138, 2003. <br />
* E. Bullitt, G. Gerig, S. Pizer, W. Lin, and S. Aylward: '''Measuring tortuosity of the intracerebral vasculature from MRA images'''. IEEE Transactions on Medical Imaging, vol. 22, no. 9, pp. 1163–1171, 2003. <br />
* D. Wallace, A. Capone, J. Jomier, S. Aylward, M. Landers, M. Trese, and P.-R. S. Grp: '''Computer automated quantification of plus disease in RetCam images of retinopathy of prematurity'''. Investigative Ophthamology & Visual Science, vol. 44, no. 1, p. U116, 2003. <br />
* D. Wallace, J. Jomier, S. Aylward, and M. Landers: '''Computer-automated quantification of plus disease in retinopathy of prematurity'''. Journal of AAPOS, vol. 7, no. 2, pp. 126–130, 2003. <br />
* E. Bullitt and S. Aylward: '''Patient-specific vascular models for endovascular and open operative procedures'''. International Congress Series, vol. 1247, pp. 129–138, 2002. <br />
* S. R. Aylward and E. Bullitt: '''Initialization, noise, singularities, and scale in height ridge traversal for tubular object centerline extraction'''. IEEE Transactions on Medical Imaging, vol. 21, no. 2, pp. 61–75, 2002. <br />
* E. Bullitt, S. Aylward, K. Smith, S. Mukherji, M. Jiroutek, and K. Muller: '''Symbolic description of intracerebral vessels segmented from magnetic resonance angiograms and evaluation by comparison with X-ray angiograms'''. Medical Image Analysis, vol. 5, no. 2, pp. 157–169, 2001. <br />
* E. Bullitt, S. Aylward, E. Bernard, and G. Gerig: '''Computer-assisted visualization of arteriovenous malformations on the home personal computer'''. Neurosurgery, vol. 48, no. 3, pp. 576–582, 2001. <br />
* E. Bullitt, A. Liu, S. Aylward, C. Coffey, J. Stone, S. Mukherji, K. Muller, and S. Pizer: '''Registration of 3D cerebral vessels with 2D digital angiograms: Clinical evaluation'''. Academic Radiology, vol. 6, no. 9, pp. 539–546, 1999. <br />
* S. Aylward, E. Bullitt, and P. Stephen: '''VTree3D: Fast and effective vessel, bronchial tube, duct, and bone display'''. Radiology, vol. 209P, no. S, p. 394, 1998. <br />
* E. Bullitt, A. Liu, S. Aylward, M. Soltys, J. Rosenman, and S. Pizer: '''Methods for displaying intracerebral vascular anatomy'''. Americal Journal of Neuroradiology, vol. 18, no. 3, pp. 417–420, Mar. 1997.<br />
<br />
= IPMI and MICCAI Publications =<br />
* R. Kwitt, D. Pace, M. Niethammer and S. Aylward: '''Studying Cerebral Vasculature Using Structure Proximity and Graph Kernels'''. In: MICCAI '13, vol. 8150, pp. 534-541, 2013 [http://public.kitware.com/Wiki/images/3/3f/SupplementaryMaterial.pdf Supplementary Material] [http://public.kitware.com/Wiki/images/e/e5/Kwitt13bMICCAI.pdf PDF]<br />
<br />
* R. Kwitt, N. Vasconcelos, S. Razzaque and S. Aylward: '''Recognition in Ultrasound Videos: Where am'''. In: MICCAI '12, vol. 7512, pp. pp 83-90, 2013 ('''Oral presentation''' ; Acceptance rate < 5%; Winner of the '''MICCAI Young Scientist Award''') [http://public.kitware.com/Wiki/images/a/af/Kwitt12aMICCAI.pdf PDF]<br />
<br />
* J. Jomier, E. Bullitt, M. Van Horn, C. Pathak, and S. Aylward: '''3D/2D model-to-image registration applied to TIPS surgery'''. In: MICCAI’06, vol. 4191, pp. 662–669, 2006<br />
<br />
* J. Jomier, V. LeDigarcher, and S. Aylward: '''Automatic vascular tree formation using the mahalanobis distance'''. In: MICCAI '05, vol. 3750, pp. 806–812, 2005<br />
<br />
* J. Jomier, V. LeDigarcher, and S. Aylward: '''Comparison of vessel segmentations using STAPLE'''. In: MICCAI '05, vol. 3749, pp. 523–530, 2005<br />
<br />
* S. Aylward, J. Jomier, C. Vivert, V. LeDigarcher, and E. Bullitt: '''Spatial graphs for intra-cranial vascular network characterization, generation, and discrimination'''. In: MICCAI '05, vol. 3749, pp. 59–66, 2005<br />
<br />
* J. Jomier and S. Aylward: '''Rigid and deformable vasculature-to-image registration: A hierarchical approach'''. In: MICCAI '04, vol. 3216, pp. 829–836, 2004 <br />
<br />
* E. Bullitt, I. Jung, K. Muller, G. Gerig, S. Aylward, S. Joshi, K. Smith, W. Lin, and M. Ewend: '''Determining malignancy of brain tumors by analysis of vessel shape'''. In: MICCAI '04, vol. 3217, pp. 645–653, 2004<br />
<br />
* J. Jomier, D. Wallace, and S. Aylward: '''Quantification of retinopathy of prematurity via vessel segmentation'''. In: MICCAI '03, vol. 2879, pp. 620–626, 2003<br />
<br />
* B. Jolly, M. Van Horn, S. Aylward, and E. Bullitt: '''Needle detection and tracking in the TIPS endovascular procedure'''. In: MICCAI '03, vol. 2879, pp. 953–954, 2003<br />
<br />
* Y. Fridman, S. Pizer, S. Aylward, and E. Bullitt: '''Segmenting 3D branching tubular structures using cores'''. In: MICCAI '03, vol. 2879, pp. 570–577, 2003<br />
<br />
* D. Cool, D. Chillet, J. Kim, J. Guyon, M. Foskey, and S. Aylward: '''Tissue-based affine registration of brain images to form a vascular density atlas'''. In: MICCAI '03, vol. 2879, pp. 9–15, 2003<br />
<br />
* D. Chillet, J. Jomier, D. Cool, and S. Aylward: '''Vascular atlas formation using a vessel-to-image affine registration method'''. In: MICCAI '03, vol. 2878, pp. 335–342, 2003 <br />
<br />
* E. Bullitt, G. Gerig, S. Aylward, S. Joshi, K. Smith, M. Ewend, and W. Lin: '''Vascular attributes and malignant brain tumors'''. In: MICCAI '03, vol. 2878, pp. 671–679, 2003<br />
<br />
* S. Aylward, S. Weeks, and E. Bullitt: '''Analysis of the Parameter Space of a Metric for Registering 3D Vascular Images'''. In: MICCAI ’01, vol. pp. 932–939, 2001 <br />
<br />
* E. Bullitt, S. Aylward, A. Liu, J. Stone, S. Mukherji, C. Coffey, G. Gerig, and S. Pizer: '''3D graph description of the intracerebral vasculature from segmented MRA and tests of accuracy by comparison with X-ray angiograms'''. In: IPMI '99, vol. 1613, pp. 308–321, 1999<br />
<br />
* E. Bullitt, A. Liu, S. Aylward, and S. Pizer: '''Reconstruction of the intracerebral vasculature from MRA and a pair of projection views'''. In: IMPI '97, vol. 1230, pp. 537–542, 1997<br />
<br />
= Other Conference Papers =<br />
* D. F. Pace, A. Enquobahrie, H. Yang, S. R. Aylward, and M. Niethammer: '''Deformable image registration of sliding organs using anisotropic diffusive regularization'''. In: IEEE International Symposium on Biomedical Imaging (ISBI), pp. 407–413, 2011<br />
<br />
* D. F. Pace, M. Niethammer, and S. R. Aylward: '''Sliding geometries in deformable image registration'''. In: MICCAI ’11 Proceedings of the Third International Conference on Abdominal Imaging, pp. 141–148, 2011<br />
<br />
* R. C. Gessner, R. Kothadia, S. Feingold, S. Aylward, E. Bullitt, and P. A. Dayton: '''Blood vessel structural morphology derived from 3D dual-frequency ultrasound images'''. In: IEEE Ultrasonics Symposium (IUS), pp. 209–212, 2010<br />
<br />
* J. Lee, J. Jomier, S. Aylward, M. Tyszka, S. Moy, J. Lauder, and M. Styner: '''Evaluation of atlas based mouse brain segmentation'''. In: SPIE Medical Imaging, 2009<br />
<br />
* Z. Zhao, D. K. Wallace, S. F. Freedman, and S. R. Aylward: '''A tool for computer-aided diagnosis of retinopathy of prematurity'''. In: SPIE Medical Imaging, 2008<br />
<br />
* E. Bullitt and S. Aylward: '''Visualizing blood vessel trees in three dimensions: clinical applications'''. In: SPIE Medical Imaging, 2005<br />
<br />
* S. R. Aylward, J. Jomier, J. P. Guyon, and S. Weeks: '''Intra-operative 3D ultrasound augmentation'''. In: IEEE International Symposium on Biomedical Imaging (ISBI), pp. 421–424, 2002<br />
<br />
* E. Bullitt, SR Aylward: '''Patient-specific vascular models for endovascular and open operative procedures'''. In: Proceedings of the 2nd International Mt. BANDAI Symposium for Neuroscience, pp. 88-94, 2001<br />
<br />
* E. Bullitt and S. R. Aylward: '''Analysis of Time-Varing Images Using 3-D Vascular Models'''. In: Proceedings of the 30th on Applied Imagery Pattern Recognition Workshop (AIPR), p. 9-14, 2001 ''(Keynote Address)''<br />
<br />
* S. Aylward, S. Pizer, D. Eberly, and E. Bullitt: '''Intensity Ridge and Widths for Tubular Object Segmentation and Description'''. In: MMBIA ’96 p. 131-138, 1996<br />
<br />
[[Category:TubeTK|Data]]<br />
[[Category:TubeTK Data|*]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=60969TubeTK/Build Instructions2016-11-01T12:11:34Z<p>Aylward: /* (Option 1) Slicer-Dependent Build */</p>
<hr />
<div>There are two ways of building TubeTK:<br />
<br />
* (Option 1) Slicer-Dependent Build<br />
* (Option 2) Stand-Alone Build<br />
<br />
If you are going to use TubeTK as a library for building your own C++ programs or for processing data using the command-line or scripts, it is sufficient to build TubeTK as a (Option 2) Stand-Alone Build.<br />
<br />
If you want a graphical user interface (albeit to a limited subset of TubeTK's methods), you should follow the (Option 1) Slicer-Dependent Build instructions.<br />
<br />
= (Option 1) Slicer-Dependent Build =<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.4 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from [http://cmake.org http://cmake.org]<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= (Option 2) Stand-Alone Build =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Before starting the configuration, make sure that you have <code>virtualenv</code> installed ('''Linux Only''').<br />
<br />
If not, just install it with :<br />
* <code> sudo apt-get install pyton-pip </code><br />
* <code> pip install virtualenv </code><br />
<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=KWPublic&diff=60964KWPublic2016-10-28T14:03:32Z<p>Aylward: /* Projects */</p>
<hr />
<div>= KWPublic Subversion Repository =<br />
<br />
=== Intent ===<br />
<br />
KWPublic is a repository of code that Kitware is releasing to augment<br />
ITK (www.itk.org), VTK (www.vtk.org), and other Kitware-supported libraries<br />
and applications.<br />
<br />
The code in this repository includes libraries, utility applications,<br />
and end-user applications written or enhanced by Kitware employees. We have<br />
found these tools to be generally useful and believe that their release will<br />
benefit a broad set of users and developers.<br />
<br />
=== Projects ===<br />
<br />
# [[KWPublic/Applications]]<br />
#* Utility applications and end-user applications<br />
# Experimental<br />
#* Code undergoing modification as part of its transition into the KWPublic repository.<br />
# itkLibXML2<br />
#* Central repository for the LibXML2 library that has been modified to compile on a larger number of platforms, using CMake<br />
# VTKEdge<br />
#* Enhancements to VTK that are distributed under special licensing terms.<br />
<br />
=== License ===<br />
<br />
Each tool in this repository is distributed under its own license. Some<br />
tools, for example, may require the purchase of a license from Kitware for<br />
use in commercial efforts. Other tools are free for non-commercial and<br />
commercial use. Please read and abide by the license for the code you use<br />
from this repository. If you have any questions, contact the code's author<br />
(if given) or send an email with your question to kitware@kitware.com<br />
<br />
The default license (if none other is specified) for all code in this repository <br />
is Version 3 of the GNU General Public License. For more information, refer <br />
to http://fsf.org/<br />
<br />
=== Access ===<br />
<br />
The repository is available via subversion:<br />
* svn co https://www.kitware.com:8443/svn/KWPublic/trunk KWPublic</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Developers_Guide&diff=59445TubeTK/Developers Guide2016-05-10T23:01:25Z<p>Aylward: /* Use of Braces { } */</p>
<hr />
<div>= TubeTK Developer's Guide =<br />
Created February 1, 2010.<br />
<br />
= Purpose =<br />
The following document is a description of the accepted coding style for TubeTK. Developers who wish to contribute code to TubeTK should read and adhere to the standards described here.<br />
<br />
= Document Overview = <br />
This document is organized into the following sections:<br />
<br />
* '''System Overview and Philosophy:''' Coding methodologies and motivation for the resulting style;<br />
* '''Copyright:''' The copyright header to be included in all files and other copyright issues;<br />
* '''File Organization:''' How to organize source code;<br />
* '''Naming Conventions:''' Patterns used to name classes, variables, template parameters, and instance variables;<br />
* '''Namespaces:''' The use of namespaces;<br />
* '''Code Layout and Indentation:''' Accepted standards for arranging code including indentation style;<br />
* '''Exception Handling:''' How to add exception handling to the system;<br />
* '''Documentation Style:''' A brief section describing the documentation philosophy used within TubeTK.<br />
<br />
This style guide is an evolving document. Please confer with the TubeTK development team if you wish to add, modify, or delete the rules described in these guidelines.<br />
<br />
= Style Guidelines =<br />
The following coding-style guidelines are to be used in development of the TubeTK. To a large extent these guidelines are a result of the fundamental architectural and implementation decisions made early in the TubeTK project. For example, the decision was made to implement TubeTK with a C++ core using principles of generic programming, so the rules are oriented towards this style of implementation. Some guidelines are relatively arbitrary, such as indentation levels and style. However, an attempt was made to find coding styles consistent with accepted practices. The point is to adhere to a common style to assist developers and users of the future learn, use, maintain, and extend TubeTK.<br />
<br />
Please do your best to be a upstanding member of the TubeTK team. The rules described here have been developed with the team as a whole in mind. If you consistently violate these rules you will likely be harassed mercilessly, first privately and then publicly. If this does not result in correct code layout, your right to Git write access (if you are developer and wish to contribute code) may be removed. Similarly, if you wish to contribute code and are not a developer, your code will not be accepted until the style is consistent with these guidelines.<br />
<br />
== System Overview and Philosophy ==<br />
The following implementation strategies have been adopted by the TubeTK team. These directly and indirectly affect the resulting code style. Understanding these strategies motivate the reasons for many of the style guidelines described in this document.<br />
<br />
=== Implementation Language === <br />
The core implementation language is C++. C++ was chosen for its flexibility, performance, and familiarity to team members. The toolkit uses the full spectrum of C++ features including const and volatile correctness, namespaces, partial template specialization, operator overloading, traits, and iterators.<br />
<br />
=== Generic Programming and the STL ===<br />
Compile-time binding using methods of generic programming and template instantiation is the preferred implementation style. This approach has demonstrated its ability to create efficient, flexible code. Use of the Standard Template Library (STL) is encouraged. In contrast with many libraries, STL containers are the acceptable for passing collections of data between public and private member functions. The STL is typically used by a class, rather than as serving as a base class for derivation of classes. <br />
<br />
=== Portability ===<br />
Most applications as well as the core of the toolkit are designed to compile on a set of target operating system/compiler combinations. These combinations are:<br />
<br />
* Linux with GCC;<br />
* Microsoft Windows XP with Microsoft Visual C++ (released within the past five years);<br />
* OS X with Clang or GCC;<br />
* Other Unix systems with GCC.<br />
<br />
Some applications and modules make use of specific GPU configurations to optimize certain calculations. These vary according to system, but there shall always be an unoptimized implementation that will comply to the above portablity standards.<br />
<br />
=== VTK and ITK ===<br />
TubeTK makes extensive use of both the Visualization Toolkit (VTK) and the Insight Toolkit (ITK). Image processing features added to TubeTK should prefer ITK constructs over those of VTK. When visualization-geared code is written for TubeTK, VTK should be favored. <br />
<br />
=== 3D Slicer ===<br />
TubeTK is intended to be use in conjunction with [http://www.slicer.org 3D Slicer], version 4. TubeTK Modules conform to the execution model used by the 3D Slicer project. For more information regarding bundling 3D Slicer extensions see the [http://www.slicer.org/slicerWiki/index.php/Documentation/4.2/Developers/Tutorials/BuildTestPackageDistributeExtensions 3D Slicer documentation pages].<br />
<br />
=== CMake Build Environment ===<br />
The TubeTK build environment is CMake. CMake is an open-source, advanced cross-platform build system that enables developers to write simple ''makefiles'' (named ''CMakeLists.txt'') that are processed to generated native build tools for a particular operating system/compiler combinations. See the [http://www.cmake.org CMake web pages] at for more information.<br />
<br />
=== Tool and Library Versions ===<br />
Because of the agile nature of TubeTK developement, the TubeTK team uses developement versions of CMake, ITK, VTK, 3D Slicer, along with a recent stable version of Qt.<br />
<br />
These are the most important factors influencing the coding style found in TubeTK. Now we will look at the details.<br />
<br />
=== Copyright ===<br />
<br />
== File Organization ==<br />
Classes are created and organized into a single class per file set. A file set consists of ''.h'' header file, ''.cxx'' implementation file, and/or a ''.hxx'' templated implementation file. Helper classes may also be defined in the file set, typically these are not visible to the system at large, or placed into a special namespace.<br />
<br />
Source files must be placed in the correct directory for logical consistency with the rest of the system, and to avoid cyclic dependencies. The TubeTK source directory structure is divided into several directories below ''TubeTK''. Please consult the TubeTK team before creating any new directories with TubeTK. Directories containing source are arranged as follows:<br />
<br />
* '''TubeTK/Applications:''' TubeTK/Applications consists of subdirectories for each TubeTK application. No application should depend upon another in any way;<br />
* '''TubeTK/Base''';<br />
* '''TubeTK/SlicerModules'''.<br />
<br />
== Naming conventions ==<br />
In general:<br />
<br />
* Names are constructed by using case change to indicate separate words, as in ''TimeStamp'' (versus ''Time_Stamp''). Underscores are not used.<br />
* Variable names are chosen carefully with the intention to convey the meaning behind the code. <br />
* Names are generally spelled out; use of abbreviations is discouraged. (Abbreviation are allowable when in common use, and should be in uppercase as in RGB.) While this does result in long names, it self-documents the code. If you learn how to use name completion in your editor (e.g., ''vim'' or ''emacs''), this inconvenience can be minimized. <br />
<br />
Depending on whether the name is a class, file, variable, or other name, variations on this theme result as explained in the following subsections.<br />
<br />
=== Naming Classes ===<br />
Classes are named beginning with a capital letter. Classes are placed in the appropriate namespace, typically tube:: or itk::tube (see namespaces below). Classes are named according to the following general rule:<br />
<br />
''class name = <algorithm><input><concept>''<br />
<br />
In this formula, the name of the algorithm or process (possibly with an associated adjective or adverb) comes first, followed by an input type, and completed by a concept name. A concept is an informal classification describing what a class does. There are many concepts in TubeTK, here are a few of them:<br />
<br />
* '''Filter:''' A class that participates in the data processing pipeline. Filters typically take one or more inputs and produce one or more outputs;<br />
* '''Iterator:''' Traverse data in various ways (e.g., forward, backward, within a region, etc.);<br />
* '''Reader:''' A class that reads a single data object (e.g., image or mesh).<br />
* '''Region:''' A subset of a data object, such as an image region;<br />
* '''Source:''' A filter that initiates the data processing pipeline such as a reader or a procedural data generator;<br />
* '''Transform:''' Various types of transformations including affine and procedural;<br />
* '''Writer:''' A filter that terminates the data processing pipeline by writing data to disk or to a communications port.<br />
<br />
The naming of classes is an art form; please review existing names to catch the spirit of the naming convention. Example names include:<br />
<br />
* ShrinkImageFilter;<br />
* TriangleCell;<br />
* ScalarImageRegionIterator;<br />
* NeighborhoodIterator;<br />
* MapContainer;<br />
* DefaultImageTraits;<br />
* BackwardDifferenceOperator.<br />
<br />
=== Naming Modules ===<br />
Modules created within TubeTK should be named in the same manner ascribed to other TubeTK classes. The directories that the modules are constructed in should end in ''Module'' as well as the shared library build of the module. However, the standalone version of the module should omit ''Module'' from its name.<br />
<br />
=== Naming Files ===<br />
Files should have the same name as the class, with the namespace of the library prepended (e.g., ''tube''). Header files are named ''.h'', while implementation files are named either ''.cxx'' or ''.hxx'', depending on whether they are implementations of templated classes. It is important to note that VTK, ITK, and Qt classes fall under their respective namespaces and do not use the ''tube'' namespace.<br />
<br />
=== Naming Methods and Functions ===<br />
Global functions and class methods, either static or class members, are named beginning with a capital letter. The biggest challenge when naming methods and functions is to be consistent with existing names. For example, given the choice between ''ComputeBoundingBox( void )'' and ''CalculateBoundingBox( void )'' (''CalcBoundingBox( void )'' is not allowed because it is not spelled out), the choice is ''ComputeBoundingBox( void )'' because ''Compute'' is used elsewhere in the system for a similar circumstance. The concepts described previously should be used whenever possible.<br />
<br />
When referring to class methods and variables in code, an explicit ''this->'' pointer should be used, as in ''this->ComputeBoundingBox()''. The use of the explicit ''this->'' pointer helps clarify exactly which method, and where it originates, is being invoked. Similarly the ''::'' global namespace should be used when referring to a global function.<br />
<br />
=== Naming Class Data Members ===<br />
Class data members are prepended with ''m_'' as in ''m_Size''. This clearly indicates the origin of data members, and differentiates them from all other variables.<br />
<br />
=== Naming Local Variables ===<br />
Local variables begin in lowercase. There is more flexibility in the naming of local variables; please remember that others will study, maintain, fix, and extend your code. Any bread crumbs that you can drop in the way of explanatory variable names and comments will go a long way towards helping other developers.<br />
<br />
=== Naming Template Parameters ===<br />
Template parameters follow the usual rules with naming except that they should start with either the capital letter ''T'' or ''V''. Type parameters begin with the letter ''T'' while value template parameters begin with the letter ''V''.<br />
<br />
=== Naming Typedefs ===<br />
Typedefs are absolutely essential in generic programming. They significantly improve the readability of code, and facilitate the declaration of complex syntactic combinations. Unfortunately, creation of typedefs is tantamount to creating another programming language. Hence typedefs must be used in a consistent fashion.<br />
<br />
The general rule for typedef names is that they end in the word ''Type''. For example:<br />
<br />
typedef TPixel PixelType;<br />
<br />
However, there are many exceptions to this rule that recognize that TubeTK has several important concepts that are expressed partially in the names used to implement the concept. An iterator is a concept, as is a container or pointer. These concepts are used in preference to ''Type'' at the end of a typedef as appropriate. For example:<br />
<br />
typedef typename ImageTraits::PixelContainer PixelContainer;<br />
<br />
Here ''Container'' is a concept used in place of ''Type''.<br />
<br />
=== Using Underscores ===<br />
Do not use them. The only exception is when defining preprocessor variables and macros (which are discouraged). In this case, underscores are allowed to separate words.<br />
<br />
=== Preprocessor Directives ===<br />
Some of the worst code contains many preprocessor directives and macros. Do not use them except in a very limited sense (to support minor differences in compilers or operating systems). If a method makes extensive use of preprocessor directives, it is a candidate for separation into its own class.<br />
<br />
=== Unused Parameters and Shadowed Parameters ===<br />
Use the macros ''vtkNotUsed()'' and ''itkNotUsed()'' when implementing class member functions that have unused parameters. Warnings are treated as errors, and unused parameters will generate warnings. <br />
<br />
void SetSigma( double sigma, double itkNotUsed( extent ) )<br />
{<br />
...some code that does not use the parameter extent...<br />
}<br />
<br />
Shadowed parameters are particularly troublesome in that they often indicate code errors and ambiguities. Again, warnings are treated as errors, and shadowed variables will generate warnings.<br />
<br />
A common mistake is to give a variable larger scope than what it needs. To avoid this, define loop variables in the loop declaration:<br />
<br />
for( unsigned int i = 0; i < 100; ++i )<br />
{<br />
...loop stuff...<br />
}<br />
<br />
Following our naming conventions also helps avoid shadowed variables. In particular, make sure all member variables begin with '''m_''', functions begin with uppercase variables, and variables names are descriptive.<br />
<br />
=== Hidden Virtual Functions ===<br />
If a base class declares a function, then an instance of that function overloaded in subclasses must include a definition that has the same parameter arguments (signature). For example, if the base class function takes two doubles as arguments, and the derived class has an instance that takes only one double as an argument, then a warning (i.e., an error) is generated. You must also define an instance in the derived class that takes two arguments.<br />
<br />
=== New Line at End of File ===<br />
Some compilers will complain (generate a warning/error) if a file does not end with a new line. To be safe, make sure each file ends with a blank line.<br />
<br />
== Namespaces ==<br />
All classes that do not inherit from VTK, ITK, or Qt classes should be placed in the tube namespace. <br />
<br />
== Const Correctness ==<br />
Const correctness is important. Please use it as appropriate to your class or method.<br />
<br />
== Exception Handling ==<br />
Indicate that methods throw exceptions in the method declaration as in:<br />
<br />
const float * foo( void ) const throws std::exception<br />
<br />
== Code Layout and Indentation ==<br />
The following are the accepted TubeTK code layout rules and indentation style. After reading this section, you may wish to visit many of the source files found in ITK. This will help crystallize the rules described here.<br />
<br />
=== General Layout ===<br />
Each line of code should take no more than 80 characters. Break the code across multiple lines as necessary. Use lots of whitespace to separate logical blocks of code, intermixed with comments. To a large extent the structure of code directly expresses its implementation.<br />
<br />
==== Indentation and Tabs ====<br />
The appropriate indentation level is two spaces for each level of indentation. Do not use tabs. Set up your editor to insert spaces. Using tabs may look good in your editor but will wreak havoc in someone else's.<br />
<br />
[[File:VisualStudioTabsSpaces.png]]<br />
<br />
==== Declarations ====<br />
<br />
The declaration of variables within classes, methods, and functions should be one declaration per line.<br />
<br />
int i;<br />
int j;<br />
char * stringname;<br />
<br />
=== Spaces ===<br />
TubeTK, like ITK, makes liberal use of spaces to improve the readability of code. When in doubt, use a space. Common examples:<br />
<br />
* Separate expressions from their enclosing paren:<br />
if( a < b )<br />
{<br />
a = ( 1 + 1 ) / 2;<br />
}<br />
* Separate arguments from their enclosing paren and from other args (there should be a space after every comma):<br />
foo( int a )<br />
{<br />
foofoo( a );<br />
foofoofoo( a, b );<br />
}<br />
* Favor right-flush for lines that are continuations of previous lines:<br />
this->IsMyReallyLong()->ITK()<br />
->FunctionCall()<br />
* Use ( void ) when declaring a function that takes no arguments:<br />
int DoesNothing( void )<br />
{<br />
}<br />
* Use spaces before and after raw pointer declarations:<br />
int * a;<br />
* You do not need to use spaces when accessing raw pointers:<br />
a->b;<br />
*a = b;<br />
<br />
=== Keep It Simple ===<br />
Break complex methods into multiple lines. Program in a way that makes it easy for your code to be debugged by others. Examples:<br />
<br />
* ''?:'' statements should not be used instead of ''if...then'' statements;<br />
* Limit the variety of operators that appear in any one line of code.<br />
<br />
=== Includes ===<br />
* Only include the necessary files, no more;<br />
* Group includes per library;<br />
* Alphabetically sort files within groups;<br />
* Order groups from local to global;<br />
* Implementation files should include the header files first.<br />
<br />
=== Class Layout ===<br />
Classes are defined using the following guidelines:<br />
<br />
* Begin with ''#include'' guards;<br />
* Follow with the necessary includes. Include only what is necessary to avoid dependency problems;<br />
* Place the class in the correct namespace;<br />
* Public methods come first;<br />
* Protected methods follow;<br />
* Private members come last;<br />
* Public data members are forbidden.<br />
<br />
The class layout looks something like this:<br />
<br />
/*=========================================================================<br />
<br />
Library: TubeTK<br />
<br />
Copyright 2010 Kitware Inc. 28 Corporate Drive,<br />
Clifton Park, NY, 12065, USA.<br />
<br />
All rights reserved.<br />
<br />
Licensed under the Apache License, Version 2.0 (the "License");<br />
you may not use this file except in compliance with the License.<br />
You may obtain a copy of the License at<br />
<br />
http://www.apache.org/licenses/LICENSE-2.0<br />
<br />
Unless required by applicable law or agreed to in writing, software<br />
distributed under the License is distributed on an "AS IS" BASIS,<br />
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br />
See the License for the specific language governing permissions and<br />
limitations under the License.<br />
<br />
=========================================================================*/<br />
<br />
#ifndef __itktubeExampleImage_h<br />
#define __itktubeExampleImage_h<br />
<br />
#include <itkDefaultDataAccessor.h><br />
#include <itkDefaultImageTraits.h><br />
#include <itkImageBase.h><br />
#include <itkPixelTraits.h><br />
<br />
namespace itk<br />
{<br />
<br />
namespace tube<br />
{<br />
<br />
template< class TPixel, unsigned int VImageDimension = 2,<br />
class TImageTraits = DefaultImageTraits< TPixel, VImageDimension > ><br />
class ITK_EXPORT ExampleImage : public ImageBase< VImageDimension ><br />
{<br />
public:<br />
typedef ExampleImage Self;<br />
typedef ImageBase< VImageDimension > Superclass;<br />
typedef SmartPointer< Self > Pointer;<br />
typedef SmartPointer< const Self > ConstPointer;<br />
<br />
itkNewMacro( Self );<br />
itkTypeMacro( ExampleImage, ImageBase );<br />
<br />
....<br />
<br />
protected: <br />
ExampleImage( void );<br />
<br />
virtual ~ExampleImage( void )<br />
{<br />
}<br />
<br />
....<br />
<br />
private:<br />
ExampleImage( const Self & other );<br />
<br />
void operator=( const Self & other );<br />
<br />
....<br />
<br />
PixelContainerPointer m_Buffer<br />
<br />
....<br />
<br />
}; // End class ExampleImage<br />
<br />
} // End namespace tube<br />
<br />
} // End namespace itk<br />
<br />
#endif // End !defined(__itktubeExampleImage_h)<br />
<br />
=== Method Definitions ===<br />
Methods are defined across multiple lines. This is to accommodate the extremely long definitions possible when using templates. The starting and ending brace should be indented. For example:<br />
<br />
template< class TPixel, unsigned int VImageDimension, <br />
class TImageTraits ><br />
const double * <br />
ExampleImage< TPixel, VImageDimension, TImageTraits ><br />
::GetSpacing( void ) const<br />
{<br />
...<br />
}<br />
<br />
The first line is the template declaration. The second line is the method return type. The third line is the class qualifier. And the fourth line in the example above is the name of the method.<br />
<br />
=== Use of Braces { } === <br />
Braces must be used to delimit the scope of an ''if'', ''for'', ''while'', ''switch'', or other control structure. Braces are placed on a line by themselves:<br />
<br />
for( unsigned int i = 0; i < 3; ++i )<br />
{<br />
...<br />
}<br />
<br />
or when using an ''if'':<br />
<br />
if( condition )<br />
{<br />
...<br />
}<br />
else if( other condition )<br />
{<br />
...<br />
}<br />
else<br />
{<br />
....<br />
}<br />
<br />
=== Use of vnl and accessing vnl matrix and vector elements === <br />
<br />
We favor the direct use of vnl for mathematics in TubeTK. ITK methods can also be used when the elements are ITK constructs, but the direct use of vnl is encouraged when the context is neutral.<br />
<br />
When accessing vnl_matrix elements, we recommend the use of parenthesis when accessing a matrix element, and the use of get_column and set_column member functions when accessing rows and columns. In general, the least ambiguous form should be chosen in any context.<br />
<br />
When accessing vnl_vector elements, parenthesis or brackets may be used - typically dictated by code flow / context.<br />
<br />
== Doxygen Documentation System ==<br />
[http://www.doxygen.org Doxygen] is an open-source system for automatically generating documentation from source code. To use Doxygen effectively, the developer must insert comments, delimited in a special way, that Doxygen extracts to produce the documentation. While there are a large number of options to Doxygen, developers at a minimum should insert the following Doxygen commands.<br />
<br />
=== Documenting a Class ===<br />
Classes should be documented using the ''\class'' and ''\brief'' Doxygen commands, followed by the detailed class description:<br />
<br />
/**<br />
* \class Object<br />
* \brief Base class for most itk classes.<br />
*<br />
* Object is the second-highest level base class for most itk objects.<br />
* It extends the base object functionality of LightObject by<br />
* implementing debug flags/methods and modification time tracking.<br />
*/<br />
<br />
=== Documenting a Method ===<br />
Methods should be documented using the following comment block style as shown in the following example:<br />
<br />
/**<br />
* Access a pixel. This version can be an lvalue.<br />
*/<br />
TPixel & operator[]( const IndexType & index )<br />
{ <br />
return this->GetPixel( index ); <br />
}<br />
<br />
The key here is that the comment starts with ''/**'', each subsequent line has an aligned ''*'', and the comment block terminates with a ''*/''.<br />
<br />
= Testing =<br />
Each developer should do his or her part to aid in testing process. It is generally accepted that each developer should write proper unit tests using CTest and those tests will be run on nightly and continuous dashboards.<br />
<br />
== Dashboards ==<br />
* [http://open.cdash.org/index.php?project=TubeTK CDash Dashboards] are maintained for all platforms;<br />
* Warnings are not tolerated;<br />
* Failing tests are preferred over disabling tests or using case/system-specific hacks for solutions. The best answer is to fix the code.<br />
<br />
== Releases ==<br />
Before each product release, a battery of testing (specified on the project wiki) will be carried out to check for regressions not caught by traditional unit testing. Release version naming convention:<br />
* ''MajorReleaseNumber.MinorReleaseNumber.PatchReleaseNumber'';<br />
* These variables are controlled in the top-level ''CMakeLists.txt'' file. They apply to all applications within TubeTK.<br />
<br />
= Code Coverage =<br />
Code coverage is responsibility of all developers.<br />
<br />
= Memory Leaks =<br />
Memory leaks must be plugged. A list of leaks and memory defects can be found on the [http://open.cdash.org/index.php?project=TubeTK Dashboard] under the ''Dynamic Analysis'' section. Clicking on the ''Defect Count'' will show further information.<br />
<br />
A script is available for Linux and OS X to help debug the memory leaks. It can generate the same output present on the dashboard on demand for a subset of tests. The command<br />
<br />
''./TubeTK/Utilities/Valgrind/runValgrind.sh -h''<br />
<br />
shows full usage instructions. Essentially install ''valgrind'' and ''xsltproc'', then execute the ''runValgrind.sh'' script from ''TubeTK-Build'' with arguments such as<br />
<br />
''-R leakyTubeTestName''.<br />
<br />
= Git repo management =<br />
<br />
Create a fork in your github account, and perform pull requests.<br />
<br />
* [https://help.github.com/articles/fork-a-repo Fork the Github repo for TubeTK]<br />
<br />
= Optimizing code in Linux =<br />
<br />
* [[TubeTK/Code Optimization in Linux|Code Optimization in Linux]]<br />
<br />
[[Category:TubeTK|Developers Guide]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK&diff=59436TubeTK2016-05-09T12:31:28Z<p>Aylward: /* Overview */</p>
<hr />
<div>__NOTITLE__<br />
__NOTOC__<br />
<br />
{| border="1" cellpadding="10" cellspacing="0"<br />
|+ [[image:TubeTK_Header.jpg|1000px|TubeTK]]<br />
|-<br />
| style="background:#efefef;" align="left" valign="top" width="150px" | <br />
<br />
'''[[TubeTK|Home]]'''<br />
*[[TubeTK/About|About]]<br />
*[[TubeTK/Images|Image Gallery]]<br />
*[[TubeTK/Data|Data and Publications]]<br />
<br><br />
----<br />
<br><br />
'''For Users'''<br />
* [[TubeTK/Installation|Installation]]<br />
* [[TubeTK/Documentation|Methods & Apps]]<br />
* [[TubeTK/Slicer|TubeTK with 3D Slicer]]<br />
* [[TubeTK/OsiriX|TubeTK with OsiriX]]<br />
<br><br />
----<br />
<br><br />
'''For Developers'''<br />
* [[TubeTK/Development|Development Docs]]<br />
<br><br />
----<br />
<br><br />
'''[https://github.com/TubeTK/TubeTK/issues Report Bugs<br>Request Features]'''<br />
<br><br />
<br><br />
----<br />
<br><br />
'''[[TubeTK/Contact|Contact Us]]'''<br />
<br />
| align="left" width="800px" | <br />
= Overview =<br />
<br />
TubeTK is being developed to host algorithms for applications involving images of tubes (blood vessel in medical images, roads in satellite images, etc.). It also offers methods for handling other geometries (points, surfaces, and densities) in images. <br />
<br />
By focusing on local geometric structure, the algorithms are able to accomplish segmentations, registrations, and other analyses that consider the physicial properties of objects and their variations, while not requiring limiting assumptions on the specific arrangement or general shape of the objects in the images. We are applying these techniques to push image understanding in new directions such as:<br />
# registration of abdominal images even when organs slides against one another<br />
# forming statistical atlases of intra-canrial vessel network topology even when that topology changes between subjects<br />
# segmentation of arbitrary objects in images even when intensity statistics of those objects, and the objects around them, vary from image to image.<br />
<br />
At this time TubeTK is targeted for<br />
# Software developers who wish to write code to integrate our algorithms into their applications<br />
# Researchers who can write bash and other scripts to string together TubeTK's command-line tools<br />
<br />
TubeTK offers various interface layers:<br />
* '''TubeTK/Base:''' This is the algorithms library. It is the lowest level of access to the methods of TubeTK. It is only available via C++, and it requires considerable expertise to effectively combine and call its methods to do anything useful. Iterfacing directly with these algorithms is not recommended and is not well supported. Unit-level testing is performed continuously on these methods.<br />
* '''TubeTK/ITKModules:''' This is the ITK interface to select methods in TubeTK/Base. This level of interface is intended for ITK users and Python scripts writers. The methods exposed represent a level of modularization that invites experimentation, integration with other toolkits (e.g., Scikit-Learn), and development of processing pipelines that accomplish significant image analysis goals. The interface is available as an ITK Extension and thereby available via Python using Wrapped ITK.<br />
* '''TubeTK/Applications:''' These are the command-line interface (CLI) equivalents to the methods available via TubeTK/ITKModules. This is intended for bash, bat, and other system-call scripts. The level of modularization and intended users are similar to those of TubeTK/ITKModules. C++ and python-based CLIs are provided. Continuous, unit-level testing of TubeTK/ITKModules is provided via these applications.<br />
* '''TubeTK/Experiments:''' These are Python Jupyter notebooks that combine many TubeTK/ITKModules into Python scripts that show how to accomplish high-level image analysis goals with TubeTK. They are intended to be an interactive basis for exploring TubeTK. Python and Jypter notebooks packages must be installed on your computer to run these. These can also be (and are) run as tests to check performance (whereas the unit-level tests focus on regression).<br />
* '''TubeTK/SlicerModules:''' These are Slicer modules that combine many of the TubeTK/ITKMoudles into Slicer elements that accomplish select high-level image analysis tasks using TubeTK.<br />
<br />
If you have questions regarding or suggestions for improving TubeTK, please do not hesitate to [[TubeTK/Contact|contact the development team]].<br />
<br />
== Features ==<br />
* Centerline vascular segmentation<br />
* Vascular atlas formation<br />
* Vascular network to image registration<br />
* Organ segmentation<br />
* Vascular-ness measures<br />
* Multi-modality support<br />
<br />
== Driving Applications ==<br />
* [[NeuralNav | NeuralNav: Brain tumor resection guidance via intra-operative registration]]<br />
* Diagnosis of retinopathy of prematurity<br />
* Analysis of vascular differences within and between populations to identify focal (e.g., stroke) and diffuse (e.g., schizophrenia) diseases.<br />
* Vascular atlas formation<br />
* Radiofrequency ablation guidance via intra-operative registration of pre-op CT with intra-op Ultrasound<br />
* Quantifying tumor micro-environments<br />
<br />
== Technical Focus ==<br />
<br />
* [[TubeTK/Vascular_Pattern_Analysis | Vascular pattern analysis]] is the characterization and comparison of individuals and populations based on "spatial graphs" as representations of vascular networks.<br />
* [[TubeTK/Sliding_Organ_Registration | Sliding organ registration]] are methods for registering images of multiple organs in which the organs may have shifted, expanded, or compressed independently.<br />
* [[TubeTK/Intra-operative_Ultrasound_Registration | Intra-operative ultrasound registration]] is the grand challenge of real-time transcription of pre-operative surgical plans into intra-operative ultrasound images.<br />
<br />
== Acknowledgement ==<br />
<br />
If you find TubeTK useful for your work and publications, please include a reference to this website and to<br />
* S. R. Aylward and E. Bullitt, “Initialization, noise, singularities, and scale in height ridge traversal for tubular object centerline extraction,” Medical Imaging, IEEE Transactions on, vol. 21, no. 2, pp. 61–75, 2002.<br />
Thank you!<br />
<br />
== External Links ==<br />
<br />
* [http://open.cdash.org/index.php?project=TubeTK TubeTK Dashboard]<br />
* [https://github.com/KitwareMedical/TubeTK/issues TubeTK GitHub Issues]<br />
* [https://github.com/KitwareMedical/TubeTK TubeTK GitHub Repository]<br />
* [http://midas3.kitware.com/midas/community/7 TubeTK Midas Platform Community]<br />
* [https://github.com/KitwareMedical KitwareMedical GitHub]<br />
<br />
<br />
[[Category:TubeTK|*]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59316TubeTK/Build Instructions2016-03-30T15:29:25Z<p>Aylward: </p>
<hr />
<div>There are two ways of building TubeTK:<br />
<br />
* (Option 1) Slicer-Dependent Build<br />
* (Option 2) Stand-Alone Build<br />
<br />
If you are going to use TubeTK as a library for building your own C++ programs or for processing data using the command-line or scripts, it is sufficient to build TubeTK as a (Option 2) Stand-Alone Build.<br />
<br />
If you want a graphical user interface (albeit to a limited subset of TubeTK's methods), you should follow the (Option 1) Slicer-Dependent Build instructions.<br />
<br />
= (Option 1) Slicer-Dependent Build =<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= (Option 2) Stand-Alone Build =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59315TubeTK/Build Instructions2016-03-30T15:28:26Z<p>Aylward: /* (Option 1) Slicer-Dependent Build */</p>
<hr />
<div>There are two ways of building TubeTK:<br />
<br />
* (Option 1) Slicer-Dependent Build<br />
* (Option 2) Stand-Alone Build<br />
<br />
If you are going to use TubeTK as a library for building your own C++ programs, from the command-line, or from within scripts; it is sufficient to build TubeTK as a (Option 2) Stand-Alone Build.<br />
<br />
If you want a graphical user interface (albeit to a limited subset of TubeTK's methods), you should follow the (Option 1) Slicer-Dependent Build instructions.<br />
<br />
= (Option 1) Slicer-Dependent Build =<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= (Option 2) Stand-Alone Build =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59314TubeTK/Build Instructions2016-03-30T15:23:02Z<p>Aylward: /* Stand-Alone Build */</p>
<hr />
<div>= (Option 1) Slicer-Dependent Build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= (Option 2) Stand-Alone Build =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59313TubeTK/Build Instructions2016-03-30T15:22:45Z<p>Aylward: /* Slicer-dependent build */</p>
<hr />
<div>= (Option 1) Slicer-Dependent Build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone Build =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59312TubeTK/Build Instructions2016-03-30T15:22:21Z<p>Aylward: /* Stand-Alone */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone Build =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59311TubeTK/Build Instructions2016-03-30T15:21:47Z<p>Aylward: /* Configure */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59310TubeTK/Build Instructions2016-03-30T15:21:31Z<p>Aylward: /* Configure */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59309TubeTK/Build Instructions2016-03-30T15:20:14Z<p>Aylward: /* Configure */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Linux and Mac only, set the CMake variables:<br />
* CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59308TubeTK/Build Instructions2016-03-30T15:19:15Z<p>Aylward: /* Configure */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59307TubeTK/Build Instructions2016-03-30T15:17:53Z<p>Aylward: /* Install Requirements and Options */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
* Mac<br />
** git is included with MacOS<br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
* Windows<br />
** Pre-compiled version of numpy, scipy, etc are available as wheels at:<br />
http://www.lfd.uci.edu/~gohlke/pythonlibs/<br />
** Using these wheels is recommended over Anaconda and other installation packages, because they also include and expose versions of Qt (for example) that are incompatible with Slicer and TubeTK.<br />
* Linux and Mac<br />
** Python is already included with most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59306TubeTK/Build Instructions2016-03-30T15:13:18Z<p>Aylward: /* CMake */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59305TubeTK/Build Instructions2016-03-30T15:13:03Z<p>Aylward: /* Install Requirements and Options */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
* CMake 3.0 or greater is required.<br />
** The Mac/Windows binaries can be downloaded from http://cmake.org<br />
** The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== GIT ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
QT version 4.8.6 or 4.8.7 is REQUIRED.<br />
* Windows<br />
** You will want the 64-bit version of Qt, with WebKIT support. See details at:<br />
http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== CMake ===<br />
CMake 3.0 or greater is required.<br />
* The Mac/Windows binaries can be downloaded from http://cmake.org<br />
* The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59304TubeTK/Build Instructions2016-03-30T15:07:55Z<p>Aylward: /* Linux and OS X */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
* CMake 3.0 or greater is required.<br />
** The Mac/Windows binaries can be downloaded from http://cmake.org<br />
** The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
* INITIAL BUILD: Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** <code> cd TubeTK-Release </code><br />
** <code> make -j8 </code><br />
* SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated in the subdir TubeTK-Release/TubeTK-build. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
** <code> cd TubeTK-Release/TubeTK-build </code><br />
** <code> make -j8 </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59303TubeTK/Build Instructions2016-03-30T15:06:08Z<p>Aylward: /* Windows */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
* CMake 3.0 or greater is required.<br />
** The Mac/Windows binaries can be downloaded from http://cmake.org<br />
** The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** INITIAL BUILD: Perform the initial build using the TubeTK.sln file at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
** SUBSEQUENT BUILDS: Subsequent builds <b>MUST</b> be initiated using the TubeTK.sln file in the subdir <b>TubeTK-Release/TubeTK-build</b>. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Choose your build type: Release, Debug, etc. It MUST match the build type chosen for Slicer.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59302TubeTK/Build Instructions2016-03-30T15:01:15Z<p>Aylward: /* Configure */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
* CMake 3.0 or greater is required.<br />
** The Mac/Windows binaries can be downloaded from http://cmake.org<br />
** The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located. We recommend using a cmake with a GUI configuration editor. This is the default on Windows and Mac. On Linux (or from Mac command-line) type:<br />
* <code> cmake-gui ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
* Linux and Mac only, also set:<br />
** CMAKE_BUILD_TYPE = <same build type as Slicer installation: Debug or Release><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=59301TubeTK/Build Instructions2016-03-30T13:53:43Z<p>Aylward: /* Install Requirements and Options */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake ===<br />
* CMake 3.0 or greater is required.<br />
** The Mac/Windows binaries can be downloaded from http://cmake.org<br />
** The linux installation from source is easiest. Assuming an older version of cmake is already installed, and you want to install v3.4.1, do the following:<br />
sudo apt-get build-dep cmake<br />
sudo apt-get install libgtkmm-2.4-dev glade-gtk2 libglademm-2.4-dev<br />
git clone http://github.com:/Kitware/CMake.git<br />
cd CMake<br />
git checkout v3.4.1<br />
cd ..<br />
mkdir CMake-Release<br />
cd CMake-Release<br />
cmake ../CMake -DCMAKE_BUILD_TYPE=Release<br />
make -j8<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
<b>Notes:</b><br />
* To address the multiple dependencies required (and optional) for VTK, we recommend installing the build dependencies of ParaView prior to building Slicer:<br />
sudo apt-get build-dep paraview<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
<b>Notes:</b><br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=File:VisualStudioTabsSpaces.png&diff=58621File:VisualStudioTabsSpaces.png2015-12-19T16:56:04Z<p>Aylward: </p>
<hr />
<div></div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Developers_Guide&diff=58620TubeTK/Developers Guide2015-12-19T16:54:17Z<p>Aylward: /* General Layout */</p>
<hr />
<div>= TubeTK Developer's Guide =<br />
Created February 1, 2010.<br />
<br />
= Purpose =<br />
The following document is a description of the accepted coding style for TubeTK. Developers who wish to contribute code to TubeTK should read and adhere to the standards described here.<br />
<br />
= Document Overview = <br />
This document is organized into the following sections:<br />
<br />
* '''System Overview and Philosophy:''' Coding methodologies and motivation for the resulting style;<br />
* '''Copyright:''' The copyright header to be included in all files and other copyright issues;<br />
* '''File Organization:''' How to organize source code;<br />
* '''Naming Conventions:''' Patterns used to name classes, variables, template parameters, and instance variables;<br />
* '''Namespaces:''' The use of namespaces;<br />
* '''Code Layout and Indentation:''' Accepted standards for arranging code including indentation style;<br />
* '''Exception Handling:''' How to add exception handling to the system;<br />
* '''Documentation Style:''' A brief section describing the documentation philosophy used within TubeTK.<br />
<br />
This style guide is an evolving document. Please confer with the TubeTK development team if you wish to add, modify, or delete the rules described in these guidelines.<br />
<br />
= Style Guidelines =<br />
The following coding-style guidelines are to be used in development of the TubeTK. To a large extent these guidelines are a result of the fundamental architectural and implementation decisions made early in the TubeTK project. For example, the decision was made to implement TubeTK with a C++ core using principles of generic programming, so the rules are oriented towards this style of implementation. Some guidelines are relatively arbitrary, such as indentation levels and style. However, an attempt was made to find coding styles consistent with accepted practices. The point is to adhere to a common style to assist developers and users of the future learn, use, maintain, and extend TubeTK.<br />
<br />
Please do your best to be a upstanding member of the TubeTK team. The rules described here have been developed with the team as a whole in mind. If you consistently violate these rules you will likely be harassed mercilessly, first privately and then publicly. If this does not result in correct code layout, your right to Git write access (if you are developer and wish to contribute code) may be removed. Similarly, if you wish to contribute code and are not a developer, your code will not be accepted until the style is consistent with these guidelines.<br />
<br />
== System Overview and Philosophy ==<br />
The following implementation strategies have been adopted by the TubeTK team. These directly and indirectly affect the resulting code style. Understanding these strategies motivate the reasons for many of the style guidelines described in this document.<br />
<br />
=== Implementation Language === <br />
The core implementation language is C++. C++ was chosen for its flexibility, performance, and familiarity to team members. The toolkit uses the full spectrum of C++ features including const and volatile correctness, namespaces, partial template specialization, operator overloading, traits, and iterators.<br />
<br />
=== Generic Programming and the STL ===<br />
Compile-time binding using methods of generic programming and template instantiation is the preferred implementation style. This approach has demonstrated its ability to create efficient, flexible code. Use of the Standard Template Library (STL) is encouraged. In contrast with many libraries, STL containers are the acceptable for passing collections of data between public and private member functions. The STL is typically used by a class, rather than as serving as a base class for derivation of classes. <br />
<br />
=== Portability ===<br />
Most applications as well as the core of the toolkit are designed to compile on a set of target operating system/compiler combinations. These combinations are:<br />
<br />
* Linux with GCC;<br />
* Microsoft Windows XP with Microsoft Visual C++ (released within the past five years);<br />
* OS X with Clang or GCC;<br />
* Other Unix systems with GCC.<br />
<br />
Some applications and modules make use of specific GPU configurations to optimize certain calculations. These vary according to system, but there shall always be an unoptimized implementation that will comply to the above portablity standards.<br />
<br />
=== VTK and ITK ===<br />
TubeTK makes extensive use of both the Visualization Toolkit (VTK) and the Insight Toolkit (ITK). Image processing features added to TubeTK should prefer ITK constructs over those of VTK. When visualization-geared code is written for TubeTK, VTK should be favored. <br />
<br />
=== 3D Slicer ===<br />
TubeTK is intended to be use in conjunction with [http://www.slicer.org 3D Slicer], version 4. TubeTK Modules conform to the execution model used by the 3D Slicer project. For more information regarding bundling 3D Slicer extensions see the [http://www.slicer.org/slicerWiki/index.php/Documentation/4.2/Developers/Tutorials/BuildTestPackageDistributeExtensions 3D Slicer documentation pages].<br />
<br />
=== CMake Build Environment ===<br />
The TubeTK build environment is CMake. CMake is an open-source, advanced cross-platform build system that enables developers to write simple ''makefiles'' (named ''CMakeLists.txt'') that are processed to generated native build tools for a particular operating system/compiler combinations. See the [http://www.cmake.org CMake web pages] at for more information.<br />
<br />
=== Tool and Library Versions ===<br />
Because of the agile nature of TubeTK developement, the TubeTK team uses developement versions of CMake, ITK, VTK, 3D Slicer, along with a recent stable version of Qt.<br />
<br />
These are the most important factors influencing the coding style found in TubeTK. Now we will look at the details.<br />
<br />
=== Copyright ===<br />
<br />
== File Organization ==<br />
Classes are created and organized into a single class per file set. A file set consists of ''.h'' header file, ''.cxx'' implementation file, and/or a ''.hxx'' templated implementation file. Helper classes may also be defined in the file set, typically these are not visible to the system at large, or placed into a special namespace.<br />
<br />
Source files must be placed in the correct directory for logical consistency with the rest of the system, and to avoid cyclic dependencies. The TubeTK source directory structure is divided into several directories below ''TubeTK''. Please consult the TubeTK team before creating any new directories with TubeTK. Directories containing source are arranged as follows:<br />
<br />
* '''TubeTK/Applications:''' TubeTK/Applications consists of subdirectories for each TubeTK application. No application should depend upon another in any way;<br />
* '''TubeTK/Base''';<br />
* '''TubeTK/SlicerModules'''.<br />
<br />
== Naming conventions ==<br />
In general:<br />
<br />
* Names are constructed by using case change to indicate separate words, as in ''TimeStamp'' (versus ''Time_Stamp''). Underscores are not used.<br />
* Variable names are chosen carefully with the intention to convey the meaning behind the code. <br />
* Names are generally spelled out; use of abbreviations is discouraged. (Abbreviation are allowable when in common use, and should be in uppercase as in RGB.) While this does result in long names, it self-documents the code. If you learn how to use name completion in your editor (e.g., ''vim'' or ''emacs''), this inconvenience can be minimized. <br />
<br />
Depending on whether the name is a class, file, variable, or other name, variations on this theme result as explained in the following subsections.<br />
<br />
=== Naming Classes ===<br />
Classes are named beginning with a capital letter. Classes are placed in the appropriate namespace, typically tube:: or itk::tube (see namespaces below). Classes are named according to the following general rule:<br />
<br />
''class name = <algorithm><input><concept>''<br />
<br />
In this formula, the name of the algorithm or process (possibly with an associated adjective or adverb) comes first, followed by an input type, and completed by a concept name. A concept is an informal classification describing what a class does. There are many concepts in TubeTK, here are a few of them:<br />
<br />
* '''Filter:''' A class that participates in the data processing pipeline. Filters typically take one or more inputs and produce one or more outputs;<br />
* '''Iterator:''' Traverse data in various ways (e.g., forward, backward, within a region, etc.);<br />
* '''Reader:''' A class that reads a single data object (e.g., image or mesh).<br />
* '''Region:''' A subset of a data object, such as an image region;<br />
* '''Source:''' A filter that initiates the data processing pipeline such as a reader or a procedural data generator;<br />
* '''Transform:''' Various types of transformations including affine and procedural;<br />
* '''Writer:''' A filter that terminates the data processing pipeline by writing data to disk or to a communications port.<br />
<br />
The naming of classes is an art form; please review existing names to catch the spirit of the naming convention. Example names include:<br />
<br />
* ShrinkImageFilter;<br />
* TriangleCell;<br />
* ScalarImageRegionIterator;<br />
* NeighborhoodIterator;<br />
* MapContainer;<br />
* DefaultImageTraits;<br />
* BackwardDifferenceOperator.<br />
<br />
=== Naming Modules ===<br />
Modules created within TubeTK should be named in the same manner ascribed to other TubeTK classes. The directories that the modules are constructed in should end in ''Module'' as well as the shared library build of the module. However, the standalone version of the module should omit ''Module'' from its name.<br />
<br />
=== Naming Files ===<br />
Files should have the same name as the class, with the namespace of the library prepended (e.g., ''tube''). Header files are named ''.h'', while implementation files are named either ''.cxx'' or ''.hxx'', depending on whether they are implementations of templated classes. It is important to note that VTK, ITK, and Qt classes fall under their respective namespaces and do not use the ''tube'' namespace.<br />
<br />
=== Naming Methods and Functions ===<br />
Global functions and class methods, either static or class members, are named beginning with a capital letter. The biggest challenge when naming methods and functions is to be consistent with existing names. For example, given the choice between ''ComputeBoundingBox( void )'' and ''CalculateBoundingBox( void )'' (''CalcBoundingBox( void )'' is not allowed because it is not spelled out), the choice is ''ComputeBoundingBox( void )'' because ''Compute'' is used elsewhere in the system for a similar circumstance. The concepts described previously should be used whenever possible.<br />
<br />
When referring to class methods and variables in code, an explicit ''this->'' pointer should be used, as in ''this->ComputeBoundingBox()''. The use of the explicit ''this->'' pointer helps clarify exactly which method, and where it originates, is being invoked. Similarly the ''::'' global namespace should be used when referring to a global function.<br />
<br />
=== Naming Class Data Members ===<br />
Class data members are prepended with ''m_'' as in ''m_Size''. This clearly indicates the origin of data members, and differentiates them from all other variables.<br />
<br />
=== Naming Local Variables ===<br />
Local variables begin in lowercase. There is more flexibility in the naming of local variables; please remember that others will study, maintain, fix, and extend your code. Any bread crumbs that you can drop in the way of explanatory variable names and comments will go a long way towards helping other developers.<br />
<br />
=== Naming Template Parameters ===<br />
Template parameters follow the usual rules with naming except that they should start with either the capital letter ''T'' or ''V''. Type parameters begin with the letter ''T'' while value template parameters begin with the letter ''V''.<br />
<br />
=== Naming Typedefs ===<br />
Typedefs are absolutely essential in generic programming. They significantly improve the readability of code, and facilitate the declaration of complex syntactic combinations. Unfortunately, creation of typedefs is tantamount to creating another programming language. Hence typedefs must be used in a consistent fashion.<br />
<br />
The general rule for typedef names is that they end in the word ''Type''. For example:<br />
<br />
typedef TPixel PixelType;<br />
<br />
However, there are many exceptions to this rule that recognize that TubeTK has several important concepts that are expressed partially in the names used to implement the concept. An iterator is a concept, as is a container or pointer. These concepts are used in preference to ''Type'' at the end of a typedef as appropriate. For example:<br />
<br />
typedef typename ImageTraits::PixelContainer PixelContainer;<br />
<br />
Here ''Container'' is a concept used in place of ''Type''.<br />
<br />
=== Using Underscores ===<br />
Do not use them. The only exception is when defining preprocessor variables and macros (which are discouraged). In this case, underscores are allowed to separate words.<br />
<br />
=== Preprocessor Directives ===<br />
Some of the worst code contains many preprocessor directives and macros. Do not use them except in a very limited sense (to support minor differences in compilers or operating systems). If a method makes extensive use of preprocessor directives, it is a candidate for separation into its own class.<br />
<br />
=== Unused Parameters and Shadowed Parameters ===<br />
Use the macros ''vtkNotUsed()'' and ''itkNotUsed()'' when implementing class member functions that have unused parameters. Warnings are treated as errors, and unused parameters will generate warnings. <br />
<br />
void SetSigma( double sigma, double itkNotUsed( extent ) )<br />
{<br />
...some code that does not use the parameter extent...<br />
}<br />
<br />
Shadowed parameters are particularly troublesome in that they often indicate code errors and ambiguities. Again, warnings are treated as errors, and shadowed variables will generate warnings.<br />
<br />
A common mistake is to give a variable larger scope than what it needs. To avoid this, define loop variables in the loop declaration:<br />
<br />
for( unsigned int i = 0; i < 100; ++i )<br />
{<br />
...loop stuff...<br />
}<br />
<br />
Following our naming conventions also helps avoid shadowed variables. In particular, make sure all member variables begin with '''m_''', functions begin with uppercase variables, and variables names are descriptive.<br />
<br />
=== Hidden Virtual Functions ===<br />
If a base class declares a function, then an instance of that function overloaded in subclasses must include a definition that has the same parameter arguments (signature). For example, if the base class function takes two doubles as arguments, and the derived class has an instance that takes only one double as an argument, then a warning (i.e., an error) is generated. You must also define an instance in the derived class that takes two arguments.<br />
<br />
=== New Line at End of File ===<br />
Some compilers will complain (generate a warning/error) if a file does not end with a new line. To be safe, make sure each file ends with a blank line.<br />
<br />
== Namespaces ==<br />
All classes that do not inherit from VTK, ITK, or Qt classes should be placed in the tube namespace. <br />
<br />
== Const Correctness ==<br />
Const correctness is important. Please use it as appropriate to your class or method.<br />
<br />
== Exception Handling ==<br />
Indicate that methods throw exceptions in the method declaration as in:<br />
<br />
const float * foo( void ) const throws std::exception<br />
<br />
== Code Layout and Indentation ==<br />
The following are the accepted TubeTK code layout rules and indentation style. After reading this section, you may wish to visit many of the source files found in ITK. This will help crystallize the rules described here.<br />
<br />
=== General Layout ===<br />
Each line of code should take no more than 80 characters. Break the code across multiple lines as necessary. Use lots of whitespace to separate logical blocks of code, intermixed with comments. To a large extent the structure of code directly expresses its implementation.<br />
<br />
==== Indentation and Tabs ====<br />
The appropriate indentation level is two spaces for each level of indentation. Do not use tabs. Set up your editor to insert spaces. Using tabs may look good in your editor but will wreak havoc in someone else's.<br />
<br />
[[File:VisualStudioTabsSpaces.png]]<br />
<br />
==== Declarations ====<br />
<br />
The declaration of variables within classes, methods, and functions should be one declaration per line.<br />
<br />
int i;<br />
int j;<br />
char * stringname;<br />
<br />
=== Spaces ===<br />
TubeTK, like ITK, makes liberal use of spaces to improve the readability of code. When in doubt, use a space. Common examples:<br />
<br />
* Separate expressions from their enclosing paren:<br />
if( a < b )<br />
{<br />
a = ( 1 + 1 ) / 2;<br />
}<br />
* Separate arguments from their enclosing paren and from other args (there should be a space after every comma):<br />
foo( int a )<br />
{<br />
foofoo( a );<br />
foofoofoo( a, b );<br />
}<br />
* Favor right-flush for lines that are continuations of previous lines:<br />
this->IsMyReallyLong()->ITK()<br />
->FunctionCall()<br />
* Use ( void ) when declaring a function that takes no arguments:<br />
int DoesNothing( void )<br />
{<br />
}<br />
* Use spaces before and after raw pointer declarations:<br />
int * a;<br />
* You do not need to use spaces when accessing raw pointers:<br />
a->b;<br />
*a = b;<br />
<br />
=== Keep It Simple ===<br />
Break complex methods into multiple lines. Program in a way that makes it easy for your code to be debugged by others. Examples:<br />
<br />
* ''?:'' statements should not be used instead of ''if...then'' statements;<br />
* Limit the variety of operators that appear in any one line of code.<br />
<br />
=== Includes ===<br />
* Only include the necessary files, no more;<br />
* Group includes per library;<br />
* Alphabetically sort files within groups;<br />
* Order groups from local to global;<br />
* Implementation files should include the header files first.<br />
<br />
=== Class Layout ===<br />
Classes are defined using the following guidelines:<br />
<br />
* Begin with ''#include'' guards;<br />
* Follow with the necessary includes. Include only what is necessary to avoid dependency problems;<br />
* Place the class in the correct namespace;<br />
* Public methods come first;<br />
* Protected methods follow;<br />
* Private members come last;<br />
* Public data members are forbidden.<br />
<br />
The class layout looks something like this:<br />
<br />
/*=========================================================================<br />
<br />
Library: TubeTK<br />
<br />
Copyright 2010 Kitware Inc. 28 Corporate Drive,<br />
Clifton Park, NY, 12065, USA.<br />
<br />
All rights reserved.<br />
<br />
Licensed under the Apache License, Version 2.0 (the "License");<br />
you may not use this file except in compliance with the License.<br />
You may obtain a copy of the License at<br />
<br />
http://www.apache.org/licenses/LICENSE-2.0<br />
<br />
Unless required by applicable law or agreed to in writing, software<br />
distributed under the License is distributed on an "AS IS" BASIS,<br />
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br />
See the License for the specific language governing permissions and<br />
limitations under the License.<br />
<br />
=========================================================================*/<br />
<br />
#ifndef __itktubeExampleImage_h<br />
#define __itktubeExampleImage_h<br />
<br />
#include <itkDefaultDataAccessor.h><br />
#include <itkDefaultImageTraits.h><br />
#include <itkImageBase.h><br />
#include <itkPixelTraits.h><br />
<br />
namespace itk<br />
{<br />
<br />
namespace tube<br />
{<br />
<br />
template< class TPixel, unsigned int VImageDimension = 2,<br />
class TImageTraits = DefaultImageTraits< TPixel, VImageDimension > ><br />
class ITK_EXPORT ExampleImage : public ImageBase< VImageDimension ><br />
{<br />
public:<br />
typedef ExampleImage Self;<br />
typedef ImageBase< VImageDimension > Superclass;<br />
typedef SmartPointer< Self > Pointer;<br />
typedef SmartPointer< const Self > ConstPointer;<br />
<br />
itkNewMacro( Self );<br />
itkTypeMacro( ExampleImage, ImageBase );<br />
<br />
....<br />
<br />
protected: <br />
ExampleImage( void );<br />
<br />
virtual ~ExampleImage( void )<br />
{<br />
}<br />
<br />
....<br />
<br />
private:<br />
ExampleImage( const Self & other );<br />
<br />
void operator=( const Self & other );<br />
<br />
....<br />
<br />
PixelContainerPointer m_Buffer<br />
<br />
....<br />
<br />
}; // End class ExampleImage<br />
<br />
} // End namespace tube<br />
<br />
} // End namespace itk<br />
<br />
#endif // End !defined(__itktubeExampleImage_h)<br />
<br />
=== Method Definitions ===<br />
Methods are defined across multiple lines. This is to accommodate the extremely long definitions possible when using templates. The starting and ending brace should be indented. For example:<br />
<br />
template< class TPixel, unsigned int VImageDimension, <br />
class TImageTraits ><br />
const double * <br />
ExampleImage< TPixel, VImageDimension, TImageTraits ><br />
::GetSpacing( void ) const<br />
{<br />
...<br />
}<br />
<br />
The first line is the template declaration. The second line is the method return type. The third line is the class qualifier. And the fourth line in the example above is the name of the method.<br />
<br />
=== Use of Braces { } === <br />
Braces must be used to delimit the scope of an ''if'', ''for'', ''while'', ''switch'', or other control structure. Braces are placed on a line by themselves:<br />
<br />
for( unsigned int i = 0; i < 3; ++i )<br />
{<br />
...<br />
}<br />
<br />
or when using an ''if'':<br />
<br />
if( condition )<br />
{<br />
...<br />
}<br />
else if( other condition )<br />
{<br />
...<br />
}<br />
else<br />
{<br />
....<br />
}<br />
<br />
== Doxygen Documentation System ==<br />
[http://www.doxygen.org Doxygen] is an open-source system for automatically generating documentation from source code. To use Doxygen effectively, the developer must insert comments, delimited in a special way, that Doxygen extracts to produce the documentation. While there are a large number of options to Doxygen, developers at a minimum should insert the following Doxygen commands.<br />
<br />
=== Documenting a Class ===<br />
Classes should be documented using the ''\class'' and ''\brief'' Doxygen commands, followed by the detailed class description:<br />
<br />
/**<br />
* \class Object<br />
* \brief Base class for most itk classes.<br />
*<br />
* Object is the second-highest level base class for most itk objects.<br />
* It extends the base object functionality of LightObject by<br />
* implementing debug flags/methods and modification time tracking.<br />
*/<br />
<br />
=== Documenting a Method ===<br />
Methods should be documented using the following comment block style as shown in the following example:<br />
<br />
/**<br />
* Access a pixel. This version can be an lvalue.<br />
*/<br />
TPixel & operator[]( const IndexType & index )<br />
{ <br />
return this->GetPixel( index ); <br />
}<br />
<br />
The key here is that the comment starts with ''/**'', each subsequent line has an aligned ''*'', and the comment block terminates with a ''*/''.<br />
<br />
= Testing =<br />
Each developer should do his or her part to aid in testing process. It is generally accepted that each developer should write proper unit tests using CTest and those tests will be run on nightly and continuous dashboards.<br />
<br />
== Dashboards ==<br />
* [http://open.cdash.org/index.php?project=TubeTK CDash Dashboards] are maintained for all platforms;<br />
* Warnings are not tolerated;<br />
* Failing tests are preferred over disabling tests or using case/system-specific hacks for solutions. The best answer is to fix the code.<br />
<br />
== Releases ==<br />
Before each product release, a battery of testing (specified on the project wiki) will be carried out to check for regressions not caught by traditional unit testing. Release version naming convention:<br />
* ''MajorReleaseNumber.MinorReleaseNumber.PatchReleaseNumber'';<br />
* These variables are controlled in the top-level ''CMakeLists.txt'' file. They apply to all applications within TubeTK.<br />
<br />
= Code Coverage =<br />
Code coverage is responsibility of all developers.<br />
<br />
= Memory Leaks =<br />
Memory leaks must be plugged. A list of leaks and memory defects can be found on the [http://open.cdash.org/index.php?project=TubeTK Dashboard] under the ''Dynamic Analysis'' section. Clicking on the ''Defect Count'' will show further information.<br />
<br />
A script is available for Linux and OS X to help debug the memory leaks. It can generate the same output present on the dashboard on demand for a subset of tests. The command<br />
<br />
''./TubeTK/Utilities/Valgrind/runValgrind.sh -h''<br />
<br />
shows full usage instructions. Essentially install ''valgrind'' and ''xsltproc'', then execute the ''runValgrind.sh'' script from ''TubeTK-Build'' with arguments such as<br />
<br />
''-R leakyTubeTestName''.<br />
<br />
= Git repo management =<br />
<br />
Create a fork in your github account, and perform pull requests.<br />
<br />
* [https://help.github.com/articles/fork-a-repo Fork the Github repo for TubeTK]<br />
<br />
= Optimizing code in Linux =<br />
<br />
* [[TubeTK/Code Optimization in Linux|Code Optimization in Linux]]<br />
<br />
[[Category:TubeTK|Developers Guide]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Developers_Guide&diff=58619TubeTK/Developers Guide2015-12-19T16:48:04Z<p>Aylward: /* Memory Leaks */</p>
<hr />
<div>= TubeTK Developer's Guide =<br />
Created February 1, 2010.<br />
<br />
= Purpose =<br />
The following document is a description of the accepted coding style for TubeTK. Developers who wish to contribute code to TubeTK should read and adhere to the standards described here.<br />
<br />
= Document Overview = <br />
This document is organized into the following sections:<br />
<br />
* '''System Overview and Philosophy:''' Coding methodologies and motivation for the resulting style;<br />
* '''Copyright:''' The copyright header to be included in all files and other copyright issues;<br />
* '''File Organization:''' How to organize source code;<br />
* '''Naming Conventions:''' Patterns used to name classes, variables, template parameters, and instance variables;<br />
* '''Namespaces:''' The use of namespaces;<br />
* '''Code Layout and Indentation:''' Accepted standards for arranging code including indentation style;<br />
* '''Exception Handling:''' How to add exception handling to the system;<br />
* '''Documentation Style:''' A brief section describing the documentation philosophy used within TubeTK.<br />
<br />
This style guide is an evolving document. Please confer with the TubeTK development team if you wish to add, modify, or delete the rules described in these guidelines.<br />
<br />
= Style Guidelines =<br />
The following coding-style guidelines are to be used in development of the TubeTK. To a large extent these guidelines are a result of the fundamental architectural and implementation decisions made early in the TubeTK project. For example, the decision was made to implement TubeTK with a C++ core using principles of generic programming, so the rules are oriented towards this style of implementation. Some guidelines are relatively arbitrary, such as indentation levels and style. However, an attempt was made to find coding styles consistent with accepted practices. The point is to adhere to a common style to assist developers and users of the future learn, use, maintain, and extend TubeTK.<br />
<br />
Please do your best to be a upstanding member of the TubeTK team. The rules described here have been developed with the team as a whole in mind. If you consistently violate these rules you will likely be harassed mercilessly, first privately and then publicly. If this does not result in correct code layout, your right to Git write access (if you are developer and wish to contribute code) may be removed. Similarly, if you wish to contribute code and are not a developer, your code will not be accepted until the style is consistent with these guidelines.<br />
<br />
== System Overview and Philosophy ==<br />
The following implementation strategies have been adopted by the TubeTK team. These directly and indirectly affect the resulting code style. Understanding these strategies motivate the reasons for many of the style guidelines described in this document.<br />
<br />
=== Implementation Language === <br />
The core implementation language is C++. C++ was chosen for its flexibility, performance, and familiarity to team members. The toolkit uses the full spectrum of C++ features including const and volatile correctness, namespaces, partial template specialization, operator overloading, traits, and iterators.<br />
<br />
=== Generic Programming and the STL ===<br />
Compile-time binding using methods of generic programming and template instantiation is the preferred implementation style. This approach has demonstrated its ability to create efficient, flexible code. Use of the Standard Template Library (STL) is encouraged. In contrast with many libraries, STL containers are the acceptable for passing collections of data between public and private member functions. The STL is typically used by a class, rather than as serving as a base class for derivation of classes. <br />
<br />
=== Portability ===<br />
Most applications as well as the core of the toolkit are designed to compile on a set of target operating system/compiler combinations. These combinations are:<br />
<br />
* Linux with GCC;<br />
* Microsoft Windows XP with Microsoft Visual C++ (released within the past five years);<br />
* OS X with Clang or GCC;<br />
* Other Unix systems with GCC.<br />
<br />
Some applications and modules make use of specific GPU configurations to optimize certain calculations. These vary according to system, but there shall always be an unoptimized implementation that will comply to the above portablity standards.<br />
<br />
=== VTK and ITK ===<br />
TubeTK makes extensive use of both the Visualization Toolkit (VTK) and the Insight Toolkit (ITK). Image processing features added to TubeTK should prefer ITK constructs over those of VTK. When visualization-geared code is written for TubeTK, VTK should be favored. <br />
<br />
=== 3D Slicer ===<br />
TubeTK is intended to be use in conjunction with [http://www.slicer.org 3D Slicer], version 4. TubeTK Modules conform to the execution model used by the 3D Slicer project. For more information regarding bundling 3D Slicer extensions see the [http://www.slicer.org/slicerWiki/index.php/Documentation/4.2/Developers/Tutorials/BuildTestPackageDistributeExtensions 3D Slicer documentation pages].<br />
<br />
=== CMake Build Environment ===<br />
The TubeTK build environment is CMake. CMake is an open-source, advanced cross-platform build system that enables developers to write simple ''makefiles'' (named ''CMakeLists.txt'') that are processed to generated native build tools for a particular operating system/compiler combinations. See the [http://www.cmake.org CMake web pages] at for more information.<br />
<br />
=== Tool and Library Versions ===<br />
Because of the agile nature of TubeTK developement, the TubeTK team uses developement versions of CMake, ITK, VTK, 3D Slicer, along with a recent stable version of Qt.<br />
<br />
These are the most important factors influencing the coding style found in TubeTK. Now we will look at the details.<br />
<br />
=== Copyright ===<br />
<br />
== File Organization ==<br />
Classes are created and organized into a single class per file set. A file set consists of ''.h'' header file, ''.cxx'' implementation file, and/or a ''.hxx'' templated implementation file. Helper classes may also be defined in the file set, typically these are not visible to the system at large, or placed into a special namespace.<br />
<br />
Source files must be placed in the correct directory for logical consistency with the rest of the system, and to avoid cyclic dependencies. The TubeTK source directory structure is divided into several directories below ''TubeTK''. Please consult the TubeTK team before creating any new directories with TubeTK. Directories containing source are arranged as follows:<br />
<br />
* '''TubeTK/Applications:''' TubeTK/Applications consists of subdirectories for each TubeTK application. No application should depend upon another in any way;<br />
* '''TubeTK/Base''';<br />
* '''TubeTK/SlicerModules'''.<br />
<br />
== Naming conventions ==<br />
In general:<br />
<br />
* Names are constructed by using case change to indicate separate words, as in ''TimeStamp'' (versus ''Time_Stamp''). Underscores are not used.<br />
* Variable names are chosen carefully with the intention to convey the meaning behind the code. <br />
* Names are generally spelled out; use of abbreviations is discouraged. (Abbreviation are allowable when in common use, and should be in uppercase as in RGB.) While this does result in long names, it self-documents the code. If you learn how to use name completion in your editor (e.g., ''vim'' or ''emacs''), this inconvenience can be minimized. <br />
<br />
Depending on whether the name is a class, file, variable, or other name, variations on this theme result as explained in the following subsections.<br />
<br />
=== Naming Classes ===<br />
Classes are named beginning with a capital letter. Classes are placed in the appropriate namespace, typically tube:: or itk::tube (see namespaces below). Classes are named according to the following general rule:<br />
<br />
''class name = <algorithm><input><concept>''<br />
<br />
In this formula, the name of the algorithm or process (possibly with an associated adjective or adverb) comes first, followed by an input type, and completed by a concept name. A concept is an informal classification describing what a class does. There are many concepts in TubeTK, here are a few of them:<br />
<br />
* '''Filter:''' A class that participates in the data processing pipeline. Filters typically take one or more inputs and produce one or more outputs;<br />
* '''Iterator:''' Traverse data in various ways (e.g., forward, backward, within a region, etc.);<br />
* '''Reader:''' A class that reads a single data object (e.g., image or mesh).<br />
* '''Region:''' A subset of a data object, such as an image region;<br />
* '''Source:''' A filter that initiates the data processing pipeline such as a reader or a procedural data generator;<br />
* '''Transform:''' Various types of transformations including affine and procedural;<br />
* '''Writer:''' A filter that terminates the data processing pipeline by writing data to disk or to a communications port.<br />
<br />
The naming of classes is an art form; please review existing names to catch the spirit of the naming convention. Example names include:<br />
<br />
* ShrinkImageFilter;<br />
* TriangleCell;<br />
* ScalarImageRegionIterator;<br />
* NeighborhoodIterator;<br />
* MapContainer;<br />
* DefaultImageTraits;<br />
* BackwardDifferenceOperator.<br />
<br />
=== Naming Modules ===<br />
Modules created within TubeTK should be named in the same manner ascribed to other TubeTK classes. The directories that the modules are constructed in should end in ''Module'' as well as the shared library build of the module. However, the standalone version of the module should omit ''Module'' from its name.<br />
<br />
=== Naming Files ===<br />
Files should have the same name as the class, with the namespace of the library prepended (e.g., ''tube''). Header files are named ''.h'', while implementation files are named either ''.cxx'' or ''.hxx'', depending on whether they are implementations of templated classes. It is important to note that VTK, ITK, and Qt classes fall under their respective namespaces and do not use the ''tube'' namespace.<br />
<br />
=== Naming Methods and Functions ===<br />
Global functions and class methods, either static or class members, are named beginning with a capital letter. The biggest challenge when naming methods and functions is to be consistent with existing names. For example, given the choice between ''ComputeBoundingBox( void )'' and ''CalculateBoundingBox( void )'' (''CalcBoundingBox( void )'' is not allowed because it is not spelled out), the choice is ''ComputeBoundingBox( void )'' because ''Compute'' is used elsewhere in the system for a similar circumstance. The concepts described previously should be used whenever possible.<br />
<br />
When referring to class methods and variables in code, an explicit ''this->'' pointer should be used, as in ''this->ComputeBoundingBox()''. The use of the explicit ''this->'' pointer helps clarify exactly which method, and where it originates, is being invoked. Similarly the ''::'' global namespace should be used when referring to a global function.<br />
<br />
=== Naming Class Data Members ===<br />
Class data members are prepended with ''m_'' as in ''m_Size''. This clearly indicates the origin of data members, and differentiates them from all other variables.<br />
<br />
=== Naming Local Variables ===<br />
Local variables begin in lowercase. There is more flexibility in the naming of local variables; please remember that others will study, maintain, fix, and extend your code. Any bread crumbs that you can drop in the way of explanatory variable names and comments will go a long way towards helping other developers.<br />
<br />
=== Naming Template Parameters ===<br />
Template parameters follow the usual rules with naming except that they should start with either the capital letter ''T'' or ''V''. Type parameters begin with the letter ''T'' while value template parameters begin with the letter ''V''.<br />
<br />
=== Naming Typedefs ===<br />
Typedefs are absolutely essential in generic programming. They significantly improve the readability of code, and facilitate the declaration of complex syntactic combinations. Unfortunately, creation of typedefs is tantamount to creating another programming language. Hence typedefs must be used in a consistent fashion.<br />
<br />
The general rule for typedef names is that they end in the word ''Type''. For example:<br />
<br />
typedef TPixel PixelType;<br />
<br />
However, there are many exceptions to this rule that recognize that TubeTK has several important concepts that are expressed partially in the names used to implement the concept. An iterator is a concept, as is a container or pointer. These concepts are used in preference to ''Type'' at the end of a typedef as appropriate. For example:<br />
<br />
typedef typename ImageTraits::PixelContainer PixelContainer;<br />
<br />
Here ''Container'' is a concept used in place of ''Type''.<br />
<br />
=== Using Underscores ===<br />
Do not use them. The only exception is when defining preprocessor variables and macros (which are discouraged). In this case, underscores are allowed to separate words.<br />
<br />
=== Preprocessor Directives ===<br />
Some of the worst code contains many preprocessor directives and macros. Do not use them except in a very limited sense (to support minor differences in compilers or operating systems). If a method makes extensive use of preprocessor directives, it is a candidate for separation into its own class.<br />
<br />
=== Unused Parameters and Shadowed Parameters ===<br />
Use the macros ''vtkNotUsed()'' and ''itkNotUsed()'' when implementing class member functions that have unused parameters. Warnings are treated as errors, and unused parameters will generate warnings. <br />
<br />
void SetSigma( double sigma, double itkNotUsed( extent ) )<br />
{<br />
...some code that does not use the parameter extent...<br />
}<br />
<br />
Shadowed parameters are particularly troublesome in that they often indicate code errors and ambiguities. Again, warnings are treated as errors, and shadowed variables will generate warnings.<br />
<br />
A common mistake is to give a variable larger scope than what it needs. To avoid this, define loop variables in the loop declaration:<br />
<br />
for( unsigned int i = 0; i < 100; ++i )<br />
{<br />
...loop stuff...<br />
}<br />
<br />
Following our naming conventions also helps avoid shadowed variables. In particular, make sure all member variables begin with '''m_''', functions begin with uppercase variables, and variables names are descriptive.<br />
<br />
=== Hidden Virtual Functions ===<br />
If a base class declares a function, then an instance of that function overloaded in subclasses must include a definition that has the same parameter arguments (signature). For example, if the base class function takes two doubles as arguments, and the derived class has an instance that takes only one double as an argument, then a warning (i.e., an error) is generated. You must also define an instance in the derived class that takes two arguments.<br />
<br />
=== New Line at End of File ===<br />
Some compilers will complain (generate a warning/error) if a file does not end with a new line. To be safe, make sure each file ends with a blank line.<br />
<br />
== Namespaces ==<br />
All classes that do not inherit from VTK, ITK, or Qt classes should be placed in the tube namespace. <br />
<br />
== Const Correctness ==<br />
Const correctness is important. Please use it as appropriate to your class or method.<br />
<br />
== Exception Handling ==<br />
Indicate that methods throw exceptions in the method declaration as in:<br />
<br />
const float * foo( void ) const throws std::exception<br />
<br />
== Code Layout and Indentation ==<br />
The following are the accepted TubeTK code layout rules and indentation style. After reading this section, you may wish to visit many of the source files found in ITK. This will help crystallize the rules described here.<br />
<br />
=== General Layout ===<br />
Each line of code should take no more than 80 characters. Break the code across multiple lines as necessary. Use lots of whitespace to separate logical blocks of code, intermixed with comments. To a large extent the structure of code directly expresses its implementation.<br />
<br />
The appropriate indentation level is two spaces for each level of indentation. Do not use tabs. Set up your editor to insert spaces. Using tabs may look good in your editor but will wreak havoc in someone else's.<br />
<br />
The declaration of variables within classes, methods, and functions should be one declaration per line.<br />
<br />
int i;<br />
int j;<br />
char * stringname;<br />
<br />
=== Spaces ===<br />
TubeTK, like ITK, makes liberal use of spaces to improve the readability of code. When in doubt, use a space. Common examples:<br />
<br />
* Separate expressions from their enclosing paren:<br />
if( a < b )<br />
{<br />
a = ( 1 + 1 ) / 2;<br />
}<br />
* Separate arguments from their enclosing paren and from other args (there should be a space after every comma):<br />
foo( int a )<br />
{<br />
foofoo( a );<br />
foofoofoo( a, b );<br />
}<br />
* Favor right-flush for lines that are continuations of previous lines:<br />
this->IsMyReallyLong()->ITK()<br />
->FunctionCall()<br />
* Use ( void ) when declaring a function that takes no arguments:<br />
int DoesNothing( void )<br />
{<br />
}<br />
* Use spaces before and after raw pointer declarations:<br />
int * a;<br />
* You do not need to use spaces when accessing raw pointers:<br />
a->b;<br />
*a = b;<br />
<br />
=== Keep It Simple ===<br />
Break complex methods into multiple lines. Program in a way that makes it easy for your code to be debugged by others. Examples:<br />
<br />
* ''?:'' statements should not be used instead of ''if...then'' statements;<br />
* Limit the variety of operators that appear in any one line of code.<br />
<br />
=== Includes ===<br />
* Only include the necessary files, no more;<br />
* Group includes per library;<br />
* Alphabetically sort files within groups;<br />
* Order groups from local to global;<br />
* Implementation files should include the header files first.<br />
<br />
=== Class Layout ===<br />
Classes are defined using the following guidelines:<br />
<br />
* Begin with ''#include'' guards;<br />
* Follow with the necessary includes. Include only what is necessary to avoid dependency problems;<br />
* Place the class in the correct namespace;<br />
* Public methods come first;<br />
* Protected methods follow;<br />
* Private members come last;<br />
* Public data members are forbidden.<br />
<br />
The class layout looks something like this:<br />
<br />
/*=========================================================================<br />
<br />
Library: TubeTK<br />
<br />
Copyright 2010 Kitware Inc. 28 Corporate Drive,<br />
Clifton Park, NY, 12065, USA.<br />
<br />
All rights reserved.<br />
<br />
Licensed under the Apache License, Version 2.0 (the "License");<br />
you may not use this file except in compliance with the License.<br />
You may obtain a copy of the License at<br />
<br />
http://www.apache.org/licenses/LICENSE-2.0<br />
<br />
Unless required by applicable law or agreed to in writing, software<br />
distributed under the License is distributed on an "AS IS" BASIS,<br />
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br />
See the License for the specific language governing permissions and<br />
limitations under the License.<br />
<br />
=========================================================================*/<br />
<br />
#ifndef __itktubeExampleImage_h<br />
#define __itktubeExampleImage_h<br />
<br />
#include <itkDefaultDataAccessor.h><br />
#include <itkDefaultImageTraits.h><br />
#include <itkImageBase.h><br />
#include <itkPixelTraits.h><br />
<br />
namespace itk<br />
{<br />
<br />
namespace tube<br />
{<br />
<br />
template< class TPixel, unsigned int VImageDimension = 2,<br />
class TImageTraits = DefaultImageTraits< TPixel, VImageDimension > ><br />
class ITK_EXPORT ExampleImage : public ImageBase< VImageDimension ><br />
{<br />
public:<br />
typedef ExampleImage Self;<br />
typedef ImageBase< VImageDimension > Superclass;<br />
typedef SmartPointer< Self > Pointer;<br />
typedef SmartPointer< const Self > ConstPointer;<br />
<br />
itkNewMacro( Self );<br />
itkTypeMacro( ExampleImage, ImageBase );<br />
<br />
....<br />
<br />
protected: <br />
ExampleImage( void );<br />
<br />
virtual ~ExampleImage( void )<br />
{<br />
}<br />
<br />
....<br />
<br />
private:<br />
ExampleImage( const Self & other );<br />
<br />
void operator=( const Self & other );<br />
<br />
....<br />
<br />
PixelContainerPointer m_Buffer<br />
<br />
....<br />
<br />
}; // End class ExampleImage<br />
<br />
} // End namespace tube<br />
<br />
} // End namespace itk<br />
<br />
#endif // End !defined(__itktubeExampleImage_h)<br />
<br />
=== Method Definitions ===<br />
Methods are defined across multiple lines. This is to accommodate the extremely long definitions possible when using templates. The starting and ending brace should be indented. For example:<br />
<br />
template< class TPixel, unsigned int VImageDimension, <br />
class TImageTraits ><br />
const double * <br />
ExampleImage< TPixel, VImageDimension, TImageTraits ><br />
::GetSpacing( void ) const<br />
{<br />
...<br />
}<br />
<br />
The first line is the template declaration. The second line is the method return type. The third line is the class qualifier. And the fourth line in the example above is the name of the method.<br />
<br />
=== Use of Braces { } === <br />
Braces must be used to delimit the scope of an ''if'', ''for'', ''while'', ''switch'', or other control structure. Braces are placed on a line by themselves:<br />
<br />
for( unsigned int i = 0; i < 3; ++i )<br />
{<br />
...<br />
}<br />
<br />
or when using an ''if'':<br />
<br />
if( condition )<br />
{<br />
...<br />
}<br />
else if( other condition )<br />
{<br />
...<br />
}<br />
else<br />
{<br />
....<br />
}<br />
<br />
== Doxygen Documentation System ==<br />
[http://www.doxygen.org Doxygen] is an open-source system for automatically generating documentation from source code. To use Doxygen effectively, the developer must insert comments, delimited in a special way, that Doxygen extracts to produce the documentation. While there are a large number of options to Doxygen, developers at a minimum should insert the following Doxygen commands.<br />
<br />
=== Documenting a Class ===<br />
Classes should be documented using the ''\class'' and ''\brief'' Doxygen commands, followed by the detailed class description:<br />
<br />
/**<br />
* \class Object<br />
* \brief Base class for most itk classes.<br />
*<br />
* Object is the second-highest level base class for most itk objects.<br />
* It extends the base object functionality of LightObject by<br />
* implementing debug flags/methods and modification time tracking.<br />
*/<br />
<br />
=== Documenting a Method ===<br />
Methods should be documented using the following comment block style as shown in the following example:<br />
<br />
/**<br />
* Access a pixel. This version can be an lvalue.<br />
*/<br />
TPixel & operator[]( const IndexType & index )<br />
{ <br />
return this->GetPixel( index ); <br />
}<br />
<br />
The key here is that the comment starts with ''/**'', each subsequent line has an aligned ''*'', and the comment block terminates with a ''*/''.<br />
<br />
= Testing =<br />
Each developer should do his or her part to aid in testing process. It is generally accepted that each developer should write proper unit tests using CTest and those tests will be run on nightly and continuous dashboards.<br />
<br />
== Dashboards ==<br />
* [http://open.cdash.org/index.php?project=TubeTK CDash Dashboards] are maintained for all platforms;<br />
* Warnings are not tolerated;<br />
* Failing tests are preferred over disabling tests or using case/system-specific hacks for solutions. The best answer is to fix the code.<br />
<br />
== Releases ==<br />
Before each product release, a battery of testing (specified on the project wiki) will be carried out to check for regressions not caught by traditional unit testing. Release version naming convention:<br />
* ''MajorReleaseNumber.MinorReleaseNumber.PatchReleaseNumber'';<br />
* These variables are controlled in the top-level ''CMakeLists.txt'' file. They apply to all applications within TubeTK.<br />
<br />
= Code Coverage =<br />
Code coverage is responsibility of all developers.<br />
<br />
= Memory Leaks =<br />
Memory leaks must be plugged. A list of leaks and memory defects can be found on the [http://open.cdash.org/index.php?project=TubeTK Dashboard] under the ''Dynamic Analysis'' section. Clicking on the ''Defect Count'' will show further information.<br />
<br />
A script is available for Linux and OS X to help debug the memory leaks. It can generate the same output present on the dashboard on demand for a subset of tests. The command<br />
<br />
''./TubeTK/Utilities/Valgrind/runValgrind.sh -h''<br />
<br />
shows full usage instructions. Essentially install ''valgrind'' and ''xsltproc'', then execute the ''runValgrind.sh'' script from ''TubeTK-Build'' with arguments such as<br />
<br />
''-R leakyTubeTestName''.<br />
<br />
= Git repo management =<br />
<br />
Create a fork in your github account, and perform pull requests.<br />
<br />
* [https://help.github.com/articles/fork-a-repo Fork the Github repo for TubeTK]<br />
<br />
= Optimizing code in Linux =<br />
<br />
* [[TubeTK/Code Optimization in Linux|Code Optimization in Linux]]<br />
<br />
[[Category:TubeTK|Developers Guide]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Development&diff=58618TubeTK/Development2015-12-19T16:44:38Z<p>Aylward: /* 4. Learn and live the development guidelines */</p>
<hr />
<div>__NOTITLE__<br />
__NOTOC__<br />
<br />
{| border="1" cellpadding="10" cellspacing="0"<br />
|+ [[image:TubeTK_Header.jpg|1000px|link=TubeTK]]<br />
|-<br />
| style="background:#efefef;" align="left" valign="top" width="150px" | <br />
<br />
'''[[TubeTK|Home]]'''<br />
*[[TubeTK/About|About]]<br />
*[[TubeTK/Images|Image Gallery]]<br />
*[[TubeTK/Data|Data and Publications]]<br />
<br><br />
----<br />
<br><br />
'''For Users'''<br />
* [[TubeTK/Installation|Installation]]<br />
* [[TubeTK/Documentation|Methods & Apps]]<br />
* [[TubeTK/Slicer|TubeTK with 3D Slicer]]<br />
* [[TubeTK/OsiriX|TubeTK with OsiriX]]<br />
<br><br />
----<br />
<br><br />
'''For Developers'''<br />
* [[TubeTK/Development|Development Docs]]<br />
<br><br />
----<br />
<br><br />
'''[https://github.com/TubeTK/TubeTK/issues Report Bugs<br>Request Features]'''<br />
<br><br />
<br><br />
----<br />
<br><br />
'''[[TubeTK/Contact|Contact Us]]'''<br />
<br />
| width="800px" align="left" | <br />
= Collaborative TubeTK Development =<br />
<br />
<b> Please follow these steps to build and extend TubeTK </b><br />
<br />
== 1. View the software over the web ==<br />
<br />
The source code for TubeTK is hosted on GitHub:<br />
<br />
* https://github.com/KitwareMedical/TubeTK<br />
<br />
== 2. Check on the status of TubeTK ==<br />
<br />
The TubeTK Dashboard reports on the nightly build process of TubeTK. Check this to make sure the current version of TubeTK is compiling and that the relevant tests are passing on your platform:<br />
* http://open.cdash.org/index.php?project=TubeTK<br />
<br />
== 3. Build the toolkit ==<br />
<br />
* [[TubeTK/Build Instructions|Build Instructions]]<br />
<br />
== 4. Learn and live the development guidelines ==<br />
<br />
* [[TubeTK/Developers Guide|Developers Guide]]<br />
<br />
== 5. Contribute Dashboard Clients ==<br />
<br />
* [[TubeTK/Dashboard Scripts|Dashboard Scripts]]<br />
<br />
== 6. Contribute Code ==<br />
<br />
* [[TubeTK/Midas Unit Tests|Adding Midas-based Unit Tests]]<br />
<br />
== 7. Read the FAQ ==<br />
<br />
* [[TubeTK/Developers FAQ|Developers FAQ]]<br />
<br />
== 8. Join the Developers' Mailing List ==<br />
<br />
*Join the TubeTK email list here: [http://public.kitware.com/cgi-bin/mailman/listinfo/tubetk-developers]<br />
<br />
|}<br />
<br />
[[Category:TubeTK|Development]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/RadiusEstimationFunction&diff=58333TubeTK/RadiusEstimationFunction2015-10-13T20:53:30Z<p>Aylward: Created page with "= Background = * In the original 1996 publication, we used an oriented Laplacian of a Guassian (Lpp) to estimate local radius. The scale that returned the local maximum respo..."</p>
<hr />
<div>= Background =<br />
* In the original 1996 publication, we used an oriented Laplacian of a Guassian (Lpp) to estimate local radius. The scale that returned the local maximum response was chosen as the radius for the local tube.<br />
** There were numerous problems with this approach:<br />
*** Interference from adjacent vessels: the Lpp function was evaluated out to 2.5 to 3.5 standard deviations. This meant that structures within a radius of the vessel would influence the estimations, and vessel estimates would be erroneous at points of high curvature.<br />
*** Interference from intensity variations within a vessel: The most strongly weighted intensities were along the centerline, yet in time-of-flight MRA, the intensity within a vessel may be dimmer, perhaps as dim as the background. Furthermore, vessel interior intensity would vary as a function of vessel radius, creating a complex coupling between medialness response and actual radius.<br />
*** Limited parameterizations: the Lpp function is defined by a limited number of variables which eliminates the option of shaping the kernel based on, for example, the local straightness or curvature of the vessel.<br />
* The long-running MIDAS vessel extraction system used an set of consentric spheres that bounded and extended along the expected vessel wall. Inner spheres has positive kernel weights and outer spheres had negative kernel weights. The weighted sum of intensities for all spheres defined the medialness value for the corresponding scale. Care was taken to ensure balance in size and coverage between and across scales. The sequence of spheres could be aligned to the curvature of the tube, and intensities near the center of the tube were not used in the computations.<br />
** There was two remaining problems with this approach:<br />
*** It integrated over only a small portion of the tube, and the discrete boundaries of each sphere created multiple local minima when applied to the sparse grid of an image (i.e., small changes in scale could result in drastic changes in medialness due to cross boundaries between adjacent voxels).<br />
*** The method could be slow to apply, it was applied at distant intervals along a tube to reduce total computational costs.<br />
* The final approach uses an ordered listing of adjacent intensities that allows for fast computation at multiple scales while maximizing available data to minimize the effect of image discretization.</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Documentation&diff=58332TubeTK/Documentation2015-10-13T20:36:51Z<p>Aylward: /* Modules */</p>
<hr />
<div>__NOTITLE__<br />
__NOTOC__<br />
<br />
{| border="1" cellpadding="10" cellspacing="0"<br />
|+ [[image:TubeTK_Header.jpg|1000px]]<br />
|-<br />
| style="background:#efefef;" align="left" valign="top" width="150px" | <br />
<br />
'''[[TubeTK|Home]]'''<br />
*[[TubeTK/About|About]]<br />
*[[TubeTK/Images|Image Gallery]]<br />
*[[TubeTK/Data|Data and Publications]]<br />
<br><br />
----<br />
<br><br />
'''For Users'''<br />
* [[TubeTK/Installation|Installation]]<br />
* [[TubeTK/Documentation|Methods & Apps]]<br />
* [[TubeTK/Slicer|TubeTK with 3D Slicer]]<br />
* [[TubeTK/OsiriX|TubeTK with OsiriX]]<br />
<br><br />
----<br />
<br><br />
'''For Developers'''<br />
* [[TubeTK/Development|Development Docs]]<br />
<br><br />
----<br />
<br><br />
'''[https://github.com/TubeTK/TubeTK/issues Report Bugs<br>Request Features]'''<br />
<br><br />
<br><br />
----<br />
<br><br />
'''[[TubeTK/Contact|Contact Us]]'''<br />
<br />
| width="800px" align="left" | <br />
= Applications =<br />
# '''GUI Applications'''<br />
# '''Command-line (CLI) Applications'''<br />
#* Command-line applications can be run directly from the command line, or graphically using 3D Slicer<br />
#* [[TubeTK/Documentation/AtlasBuilderUsingIntensity | AtlasBuilderUsingIntensity]]<br />
#* [[TubeTK/Documentation/ComputeBinaryImageSimilarityMetrics | ComputeBinaryImageSimilarityMetrics]]<br />
#* [[TubeTK/Documentation/ComputeImageSimilarityMetrics | ComputeImageSimilarityMetrics]]<br />
#* [[TubeTK/Documentation/ComputeImageStatisticsUsingMask | ComputeImageStatisticsUsingMask]]<br />
#* [[TubeTK/Documentation/ComputeSegmentTubesParameters | ComputeSegmentTubesParameters]]<br />
#* [[TubeTK/Documentation/ComputeTubeGraphProbability | ComputeTubeGraphProbability]]<br />
#* [[TubeTK/Documentation/ComputeTubeMeasures | ComputeTubeMeasures]]<br />
#* [[TubeTK/Documentation/ComputeTubeProbability | ComputeTubeProbability]]<br />
#* [[TubeTK/Documentation/ConvertInnerOpticToPlus | ConvertInnerOpticToPlus]]<br />
#* [[TubeTK/Documentation/ConvertShrunkenSeedImageToList | ConvertShrunkenSeedImageToList]]<br />
#* [[TubeTK/Documentation/ConvertTRE | ConvertTRE]]<br />
#* [[TubeTK/Documentation/ConvertTubeGraphToImage | ConvertTubeGraphToImage]]<br />
#* [[TubeTK/Documentation/ConvertTubesToDensityImage | ConvertTubesToDensityImage]]<br />
#* [[TubeTK/Documentation/ConvertTubesToImage | ConvertTubesToImage]]<br />
#* [[TubeTK/Documentation/ConvertTubesToSurface | ConvertTubesToSurface]]<br />
#* [[TubeTK/Documentation/ConvertTubeToTubeGraph | ConvertTubeToTubeGraph]]<br />
#* [[TubeTK/Documentation/CropImage | CropImage]]<br />
#* [[TubeTK/Documentation/DeblendTomosynthesisSlicesUsingPrior | DeblendTomosynthesisSlicesUsingPrior]]<br />
#* [[TubeTK/Documentation/EnhanceCoherenceAndEdgesUsingDiffusion | EnhanceCoherenceAndEdgesUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceCoherenceUsingDiffusion | EnhanceCoherenceUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceContrastUsingPrior | EnhanceContrastUsingPrior]]<br />
#* [[TubeTK/Documentation/EnhanceEdgesUsingDiffusion | EnhanceEdgesUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceTubesUsingDiffusion | EnhanceTubesUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceTubesUsingDiscriminantAnalysis | EnhanceTubesUsingDiscriminantAnalysis]]<br />
#* [[TubeTK/Documentation/EnhanceUsingDiscriminantAnalysis | EnhanceUsingDiscriminantAnalysis]]<br />
#* [[TubeTK/Documentation/EnhanceUsingNJetDiscriminantAnalysis | EnhanceUsingNJetDiscriminantAnalysis]]<br />
#* [[TubeTK/Documentation/ImageCompareCommand | ImageCompareCommand]]<br />
#* [[TubeTK/Documentation/JsonCompareCommand | JsonCompareCommand]]<br />
#* [[TubeTK/Documentation/MergeAdjacentImages | MergeAdjacentImages]]<br />
#* [[TubeTK/Documentation/MergeTubeGraphs | MergeTubeGraphs]]<br />
#* [[TubeTK/Documentation/RegisterImages | RegisterImages]]<br />
#* [[TubeTK/Documentation/RegisterUsingImageCenters | RegisterUsingImageCenters]]<br />
#* [[TubeTK/Documentation/RegisterUsingSlidingGeometries | RegisterUsingSlidingGeometries]]<br />
#* [[TubeTK/Documentation/ResampleImage | ResampleImage]]<br />
#* [[TubeTK/Documentation/SampleCLIApplication | SampleCLIApplication]]<br />
#* [[TubeTK/Documentation/SegmentBinaryImageSkeleton | SegmentBinaryImageSkeleton]]<br />
#* [[TubeTK/Documentation/SegmentConnectedComponents | SegmentConnectedComponents]]<br />
#* [[TubeTK/Documentation/SegmentConnectedComponentsUsingParzenPDFs | SegmentConnectedComponentsUsingParzenPDFs]]<br />
#* [[TubeTK/Documentation/SegmentTubes | SegmentTubes]]<br />
#* [[TubeTK/Documentation/SegmentUsingOtsuThreshold | SegmentUsingOtsuThreshold]]<br />
#* [[TubeTK/Documentation/ShrinkImage | ShrinkImage]]<br />
#* [[TubeTK/Documentation/SimulateAcquisitionArtifactsUsingPrior | SimulateAcquisitionArtifactsUsingPrior]]<br />
#* [[TubeTK/Documentation/SubSampleTubes | SubSampleTubes]]<br />
#* [[TubeTK/Documentation/TextCompareCommand | TextCompareCommand]]<br />
#* [[TubeTK/Documentation/TransformTubes | TransformTubes]]<br />
#* [[TubeTK/Documentation/HessianVesselness2D | Hessian Vesselness 2D]]<br />
#* [[TubeTK/Documentation/ExtractCurves2D | Extract Curves 2D]]<br />
#* [[TubeTK/Documentation/ComputeTortuosity | Compute Tortuosity]]<br />
#* [[TubeTK/Documentation/Sliding_Organ_Registration | Sliding Geometries Registration]]<br />
# '''3D Slicer Python Applications'''<br />
#* [[TubeTK/Documentation/InteractivePDFSegmenter | Interactive PDF Segmenter]]<br />
<br />
= Modules =<br />
# Pre-processing<br />
#* [[TubeTK/Anisotropic Hybrid Diffusion with Continuous Switch|Anisotropic Hybrid Diffusion with Continuous Switch]]<br />
# Object segmentation<br />
# Tube extraction<br />
#* [[TubeTK/RadiusEstimationFunction|Radius Estimations Functions]]<br />
# Data structures<br />
# Topology analysis<br />
# Editing<br />
# Export<br />
# [[TubeTK/OpenIGTLink|OpenIGTLink]]<br />
# Python<br />
#* [http://nbviewer.ipython.org/5925084 Tube NumPy Array]<br />
<br />
= Related Efforts =<br />
<br />
* [[TubeTK/Related Work|Related Work]]<br />
<br />
|}<br />
<br />
[[Category:TubeTK|Documentation]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Documentation&diff=58331TubeTK/Documentation2015-10-13T20:36:08Z<p>Aylward: /* Related Efforts */</p>
<hr />
<div>__NOTITLE__<br />
__NOTOC__<br />
<br />
{| border="1" cellpadding="10" cellspacing="0"<br />
|+ [[image:TubeTK_Header.jpg|1000px]]<br />
|-<br />
| style="background:#efefef;" align="left" valign="top" width="150px" | <br />
<br />
'''[[TubeTK|Home]]'''<br />
*[[TubeTK/About|About]]<br />
*[[TubeTK/Images|Image Gallery]]<br />
*[[TubeTK/Data|Data and Publications]]<br />
<br><br />
----<br />
<br><br />
'''For Users'''<br />
* [[TubeTK/Installation|Installation]]<br />
* [[TubeTK/Documentation|Methods & Apps]]<br />
* [[TubeTK/Slicer|TubeTK with 3D Slicer]]<br />
* [[TubeTK/OsiriX|TubeTK with OsiriX]]<br />
<br><br />
----<br />
<br><br />
'''For Developers'''<br />
* [[TubeTK/Development|Development Docs]]<br />
<br><br />
----<br />
<br><br />
'''[https://github.com/TubeTK/TubeTK/issues Report Bugs<br>Request Features]'''<br />
<br><br />
<br><br />
----<br />
<br><br />
'''[[TubeTK/Contact|Contact Us]]'''<br />
<br />
| width="800px" align="left" | <br />
= Applications =<br />
# '''GUI Applications'''<br />
# '''Command-line (CLI) Applications'''<br />
#* Command-line applications can be run directly from the command line, or graphically using 3D Slicer<br />
#* [[TubeTK/Documentation/AtlasBuilderUsingIntensity | AtlasBuilderUsingIntensity]]<br />
#* [[TubeTK/Documentation/ComputeBinaryImageSimilarityMetrics | ComputeBinaryImageSimilarityMetrics]]<br />
#* [[TubeTK/Documentation/ComputeImageSimilarityMetrics | ComputeImageSimilarityMetrics]]<br />
#* [[TubeTK/Documentation/ComputeImageStatisticsUsingMask | ComputeImageStatisticsUsingMask]]<br />
#* [[TubeTK/Documentation/ComputeSegmentTubesParameters | ComputeSegmentTubesParameters]]<br />
#* [[TubeTK/Documentation/ComputeTubeGraphProbability | ComputeTubeGraphProbability]]<br />
#* [[TubeTK/Documentation/ComputeTubeMeasures | ComputeTubeMeasures]]<br />
#* [[TubeTK/Documentation/ComputeTubeProbability | ComputeTubeProbability]]<br />
#* [[TubeTK/Documentation/ConvertInnerOpticToPlus | ConvertInnerOpticToPlus]]<br />
#* [[TubeTK/Documentation/ConvertShrunkenSeedImageToList | ConvertShrunkenSeedImageToList]]<br />
#* [[TubeTK/Documentation/ConvertTRE | ConvertTRE]]<br />
#* [[TubeTK/Documentation/ConvertTubeGraphToImage | ConvertTubeGraphToImage]]<br />
#* [[TubeTK/Documentation/ConvertTubesToDensityImage | ConvertTubesToDensityImage]]<br />
#* [[TubeTK/Documentation/ConvertTubesToImage | ConvertTubesToImage]]<br />
#* [[TubeTK/Documentation/ConvertTubesToSurface | ConvertTubesToSurface]]<br />
#* [[TubeTK/Documentation/ConvertTubeToTubeGraph | ConvertTubeToTubeGraph]]<br />
#* [[TubeTK/Documentation/CropImage | CropImage]]<br />
#* [[TubeTK/Documentation/DeblendTomosynthesisSlicesUsingPrior | DeblendTomosynthesisSlicesUsingPrior]]<br />
#* [[TubeTK/Documentation/EnhanceCoherenceAndEdgesUsingDiffusion | EnhanceCoherenceAndEdgesUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceCoherenceUsingDiffusion | EnhanceCoherenceUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceContrastUsingPrior | EnhanceContrastUsingPrior]]<br />
#* [[TubeTK/Documentation/EnhanceEdgesUsingDiffusion | EnhanceEdgesUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceTubesUsingDiffusion | EnhanceTubesUsingDiffusion]]<br />
#* [[TubeTK/Documentation/EnhanceTubesUsingDiscriminantAnalysis | EnhanceTubesUsingDiscriminantAnalysis]]<br />
#* [[TubeTK/Documentation/EnhanceUsingDiscriminantAnalysis | EnhanceUsingDiscriminantAnalysis]]<br />
#* [[TubeTK/Documentation/EnhanceUsingNJetDiscriminantAnalysis | EnhanceUsingNJetDiscriminantAnalysis]]<br />
#* [[TubeTK/Documentation/ImageCompareCommand | ImageCompareCommand]]<br />
#* [[TubeTK/Documentation/JsonCompareCommand | JsonCompareCommand]]<br />
#* [[TubeTK/Documentation/MergeAdjacentImages | MergeAdjacentImages]]<br />
#* [[TubeTK/Documentation/MergeTubeGraphs | MergeTubeGraphs]]<br />
#* [[TubeTK/Documentation/RegisterImages | RegisterImages]]<br />
#* [[TubeTK/Documentation/RegisterUsingImageCenters | RegisterUsingImageCenters]]<br />
#* [[TubeTK/Documentation/RegisterUsingSlidingGeometries | RegisterUsingSlidingGeometries]]<br />
#* [[TubeTK/Documentation/ResampleImage | ResampleImage]]<br />
#* [[TubeTK/Documentation/SampleCLIApplication | SampleCLIApplication]]<br />
#* [[TubeTK/Documentation/SegmentBinaryImageSkeleton | SegmentBinaryImageSkeleton]]<br />
#* [[TubeTK/Documentation/SegmentConnectedComponents | SegmentConnectedComponents]]<br />
#* [[TubeTK/Documentation/SegmentConnectedComponentsUsingParzenPDFs | SegmentConnectedComponentsUsingParzenPDFs]]<br />
#* [[TubeTK/Documentation/SegmentTubes | SegmentTubes]]<br />
#* [[TubeTK/Documentation/SegmentUsingOtsuThreshold | SegmentUsingOtsuThreshold]]<br />
#* [[TubeTK/Documentation/ShrinkImage | ShrinkImage]]<br />
#* [[TubeTK/Documentation/SimulateAcquisitionArtifactsUsingPrior | SimulateAcquisitionArtifactsUsingPrior]]<br />
#* [[TubeTK/Documentation/SubSampleTubes | SubSampleTubes]]<br />
#* [[TubeTK/Documentation/TextCompareCommand | TextCompareCommand]]<br />
#* [[TubeTK/Documentation/TransformTubes | TransformTubes]]<br />
#* [[TubeTK/Documentation/HessianVesselness2D | Hessian Vesselness 2D]]<br />
#* [[TubeTK/Documentation/ExtractCurves2D | Extract Curves 2D]]<br />
#* [[TubeTK/Documentation/ComputeTortuosity | Compute Tortuosity]]<br />
#* [[TubeTK/Documentation/Sliding_Organ_Registration | Sliding Geometries Registration]]<br />
# '''3D Slicer Python Applications'''<br />
#* [[TubeTK/Documentation/InteractivePDFSegmenter | Interactive PDF Segmenter]]<br />
<br />
= Modules =<br />
# Pre-processing<br />
#* [[TubeTK/Anisotropic Hybrid Diffusion with Continuous Switch|Anisotropic Hybrid Diffusion with Continuous Switch]]<br />
# Object segmentation<br />
# Tube extraction<br />
# Data structures<br />
# Topology analysis<br />
# Editing<br />
# Export<br />
# [[TubeTK/OpenIGTLink|OpenIGTLink]]<br />
# Python<br />
#* [http://nbviewer.ipython.org/5925084 Tube NumPy Array]<br />
<br />
= Related Efforts =<br />
<br />
* [[TubeTK/Related Work|Related Work]]<br />
<br />
|}<br />
<br />
[[Category:TubeTK|Documentation]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=58144TubeTK/Build Instructions2015-08-30T19:34:01Z<p>Aylward: /* Boost (optional) */</p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
* Mac: if compiling for compatibility with older versions of MacOS, you may need to build boost using the following command:<br />
** <code> ./b2 toolset=clang cxxflags="-stdlib=libstdc++" linkflags="-stdlib=libstdc++" link=static install -a </code><br />
** Slicer and TubeTK matches its build environment with the environment used to build qmake. This means that all code build using Slicer and TubeTK must also build using that environment. So, on some systems you will need to specify stdlib=libstdc++ (for 10.8) or stdlib-libc++ (for 10.9 and beyond). See the comments starting in line 103 of https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockSetCMakeOSXVariables.cmake<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57658TubeTK/Build Instructions2015-03-13T15:25:37Z<p>Aylward: </p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57657TubeTK/Build Instructions2015-03-13T15:25:13Z<p>Aylward: </p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
=== Linux and OS X ===<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57656TubeTK/Build Instructions2015-03-13T15:24:47Z<p>Aylward: </p>
<hr />
<div>= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== Slicer ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release</code><br />
* <code> cd TubeTK-Release</code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK</code><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57655TubeTK/Build Instructions2015-03-13T15:10:59Z<p>Aylward: /* Stand-Alone or Slicer-Dependent Builds */</p>
<hr />
<div>= Stand-Alone =<br />
<br />
In this build format, TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost (optional) ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
=== Python (optional) ===<br />
<br />
Versions 2.7.x is supported at this time.<br />
<br />
Download and install per system instructions at:<br />
* https://www.python.org/downloads/<br />
** Note that python is already installed in most Linux and Mac variants.<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Slicer-dependent build =<br />
<br />
This is the recommended build process.<br />
<br />
It uses a compiled version of Slicer to provide its dependencies. <br />
<br />
In this build format, <br />
# TubeTK produces a set of libraries and command-line programs that can be used to process images from the command line and to build other applications.<br />
# TubeTK methods are available from within the Slicer application against which it is built.<br />
<br />
This build format is tested nightly on Windows, OS X, and Linux machines.<br />
<br />
This build format has the following steps:<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
* <code> git clone https://github.com/KitwareMedical/TubeTK TubeTK </code><br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
* <code> mkdir TubeTK-Release </code><br />
* <code> cd TubeTK-Release </code><br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
* <code> cmake ../TubeTK </code><br />
<br />
Set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* <code> Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln </code><br />
** Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> Right click on the "ALL_BUILD" project and select "Build". </code><br />
** Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
*** <code> Right click on the "TubeTK" project and select "Build". </code><br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* <code> cd $HOME/TubeTK-Release </code><br />
* <code> make </code><br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* <code> cd $HOME/TubeTK-Release/TubeTK-build </code><br />
* <code> make </code><br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57654TubeTK/Build Instructions2015-03-13T14:54:25Z<p>Aylward: /* Slicer (Required for Slicer-Dependent Build) */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
* If you are building the Stand-Alone version of TubeTK, you do not need to build Slicer.<br />
<br />
* If you are building the Slicer-Dependent version of TubeTK, you must build Slicer from source:<br />
** Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57653TubeTK/Build Instructions2015-03-13T14:52:46Z<p>Aylward: /* Qt */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_3<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57652TubeTK/Build Instructions2015-03-13T14:52:05Z<p>Aylward: /* Qt */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions/Prerequisites/Qt#Windows_2<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57650TubeTK/Build Instructions2015-03-13T11:58:57Z<p>Aylward: /* Qt */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://qt-project.org/wiki/How_to_build_64bit_Qt_for_windows<br />
** and<br />
** http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/#comment-7546<br />
** when configuring, add the -webkit option<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57649TubeTK/Build Instructions2015-03-13T11:02:58Z<p>Aylward: /* Qt */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** You will want the 64-bit version of Qt, which must be compiled from source.<br />
** http://qt-project.org/wiki/How_to_build_64bit_Qt_for_windows<br />
** and<br />
** http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/#comment-7546<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57642TubeTK/Build Instructions2015-03-12T20:28:46Z<p>Aylward: /* Install Requirements and Options */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** <code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** <code> ./bootstrap.sh <br> </code><br />
** <code> ./bjam -j14 </code><br />
** <code> ./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14 </code><br />
<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57641TubeTK/Build Instructions2015-03-12T20:24:43Z<p>Aylward: /* Install Requirements and Options */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
<code> sudo apt-get install git </code><br />
<br />
=== Qt ===<br />
<br />
Install version 4.8.6<br />
* Windows<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
* Linux<br />
** Qt is included with most versions of Linux<br />
* Mac<br />
** Download the installer from<br />
*** http://download.qt.io/archive/qt/4.8/<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
<code> ./bootstrap.sh <br><br />
./bjam -j14<br />
./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14<br />
</code><br><br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run cmake and point it to where the source is located<br />
cmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57348TubeTK/Build Instructions2015-01-09T02:05:47Z<p>Aylward: /* Boost */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
<code> sudo apt-get install git </code><br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
<code> ./bootstrap.sh <br><br />
./bjam -j14<br />
./bjam cxxflags=-fPIC cflags=-fPIC -a link=static -j14<br />
</code><br><br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run ccmake and point it to where the source is located<br />
ccmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57347TubeTK/Build Instructions2015-01-09T02:03:21Z<p>Aylward: /* GIT (Requirement) */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
<code> sudo apt-get install git </code><br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
<code> ./bootstrap.sh <br><br />
./b2 cflags=-fPIC cxxflags=-fPIC link=static <br><br />
./bjam cflags=-fPIC cxxflags=-fPIC</code><br><br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run ccmake and point it to where the source is located<br />
ccmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57346TubeTK/Build Instructions2015-01-09T02:03:01Z<p>Aylward: /* Boost */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** > <code> sudo apt-get install git </code><br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
<code> ./bootstrap.sh <br><br />
./b2 cflags=-fPIC cxxflags=-fPIC link=static <br><br />
./bjam cflags=-fPIC cxxflags=-fPIC</code><br><br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run ccmake and point it to where the source is located<br />
ccmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57345TubeTK/Build Instructions2015-01-09T01:57:10Z<p>Aylward: /* Boost */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** > <code> sudo apt-get install git </code><br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
** > <code> ./bootstrap.sh</code><br />
** > <code> ./b2 cflags=-fPIC cxxflags=-fPIC link=static </code><br />
** > <code> ./bjam cflags=-fPIC cxxflags=-fPIC</code><br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run ccmake and point it to where the source is located<br />
ccmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57344TubeTK/Build Instructions2015-01-09T01:56:11Z<p>Aylward: /* Stand-Alone or Slicer-Dependent Builds */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
** > <code> sudo apt-get install git </code><br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
<code> <br />
./bootstrap.sh<br />
./b2 cflags=-fPIC cxxflags=-fPIC link=static <br />
./bjam cflags=-fPIC cxxflags=-fPIC<br />
</code><br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run ccmake and point it to where the source is located<br />
ccmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57343TubeTK/Build Instructions2015-01-09T01:54:06Z<p>Aylward: /* Stand-Alone or Slicer-Dependent Builds */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
<em> sudo apt-get install git </em><br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
<em> ./bootstrap.sh </em><br />
<em> ./b2 cflags=-fPIC cxxflags=-fPIC link=static </em><br />
<em> ./bjam cflags=-fPIC cxxflags=-fPIC </em><br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run ccmake and point it to where the source is located<br />
ccmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylwardhttps://public.kitware.com/Wiki/index.php?title=TubeTK/Build_Instructions&diff=57342TubeTK/Build Instructions2015-01-09T01:50:46Z<p>Aylward: /* Process */</p>
<hr />
<div>= Stand-Alone or Slicer-Dependent Builds =<br />
<br />
There are two ways in which TubeTK can be used:<br />
# "Stand-Alone"<br />
#* TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.<br />
# "Slicer-Dependent"<br />
#* TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.<br />
<br />
Both build types are tested nightly on Windows, OS X, and Linux machines.<br />
<br />
Both build process consists of the following steps<br />
* Install requirements and options<br />
* Download source<br />
* Configure using CMake<br />
* Build<br />
<br />
== Install Requirements and Options ==<br />
<br />
=== CMake (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* http://www.cmake.org<br />
<br />
=== GIT (Requirement) ===<br />
<br />
Install the latest stable release.<br />
* Windows<br />
** http://msysgit.github.io/<br />
* Linux<br />
sudo apt-get install git<br />
<br />
=== Boost ===<br />
<br />
Download and build Boost:<br />
* http://www.boost.org/<br />
<br />
Oddities<br />
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.<br />
./bootstrap.sh<br />
./b2 cflags=-fPIC cxxflags=-fPIC link=static<br />
./bjam cflags=-fPIC cxxflags=-fPIC<br />
<br />
<br />
=== Slicer (Required for Slicer-Dependent Build) ===<br />
<br />
If you are building the Stand-Alone version of TubeTK, you should not build Slicer.<br />
<br />
If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.<br />
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions<br />
* Binaries: http://download.slicer.org/<br />
<br />
Oddities<br />
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9. The simple fix is pending integration into Master. You can apply it manually. See https://github.com/Slicer/Slicer/pull/189/files<br />
<br />
== Download Source ==<br />
<br />
Download the source via git<br />
git clone https://github.com/KitwareMedical/TubeTK TubeTK<br />
<br />
== Configure ==<br />
<br />
Create a directory, outside of the source directory, to hold the compilation<br />
mkdir TubeTK-Release<br />
cd TubeTK-Release<br />
<br />
Within that compilation directory, run ccmake and point it to where the source is located<br />
ccmake ../TubeTK<br />
<br />
If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables<br />
* Build_TYPE = <same build type as Slicer installation: Debug or Release><br />
* TubeTK_USE_SLICER = On<br />
* Slicer_DIR = <Path to your Slicer build directory><br />
<br />
== Build ==<br />
<br />
=== Windows ===<br />
Load the TubeTK solution file in Visual Studio<br />
* Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
* Right click on the "ALL_BUILD" project and select "Build".<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
* Right click on the "TubeTK" project and select "Build".<br />
<br />
==== Linux and OS X ====<br />
Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.<br />
cd $HOME/TubeTK-Release<br />
make<br />
Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.<br />
cd $HOME/TubeTK-Release/TubeTK-build<br />
make<br />
<br />
= Build Using Slicer =<br />
<br />
<br />
[[Category:TubeTK|Build Instructions]]</div>Aylward