Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Collision Detection #128

Closed

Conversation

NicerNewerCar
Copy link
Contributor

@NicerNewerCar NicerNewerCar commented Jun 1, 2023

The groundwork for collision detection in Autoscoper.

Enable collision detection by either turning the Autoscoper_BUILD_VTK option on or by passing VTK_DIR (build directory of a pre-built VTK library) at configuration time.

  • Add option Autoscoper_BUILD_VTK - Builds VTK as part of Autoscopers Superbuild - Defaults to OFF
  • Add definition for Autoscoper_COLLISION_DETCTION
    • Enabled if either Autoscoper_BUILD_VTK or VTK_DIR is defined
  • Add support for loading meshes with a trial
  • Add new keyword to config file MeshFile
    • MeshFile must be placed in the same order as VolumeFile, so the meshes stay synced with the volumes.

Example config file (Note this version of Autoscoper does NOT have relative path support, this is for demonstration purposes):

mayaCam_csv \WN00105\Data_XROMM\xr_pre_cube_2_817_cam01_MayaCam.csv
mayaCam_csv \WN00105\Data_XROMM\xr_pre_cube_2_817_cam02_MayaCam.csv

CameraRootDir \WN00105\XMA_UND\xr_flx_ext_cam01UND
CameraRootDir \WN00105\XMA_UND\xr_flx_ext_cam02UND

VolumeFile \WN00105\Models\rad\rad_dcm_cropped.tif
VolumeFlip 0 0 0
VoxelSize 0.390625 0.390625 0.625
MeshFile \WN00105\Models\WN00105_trimesh\stl\AUT_rad.stl

VolumeFile \WN00105\Models\mc3\mc3_dcm_cropped.tif
VolumeFlip 0 0 0
VoxelSize 0.390625 0.390625 0.625
MeshFile \WN00105\Models\WN00105_trimesh\stl\AUT_mc3.stl

RenderResolution 512 512
OptimizationOffsets 0.1 0.1 0.1 0.1 0.1 0.1

TODO:

  • Add Mesh class from PR Add support for loading meshes with trials #87
    • Update to use VTK PolyData objects
  • Finalized list of VTK modules
  • Update External_VTK.cmake to only build what modules we need
    • Test External_VTK -> Currently untested

* Add option `Autoscoper_BUILD_VTK` - Builds VTK as part of Autoscopers
  Superbuild - Defaults to OFF
* Add External_VTK for VTK v9.2.6
jcfr added a commit to jcfr/SlicerAutoscoperM that referenced this pull request Jun 23, 2023
Highlighted Autoscoper changes:

* Fix trailing comma when saving single volume tracking data so that the file
  can be loaded by other CVS reader (e.g numpy)
  Before:
    X_data, Y_data, Z_data, YAW_data, PITCH_data, ROLL_data,
  After:
    X_data, Y_data, Z_data, YAW_data, PITCH_data, ROLL_data
  See pull request BrownBiomechanics/Autoscoper#130

* Documentation updates

* Update sources to explicitly reference "std" namespace.

* Add support for 3D kernels (Kernel::block3d and Kernel::grid3d).
  Not yet used. It was originally integrated to support the computation
  of "Distance field" in pull request BrownBiomechanics/Autoscoper#87
  (Add support for loading meshes with trials) which was closed in favor
  of BrownBiomechanics/Autoscoper#128 (Add Collision Detection)

List of Autoscoper changes:

$ git shortlog 60b3d6ec0..b29d30f51 --no-merges
Anthony Lombardi (20):
      ENH: Update OpenCL wrapper to support 3D kernels (PR-113)
      DOC: Fix typos in PyAutoscoper docstrings
      DOC: Set up Markdown Sphinx docs
      DOC: Add Documentation for PyAutoscoper
      DOC: Add About Autoscoper section to RTD
      DOC: Add getting started and user interface to RTD
      DOC: Add MATLAB socket control docs to RTD
      DOC: Add dev guide to RTD
      DOC: Update the license info on the home page
      DOC: Add UI description
      DOC: Add instructions for remote GPU access
      DOC: Add tutorials for sample and custom data
      DOC: Add file specifications
      ENH: Add .readthedocs.yaml to install required packages
      ENH: Make content take up 100% of the screen width
      DOC: Add tutorial for filters
      DOC: Update History and Getting Started
      DOC: Update README for PyAutoscoper to point to RTD
      DOC: Add tutorial descriptions and reference on getting started
      BUG: Fix trailing comma when saving single volume tracking data

