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
00146 class SoImageRegistrationTransform : public SoImageVizEngine
00147 {
00148 SO_IMAGEVIZ_ENGINE_HEADER( SoImageRegistrationTransform );
00149
00150 public:
00151
00157 struct RegistrationEvent : public SbEventArg
00158 {
00160 SoImageVizEngine* getSource() const
00161 {
00162 return m_engine;
00163 }
00164
00166 float getProgress() const
00167 {
00168 return m_progress;
00169 }
00170
00179 double getSimilarity() const
00180 {
00181 return m_similarity;
00182 }
00183
00185 SbMatrix getTransform() const
00186 {
00187 return m_transform;
00188 }
00189
00191 RegistrationEvent( SoImageVizEngine* engine, float progress, double similarity, const SbMatrix& matrix )
00192 : m_engine( engine ),
00193 m_progress( progress ),
00194 m_similarity( similarity ),
00195 m_transform( matrix )
00196 { }
00197
00199 ~RegistrationEvent() { }
00200
00201 private:
00202 SoImageVizEngine* m_engine;
00203 float m_progress;
00204 double m_similarity;
00205 SbMatrix m_transform;
00206 };
00207
00209 SbEventHandler<RegistrationEvent&> onProgressRegistration;
00210
00212 SoImageRegistrationTransform();
00213
00217 SoSFEnum computeMode;
00218
00220 SoSFImageDataAdapter inMovingImage;
00221
00223 SoSFImageDataAdapter inFixedImage;
00224
00227 SoSFMatrix initialTransform;
00228
00245 SoSFBool autoParameterMode;
00246
00268 SoSFVec2f optimizerStep;
00269
00281 SoSFVec2f intensityRangeReference;
00282
00293 SoSFVec2f intensityRangeModel;
00294
00312 SoSFVec3i32 coarsestResampling;
00313
00314 enum RangeMode{
00318 MIN_MAX = 0,
00322 OTHER = 1
00323 };
00324
00331 SoSFEnum rangeModeReference;
00332
00339 SoSFEnum rangeModeModel;
00340
00344 enum TransformationType
00345 {
00349 TRANSLATION = 4,
00350
00354 RIGID = 0,
00358 RIGID_ISOTROPIC_SCALING = 1,
00362 RIGID_ANISOTROPIC_SCALING = 2,
00366 AFFINE = 3,
00367 };
00368
00373 SoSFEnum transformType;
00374
00379 SoSFBool ignoreFinestLevel;
00380
00384 enum MetricType
00385 {
00392 EUCLIDIAN = 0,
00400 CORRELATION,
00414 NORMALIZED_MUTUAL_INFORMATION,
00415 };
00416
00421 SoSFEnum metricType;
00422
00423
00426 SoImageVizEngineOutput<SoSFFieldContainer, SoRegistrationResult*> outTransform;
00427
00429 SbMatrix getOutputTransformation()
00430 {
00431 return outTransform.getValue()->transformation.getValue();
00432 }
00433
00434 private:
00436 virtual ~SoImageRegistrationTransform();
00437 };
00438
00439 #endif //_SO_SOIMAGEREGISTRATIONTRANSFORM_H_
00440