Git Product home page Git Product logo

btkcore's People

Contributors

alzathar avatar klshrinidhi avatar modenaxe avatar moorepants avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

btkcore's Issues

Improve the parser of the BSF file format to support the version number 105

From Marcos Duarte on the mailing-list:

Now, the AMTI .bsf file has a new version number, 105. The difference in relation to version 100 (the version BTK can read) is that data is saved as 8-byte doubles and not anymore as 2-byte integers. And the data is already in engineering units, at least when a new AMTI amplifier is used and the full conditioned mode is selected in the AMTI configuration software.

For whom is interested, the following page describes a Python code to open the .bsf file at the new version 105: https://github.com/demotu/BMC/blob/master/notebooks/AMTIbsfFile.ipynb.

cmake error

cmake fails to find Numpy for making the python wrapping even after I manually input the outputs of import numpy as np; np.get_include(); np.__version__ in the NUMPY_INCLUDE_DIR and NUMPY_VERSION in the cmake options.

I am using python 3.5 on Ubuntu 16.10 (kernel version 4.4.0-31), python 3.5.1 and numpy version 1.11.1. I have tried to build it on the commit d4c03aa9e354be16265d0efe0815c09b35abc642

Can anyone please help?

btkGroundReactionWrenchFilter.h - BTK Matlab Wrapping - QUESTIONS

Hi all,

I originally posted this question on the Google User Group but I did not receive any replies so I thought I would try my luck here! (Apologies for double posting!).

Firstly, Arnaud thank you very much for developing BTK - I am a relatively new PhD student and I am using your BTK Matlab wrapping functions to generate the necessary input files for use with OpenSim. Your software is extremely useful and versatile, please continue the excellent work! :-)

I have a few queries regarding the btkGroundReactionWrenchFilter.h that I was wondering if you could please answer? or perhaps other more experienced BTK users.

GitHub code link - https://github.com/Biomechanical-ToolKit/BTKCore/blob/master/Code/BasicFilters/btkGroundReactionWrenchFilter.h

  1. Regarding line 93, M_s = M_o + F x OS, and the subsequent three lines (94-96). Is M_o referring to the moments calculated about force platforms geometric centre? Whilst M_s is referring to the moments calculated about the force platforms top surface?

  2. The Point of Wrench Application (PWA) should only have values for Med-Lat (X-axis) and Ant-Post (Y-axis) directions, meanwhile the Vertical direction (Z-axis) should be zero - however my Z-axis PWA values are not zero (~ -0.003 m) ... are these values non-zero due to being subsequently expressed in the Global Coordinate System (GCS)? Which would suggest there is a misalignment between my Force Platform vertical direction and the GCS... I should also point out that I have added an additional surface to force platform and accounted for this additional height within the force platform parameters - it is not however a perfectly rigid surface, it is somewhat compliant.

  3. Line 115, M_pwa = M_s + F_s x PWA, and the subsequent three lines (116-118). M_pwa refers to the moment about the PWA - I believe. Do these moments represent the free moments? If so does the moment about the vertical axis of the PWA represent what is commonly termed Tz? and therefore the remaining horizontal moments about the PWA should both equal zero?

  4. Lastly, are the subsequent forces, PWA and moments transformed to be expressed in my GCS?

Apologies for the lengthy message.

Kind regards,

Nicos Haralabidis

Building in Windows 7 with MinGW 5.3.0

I tried to build with MinGW but it is impossible. Here are errors I received:

