VG Studio runs DVC analysis by executing dvc.exe executable from the installation directory with some input arguments.
The call looks like:
C:/Program Files/Volume Graphics/VGSTUDIO MAX 20233/dvc.exe -out [output_directory] -p [params_file] -f [fixed_volume] -m [moving_volume]
We can create a wrapper around the executable and name it dvc.exe to force VG Studio to run with our parameters.
The call from our wrapper is something like:
elastix.exe -out [output_directory] -p [modified_params_file] -f [fixed_volume] -m [moving_volume]
where the executable elastix.exe is compiled elastix1 package (we use the lastest version of the package).
- Open the project in Visual Studio. Choose the 'HandleVGStudioDVC' as the startup project. Compile the Visual Studio project. It should be straightforward as it only has dependencies from the C++ standard library.
- Take the resulting executable
HandleVGStudioDVC.exe, rename it todvc.exeand paste it in the VG Studio installation directory. (Create a backup copy of the originaldvc.exefile and replace it with this version.) - Take elastix 1 binary (from official release, or compile it yourself) and place it in the same directory as the VG Studio '.vgl' file which will be running the analysis. You'll also need to copy the associated dll
ANNlib-5.1.dll - Run DVC analysis from VG Studio as before. New files will be created in the directory:
DVC_mod_params.txt,DVC_log.txtandDVC_run_params.txt. Their purpose is as follows: (i)DVC_log.txtis a log file. Use for troubleshooting. (ii)DVC_mod_params.txtwill be initially empty. This file is the one we can modify to overwrite the default set of parameters. (iii)DVC_run_params.txtis the file with the final set of parameters which will be used for the analysis. - Modify the
DVC_mod_params.txtfile if needed. Any line fromDVC_run_params.txtcan be copied and changed. Running the analysis from VG Studio again will result in an analysis with the modified option. Some other settings that we implemented are:- including line
// copy_logor// copy_logswill copy text logs from the temporary output directory into a subfolder in the current directory - including line
// copy_volumeor// copy_volumeswill copy the volume files from the temporary output directory into a subfolder in the current directory - including line
// gnuplotwill produce a gnuplot script linked to the (temporary) output directory. The script can be used to monitor convergence during the analysis. If// copy_logsis also set, at the end of the run the gnuplot script will change to point to the subfolder with copied logs. - any command line arguments can be passed in. For instance, including
-t0 [file]will add this argument to the system call toelastix.exe. If the argument is one that was already part of the arguments in the VG Studio call, priority will be given to the argument value inDVC_mod_params.txt.
- including line
- Run VG Studio DVC analysis again to take the modified parameters into effect. Results will be read and visualized by VG Studio as before.