zxhproj v 2.2
zxhproj
|
can input multiple images for registration m_pImageTest(ref) are the same, and used as coordinate reference, such as when define FFD m_pImageTest3D[?] and m_imgTest3DResampled[2][?] are other 3D test images (number: m_nImage3D) m_pImagRef3D[?] and m_imgRef3D[?] are other 3D ref images (number: m_nImage3D) GetValue and MetricGradient are first normalized by number of voxels computed More...
#include <zxhMetricMultiImageBase.h>
Public Member Functions | |
zxhMetricMultiImageBase (void) | |
constructor | |
~zxhMetricMultiImageBase (void) | |
virtual std::string | GetMetricType () |
virtual zxhMetricMultiImageBase * | Clone (zxhMetricMultiImageBase *&pRet) |
virtual void | SetNeedToUpdateOtherImageMetric (const bool b) |
should set true when SetImage, SetSampling, SetMask, SetTransform, etc. in metricbase | |
virtual bool | GetNeedToUpdateOtherImageMetric () const |
virtual void | SetOtherImage3D (int n, zxhImageData *pt, zxhImageData *pr) |
virtual void | SetWeightOtherImage3D (int n, const float f[]) |
virtual void | SetNormalizedWithNumberSamplePoint (bool b) |
virtual bool | GetNormalizedWithNumberSamplePoint (void) |
Protected Member Functions | |
virtual bool | UpdateOtherImageMetric (bool bupdate) |
virtual bool | Project3DVectorTo2DPlane (float *fc, zxhImageData *pImageSlice) |
virtual float | GetWeightedMetricValueOfOtherImages (zxhlfloat &fValue) |
fValue += num*m_afWeightImage3D*othermetric->GetValue; return sum_of_num*m_afWeightImage3D ; | |
virtual void | SetMultiMetricBase ()=0 |
Protected Attributes | |
bool | m_bNormalizedWithNumberSamplePoint |
zxhMetricBase * | m_pMImgMetricBase |
Pointer to this metric object, not clone-able. | |
zxhMetricBase * | m_pMImgMetricType |
metric type for clone of m_apMetric3D | |
bool | m_bNeedToUpdateOtherImageMetric |
int | m_nImage3D |
number of other 3D images for registration | |
float | m_afWeightImage3D [ZXHOTHERIMAGEMAX] |
default all 1 | |
zxhImageData * | m_pImageTest3D |
Pointer to original other 3D test images;. | |
zxhImageData | m_imgTest3DResampled [2][ZXHOTHERIMAGEMAX] |
Resample other 2D/3D test image to same spacing as sampling physical m_imgTest3DResampled[0][?], and resave to m_pImageTest space with mask m_imgTest3DResampled[1][?]. | |
zxhImageData * | m_pImageRef3D |
Pointer to other 3D ref images. | |
zxhImageData | m_imgRef3D [ZXHOTHERIMAGEMAX] |
If 3/4D copy m_pImageRef3D; if 2D, stack z-dim 2 slice with spacing[2]=0.5*sampling. | |
zxhMetricBase * | m_apMetric3D [ZXHOTHERIMAGEMAX] |
miffd2 metric for similarity and gradient computation (not a property) |
can input multiple images for registration m_pImageTest(ref) are the same, and used as coordinate reference, such as when define FFD m_pImageTest3D[?] and m_imgTest3DResampled[2][?] are other 3D test images (number: m_nImage3D) m_pImagRef3D[?] and m_imgRef3D[?] are other 3D ref images (number: m_nImage3D) GetValue and MetricGradient are first normalized by number of voxels computed
zxhMetricMultiImageBase::~zxhMetricMultiImageBase | ( | void | ) |
zxhMetricMultiImageBase * zxhMetricMultiImageBase::Clone | ( | zxhMetricMultiImageBase *& | pRet | ) | [virtual] |
bool zxhMetricMultiImageBase::Project3DVectorTo2DPlane | ( | float * | fc, |
zxhImageData * | pImageSlice | ||
) | [protected, virtual] |
gradient fc, project to 2D slice pImageSlice Origin_W ---> (Origin_W + fc_W) |(W2I) \|/ Origin_I ---> Origin_I + (_Ix,_Iy,_Iz)=(fc_I-w2i[0-2][3]) {noted:Origin_I=(0,0,0)} |(I2W) | (fc_Ix, fc_Iy, 0) \|/ \|/ Origin_W ---> Origin_W + (fc_W_on2dplane - i2w[0-2][3]) SO.... fc_W_on2dplane = I2W( setZtozero( W2I( fc_W ) ) )
gradient fc, project to 2D slice pImageSlice Origin_W ---> {Origin_W + fc_W} |(W2I) \|/ Origin_I ---> {Origin_I + (_Ix,_Iy,_Iz)=(fc_I-w2i[0-2][3]) } {noted:Origin_I=(0,0,0)} |(I2W){Origin_I + | (_Ix, _Iy, 0)=proj } \|/ \|/ Origin_W ---> {Origin_W + (proj_W - i2w[0-2][3]) } SO.... fc_W_on2dplane =
virtual void zxhMetricMultiImageBase::SetMultiMetricBase | ( | ) | [protected, pure virtual] |
this function is to remind of setting m_pMImgMetricBase and m_pMImgMetricType in derived class {m_pMImgMetricBase=this; m_pMimgMetricType=new Metric;}
Implemented in zxhMetricMIFFD2MultiImage, and zxhMetricMIMultiImage.
bool zxhMetricMultiImageBase::UpdateOtherImageMetric | ( | bool | bupdate | ) | [protected, virtual] |
1) check whether need to update 2) SetMultiMetricBase, clone metric (including sampling, mask, transform, diff... info) save all test image into the test space, with spacing to physical sample interval 3) set test and ref image ; update m_bNeedToUpdateOtherImageMetric return whether updated
Reimplemented in zxhMetricMIFFD2MultiImage.