Tutorial:Add an Image to a Report Simple Pipeline: Difference between revisions

From Software Product Documentation
Jump to navigation Jump to search
m (Text replacement - "http://www.c-motion.com" to "https://www.c-motion.com")
m (Text replacement - "www.c-motion.com/download" to "www.has-motion.com/download")
 
Line 12: Line 12:
More advanced pipelines can be made to add an image to a report, an example is shown [[Tutorial:Add_an_Image_to_a_Report_Advanced_Pipeline | Add Image to Report Advanced Pipeline Tutorial]].<br> </b>
More advanced pipelines can be made to add an image to a report, an example is shown [[Tutorial:Add_an_Image_to_a_Report_Advanced_Pipeline | Add Image to Report Advanced Pipeline Tutorial]].<br> </b>
<br>
<br>
Sample files may be downloaded [https://www.c-motion.com/download/Tutorial_Report_AddImage_SimplePipeline.zip here].<br>
Sample files may be downloaded [https://www.has-motion.com/download/Tutorial_Report_AddImage_SimplePipeline.zip here].<br>
:CreatingReport_Tutorial_Image_blank.cmo will be used in this tutorial<br>
:CreatingReport_Tutorial_Image_blank.cmo will be used in this tutorial<br>
:CreatingReport_Tutorial_Image.cmo contains the completed cmo file <br>
:CreatingReport_Tutorial_Image.cmo contains the completed cmo file <br>

Latest revision as of 11:20, 22 May 2024

Language:  English  • français • italiano • português • español 


The following pipeline is a simple pipeline script, which can be used to automate the process of adding an image to a report.

This pipeline automates the process shown in the Add Image to Report Tutorial.
More advanced pipelines can be made to add an image to a report, an example is shown Add Image to Report Advanced Pipeline Tutorial.

Sample files may be downloaded here.

CreatingReport_Tutorial_Image_blank.cmo will be used in this tutorial
CreatingReport_Tutorial_Image.cmo contains the completed cmo file
AddImage.v3s is the pipeline script shown below



Add Image to Report - Simple Pipeline

The following script will add the two images of the skeleton to page 3 of the report (seen below) by:
1) Prompt the user for the desired file to export from a list of files in the workspace (default for this example is NWalk0001.c3d)
2) Prompt the user for the desired frame to export (default for this example is Frame 239)
3) Set the view options:

a. Turn off lab axes, targets, landmarks, & segment coordinate system axes
b. Set 3D viewer background to white

4) Get the trial (without .c3d extension) so the exported filename will contain the trial name
5) Set the camera perspective to the sagittal view and export image
6) Set the camera perspective to the A/P view and export image
7) Switch to report mode & plot the images
8) Set the view options back to default values:

a. Turn on lab axes, targets, landmarks, & segment coordinate system axes
b. Set 3D viewer background to black
NOTE: These are not the "default" V3D values, these is my personal preference of what to see in the 3D viewer

caption



Sample Script


! ================================================
!  Export and add two images to the Report
! ================================================

! ------------------------------------------------
!  Prompt the user for the desired image from a 
!	list of files in the workspace
! ------------------------------------------------

Set_Pipeline_Parameter_To_List_Of_Tagged_Files
/PARAMETER_NAME=FILES
/TAG_NAME=ALL_FILES
/GET_CURRENT_SELECTED_FILES=false
/USE_SHORT_FILENAMES=TRUE
;

Prompt_For_Pipeline_Parameter_Value
/PIPELINE_PARAMETER_NAME=SELECTED_FILE
/PROMPT=Select image file
! /DATA_TYPE=
/DEFAULT_VALUE=::FILES
;

Select_Active_File
/FILE_NAME=*&::SELECTED_FILE
! /QUERY=
;

! ------------------------------------------------
!  Prompt the user for the desired frame
! ------------------------------------------------

