Part 4: Performing a Translation with SimVTK
Necessary Files
Your own files, or:
- croppedCT.vtk.zip (13.22 MB)
- zAxisMirrorMR.vtk.zip (7.75 MB)
Optional Files (premade Model files use example files above)
- VolumeTranslationCT.mdl.zip (6 KB)
- VolumeTranslationMR.mdl.zip (6 KB)
As stated in the title, the purpose of this tutorial is to teach you how to perform a simple translation of a volume using SimVTK. Just like mentioned in the previous tutorial, the same steps are followed in the creation of both the CT and MR data. The only difference is the paramater values within the vtkImageChangeInformation block as seen below.
In Simulink, create a new model. Three blocks will be necessary:
- a vtkDataSetReader block (found in the SimVTK IOLibrary)
- a vtkDataSetWriter block (also in the SimVTK IOLibrary)
- and a vtkImageChangeInformation block (found in the SimVTK ImagingLibrary)
Connect the vtkDataSetReader block to the vtkImageChangeInformation and the vtkImageChangeInformation block to the vtkDataSetWriter block. Since we are still concerned with the use of .vtk files, we will continue to use vtkDataSetReader and vtkDataSetWriter blocks in this tutorial.
Exactly like the previous tutorials, we will read in the .vtk file, perform the specified translation, and write the translated output as a .vtk file.
Your workflow should look similar to this:

The vtkDataSetReader and vtkDataSetWriter blocks will not be discussed here as they are used in the same manner as outlined in the Crop tutorial. For instructions on proper configuration of the blocks, please see the Crop tutorial. The vtkImageChangeInformation block needs to be configured, however.
vtkImageChangeInformation
Double-click the block and change the OriginTranslation Parameter to the “As Parameter” option in the pull-down menu. The OriginTranslation Value field will appear. This field requires a three value vector corresponding to the desired [x y z] translation. Since the registration will work best when the volumes are already overlayed one another, we will translate the volumes to the origin. This is simple as the translation will be in the opposite direction of the current [x y z] origins for the volume.
If you are using the CroppedCT.vtk and CroppedMR.vtk volumes, the origins for these files are:
- CT: [-48.316 -39.422 47.125]
- MR: [126.061 172.569 -29.486]
Taking the opposite of these for use in the OriginTranslation Value field would yield:
- CT OriginTranslation Value: [48.316 39.422 -47.125]
- MR OriginTranslation Value: [-126.061 -172.569 29.486]
To be doubly sure, here is an example screenshot of the CT window using these values:

And an example screenshow of the MR window using the MR OriginTranslation Value:

Once everything is configured, and ensuring that the Configuration Parameters have been appropriately set, press the play button found in the toolbar to start the workflow. When the workflow has completed, a sound will be heard and the resulting file with the given filename in the vtkDataSetReader will have been created.
Congratulations! You have completed the tutorial!
> Continue onto the Registration tutorial.