testing data generation scripts for Varian adaptive project
Applies a synthetic deformation to an image to generate a synthetic image. This script is capable of the following actions:
- deform a CT scan to produce a new CT scan
- deform a CT scan to produce a new CBCT scan
- deform a CBCT scan to produce a new CBCT scan
art-testing uses plastimatch for the heavy lifting. Please install plastimatch on your system first:
- Download and install plastimatch by building from source or by installing the Windows binary.
- If you did not install plastimatch into a standard path, update the variable
plastimatch_executable
inmake_synthetic_image.py
.
art-testing needs SimpleITK and numpy for image manipulation.
SimpleITK can be installed with pip or using a package manager such as Anaconda (I recommend Anaconda). Installation instructions for SimpleITK can be found here.
Numpy can be installed similarly (by default with Anaconda or with pip).
That's it! You're now ready to use the script make_synthetic_image.py
Input CT images, CBCT images and structure file must follow the following structure:
# # # # # # # # # # # # Input: # Pt1 # Origin (e.g Ptname)/ # -CT # -CT.dcms # -RS # -RS.dcm # -CBCT # -CBCT.dcms # # Output: # Pt1 # Origin/ # -CT # -RS # -CBCT # -input.nii # a warped of CT folder # Deform1 (or Fx1)/ # -gaussian # -dicom # -vf.mha # -warped.nii # -CT # CT.dcms # RS.dcm # -CBCT # -CBCT.dcms # -RS??? No need # # Deform2 (or Fx2)/ # -gaussian # -dicom # -vf.mha # -warped.nii # -CT # CT.dcms # RS.dcm # -CBCT # -CBCT.dcms # -RS??? No need
The Gaussian information needed for the deformation can be entered in a .csv file. An example is given in Gaussian.csv. Note about the Gaussian information:
- center: x y z in mm. It follows plastimatch coordinate
- magnitude: x y z in mm. It can be negative, which means the vector will point in the reverse direction
- standard deviation: in mm.
- nGaussian: the order of Gaussian components. There can be many Gaussian components.