CTHeadDeformation


NameCTHeadDeformation JSON
Version 0.1.4 PyPI version JSON
download
home_pagehttps://github.com/ACRF-Image-X-Institute/CTHeadDeformation
SummaryPerform Realistic Head Deformations
upload_time2022-12-05 22:22:24
maintainer
docs_urlNone
authorMark Gardner
requires_python>=3.7
licenseMIT
keywords ct deformation head and neck
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## CT Head Deformation

[![test](https://github.com/ACRF-Image-X-Institute/CTHeadDeformation/actions/workflows/python-app.yml/badge.svg?branch=main)](https://github.com/ACRF-Image-X-Institute/CTHeadDeformation/actions/workflows/python-app.yml)
[![codecov](https://codecov.io/gh/ACRF-Image-X-Institute/CTHeadDeformation/branch/main/graph/badge.svg?token=WETEA11B5D)](https://codecov.io/gh/ACRF-Image-X-Institute/CTHeadDeformation)

**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.

![image](https://media.github.sydney.edu.au/user/5547/files/cf5b651f-fcde-4603-a6d7-d487df5e9904)

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.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ACRF-Image-X-Institute/CTHeadDeformation",
    "name": "CTHeadDeformation",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "CT,deformation,head and neck",
    "author": "Mark Gardner",
    "author_email": "mark.gardner@sydney.edu.au",
    "download_url": "https://files.pythonhosted.org/packages/2c/b9/acb87130959eb2f4b200d805ae27b24cdd7e9fb25713ccaf1e16875f9367/CTHeadDeformation-0.1.4.tar.gz",
    "platform": null,
    "description": "## CT Head Deformation\r\n\r\n[![test](https://github.com/ACRF-Image-X-Institute/CTHeadDeformation/actions/workflows/python-app.yml/badge.svg?branch=main)](https://github.com/ACRF-Image-X-Institute/CTHeadDeformation/actions/workflows/python-app.yml)\r\n[![codecov](https://codecov.io/gh/ACRF-Image-X-Institute/CTHeadDeformation/branch/main/graph/badge.svg?token=WETEA11B5D)](https://codecov.io/gh/ACRF-Image-X-Institute/CTHeadDeformation)\r\n\r\n**Author:** *Mark Gardner*\r\n\r\nThe 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:\r\n\r\n- Studying how realistic patient motion can affect the treatment plan/delivered treatment dose.\r\n- Data augmentation for training robust deep-learning networks.\r\n- Simulating how realistic patient motion can affect the accuracy of CT/CBCT reconstructions.\r\n- Other applications involving realistic patient head motion.\r\n\r\nThe 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.\r\n\r\n![image](https://media.github.sydney.edu.au/user/5547/files/cf5b651f-fcde-4603-a6d7-d487df5e9904)\r\n\r\nFurther information can be found in the repo wiki (https://github.sydney.edu.au/ACRF-Image-X-Institute/CTHeadDeformation/wiki) which is updated (semi) regularly. \r\n\r\n## Setup/Build/Install\r\n\r\nThe module can be installed using pip:\r\n\r\n```\r\npip install CTHeadDeformation\r\n```\r\n\r\nThis 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). \r\n\r\nInstall elastix (https://elastix.lumc.nl/index.php)\r\n\r\nAdd the elastix.exe program pathfile to the system path.\r\n\r\n## Usage\r\n\r\nThe 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\r\n\r\nExample:\r\nOpen up the file OneAxisRotation.json and tell the json file to deform the dicom files in directory \"dicomSource\" by changing\r\n```\r\n\"InputDirectory\":\"\"\r\n```\r\n\r\nto  \r\n\r\n```\r\n\"InputDirectory\":\"dicomSource\"\r\n```\r\n\r\nAlso change the variable \"name\" to the 'Patient's name' variable as defined in the dicom metadata. \r\n\r\n### Run in python script\r\n\r\n```\r\nfrom DeformHeadCT.DeformVolume import DeformationScript\r\nJsonInfoFile = 'examples/OneAxisRotation.json'\r\nDeformationScript(JsonInfoFile)\r\n```\r\n\r\n### Command Line\r\n\r\nIn a command line (such as anaconda command prompt) navigate to the directory that the CTHeadDeformation repo was cloned to and run \r\n```python DeformVolume.py examples/OneAxisRotation.json```\r\n\r\nBy default the code will automatically use the elastix parameter in the examples folder, and will automatially locate the BoneMask volume required for the deformation. \r\n\r\nDicom Files of head and neck CT scans are avaiable at (https://www.cancerimagingarchive.net/collections/), subject to their licence agreements. \r\n\r\n## Directory Structure\r\n\r\n* DeformHeadCT - Contains the main python script and supporting functions\r\n\r\n* examples - contains example .json files as well as an example elastix file.\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Perform Realistic Head Deformations",
    "version": "0.1.4",
    "split_keywords": [
        "ct",
        "deformation",
        "head and neck"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "7d8527275a4e9af3ad7ac7c043e5c0c4",
                "sha256": "20c80b516a6c0dd20557d727339dd769e4d0fc203824b7236636002c4c1e7587"
            },
            "downloads": -1,
            "filename": "CTHeadDeformation-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7d8527275a4e9af3ad7ac7c043e5c0c4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 19773,
            "upload_time": "2022-12-05T22:22:22",
            "upload_time_iso_8601": "2022-12-05T22:22:22.175474Z",
            "url": "https://files.pythonhosted.org/packages/7e/8c/d90dc633f60f1ecefd320bce16d3c839b377e31f52d8d03ab70313246292/CTHeadDeformation-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "dc693a86c9436c8a2ad8e61f44309104",
                "sha256": "a5eae7c471bebfee86f3c270f91cce1e857c01acde10c322196b10fb405aa93f"
            },
            "downloads": -1,
            "filename": "CTHeadDeformation-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "dc693a86c9436c8a2ad8e61f44309104",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 16078,
            "upload_time": "2022-12-05T22:22:24",
            "upload_time_iso_8601": "2022-12-05T22:22:24.496841Z",
            "url": "https://files.pythonhosted.org/packages/2c/b9/acb87130959eb2f4b200d805ae27b24cdd7e9fb25713ccaf1e16875f9367/CTHeadDeformation-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-05 22:22:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "ACRF-Image-X-Institute",
    "github_project": "CTHeadDeformation",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "ctheaddeformation"
}
        
Elapsed time: 0.01602s