Perform Realistic Head Deformations
Project description
CT Head Deformation
Author: Mark Gardner
The CTHeadDeformation module is an open-sourced library for taking CT and cone-beam CT (CBCT) scans and deforming these scans in a way that simulates realistic head motion. Deforming CT and CBCT scans can be used for:
- Studying how realistic patient motion can affect the treatment plan/delivered treatment dose.
- Data augmentation for training robust deep-learning networks.
- Simulating how realistic patient motion can affect the accuracy of CT/CBCT reconstructions.
- Other applications involving realistic patient head motion.
The image below shows example of how the original CT volume (left) can be realistically deformed to simulate a patient tilting their head up (right). The red lines are added to show how the anatomical landmarks have either moved or remained stationary after the deformation is complete.
Further information can be found in the repo wiki (https://github.sydney.edu.au/ACRF-Image-X-Institute/CTHeadDeformation/wiki) which is updated (semi) regularly.
Setup/Build/Install
The module can be installed using pip:
pip install CTHeadDeformation
This code uses the platipy repo (https://github.com/pyplati/platipy). If the platipy module is not automatically installed when installing the CTHeadDeformation code, the platipy library can be installed separately using the installation instructions (https://pyplati.github.io/platipy/getting_started.html).
Install elastix (https://elastix.lumc.nl/index.php)
Add the elastix.exe program pathfile to the system path.
Usage
The code DeformVolume.py is the main function. The deformation information is passed to this function in the form of a .json file. There are examples of .json files in the examples directory. The path to this json file is then the main input for the function DeformVolume.py
Example: Open up the file OneAxisRotation.json and tell the json file to deform the dicom files in directory "dicomSource" by changing
"InputDirectory":""
to
"InputDirectory":"dicomSource"
Also change the variable "name" to the 'Patient's name' variable as defined in the dicom metadata.
Run in python script
from DeformHeadCT.DeformVolume import DeformationScript
JsonInfoFile = 'examples/OneAxisRotation.json'
DeformationScript(JsonInfoFile)
Command Line
In a command line (such as anaconda command prompt) navigate to the directory that the CTHeadDeformation repo was cloned to and run
python DeformVolume.py examples/OneAxisRotation.json
By default the code will automatically use the elastix parameter in the examples folder, and will automatially locate the BoneMask volume required for the deformation.
Dicom Files of head and neck CT scans are avaiable at (https://www.cancerimagingarchive.net/collections/), subject to their licence agreements.
Directory Structure
-
DeformHeadCT - Contains the main python script and supporting functions
-
examples - contains example .json files as well as an example elastix file.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file CTHeadDeformation-0.1.4.tar.gz
.
File metadata
- Download URL: CTHeadDeformation-0.1.4.tar.gz
- Upload date:
- Size: 16.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5eae7c471bebfee86f3c270f91cce1e857c01acde10c322196b10fb405aa93f |
|
MD5 | dc693a86c9436c8a2ad8e61f44309104 |
|
BLAKE2b-256 | 2cb9acb87130959eb2f4b200d805ae27b24cdd7e9fb25713ccaf1e16875f9367 |
File details
Details for the file CTHeadDeformation-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: CTHeadDeformation-0.1.4-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20c80b516a6c0dd20557d727339dd769e4d0fc203824b7236636002c4c1e7587 |
|
MD5 | 7d8527275a4e9af3ad7ac7c043e5c0c4 |
|
BLAKE2b-256 | 7e8cd90dc633f60f1ecefd320bce16d3c839b377e31f52d8d03ab70313246292 |