Prompt_For_Pipeline_Parameter_Value
/PIPELINE_PARAMETER_NAME=EXPORT_FRAME
/PROMPT=Export Frame:
! /DATA_TYPE=
/DEFAULT_VALUE=239
;

! ------------------------------------------------
!  Set the view options:
! Turn off lab axes, targets, landmarks, 
!	segment coordinate system axes (SCS) &
! Set 3D viewer background to white
! ------------------------------------------------

Set_View_Options
! /VIEW_GRAPH_ANIMATION_FRAME_LINE=
! /VIEW_FORCE_PLATFORMS=
! /VIEW_GRF_BUTTERFLY=
! /VIEW_GRF=
! /VIEW_GRF_COFP=
! /VIEW_FREEMOMENT_AT_COP=
! /VIEW_FORCE_STRUCTURE_VECTOR=
! /VIEW_CUSTOM_FORCES=
! /VIEW_JOINTS=
/VIEW_LAB=FALSE
/VIEW_LAB_AXES=FALSE
/VIEW_LANDMARKS=FALSE
! /VIEW_MODEL_COM=
! /VIEW_MUSCLES=
! /VIEW_MUSCLES_AS_LINES=
! /VIEW_MUSCLES_AS_CYLINDERS=
/VIEW_SCS_AXES=FALSE
! /VIEW_SCS_AXES_COM=
! /VIEW_SEGMENTS=
! /VIEW_KINEMATIC_ONLY_SEGMENTS=
! /VIEW_SEGMENT_COLORIZATION=
! /VIEW_SEGMENT_GEOMETRY=
! /VIEW_SEGMENT_LINES=
/VIEW_TARGETS=FALSE
! /VIEW_TARGETS_WITH_RESIDUAL_COLORMAP=
! /VIEW_COM_TRAIL=
! /VIEW_LANDMARK_TRAIL=
! /VIEW_SEGMENT_TRAIL=
! /VIEW_TARGET_TRAIL=
! /VIEW_WHITE_BACKGROUND=FALSE
/SET_BACKGROUND_COLOR=1+1+1
;

! ------------------------------------------------
!  Remove ".c3d" from the filename so the 
!	filename may be used in the export
! ------------------------------------------------

Set_Pipeline_Parameter
/PARAMETER_NAME=SELECTED_FILE_NUMBER
/PARAMETER_VALUE=::SELECTED_FILE
/PARAMETER_VALUE_SEARCH_FOR=.c3d
/PARAMETER_VALUE_REPLACE_WITH=
! /PARAMETER_VALUE_PREFIX=
! /PARAMETER_VALUE_APPEND=
;

! ------------------------------------------------
!  Set the camera perspective to the sagittal 
!	view and export image
! ------------------------------------------------

Set_Camera_Perspective
! /USE_STATIONARY_CAMERA=TRUE
! /SEGMENT=
/CAMERA_X_CENTER=0.379
/CAMERA_Y_CENTER=-1.228
/CAMERA_Z_CENTER=-0.873
/CAMERA_ZOOM=2.472
/CAMERA_PAN=0.825
/CAMERA_TILT=-0.9
;

Export_3D_Animation_To_Image
/FILE_NAME=*&::SELECTED_FILE
/IMAGE_FILE_NAME=\\psf\Home\Desktop\WikiTutorials\ReportTutorial\AddImage_Pipeline\&::SELECTED_FILE_NUMBER&_Sag.png
! /APPEND_FRAME_TO_FILENAME=FALSE
! /APPEND_C3DNAME_TO_FILENAME=FALSE
! /IMAGE_FORMAT=png
/START_FRAME=::EXPORT_FRAME
! /END_FRAME=
! /EVENT_SEQUENCE=
! /EXCLUDE_EVENTS=
! /OUTPUT_WIDTH=640
! /OUTPUT_HEIGHT=480
;

! ------------------------------------------------
!  Set the camera perspective to the A/P 
!	view and export image
! ------------------------------------------------

