FRAT/Library: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 114: | Line 114: | ||
==== VectorImageTimeSeriesXD ==== | ==== VectorImageTimeSeriesXD ==== | ||
The VectorImageTimeSeriesXD data structures act as container classes for the data computed during time series registration. Additionally, they provide functionality to use the computed velocity field to interpolate an image or displacement map at any time-point along the series trajectory. The important members of the data structure are: | |||
* ''VSeries'': The series of velocity fields between each known image in the time series | |||
* ''ISet'': The set of known images for the time series | |||
* ''MapSet'': The set of displacement maps used to initialize the transformations for each known image | |||
* ''timeSet'': The set of times associated with ISet and MapSet | |||
* ''IPathSet'': The paths to each of the known images. This is used when saving a time series object so that the images can be re-read later | |||
* ''AlgParams'': The parameters used to compute the time series | |||
=== Utility Functions === | === Utility Functions === | ||
FRAT has a collection of utility classes that contain static functions for operating on the data structures. These classes are divided based on the data structure they cater to. Additionally, a set of more advanced algorithmic parameters is provided in LDDMMUtils and a set of utilities for writing applications is provided in ApplicationUtils. The utility classes are: | FRAT has a collection of utility classes that contain static functions for operating on the data structures. These classes are divided based on the data structure they cater to. Additionally, a set of more advanced algorithmic parameters is provided in LDDMMUtils and a set of utilities for writing applications is provided in ApplicationUtils. The utility classes are: | ||
* VectorImage2DUtils | * ''VectorImage2DUtils'' and ''VectorImage3DUtils'': Basic utilities, including IO, for the VectorImageXD data structures | ||
* ''VectorField2DUtils'' and ''VectorField3DUtils'': Utilities specific to the displacement field nature of the VectorFieldXD data structures. Use VectorImageXDUtils for IO. | |||
* VectorField2DUtils | * ''TimeSeries2DUtils'' and ''TimeSeries3DUtils'': IO utilities for the VectorImageTimeSeriesXD data structures. | ||
* ''LDDMMUtils'': Subroutines for LDDMM registration. | |||
* TimeSeries2DUtils | * ''ApplicationUtils'': Front-end utilities such as string parsing and path verification for writing executables | ||
* LDDMMUtils | |||
* ApplicationUtils | |||
=== Algorithims === | |||
FRAT implements a set of algorithms based on LDDMM registration. The lowest-level algorithms are: | |||
* ''FlowAdvectionSemiLagrangian'': Flow a volume using a provided velocity field. This implements a discrete solution to the advection equation and is a core component in the LDDMM registration algorithm. | |||
* ''FlowScalarConsrvation'': Flow a volume using a provided velocity field while conserving overall volume intensity. This implements a discrete solution to the scalar conservation equation and is a core component in the LDDMM registration algorithm. | |||
The higher-level algorithms are used to perform various registration tasks. Each algorithm is implemented first with a single-scale system and then augmented with a multiscale wrapper. These algorithms are: | |||
* ''LDDMMAdjoint'': Fluid registration from a source image to a target image | |||
* ''AtlasBuilder'': Cross-sectional atlas construction for a set of images | |||
* ''TimeSeries'': Fluid registration between a series of N time-point images | |||
* ''GeometricMetamorphosis'': Fluid registration between images with structural differences | |||
Finally, the ''LongitudinalAtlasBuilder'' algorithm uses TimeSeries and AtlasBuilder internally to create an average growth model for a longitudinal population of subjects. | |||
|- | |- | ||
|} | |} |
Latest revision as of 23:19, 11 August 2011
__NOTITLE__
|
FRAT as a LibraryIn addition to command line executables, FRAT provides a C++ library that can be used in external projects. Since FRAT is currently only available as source code, you must first follow the instructions in the Installation Guide to build FRAT. Using libFRAT in an External ProjectOnce built, the steps for using FRAT in your own CMake project are:
find_package(FRAT REQUIRED) if(FRAT_FOUND) include(${FRAT_USE_FILE}) else(FRAT_FOUND) message(FATAL_ERROR "FRAT not found. Please set FRAT_DIR.") endif(FRAT_FOUND)
add_library(bar bar.cxx) target_link_libraries(bar ${FRAT_LIBRARIES}) add_executable(foo foo.cxx) target_link_libraries(foo bar ${FRAT_LIBRARIES})
Basic Concepts in FRATThis section outlines some of the basics of the FRAT project so you can learn how to use libFRAT in your own project. Data StructuresFRAT provides libraries for working with both 2D and 3D vector-valued images. Most functions and algorithms are implemented for both 2D and 3D, so for the sake of brevity, we'll use XD in place of 2D or 3D. At this time, FRAT is not generalized to arbitrary dimensionality. The base data classes in FRAT are the VectorArrayXD classes. These templated classes store XD vector-valued data of any type. Throughout the code, they are used only as the superclass for the float-based VectorImageXD and VectorFieldXD classes. VectorImageXDThe VectorImage2D and VectorImage3D classes offer basic vector-value XD image functionality with float type pixels. The following trivial example shows a simple operation using the VectorImage2D type and then deletes the image. In this case it simply sets the value of each pixel to the value of the x index times the value of the y index. unsigned int szX = 100; unsigned int szY = 50; unsigned int dim = 1; VectorImage2D* im = new VectorImage2D(szX, szY, dim); for (unsigned int y = 0; y < szY; y++) { for (unsigned int x = 0; x < szX; x++) { for (unsigned int d = 0; d < dim; d++) { im->setValue(x,y,d, x*y); } } } delete im;
unsigned int szX = 100; unsigned int szY = 50; unsigned int dim = 1; float spX = 0.1; float spY = 0.2; float spFct = 0.01; VectorImage2D* im = new VectorImage2D(szX, szY, dim, spX, spY, spFct);
VectorFieldXDThe other primary data type used in FRAT is vector fields, implemented in the VectorField2D and VectorField3D classes. In practice these classes are simply subclasses of the VectorImageXD classes where the vector size is specified as 2 for 2D fields and 3 for 3D fields. In theory, however, these classes should be thought of as separate entities from the VectorImageXD classes. To access vector components, these classes provide axis specific get and set methods such as getX(x,y,d) and setX(x,y,d, val). Since the dimensionality is fixed for vector fields, a dim value cannot be included when instantiating a field. For example: unsigned int szX = 100; unsigned int szY = 50; float spX = 0.1; float spY = 0.2; float spFct = 0.01; VectorField2D* fld = new VectorField2D(szX, szY, spX, spY, spFct); When using VectorFieldXD objects in conjunction with VectorImageXD objects, it is important that the fields use the same spacings and space factor as the images. VectorImageTimeSeriesXDThe VectorImageTimeSeriesXD data structures act as container classes for the data computed during time series registration. Additionally, they provide functionality to use the computed velocity field to interpolate an image or displacement map at any time-point along the series trajectory. The important members of the data structure are:
Utility FunctionsFRAT has a collection of utility classes that contain static functions for operating on the data structures. These classes are divided based on the data structure they cater to. Additionally, a set of more advanced algorithmic parameters is provided in LDDMMUtils and a set of utilities for writing applications is provided in ApplicationUtils. The utility classes are:
AlgorithimsFRAT implements a set of algorithms based on LDDMM registration. The lowest-level algorithms are:
The higher-level algorithms are used to perform various registration tasks. Each algorithm is implemented first with a single-scale system and then augmented with a multiscale wrapper. These algorithms are:
Finally, the LongitudinalAtlasBuilder algorithm uses TimeSeries and AtlasBuilder internally to create an average growth model for a longitudinal population of subjects. |