C:\libs\BTKCore-master\build>mingw32-make
Scanning dependencies of target BTKCommon
[ 0%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkAcquisition.c
pp.obj
[ 1%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkAnalog.cpp.ob
j
[ 2%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkDataObject.cp
p.obj
[ 3%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkEvent.cpp.obj

[ 4%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkForcePlatform
.cpp.obj
[ 4%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkLogger.cpp.ob
j
[ 5%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkPoint.cpp.obj

[ 6%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkMetaData.cpp.
obj
[ 7%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkMetaDataInfo.
cpp.obj
[ 7%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkMetaDataUtils
.cpp.obj
[ 8%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkIMU.cpp.obj
[ 9%] Building CXX object Code/Common/CMakeFiles/BTKCommon.dir/btkObject.cpp.ob
j
C:\libs\BTKCore-master\Code\Common\btkObject.cpp: In member function 'virtual vo
id btk::Object::Modified()':
C:\libs\BTKCore-master\Code\Common\btkObject.cpp:88:12: error: 'LONG' does not n
ame a type
static LONG _atomic_time = 0;
^
C:\libs\BTKCore-master\Code\Common\btkObject.cpp:89:62: error: '_atomic_time' wa
s not declared in this scope
this->m_Timestamp = (unsigned long)InterlockedIncrement(&_atomic_time);
^
C:\libs\BTKCore-master\Code\Common\btkObject.cpp:89:74: error: 'InterlockedIncre
ment' was not declared in this scope
this->m_Timestamp = (unsigned long)InterlockedIncrement(&_atomic_time);
^
Code\Common\CMakeFiles\BTKCommon.dir\build.make:337: recipe for target 'Code/Com
mon/CMakeFiles/BTKCommon.dir/btkObject.cpp.obj' failed
mingw32-make[2]: *** [Code/Common/CMakeFiles/BTKCommon.dir/btkObject.cpp.obj] Er
ror 1
CMakeFiles\Makefile2:108: recipe for target 'Code/Common/CMakeFiles/BTKCommon.di
r/all' failed
mingw32-make[1]: *** [Code/Common/CMakeFiles/BTKCommon.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

I wish anyone would fix that. Thanks.

Question about getting units & data-rate from C3D

We are using BTK to read C3D files into OpenSim data-structure.
Here is my understanding so far. In order to get the raw forces, moments and positions from force platforms using BTK, I follow these steps --

  • Extract the collection of force platforms from the acquisition.
  • For each force platform:
    • Get the calibration matrix, corners and origin for the force platform.
    • Feed the force platform to the ground reaction wrench filter to get the collection of wrenches for that force platform.
    • For each wrench:
      • Get forces, moments and positions from the wrench.

I am currently using the following snippet to do the above. My questions:

  • How to get the units of various physical quantities -- forces, moments, positions, corners, origin ?
  • How to get the data-rate for forces, moments & positions ?
    auto reader = btk::AcquisitionFileReader::New();
    reader->SetFilename(fileName);
    reader->Update();
    auto acquisition = reader->GetOutput();

    auto    marker_pts = btk::PointCollection::New();
    auto usr_force_pts = btk::PointCollection::New();
    for(auto it = acquisition->BeginPoint();
        it != acquisition->EndPoint();
        ++it) {
        auto pt = *it;
        if(pt->GetType() == btk::Point::Marker)
               marker_pts->InsertItem(pt);
        else if(pt->GetType() == btk::Point::Force)
            usr_force_pts->InsertItem(pt);
    }

    if(marker_pts->GetItemNumber() != 0) {
        auto datarate =  acquisition->GetPointFrequency();
        auto units = acquisition->GetPointUnit();

        std::vector<std::string> marker_labels{};
        for(auto it = marker_pts->Begin();
            it != marker_pts->End();
            ++it)
            marker_labels.push_back((*it)->GetLabel());

        double time_step{1.0 / acquisition->GetPointFrequency()};
        for(size_t f = 0;
            f < marker_pts->GetFrontItem()->GetFrameNumber();
            ++f) {
            for(auto it = marker_pts->Begin();
                it != marker_pts->End();
                ++it) {
                auto pt = *it;
                auto x = pt->GetValues().coeff(f, 0);
                auto y = pt->GetValues().coeff(f, 1);
                auto z = pt->GetValues().coeff(f, 2);
            }
        }
    }

    if(usr_force_pts->GetItemNumber() != 0) {
        std::vector<std::string> force_labels{};
        for(auto it = usr_force_pts->Begin();
            it != usr_force_pts->End();
            ++it) {
            auto pt = *it;
            force_labels.push_back(pt->GetLabel());
        }

        double time_step{1.0 / acquisition->GetAnalogFrequency()};
        for(size_t f = 0;
            f < usr_force_pts->GetFrontItem()->GetFrameNumber();
            ++f) {
            for(auto it = usr_force_pts->Begin();
                it != usr_force_pts->End();
                ++it) {
                auto pt = *it;
                auto x = pt->GetValues().coeff(f, 0);
                auto y = pt->GetValues().coeff(f, 1);
                auto z = pt->GetValues().coeff(f, 2);
            }
            usr_force_table.appendRow(0 + f * time_step, row);
        }
    }

    auto force_platforms_extractor = btk::ForcePlatformsExtractor::New();
    force_platforms_extractor->SetInput(acquisition);
    auto force_platform_collection = force_platforms_extractor->GetOutput();
    force_platforms_extractor->Update();

    std::vector<btk::ForcePlatform::CalMatrix> fp_cal_matrices{};
    std::vector<btk::ForcePlatform::Corners>   fp_corners{};
    std::vector<btk::ForcePlatform::Origin>    fp_origins{};
    std::vector<unsigned>                      fp_types{};
    auto    fp_force_pts = btk::PointCollection::New();
    auto   fp_moment_pts = btk::PointCollection::New();
    auto fp_position_pts = btk::PointCollection::New();
    for(auto platform = force_platform_collection->Begin();
        platform != force_platform_collection->End();
        ++platform) {
        fp_cal_matrices.push_back((*platform)->GetCalMatrix());
        fp_corners.push_back((*platform)->GetCorners());
        fp_origins.push_back((*platform)->GetOrigin());
        fp_types.push_back(static_cast<unsigned>((*platform)->GetType()));

        auto ground_reaction_wrench_filter =
            btk::GroundReactionWrenchFilter::New();
        ground_reaction_wrench_filter->SetInput(*platform);
        auto wrench_collection = ground_reaction_wrench_filter->GetOutput();
        ground_reaction_wrench_filter->Update();

        for(auto wrench = wrench_collection->Begin();
            wrench != wrench_collection->End();
            ++wrench) {
            // Forces time series.                                                                                                                                                                                                                                                         
            fp_force_pts->InsertItem((*wrench)->GetForce());
            // Moment time series.                                                                                                                                                                                                                                                         
            fp_moment_pts->InsertItem((*wrench)->GetMoment());
            // Position time series.                                                                                                                                                                                                                                                       
            fp_position_pts->InsertItem((*wrench)->GetPosition());
        }
    }
        double time_step{1.0 / acquisition->GetAnalogFrequency()};
        for(size_t f = 0;
            f < fp_force_pts->GetFrontItem()->GetFrameNumber();
            ++f) {
            for(auto fit = fp_force_pts->Begin(),
                mit =     fp_moment_pts->Begin(),
                pit =   fp_position_pts->Begin();
                fit != fp_force_pts->End();
                ++fit,
                ++mit,
                ++pit) {
                auto fx = (*fit)->GetValues().coeff(f, 0);
                auto fy = (*fit)->GetValues().coeff(f, 1);
                auto fz = (*fit)->GetValues().coeff(f, 2)};
                auto mx = (*mit)->GetValues().coeff(f, 0);
                auto my = (*mit)->GetValues().coeff(f, 1);
                auto mz = (*mit)->GetValues().coeff(f, 2);
                auto px = (*pit)->GetValues().coeff(f, 0);
                auto py = (*pit)->GetValues().coeff(f, 1);
                auto pz = (*pit)->GetValues().coeff(f, 2);
            }
        }
    }

    auto events = acquisition->GetEvents();
    for(auto it = events->Begin();
        it != events->End();
        ++it) {
        auto et = *it;
        auto label = et->GetLabel();
        auto time = et->GetTime();
        auto frame = et->GetFrame();
        auto description = et->GetDescription();
    }

Error compiling BTK with Octave

Hello

I don't know if any of you could help me. I couldn't compile BTK 4.0 with Octave 4.0.3. It throws the following error:

Wrapping/Octave/CMakeFiles/btkSetAnalogLabel.dir/build.make:99: recipe for target 'bin/btkSetAnalogLabel.mex' failed
make[2]: *** [bin/btkSetAnalogLabel.mex] Error 1

Anybody can help me with this?
Regards

Hints to build with Win10 / VS2019 / Python 3.7

For a Win10/VS2019 build with a Python3.7 wrapper and SWIG4.0.1 I had to make the following changes in the current master BTK-core:

  • #26 Support building for Python 3
  • #23 Avoid tr1 with VS2017: 2b7a9a8
  • #16 Moved the *.tpp includes from the .h to the .cpp.
  • #12 Fix the problem with using BTK in other libraries (like OpenSim) on Windows with MSVC.
  • Adapt ...\BTKCore-master\Utilities\eigen3\Eigen\src\Core\VectorwiseOp.h on line 585 to include the following:
    #ifdef EIGEN_VECTOROP_PLUGIN
    #include EIGEN_VECTOROP_PLUGIN
    #endif

Perhaps this can save somebody else some trouble. As a n00b this took me a long time to figure out ;) Now it passes all tests and I'm happy!

Edit: spelling

fails to open sample c3d trial (via Python wrapper)

Hi,

I have used the btk Python wrapper successfully in the past.
Now I downloaded some sample c3d data from:
https://www.c3d.org/data/sample03.zip

I extracted the trials and tried the following code:

import btk
c3dfile = "gait-pig.c3d"
reader = btk.btkAcquisitionFileReader()
reader.SetFilename(c3dfile)
reader.Update()

However this causes the Python interpreter to crash. I get the following print at the console:

[BTK WARNING] gait-pig.c3d - The number of blocks to be read in the parameter section is different than the number of blocks read. The value kept is the number of blocks read.
[BTK ERROR] Impossible to set a scaling factor to 0.
[BTK ERROR] Impossible to set a scaling factor to 0.
[BTK ERROR] Impossible to set a scaling factor to 0.
[BTK ERROR] Impossible to set a scaling factor to 0.
[BTK ERROR] Impossible to set a scaling factor to 0.
[BTK ERROR] Impossible to set a scaling factor to 0.

I'd also note that the file opens just fine in Mokka, which uses btk. So maybe the problem is with the Python wrapper?

Readme.html is generated, so it may be good to remove it from the git repo

If you build BTK with -DBUILD_DOCUMENTATION_README:BOOL=1 it overwrites the Readme.html in the root directory. This is sorta annoying because then git recognizes it as a modified file (if the committed version is different than the generated one). Should Readme.html be in the git repo if it a generated file?

Visual Studio 2017 warning about std::tr1

Visual Studio 2017 generates the following warning:

c:\projects\opensim-core\dependencies\btk\code\common\btkSharedPtr.h(66): warning C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED. You can define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to acknowledge that you have received this warning.

@Alzathar would you be interested in accepting a PR to get rid of this warning?

Mac warning about OSAtomicIncrement64Barrier

I get the following warning on macOS 10.13.3:

/Users/chris/repos/opensim-core/2/opensim-core/dependencies/BTK/Code/Common/btkO
bject.cpp:100:40: warning: 
      'OSAtomicIncrement64Barrier' is deprecated: first deprecated in macOS
      10.12 - Use std::atomic_fetch_add() from <atomic> instead
      [-Wdeprecated-declarations]    
    this->m_Timestamp = (unsigned long)OSAtomicIncrement64Barrier(&_atom...
                                       ^    
/usr/include/libkern/OSAtomicDeprecated.h:269:9: note: 
      'OSAtomicIncrement64Barrier' has been explicitly marked deprecated here
int64_t OSAtomicIncrement64Barrier( volatile OSAtomic_int64_aligned64_t ...

Clang version:

Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

issue compiling with recent Eigen

Hi,

I found that I could not compile using the current HEAD vs. my current version of Eigen 3 (installed through Homebrew on OSX, version 3.3.1)

The error was:
/usr/local/include/btk-0.3/Utilities/btkEigen/Plugin/DenseBaseAddons.h:41:145: error: no type named
'ReturnType' in 'Eigen::internal::scalar_product_traits<double, double>'
...typename internal::scalar_product_traits<typename internal::traits::Scalar,typename internal::traits::Scalar>::ReturnType...

I managed to get things to work by editing DenseBaseAddons.h to:

/// \internal helper struct to form the return type of the percentile
template<typename OtherDerived> struct precentile_return_type {
  typedef typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType Scalar;
  typedef Array<typename DenseBase<OtherDerived>::Scalar, DenseBase<OtherDerived>::RowsAtCompileTime, DenseBase<OtherDerived>::ColsAtCompileTime> type;
};

which changed internal::scalar_product_traits to ScalarBinaryOpTraits

Note I've not double checked this repair is perfectly correct, merely made it work for me!

Trouble building the VTK app

Once again I'm on Ubuntu 13.10 64 bit. I have these libs installed from the 13.10 repos:

libvtk5-dev
libqt4-dev

Here are the errors I get on cmake:

moorepants@moorepants-2170p:build-with-vtk(docs)$ cmake \
>    -DCMAKE_BUILD_TYPE:CHAR=Release \
>    -DBUILD_SHARED_LIBS:BOOL=1 \
>    -DBTK_WRAP_PYTHON:BOOL=1 \
>    -DBTK_WRAP_OCTAVE:BOOL=1 \
>    -DBUILD_TESTING:BOOL=1 \
>    -DBTK_TESTING_DATA_PATH:CHAR=~/Data/BTKData \
>    -DBTK_EXTRA_COMPILER_WARNINGS:BOOL=1 \
>    -DBUILD_DOCUMENTATION:BOOL=1 \
>    -DBUILD_DOCUMENTATION_API:BOOL=1 \
>    -DBUILD_DOCUMENTATION_API_UNSELECTED_MODULES:BOOL=1 \
>    -DBUILD_EXAMPLES:BOOL=1 \
>    -DPYTHON_LIBRARY:CHAR=/usr/lib/x86_64-linux-gnu/libpython2.7.so \
>    -DPYTHON_INCLUDE_DIR:CHAR=/usr/include/python2.7 \
>    -DBTK_USE_VISSUPPORT:BOOL=1 \
>    -DBTK_USE_VTK:BOOL=1 \
>    -DBUILD_TOOLS:BOOL=1 \
>    -G "Unix Makefiles" ..
-- The imported target "vtkParseJava" references the file
   "/usr/bin/vtkParseJava"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkWrapJava" references the file
   "/usr/bin/vtkWrapJava"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkCommonJava" references the file
   "/usr/lib/jni/libvtkCommonJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkFilteringJava" references the file
   "/usr/lib/jni/libvtkFilteringJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkImagingJava" references the file
   "/usr/lib/jni/libvtkImagingJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkGraphicsJava" references the file
   "/usr/lib/jni/libvtkGraphicsJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkGenericFilteringJava" references the file
   "/usr/lib/jni/libvtkGenericFilteringJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkIOJava" references the file
   "/usr/lib/jni/libvtkIOJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkRenderingJava" references the file
   "/usr/lib/jni/libvtkRenderingJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkVolumeRenderingJava" references the file
   "/usr/lib/jni/libvtkVolumeRenderingJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkHybridJava" references the file
   "/usr/lib/jni/libvtkHybridJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkWidgetsJava" references the file
   "/usr/lib/jni/libvtkWidgetsJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkParallelJava" references the file
   "/usr/lib/jni/libvtkParallelJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkInfovisJava" references the file
   "/usr/lib/jni/libvtkInfovisJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkGeovisJava" references the file
   "/usr/lib/jni/libvtkGeovisJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkViewsJava" references the file
   "/usr/lib/jni/libvtkViewsJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkQtChart" references the file
   "/usr/lib/libvtkQtChart.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "QVTK" references the file
   "/usr/lib/libQVTK.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtkChartsJava" references the file
   "/usr/lib/jni/libvtkChartsJava.so.5.8.0"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/vtk-5.8/VTKTargets.cmake"
but not all the files it references.

-- WARNING: Even if the code works with VTK 5.8, small glitches are visible in charts (e.g. the first item plotted has for effect to initially display the boundaries in Mokka). It is advised to compile Mokka with VTK 5.10 or greater
-- Found Freetype: /usr/lib/x86_64-linux-gnu/libfreetype.so (found version "2.4.12") 
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
  Could NOT find Qt4 (missing: QT_MOC_EXECUTABLE QT_UIC_EXECUTABLE) (found
  version "4.8.4")
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindQt4.cmake:1389 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  Code/VisSupport/VTK/CMakeLists.txt:40 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!

Where do I find the exact dependencies needed for building the visual apps?

Get Free moment through wrapper

Can't find a method to get the calculated free moments through matlab/python interface.

Would be an important feature for those using btk to export data to OpenSim.

Thanks for all your awesome work!

Python Wrapping Failing

I'm trying to build on Ubuntu 13.10 64 bit and having issues with the Python wrappings being built properly.

moorepants@moorepants-2170p:~$ git clone [email protected]:Biomechanical-ToolKit/BTKCore.git ~/src/BTKCore
moorepants@moorepants-2170p:~$ git clone [email protected]:Biomechanical-ToolKit/BTKData.git ~/Data/BTKData
moorepants@moorepants-2170p:~$ cd ~/src/BTKCore
# last working commit on the CI linux machine on the master branch
moorepants@moorepants-2170p:BTKCore(master)$ git checkout 8971e194fefdc14
moorepants@moorepants-2170p:BTKCore((8971e19...))$ git checkout -b new-numpy-i
moorepants@moorepants-2170p:BTKCore(new-numpy-i)$ wget https://raw.github.com/numpy/numpy/master/doc/swig/numpy.i -O Utilities/SWIG/numpy.i
moorepants@moorepants-2170p:BTKCore(new-numpy-i)$ mkdir build
moorepants@moorepants-2170p:BTKCore(new-numpy-i)$ cd build
moorepants@moorepants-2170p:build(new-numpy-i)$ cmake \
>    -DCMAKE_BUILD_TYPE:CHAR=Release \
>    -DBUILD_SHARED_LIBS:BOOL=1 \
>    -DBTK_WRAP_PYTHON:BOOL=1 \
>    -DBTK_WRAP_OCTAVE:BOOL=1 \
>    -DBUILD_TESTING:BOOL=1 \
>    -DBTK_TESTING_DATA_PATH:CHAR=~/Data/BTKData \
>    -DBTK_EXTRA_COMPILER_WARNINGS:BOOL=1 \
>    -DBUILD_DOCUMENTATION:BOOL=1 \
>    -DBUILD_DOCUMENTATION_API:BOOL=1 \
>    -DBUILD_DOCUMENTATION_API_UNSELECTED_MODULES:BOOL=1 \
>    -DBUILD_DOCUMENTATION_MOKKA:BOOL=1 \
>    -DBUILD_DOCUMENTATION_README:BOOL=1 \
>    -DBUILD_EXAMPLES:BOOL=1 \
>    -G "Unix Makefiles" ..
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for sys/mman.h
-- Looking for sys/mman.h - found
-- Looking for C++ include memory
-- Looking for C++ include memory - found
-- Looking for C++ include tr1/memory
-- Looking for C++ include tr1/memory - found
-- Looking for boost/memory.hpp
-- Looking for boost/memory.hpp - not found
-- Looking for boost/tr1/memory.hpp
-- Looking for boost/tr1/memory.hpp - not found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Checking for builtin __sync_add_and_fetch
-- Checking for builtin __sync_add_and_fetch -- success
-- Performing Test HAVE_GCC_ERROR_RETURN_TYPE
-- Performing Test HAVE_GCC_ERROR_RETURN_TYPE - Success
-- Found SWIG: /usr/bin/swig2.0 (found suitable version "2.0.10", minimum required is "2.0") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.3m.so (found version "3.3.2+") 
-- Found PythonInterp: /usr/bin/python (found version "2.7.5") 
-- Found NumPy: 1.7.1  
-- Found Octave: /usr/bin/octave  
-- Found Doxygen: /usr/bin/doxygen (found version "1.8.4") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/moorepants/src/BTKCore/build

Notice that cmake finds the python 3 shared library but the python 2.7.5 interpreter. The build then fails:

moorepants@moorepants-2170p:build(new-numpy-i)$ make -j4
.
.
.
[100%] Building CXX object Wrapping/Python/CMakeFiles/_btk.dir/btkSwigPYTHON_wrap.cxx.o
/home/moorepants/src/BTKCore/build/Wrapping/Python/btkSwigPYTHON_wrap.cxx: In function ‘void CopyFromEigenToNumPyMatrix(PyObject*, Eigen::MatrixBase<Derived>*)’:
/home/moorepants/src/BTKCore/build/Wrapping/Python/btkSwigPYTHON_wrap.cxx:4378:93: error: cannot convert ‘PyObject* {aka _object*}’ to ‘PyArrayObject* {aka tagPyArrayObject*}’ for argument ‘1’ to ‘void* PyArray_DATA(PyArrayObject*)’
     typename Derived::Scalar* data = static_cast<typename Derived::Scalar*>(PyArray_DATA(out));
                                                                                             ^
/home/moorepants/src/BTKCore/build/Wrapping/Python/btkSwigPYTHON_wrap.cxx: In function ‘void ConvertFromEigenToNumPyMatrix(PyObject**, Eigen::MatrixBase<Derived>*)’:
/home/moorepants/src/BTKCore/build/Wrapping/Python/btkSwigPYTHON_wrap.cxx:4392:94: error: cannot convert ‘PyObject* {aka _object*}’ to ‘PyArrayObject* {aka tagPyArrayObject*}’ for argument ‘1’ to ‘void* PyArray_DATA(PyArrayObject*)’
     typename Derived::Scalar* data = static_cast<typename Derived::Scalar*>(PyArray_DATA(*out));
                                                                                              ^
/home/moorepants/src/BTKCore/build/Wrapping/Python/btkSwigPYTHON_wrap.cxx: In function ‘int NumPyType() [with T = double]’:
/home/moorepants/src/BTKCore/build/Wrapping/Python/btkSwigPYTHON_wrap.cxx:4398:46: error: ‘PyArray_DOUBLE’ was not declared in this scope
   template<> int NumPyType<double>() {return PyArray_DOUBLE;};
                                              ^
make[2]: *** [Wrapping/Python/CMakeFiles/_btk.dir/btkSwigPYTHON_wrap.cxx.o] Error 1
make[1]: *** [Wrapping/Python/CMakeFiles/_btk.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Linking CXX executable ../../bin/TDD
[100%] Built target TDD
make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.