Set_Camera_Perspective
! /USE_STATIONARY_CAMERA=TRUE
! /SEGMENT=
/CAMERA_X_CENTER=0.379
/CAMERA_Y_CENTER=-1.228
/CAMERA_Z_CENTER=-0.873
/CAMERA_ZOOM=2.493
/CAMERA_PAN=-89.175
/CAMERA_TILT=-1.05
;

Export_3D_Animation_To_Image
/FILE_NAME=*&::SELECTED_FILE
/IMAGE_FILE_NAME=\\psf\Home\Desktop\WikiTutorials\ReportTutorial\AddImage_Pipeline\&::SELECTED_FILE_NUMBER&_AP.png
! /APPEND_FRAME_TO_FILENAME=FALSE
! /APPEND_C3DNAME_TO_FILENAME=FALSE
! /IMAGE_FORMAT=png
/START_FRAME=::EXPORT_FRAME
! /END_FRAME=
! /EVENT_SEQUENCE=
! /EXCLUDE_EVENTS=
! /OUTPUT_WIDTH=640
! /OUTPUT_HEIGHT=480
;

! ------------------------------------------------
!  Switch to report mode & plot the images
! ------------------------------------------------

Switch_to_Report_Mode
! /SHOW_ANIMATION=FALSE
/PAGE_NUMBER=3
;

Make_Image_Item
/IMAGE_FILE=\\psf\Home\Desktop\WikiTutorials\ReportTutorial\AddImage_Pipeline\&::SELECTED_FILE_NUMBER&_Sag.png
/PAGE_NUMBER=3
/COLUMN_NUMBER=1
/ROW_NUMBER=1
! /COLUMN_SPAN=1
! /ROW_SPAN=1
;

Make_Image_Item
/IMAGE_FILE=\\psf\Home\Desktop\WikiTutorials\ReportTutorial\AddImage_Pipeline\&::SELECTED_FILE_NUMBER&_AP.png
/PAGE_NUMBER=3
/COLUMN_NUMBER=1
/ROW_NUMBER=2
! /COLUMN_SPAN=1
! /ROW_SPAN=1
;

! ------------------------------------------------
!  Set the view options back to default values: 
!	(default values are lab dependent)
! Turn on lab axes, targets, landmarks, 
!	segment coordinate system axes (SCS) &
! Set 3D viewer background to black
! ------------------------------------------------

Set_View_Options
! /VIEW_GRAPH_ANIMATION_FRAME_LINE=
! /VIEW_FORCE_PLATFORMS=
! /VIEW_GRF_BUTTERFLY=
! /VIEW_GRF=
! /VIEW_GRF_COFP=
! /VIEW_FREEMOMENT_AT_COP=
! /VIEW_FORCE_STRUCTURE_VECTOR=
! /VIEW_CUSTOM_FORCES=
! /VIEW_JOINTS=
! /VIEW_LAB=
/VIEW_LAB_AXES=TRUE
/VIEW_LANDMARKS=TRUE
! /VIEW_MODEL_COM=
! /VIEW_MUSCLES=
! /VIEW_MUSCLES_AS_LINES=
! /VIEW_MUSCLES_AS_CYLINDERS=
/VIEW_SCS_AXES=TRUE
! /VIEW_SCS_AXES_COM=
! /VIEW_SEGMENTS=
! /VIEW_KINEMATIC_ONLY_SEGMENTS=
! /VIEW_SEGMENT_COLORIZATION=
! /VIEW_SEGMENT_GEOMETRY=
! /VIEW_SEGMENT_LINES=
/VIEW_TARGETS=TRUE
! /VIEW_TARGETS_WITH_RESIDUAL_COLORMAP=
! /VIEW_COM_TRAIL=
! /VIEW_LANDMARK_TRAIL=
! /VIEW_SEGMENT_TRAIL=
! /VIEW_TARGET_TRAIL=
! /VIEW_WHITE_BACKGROUND=
! /SET_BACKGROUND_COLOR=0+0+0
;
Retrieved from ""