NPL
Neurological Programs and Libraries
|
This is a specialized viewer for computing the value of a cubic B-Spline interpolation from the parameters. Thus the input to the constructor or setArray must be a parameter image. More...
#include <accessors.h>
Inherits npl::NDView< T >.
Public Member Functions | |
BSplineView (std::shared_ptr< MRImage > params, BoundaryConditionT bound=ZEROFLUX) | |
BSplineView () | |
void | createOverlay (ptr< const MRImage > overlay, double bspace) |
bool | get (size_t len, const double *point, int dir, double &val, double &dval) |
Samples the BSpline function at the specified point. More... | |
double | get (size_t len, double *point) |
Simple sample function, just retrieve value at point, does not perform derivative. More... | |
ptr< MRImage > | reconstruct (ptr< const MRImage > input) |
Perform full-on reconstruction in the space of the input image. More... | |
ptr< MRImage > | reconstructNotAligned (ptr< const MRImage > input) |
ptr< MRImage > | reconstructAligned (ptr< const MRImage > input) |
double | thinPlateEnergy () |
double | thinPlateEnergy (size_t len, double *grad) |
double | jacobianDet (int dir) |
Computes the regularization term by integrating over the entire space for each knot. Thankfully integrals can be pre-computed (vConv, dvConv, ddvConv). See equations 66-71 in docs/bspline/fmri_dist_correct_2013-12-06.pdf. More... | |
double | jacobianDet (int dir, size_t len, double *grad) |
Computes the gradient of regularization for each of the knots. Thankfully integrals can be pre-computed (uConv, duConv, dduConv). See equations 54-59 in docs/bspline/fmri_dist_correct_2013-12-06.pdf. More... | |
ptr< MRImage > | getParams () |
Return the parameter image. More... | |
void | setArray (ptr< NDArray > in) |
T | operator[] (int64_t index) |
Gets value linear position in array, then casts to T. More... | |
T | operator[] (const std::vector< int64_t > &index) |
Gets value at array index and then casts to T. More... | |
T | get (const std::vector< int64_t > &index) |
Gets value at array index and then casts to T. More... | |
T | get (size_t len, int64_t *index) |
Gets value at array index and then casts to T. More... | |
void | set (size_t len, const int64_t *index, T v) |
Casts to the appropriate type then sets array at given index. More... | |
void | set (const std::vector< int64_t > &index, T v) |
Casts to the appropriate type then sets array at given index. More... | |
void | set (int64_t index, T v) |
Casts to the appropriate type then sets array at given index. More... | |
int64_t | tlen () |
Public Attributes | |
BoundaryConditionT | m_boundmethod |
How to handle boundaries (ZEROFLUX for constant outside bounds, ZERO for outside to be 0 and WRAP to wrap values, this might also be called periodic) More... | |
bool | m_ras |
if true, then this assumes the inputs are RAS coordinates rather than indexes. Default is false More... | |
double | vConv [5][5] |
double | dvConv [5][5] |
double | ddvConv [5][5] |
double | U200 [9][9][9] |
double | U110 [9][9][9] |
double | U100 [9][9][9] |
Static Protected Member Functions | |
template<typename U > | |
static T | castgetStatic (void *ptr) |
This is a wrapper function that will be called to safely cast from the underlying type. More... | |
template<typename U > | |
static void | castsetStatic (void *ptr, const T &val) |
This is a wrapper function that will be called to safely cast to the underlying type. More... | |
Protected Attributes | |
std::shared_ptr< NDArray > | parent |
Where to get the dat a from. Also the shared_ptr prevents dealloc. More... | |
T(* | castget )(void *ptr) |
Function pointer to the correct function for casting from the underlying type. More... | |
void(* | castset )(void *ptr, const T &v) |
Function pointer to the correct function for casting to the underlying type. This should be set during construction. More... | |
This is a specialized viewer for computing the value of a cubic B-Spline interpolation from the parameters. Thus the input to the constructor or setArray must be a parameter image.
estimate(in) will generate the parameters that minimize the least squares difference from the given image (in).
createOverlay(in) will create a new parameter array in params that extends for two knots outside the input image (in)
T | Value to interpolate as |
Definition at line 2049 of file accessors.h.
|
inline |
Definition at line 2052 of file accessors.h.
|
inline |
Definition at line 2057 of file accessors.h.
|
inlinestaticprotectedinherited |
This is a wrapper function that will be called to safely cast from the underlying type.
U | Underlying type of pixel, figured out in the constructor |
ptr | Pointer to memory where the pixel is. |
Definition at line 272 of file accessors.h.
|
inlinestaticprotectedinherited |
This is a wrapper function that will be called to safely cast to the underlying type.
U | Underlying type of pixel, figured out in the constructor |
ptr | Pointer to memory where the pixel is. |
val | new value to write |
Definition at line 287 of file accessors.h.
|
inline |
Definition at line 2059 of file accessors.h.
|
inlineinherited |
Gets value at array index and then casts to T.
index | n-d index to access |
Definition at line 170 of file accessors.h.
|
inlineinherited |
Gets value at array index and then casts to T.
len | length of index array |
index | n-d index to access |
Definition at line 186 of file accessors.h.
|
inline |
Samples the BSpline function at the specified point.
len | Length of point vector |
point | Point (if m_ras) or continuous index in parameter space |
dir | Dimension to take derivative in, must be >= 0 |
val | Return value at specified point |
dval | Return derivative of Bspline in dir direction |
Definition at line 2108 of file accessors.h.
|
inline |
Simple sample function, just retrieve value at point, does not perform derivative.
len | Length of point array |
point | Point (or if m_ras = false, then continuous index in parameter space) |
Definition at line 2198 of file accessors.h.
|
inline |
|
inline |
Computes the regularization term by integrating over the entire space for each knot. Thankfully integrals can be pre-computed (vConv, dvConv, ddvConv). See equations 66-71 in docs/bspline/fmri_dist_correct_2013-12-06.pdf.
Definition at line 2508 of file accessors.h.
|
inline |
Computes the gradient of regularization for each of the knots. Thankfully integrals can be pre-computed (uConv, duConv, dduConv). See equations 54-59 in docs/bspline/fmri_dist_correct_2013-12-06.pdf.
dir | Direction of distortion/deformation |
len | Length of grad vector |
grad | Vector of values, one for each parameter in the B-spline |
Definition at line 2565 of file accessors.h.
|
inlineinherited |
Gets value linear position in array, then casts to T.
Definition at line 155 of file accessors.h.
|
inlineinherited |
Gets value at array index and then casts to T.
index | n-d index to access |
Definition at line 201 of file accessors.h.
|
inline |
Perform full-on reconstruction in the space of the input image.
input |
Definition at line 2274 of file accessors.h.
|
inline |
Definition at line 2292 of file accessors.h.
|
inline |
Definition at line 2284 of file accessors.h.
|
inlineinherited |
Casts to the appropriate type then sets array at given index.
len | length of index array |
index | n-d index to access |
v | value to set at index |
Definition at line 218 of file accessors.h.
|
inlineinherited |
Casts to the appropriate type then sets array at given index.
v | value to set at index |
index | n-d index to access |
Definition at line 234 of file accessors.h.
|
inlineinherited |
Casts to the appropriate type then sets array at given index.
v | value to set at index |
index | n-d index to access |
Definition at line 250 of file accessors.h.
|
inlineinherited |
Definition at line 73 of file accessors.h.
|
inline |
Definition at line 2349 of file accessors.h.
|
inline |
Definition at line 2408 of file accessors.h.
|
inlineinherited |
Definition at line 258 of file accessors.h.
|
protectedinherited |
Function pointer to the correct function for casting from the underlying type.
ptr | location in memory where the pixel is stored |
Definition at line 303 of file accessors.h.
|
protectedinherited |
Function pointer to the correct function for casting to the underlying type. This should be set during construction.
ptr | pointer to memory |
v | value to cast and write |
Definition at line 313 of file accessors.h.
double npl::BSplineView< T >::ddvConv[5][5] |
Definition at line 2657 of file accessors.h.
double npl::BSplineView< T >::dvConv[5][5] |
Definition at line 2651 of file accessors.h.
BoundaryConditionT npl::BSplineView< T >::m_boundmethod |
How to handle boundaries (ZEROFLUX for constant outside bounds, ZERO for outside to be 0 and WRAP to wrap values, this might also be called periodic)
Definition at line 2630 of file accessors.h.
bool npl::BSplineView< T >::m_ras |
if true, then this assumes the inputs are RAS coordinates rather than indexes. Default is false
Definition at line 2643 of file accessors.h.
|
protectedinherited |
Where to get the dat a from. Also the shared_ptr prevents dealloc.
Definition at line 290 of file accessors.h.
double npl::BSplineView< T >::U100[9][9][9] |
Definition at line 3614 of file accessors.h.
double npl::BSplineView< T >::U110[9][9][9] |
Definition at line 3139 of file accessors.h.
double npl::BSplineView< T >::U200[9][9][9] |
Definition at line 2664 of file accessors.h.
double npl::BSplineView< T >::vConv[5][5] |
Definition at line 2645 of file accessors.h.