cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstNumerical
nmrPython.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
6
Author(s): Anton Deguet
7
Created on: 2010-07-12
8
9
(C) Copyright 2010-2016 Johns Hopkins University (JHU), All Rights Reserved.
10
11
--- begin cisst license - do not edit ---
12
13
This software is provided "as is" under an open source license, with
14
no warranty. The complete license can be found in license.txt and
15
http://www.cisst.org/cisst/license.txt.
16
17
--- end cisst license ---
18
19
*/
20
21
26
#pragma once
27
28
#ifndef _nmrPython_h
29
#define _ntmPython_h
30
31
#include <
cisstCommon/cmnPython.h
>
32
#include <
cisstVector/vctPython.h
>
33
34
#include <
cisstNumerical/nmrNetlib.h
>
35
36
#if CISST_HAS_CISSTNETLIB
37
#include <
cisstNumerical/nmrSVD.h
>
38
#include <
cisstNumerical/nmrPInverse.h
>
39
#include <
cisstNumerical/nmrRegistrationRigid.h
>
40
41
// Following is declared in cisstNumerical.i
42
std::pair<vctFrm3, double>
nmrRegistrationRigid
(
const
vctDynamicMatrix<double>
&dataSet1,
const
vctDynamicMatrix<double>
&dataSet2)
43
{
44
if
((dataSet1.cols() != 3) || (dataSet2.cols() != 3))
45
cmnThrow
(std::runtime_error(
"nmrRegistrationRigid: column size must be 3"
));
46
if
(dataSet1.rows() != dataSet2.rows())
47
cmnThrow
(std::runtime_error(
"nmrRegistrationRigid: number of data points (row sizes) must be equal"
));
48
const
vct3
*ptr1 =
reinterpret_cast<
const
vct3
*
>
(dataSet1.Pointer());
49
vctDynamicConstVectorRef<vct3>
d1(dataSet1.rows(), ptr1, 1);
50
const
vct3
*ptr2 =
reinterpret_cast<
const
vct3
*
>
(dataSet2.Pointer());
51
vctDynamicConstVectorRef<vct3>
d2(dataSet2.rows(), ptr2, 1);
52
vctFrm3
transform;
53
double
fre;
54
if
(!
nmrRegistrationRigid
(d1, d2, transform, &fre))
55
cmnThrow
(std::runtime_error(
"nmrRegistrationRigid: failed to compute registration"
));
56
return
std::pair<vctFrm3, double>(transform, fre);
57
}
58
59
#endif
60
61
#endif
// _nmrPython_h
vctDynamicConstVectorRef
Dynamic vector referencing existing memory (const).
Definition
vctDynamicConstVectorRef.h:79
vctDynamicMatrix
Definition
vctForwardDeclarations.h:157
cmnPython.h
Header files from cisstCommon required to compile the SWIG generated Python wrappers.
cmnThrow
void cmnThrow(const _exceptionType &except, cmnLogLevel lod=CMN_LOG_LEVEL_INIT_ERROR)
Definition
cmnThrow.h:76
nmrNetlib.h
nmrPInverse.h
Declaration of nmrPInverse.
nmrRegistrationRigid.h
nmrRegistrationRigid
bool CISST_EXPORT nmrRegistrationRigid(vctDynamicConstVectorBase< _vectorOwnerType, vct3 > &dataSet1, vctDynamicConstVectorBase< _vectorOwnerType, vct3 > &dataSet2, vctFrm3 &transform, double *fre=0)
nmrSVD.h
Declaration of nmrSVD.
vct3
vctFixedSizeVector< double, 3 > vct3
Definition
vctFixedSizeVectorTypes.h:46
vctPython.h
Header files from cisstVector required to compile the SWIG generated Python wrappers.
vctFrm3
vctFrameBase< vctRot3 > vctFrm3
Definition
vctTransformationTypes.h:137
Generated by
1.18.0