Jean-Christophe Fillion-Robin (24):
      STYLE: Update "line-length" black settings from 88 to 120
      DOC: Add top-level license based on source file headers
      DOC: Update README adding a "License" section along with historical notes
      STYLE: Update black version specified in pre-commit config
      COMP: Update pre-commit config to ensure black always uses expected settings
      COMP: Explicitly reference "std" namespace
      DOC: Consistently add an empty line between header and content
      DOC: Strip trailing white spaces
      DOC: Add dedicated "About" top-level section
      DOC: Move SampleData description in "Getting Started"
      DOC: Move "Advanced Topics" after "User Interface" and "Tutorials"
      DOC: Fix headers in CONTRIBUTING document
      DOC: Fix cross-references warnings
      DOC: Update configuration removing invalid options
      DOC: Fix formatting of "Example" in "Camera Calibration File Format"
      DOC: Update "Getting Started" to fix reference to sample data
      ENH: Update NewTrialDialog UI file to use "OK" instead of "Ok"
      DOC: Fix miscellaneous typos
      DOC: Update PyAutoscoper document to use back-ticks around method names
      DOC: Tweak formatting of "Loading and Tracking Data" tutorial
      DOC: Use "AutoscoperM" instead of SAM in "Loading Custom Data" tutorial
      DOC: Ensure "Tutorials" are complete by relying on implicit link text
      STYLE: Remove obsolete comments from autoscoper/CMakeLists.txt
      COMP: Set autoscoper_set_env.sh permission flags only if configuring script
jcfr added a commit to BrownBiomechanics/SlicerAutoscoperM that referenced this pull request Jun 23, 2023
Highlighted Autoscoper changes:

* Fix trailing comma when saving single volume tracking data so that the file
  can be loaded by other CVS reader (e.g numpy)
  Before:
    X_data, Y_data, Z_data, YAW_data, PITCH_data, ROLL_data,
  After:
    X_data, Y_data, Z_data, YAW_data, PITCH_data, ROLL_data
  See pull request BrownBiomechanics/Autoscoper#130

* Documentation updates

* Update sources to explicitly reference "std" namespace.

* Add support for 3D kernels (Kernel::block3d and Kernel::grid3d).
  Not yet used. It was originally integrated to support the computation
  of "Distance field" in pull request BrownBiomechanics/Autoscoper#87
  (Add support for loading meshes with trials) which was closed in favor
  of BrownBiomechanics/Autoscoper#128 (Add Collision Detection)

List of Autoscoper changes:

$ git shortlog 60b3d6ec0..b29d30f51 --no-merges
Anthony Lombardi (20):
      ENH: Update OpenCL wrapper to support 3D kernels (PR-113)
      DOC: Fix typos in PyAutoscoper docstrings
      DOC: Set up Markdown Sphinx docs
      DOC: Add Documentation for PyAutoscoper
      DOC: Add About Autoscoper section to RTD
      DOC: Add getting started and user interface to RTD
      DOC: Add MATLAB socket control docs to RTD
      DOC: Add dev guide to RTD
      DOC: Update the license info on the home page
      DOC: Add UI description
      DOC: Add instructions for remote GPU access
      DOC: Add tutorials for sample and custom data
      DOC: Add file specifications
      ENH: Add .readthedocs.yaml to install required packages
      ENH: Make content take up 100% of the screen width
      DOC: Add tutorial for filters
      DOC: Update History and Getting Started
      DOC: Update README for PyAutoscoper to point to RTD
      DOC: Add tutorial descriptions and reference on getting started
      BUG: Fix trailing comma when saving single volume tracking data

Jean-Christophe Fillion-Robin (24):
      STYLE: Update "line-length" black settings from 88 to 120
      DOC: Add top-level license based on source file headers
      DOC: Update README adding a "License" section along with historical notes
      STYLE: Update black version specified in pre-commit config
      COMP: Update pre-commit config to ensure black always uses expected settings
      COMP: Explicitly reference "std" namespace
      DOC: Consistently add an empty line between header and content
      DOC: Strip trailing white spaces
      DOC: Add dedicated "About" top-level section
      DOC: Move SampleData description in "Getting Started"
      DOC: Move "Advanced Topics" after "User Interface" and "Tutorials"
      DOC: Fix headers in CONTRIBUTING document
      DOC: Fix cross-references warnings
      DOC: Update configuration removing invalid options
      DOC: Fix formatting of "Example" in "Camera Calibration File Format"
      DOC: Update "Getting Started" to fix reference to sample data
      ENH: Update NewTrialDialog UI file to use "OK" instead of "Ok"
      DOC: Fix miscellaneous typos
      DOC: Update PyAutoscoper document to use back-ticks around method names
      DOC: Tweak formatting of "Loading and Tracking Data" tutorial
      DOC: Use "AutoscoperM" instead of SAM in "Loading Custom Data" tutorial
      DOC: Ensure "Tutorials" are complete by relying on implicit link text
      STYLE: Remove obsolete comments from autoscoper/CMakeLists.txt
      COMP: Set autoscoper_set_env.sh permission flags only if configuring script
@@ -2,6 +2,8 @@
#include <iostream>
#include <string>

#define VELOCITY_FILTER 0
#define COLLISION_REPONSE 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#define COLLISION_REPONSE 0
#define COLLISION_RESPONSE 0

@amymmorton
Copy link
Collaborator

is it possible to get a version if collision detected .. rather than integrated into optimization? As a first step

@NicerNewerCar
Copy link
Contributor Author

Closing in favor of #295

@NicerNewerCar NicerNewerCar deleted the add-collision branch August 12, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants