Announcement

Collapse
No announcement yet.

BodyBuilder script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • BodyBuilder script

    Hello all,

    I am attempting to write some code in bodybuilder for a foot modeling project and am running into some issues. (I have never written anything in BB before). What we are doing is using 3-marker clusters on the feet and then taking static pointing trials in which we use a 2-marker wand to point to anatomical landmarks. How does one go about writing a BB script such that it will create the dummy marker according to the pointing trial and then recreate that marker (using cluster as reference) during dynamic trials?

    Any help would be greatly appreciated!

  • #2
    Re: BodyBuilder script

    Hi Jennifer,

    I actually had a similar problem not too long ago, where we wanted script to place the a virtual marker where the 2-marker wand is pointing. What we have is the "Davis Wand" which compresses so that the 2 markers move closer to each other when you are pressing where you want the virtual marker. I had trouble trying to write out this function using the bodybuilder code and instead wrote that part in Matlab (which can also be run in the Nexus pipeline). It works, but can be a bit clunky, since you need to wait for Vicon to open up Matlab and execute the script (and you need to have Matlab). I'd be interested if anyone has been able to write BB code to do the whole operation.

    If you're using the Davis Wand too and Matlab is a feasible option, let me know and I can share our code.

    Kyle Chadwick
    Motion Lab Engineer
    Children's Hospital Los Angeles

    Comment


    • #3
      Re: BodyBuilder script

      It's relatively straightforward. BB has inbuilt functions (using * and /) for global/local transformations that make it easy.

      Conceptually, without giving you exact syntax, this is the process:

      In the static trial ...
      1. Having captured the pointer markers, calculate the projected tip location in the global coordinate system (from the known pointer geometry).
      2. Construct a coordinate system from the 3 cluster markers (hopefully relatively rigid).
      3. Express the global pointer tip location (from 1) as local coordinates in the cluster coordinate system (using / syntax).
      4. Save those local coordinates to the MP/VSK file (via PARAM command and using $ syntax).

      In the dynamic trial ...
      1. Construct the cluster coordinate system again (in exactly the same way).
      2. Retrieve the local pointer tip coordinates from the MP/VSK (simply by referring to them with $ syntax).
      3. Re-express the local tip coordinates as global (using * syntax).
      4. Save global coordinates via OUTPUT.

      Hope that gives you enough to go on.

      Tim Wrigley
      University of Melbourne

      Comment


      • #4
        Re: BodyBuilder script

        Dear Jeniffer,

        I've been using this pointer technique to create LASI, RASI markers and one cluster with 3 markers on LPSI,RPSI and Sacrum in BB.

        Is you need I can send it to you and you just have to change the markers name and the markers pointer distance.

        Best

        Paulo Lucareli
        Universidade Nove de Julho
        Brazil
        Last edited by Paulo Lucareli; April 21st, 2016, 07:37 AM. Reason: I forgot to assign

        Comment


        • #5
          Re: BodyBuilder script

          Originally posted by lucarelli36 View Post
          Dear Jeniffer,

          I've been using this pointer technique to create LASI, RASI markers and one cluster with 3 markers on LPSI,RPSI and Sacrum in BB.

          Is you need I can send it to you and you just have to change the markers name and the markers pointer distance.

          Best

          Paulo Lucareli
          Universidade Nove de Julho
          Brazil
          Paulo,

          That would be amazing to see your script for the pointer technique. I am assuming it is two scripts, one to define the virtual marker and one to reproduce it. If you could send them to jap6rc@virginia.edu that would be a huge help.

          Thanks,
          Jennifer

          Comment


          • #6
            Re: BodyBuilder script

            Thank you, Tim! That conceptual layout helped clear the fog for me on where I was going wrong.

            Thanks,
            Jennifer

            Comment


            • #7
              Re: BodyBuilder script

              Originally posted by Jennifer Perry View Post
              Paulo,

              That would be amazing to see your script for the pointer technique. I am assuming it is two scripts, one to define the virtual marker and one to reproduce it. If you could send them to jap6rc@virginia.edu that would be a huge help.

              Thanks,
              Jennifer

              Dear Paulo,

              if it is possible, for me too it would be an amazing help to see your pointer and cluster technique. I'm trying to write something in BB, but I've never used before. Please if it's possible, could you send its to corona.federic@gmail.com

              Thanks,
              Federica

              Comment


              • #8
                Re: BodyBuilder script

                Originally posted by lucarelli36 View Post
                Dear Jeniffer,

                I've been using this pointer technique to create LASI, RASI markers and one cluster with 3 markers on LPSI,RPSI and Sacrum in BB.

                Is you need I can send it to you and you just have to change the markers name and the markers pointer distance.

                Best

                Paulo Lucareli
                Universidade Nove de Julho
                Brazil
                Dear Paulo,

                if it's possible, could you send to corona.federic@gmail.com your pointer and cluster technique? I'm trying to write my first code in BB with more doubts.

                Thank you,
                Federica

                Comment


                • #9
                  Re: BodyBuilder script

                  Federica,

                  If you are using Vicon Nexus with your BodyLangauge scripts then here is an example of what Tim Wrigley has outlined above.


                  {*-------------------------Pointer-------------------------*}


                  Global = [{0,0,0},{1,0,0},{0,0,1},xyz]


                  {*---------------Model---------------*}
                  {*Optional points*}
                  OptionalPoints(PM)


                  {*General*}
                  tempSeg = [STER,CLAV-STER,STER-T10,xzy]


                  {*Static trials*}
                  If $Static==1
                  $%PMcalc = PM/tempSeg
                  PARAM ($%PMcalc)
                  EndIf

                  {*Replace PM*}
                  If $Static==0
                  PM = $%PMcalc*tempSeg
                  EndIf


                  OUTPUT(PM)


                  If you were to run this through Vicon Nexus using the 'Run Static BodyLanguage Model' pipeline command, then your pointer marker will be saved to the VSK relative to the tempSeg segment. Then when you run the same script again using the 'Run Dynamic BodyLanguage Model' pipeline command, your pointer marker will be recreated. It is important to use these pipeline commands as they align with the ''If $Static ==1" and "If $Static ==0" in the script.

                  A couple of things to note:

                  1. This script needs to be saved as a .mod file.
                  2. Create an empty text file, of the same name with the extension .mp. Ensure it is stored in the same location as the .mod file.
                  3. This is an example, the chosen markers do not really suit the application, but should give you a framework to work from.


                  Good luck.

                  Tim Blackmore

                  Comment


                  • #10
                    Re: BodyBuilder script

                    Originally posted by Jennifer Perry View Post
                    Hello all,

                    I am attempting to write some code in bodybuilder for a foot modeling project and am running into some issues. (I have never written anything in BB before). What we are doing is using 3-marker clusters on the feet and then taking static pointing trials in which we use a 2-marker wand to point to anatomical landmarks. How does one go about writing a BB script such that it will create the dummy marker according to the pointing trial and then recreate that marker (using cluster as reference) during dynamic trials?

                    Any help would be greatly appreciated!
                    You need to use the PARAM() statement to write expressions to the MP file which can then be used by dynamic files. Also use conditional code such as If Static = 1 or have separate scripts for dynamic and static trials.

                    Comment


                    • #11
                      Re: BodyBuilder script

                      Originally posted by Fede View Post
                      Dear Paulo,

                      if it is possible, for me too it would be an amazing help to see your pointer and cluster technique. I'm trying to write something in BB, but I've never used before. Please if it's possible, could you send its to corona.federic@gmail.com

                      Thanks,
                      Federica

                      Hi Federica,

                      I'll send to you in you email.

                      Best

                      Paulo

                      Comment


                      • #12
                        Re: BodyBuilder script

                        Originally posted by lucarelli36 View Post
                        Hi Federica,

                        I'll send to you in you email.

                        Best

                        Paulo

                        Thanks a lot Paulo.

                        Best,
                        Federica

                        Comment

                        Working...
                        X