zxhproj v 2.2
zxhproj
|
This class is used as tranformation class Transformation This class is an abstract class to represent the transformation, or gradient type of Metrics 在Transform中,只是针对imageTest,因为所谓的transform是对test image 进行transform,其实不涉及到别的image。只有在把test image transform完 后的image 映射到reference image时才与之有关系。而test与ref image的关系 是通过test原来的原点坐标(就是世界坐标)与ref image的原点坐标(也是世界坐标) 是一样的。 所以 T(x) = x' 为image 内部坐标x 变换到 内部坐标 x' AdjustTestToWorldicalx'*spacing or x*spacing 为世界坐标 smm smm 映射到ref image 上的坐标为 xref=smm/spacing_ref AdjustToRefGrid: x'(x)*spacing/spacing_ref = xref 1. setdimension, setimage before reading transform from file in order to keep consistency 2. transform type:AFF,FFD,FFDMI,FLD. More...
#include <zxhTransformBase.h>
Public Member Functions | |
zxhTransformBase () | |
construction | |
virtual | ~zxhTransformBase () |
deconstruct | |
virtual bool | SetImage (zxhImageData *pTest, zxhImageData *pRef) |
will set dimension of transformation same to image if the two image's dimension same | |
virtual zxhImageData * | GetTestImage () |
virtual zxhImageData * | GetRefImage () |
virtual int | GetDimension () |
dimension | |
virtual bool | SetDimension (int i) |
专门为把Transform当作导数类型用在梯度下降算法中 | |
virtual std::string | GetTransformType () |
return image type string in upper case, currently have | |
virtual zxhTransformBase * | Clone (zxhTransformBase *&pRet) |
if pRet==0, new one object in method of clone | |
virtual bool | TransformPointTo (float fVectorFrom[ImageDimensionMax], float fVectorTo[ImageDimensionMax]) |
virtual void | TransformPointToWorld (float fVectorFrom[ImageDimensionMax], float fVectorToWorld[ImageDimensionMax]) |
virtual void | TransformWorldToWorld (const float fVectorFromWorld[ImageDimensionMax], float fVectorToWorld[ImageDimensionMax])=0 |
virtual void | InverseTransformWorld (float fVectorToWorld[ImageDimensionMax], float fVectorFromWorld[ImageDimensionMax]) |
inverse transform, input fVectorToWorld, output fVectorFromWorld | |
virtual bool | GetJacobianMatrix (float fVector[ImageDimensionMax], float pJacobian[ImageDimensionMax *ImageDimensionMax]) |
pJacobian[i*4+0..3] = dX/dx.dy.dz.dt | |
virtual bool | GetJacobianMatrixWorld (float fWorld[ImageDimensionMax], float pJacobian[ImageDimensionMax *ImageDimensionMax]) |
virtual void | TransformIntensityGradientVectorTo (float fVectorFrom[ImageDimensionMax], float fVectorTo[ImageDimensionMax], float *fWorldFrom) |
virtual void | InverseTransformIntensityGradientVector (float fVectorRef[ImageDimensionMax], float fInverseVectorTest[ImageDimensionMax], float *fWorldTest) |
inverse dC/dx1=dC/dy1*dy1/dx1 + dC/dy2*dy2/dx1 + dC/dy3*dy3/dx1 | |
virtual bool | SetTransformPara (float) |
operators | |
virtual bool | GetAdd (zxhTransformBase *, zxhTransformBase *) |
A+B. | |
virtual bool | Add (zxhTransformBase *) |
+ | |
virtual bool | GetSubtract (zxhTransformBase *, zxhTransformBase *) |
A-B. | |
virtual bool | Subtract (zxhTransformBase *) |
virtual bool | GetMultiply (zxhTransformBase *, float) |
A*f. | |
virtual bool | Multiply (float) |
* | |
virtual bool | GetMultiplyByPara (zxhTransformBase *, zxhTransformBase *) |
A*B. | |
virtual bool | MultiplyByPara (zxhTransformBase *) |
*B | |
virtual float | GetMagnitudeAsVector () |
transformation regarded as a vector | |
virtual float | GetMaxLocalMagnitudeAndNormalisation (bool bNormalisationByLocalMagnitude) |
for optimization step length normalization | |
virtual float | GetMaxAbsValueFromParameters () |
virtual float | GetPointMutiplyAsVector (zxhTransformBase *) |
virtual bool | SetTransformIdentity ()=0 |
set transformation as a identity transform | |
virtual bool | SetTransformFromStream (std::ifstream &ifs) |
read transformation from stream, donot care the comments | |
virtual bool | SetTransformFromFile (const char *pFile) |
from file | |
virtual std::string | GetTransformFileName () |
virtual std::string | GetPrintString () |
virtual bool | SaveTransform2Disc (std::string sFileNameWithoutExt) |
save to disc | |
virtual float | Guarantee1To1 (void) |
virtual void | SetGuarantee1To1Effected (bool b=true) |
set | |
virtual bool | AdvanceStep (zxhTransformBase *p, float f=1) |
for registration optimization | |
void | AdjustTestImageToWorld (float afTest[]) |
void | AdjustWorldToRefImage (float afRef[]) |
ajust the world coodinate in reference image's world coordinate to reference image grid | |
virtual int | GetNoParameters ()=0 |
virtual float | GetParameters (int index)=0 |
virtual bool | SetParameterValue (int index, float f)=0 |
virtual int | GetDegreeOfFreedom () |
get transforms DOF | |
virtual int | GetDOFWithValue (float f) |
get parameter value >= f , dof | |
virtual int | GetActiveDof () |
Protected Attributes | |
int | m_iDimension |
dimension of transformation, currently only same as image | |
bool | m_bEffect1to1 |
state of whether guarantee the transformation as smooth as one to one | |
zxhImageData * | m_pImageTest |
not transformation property | |
zxhImageData * | m_pImageRef |
ref image | |
std::string | m_strFileName |
Static Protected Attributes | |
static const unsigned int | static_buffer_size_of_base = 1024 |
constant value |
This class is used as tranformation class Transformation This class is an abstract class to represent the transformation, or gradient type of Metrics 在Transform中,只是针对imageTest,因为所谓的transform是对test image 进行transform,其实不涉及到别的image。只有在把test image transform完 后的image 映射到reference image时才与之有关系。而test与ref image的关系 是通过test原来的原点坐标(就是世界坐标)与ref image的原点坐标(也是世界坐标) 是一样的。 所以 T(x) = x' 为image 内部坐标x 变换到 内部坐标 x' AdjustTestToWorldicalx'*spacing or x*spacing 为世界坐标 smm smm 映射到ref image 上的坐标为 xref=smm/spacing_ref AdjustToRefGrid: x'(x)*spacing/spacing_ref = xref 1. setdimension, setimage before reading transform from file in order to keep consistency 2. transform type:AFF,FFD,FFDMI,FLD.
2010-sep-10, xiahai add: GetTransformationDerivativeByParameter
void zxhTransformBase::AdjustTestImageToWorld | ( | float | afTest[] | ) | [inline] |
adjust the coordinate of the transformed point to the coordinate system of the reference image, considering the different spacing this is much more complicated than statement here, consider interpolation is based on image lattice points
bool zxhTransformBase::GetJacobianMatrix | ( | float | fVector[ImageDimensionMax], |
float | pJacobian[ImageDimensionMax *ImageDimensionMax] | ||
) | [virtual] |
pJacobian[i*4+0..3] = dX/dx.dy.dz.dt
Reimplemented in zxhTransformAffine.
bool zxhTransformBase::GetJacobianMatrixWorld | ( | float | fWorld[ImageDimensionMax], |
float | pJacobian[ImageDimensionMax *ImageDimensionMax] | ||
) | [virtual] |
Get partial differential of transformation [Y1 Y2 Y3]=T(x), with respect to the transformation parameter Ti with index return whether success, results (e.g. 3D, [d(Y1)/d(Ti) d(Y2)/d(Ti) d(Y3)/d(Ti)]) returned in g[4]
Reimplemented in zxhTransformAffine, and zxhTransformLocalAffines.
virtual int zxhTransformBase::GetNoParameters | ( | ) | [pure virtual] |
Get partial differential of transformation [Y1 Y2 Y3]=T(x), with respect to the transformation parameter Ti with index return whether success, results (e.g. 3D, [d(Y1)/d(Ti) d(Y2)/d(Ti) d(Y3)/d(Ti)]) returned in g[4]
Implemented in zxhTransformAffine, zxhTransformCmriShiftCorrect, zxhTransformFFDBase, zxhTransformFields, zxhTransformMultipleAffines, and zxhTransformMultiRigid.
float zxhTransformBase::GetPointMutiplyAsVector | ( | zxhTransformBase * | p | ) | [virtual] |
Reimplemented in zxhTransformAffine, and zxhTransformMultipleAffines.
std::string zxhTransformBase::GetPrintString | ( | void | ) | [virtual] |
description of the transformation type(not gradient), can be saved to disk as a file and read by SetTransformFromFile
Reimplemented in zxhTransformAffine, zxhTransformCmriShiftCorrect, zxhTransformFFD, zxhTransformFFDBase, zxhTransformFields, zxhTransformLocalAffines, zxhTransformLocalAffines2, zxhTransformMatrix, zxhTransformMultipleAffines, and zxhTransformMultiRigid.
virtual zxhImageData* zxhTransformBase::GetRefImage | ( | ) | [inline, virtual] |
virtual zxhImageData* zxhTransformBase::GetTestImage | ( | ) | [inline, virtual] |
virtual float zxhTransformBase::Guarantee1To1 | ( | void | ) | [inline, virtual] |
make the transformation one to one, currently only for FFD return the portion of degrees needs corrections
Reimplemented in zxhTransformFFDBase.
bool zxhTransformBase::SaveTransform2Disc | ( | std::string | sFileNameWithoutExt | ) | [virtual] |
virtual bool zxhTransformBase::SetParameterValue | ( | int | index, |
float | f | ||
) | [pure virtual] |
set transformation parameter value, if the transformation model need pre-computation from parameters for efficiency such as affine, then re-implement this function to call the pre-computation method after set the value
Implemented in zxhTransformAffine, zxhTransformCmriShiftCorrect, zxhTransformFFDBase, zxhTransformFields, zxhTransformMultipleAffines, and zxhTransformMultiRigid.
virtual bool zxhTransformBase::TransformPointTo | ( | float | fVectorFrom[ImageDimensionMax], |
float | fVectorTo[ImageDimensionMax] | ||
) | [inline, virtual] |
return whether is outlier point given reference image fVectorFrom is the grid coordinate of test image and fVectorTo is a return value of grid coordinate of reference image if the test/ref image is not set then the coordinate is regarded as world coordinate hence they can be seen as with image spacing 1mm
virtual void zxhTransformBase::TransformPointToWorld | ( | float | fVectorFrom[ImageDimensionMax], |
float | fVectorToWorld[ImageDimensionMax] | ||
) | [inline, virtual] |