00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_SOIMAGEREGISTRATIONTRANSFORM_H_
00025 #define _SO_SOIMAGEREGISTRATIONTRANSFORM_H_
00026
00027 #include <Inventor/SbMatrix.h>
00028 #include <Inventor/fields/SoSFEnum.h>
00029 #include <Inventor/fields/SoSFMatrix.h>
00030 #include <Inventor/fields/SoSFInt32.h>
00031 #include <Inventor/fields/SoSFVec2f.h>
00032 #include <Inventor/fields/SoSFVec3i32.h>
00033 #include <Inventor/fields/SoSFBool.h>
00034
00035 #include <ImageViz/Fields/SoSFImageDataAdapter.h>
00036 #include <ImageViz/SoImageViz.h>
00037 #include <ImageViz/Engines/SoImageVizEngineOutput.h>
00038 #include <ImageViz/Engines/SoImageVizEngine.h>
00039 #include <ImageViz/Engines/SoSubImageVizEngine.h>
00040 #include <ImageViz/Nodes/Registration/SoRegistrationResult.h>
00041
00042
00142 class SoImageRegistrationTransform : public SoImageVizEngine
00143 {
00144 SO_IMAGEVIZ_ENGINE_HEADER( SoImageRegistrationTransform );
00145
00146 public:
00147
00153 struct RegistrationEvent : public SbEventArg
00154 {
00156 SoImageVizEngine* getSource() const
00157 {
00158 return m_engine;
00159 }
00160
00162 float getProgress() const
00163 {
00164 return m_progress;
00165 }
00166
00175 double getSimilarity() const
00176 {
00177 return m_similarity;
00178 }
00179
00181 SbMatrix getTransform() const
00182 {
00183 return m_transform;
00184 }
00185
00187 RegistrationEvent( SoImageVizEngine* engine, float progress, double similarity, const SbMatrix& matrix )
00188 : m_engine( engine ),
00189 m_progress( progress ),
00190 m_similarity( similarity ),
00191 m_transform( matrix )
00192 { }
00193
00195 ~RegistrationEvent() { }
00196
00197 private:
00198 SoImageVizEngine* m_engine;
00199 float m_progress;
00200 double m_similarity;
00201 SbMatrix m_transform;
00202 };
00203
00205 SbEventHandler<RegistrationEvent&> onProgressRegistration;
00206
00208 SoImageRegistrationTransform();
00209
00213 SoSFEnum computeMode;
00214
00216 SoSFImageDataAdapter inMovingImage;
00217
00219 SoSFImageDataAdapter inFixedImage;
00220
00223 SoSFMatrix initialTransform;
00224
00241 SoSFBool autoParameterMode;
00242
00264 SoSFVec2f optimizerStep;
00265
00283 SoSFVec3i32 coarsestResampling;
00284
00288 enum TransformationType
00289 {
00293 TRANSLATION = 4,
00294
00298 RIGID = 0,
00302 RIGID_ISOTROPIC_SCALING = 1,
00306 RIGID_ANISOTROPIC_SCALING = 2,
00310 AFFINE = 3,
00311 };
00312
00317 SoSFEnum transformType;
00318
00323 SoSFBool ignoreFinestLevel;
00324
00328 enum MetricType
00329 {
00338 EUCLIDIAN = 0,
00346 CORRELATION,
00360 NORMALIZED_MUTUAL_INFORMATION,
00361 };
00362
00367 SoSFEnum metricType;
00368
00369
00371 SoImageVizEngineOutput<SoSFFieldContainer, SoRegistrationResult*> outTransform;
00372
00374 SbMatrix getOutputTransformation()
00375 {
00376 return outTransform.getValue()->transformation.getValue();
00377 }
00378
00379 private:
00381 virtual ~SoImageRegistrationTransform();
00382 };
00383
00384 #endif //_SO_SOIMAGEREGISTRATIONTRANSFORM_H_
00385