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 support for loading meshes with trials #87

Closed

Conversation

NicerNewerCar
Copy link
Contributor

@NicerNewerCar NicerNewerCar commented Feb 27, 2023

  • Added Mesh Class
  • Added Distance field kernel for distance field calculations
    • Will be called during the loading of a trial if OpenCL is the rendering backend
  • Added new keyword Mesh to the config file
  • Support for STL and VRML files
  • Loaded into facet representation (3 points and a normal)
  • Example config file
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
#Mesh \WN00105\Models\WN00105_trimesh\AUT_rad.wrl
Mesh \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
#Mesh \WN00105\Models\WN00105_trimesh\AUT_mc3.wrl
Mesh \WN00105\Models\WN00105_trimesh\stl\AUT_mc3.stl
RenderResolution 512 512
OptimizationOffsets 0.1 0.1 0.1 0.1 0.1 0.1

@amymmorton
Copy link
Collaborator

Successful load (added Mesh to config file) but expected some visual display.. how are the mesh files viewed?

Copy link
Contributor

@jcfr jcfr left a comment

Choose a reason for hiding this comment

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

If code for reading STL/VRML/... existings in ITK or VTK, it may be sensible to "vendorize" it. (see vtkSTLReader, vtkSTLWriter, ...)

libautoscoper/CMakeLists.txt Outdated Show resolved Hide resolved
libautoscoper/src/Mesh.cpp Outdated Show resolved Hide resolved
libautoscoper/src/Mesh.cpp Outdated Show resolved Hide resolved
libautoscoper/src/Mesh.cpp Outdated Show resolved Hide resolved
libautoscoper/src/Mesh.cpp Outdated Show resolved Hide resolved
libautoscoper/src/PSO.cpp Outdated Show resolved Hide resolved
libautoscoper/src/PSO.cpp Outdated Show resolved Hide resolved
libautoscoper/src/Tracker.cpp Outdated Show resolved Hide resolved
libautoscoper/src/Tracker.cpp Outdated Show resolved Hide resolved
libautoscoper/src/Mesh.cpp Outdated Show resolved Hide resolved
@NicerNewerCar
Copy link
Contributor Author

@jcfr
Re: viewing the mesh
Looks like I will need to add some OpenCL code to the View::Render method to get the meshes onto the screen. Do you have any recommendations for methods to render the triangular meshes into the 2D buffer?

Re: output
Should I pivot to exporting the rotated meshes as stls rather than the csvs of rotations/translations?

@NicerNewerCar NicerNewerCar requested a review from jcfr April 17, 2023 17:07
@NicerNewerCar NicerNewerCar marked this pull request as ready for review April 17, 2023 17:07
@NicerNewerCar
Copy link
Contributor Author

Closing this in favor of #128

@NicerNewerCar NicerNewerCar deleted the mesh-representation branch June 5, 2023 13:46
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
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.

3 participants