diffdrrdata


Namediffdrrdata JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/eigenvivek/DiffDRR-Datasets
SummaryOpen-source 2D/3D registration datasets and dataloaders for DiffDRR
upload_time2024-06-12 18:51:43
maintainerNone
docs_urlNone
authorVivek Gopalakrishnan
requires_python>=3.7
licenseApache Software License 2.0
keywords nbdev jupyter notebook python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DiffDRR Datasets


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

> Open-source 2D/3D registration datasets and dataloaders for
> [`DiffDRR`](https://github.com/eigenvivek/DiffDRR/)

[![CI](https://github.com/eigenvivek/DiffDRR-Datasets/actions/workflows/test.yaml/badge.svg)](https://github.com/eigenvivek/DiffDRR-Datasets/actions/workflows/test.yaml)
[![Paper
shield](https://img.shields.io/badge/arXiv-2208.12737-red.svg)](https://arxiv.org/abs/2208.12737)
[![License:
MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Docs](https://github.com/eigenvivek/DiffDRR-Datasets/actions/workflows/deploy.yaml/badge.svg)](https://vivekg.dev/DiffDRR-Datasets/)
[![Code style:
black](https://img.shields.io/badge/Code%20style-black-black.svg)](https://github.com/psf/black)

## Install

``` zsh
pip install diffdrrdata
```

## DiffDRR

[`DiffDRR`](https://github.com/eigenvivek/DiffDRR/) is an differentiable
X-ray renderer used for solving inverse problems in tomographic imaging.
If you find `DiffDRR` useful in your work, please cite our paper:

    @inproceedings{gopalakrishnan2022fast,
      title={Fast auto-differentiable digitally reconstructed radiographs for solving inverse problems in intraoperative imaging},
      author={Gopalakrishnan, Vivek and Golland, Polina},
      booktitle={Workshop on Clinical Image-Based Procedures},
      pages={1--11},
      year={2022},
      organization={Springer}
    }

## Datasets

We provide APIs to load the following open-source datasets into
`DiffDRR`:

| **Dataset**                                                                | **Anatomy**      | **\# of Subjects** | **\# of 2D Images** | **CTs** | **X-rays** | **GT Fiducials** |
|----------------------------------------------------------------------------|------------------|:------------------:|:-------------------:|:-------:|:----------:|:----------------:|
| [`DeepFluoro`](https://github.com/rg2/DeepFluoroLabeling-IPCAI2020)        | pelvis           |         6          |         366         |   ✅    |     ✅     |        ❌        |
| [`Ljubljana`](https://lit.fe.uni-lj.si/en/research/resources/3D-2D-GS-CA/) | neurovasculature |         10         |         20          |   ✅    |     ✅     |        ✅        |

If you use any of these datasets, please cite the original papers.

### `DeepFluoro`

[`DeepFluoro`](https://github.com/rg2/DeepFluoroLabeling-IPCAI2020)
([**Grupp et al.,
2020**](https://link.springer.com/article/10.1007/s11548-020-02162-7))
provides paired X-ray fluoroscopy images and CT volume of the pelvis.
The data were collected from six cadaveric subjects at John Hopkins
University. Ground truth camera poses were estimated with an offline
registration process. A visualization of the X-ray / CT pairs in the
`DeepFluoro` dataset is available
[here](https://vivekg.dev/DiffDRR-Datasets/deepfluoro_camera_poses.html).

    @article{grupp2020automatic,
      title={Automatic annotation of hip anatomy in fluoroscopy for robust and efficient 2D/3D registration},
      author={Grupp, Robert B and Unberath, Mathias and Gao, Cong and Hegeman, Rachel A and Murphy, Ryan J and Alexander, Clayton P and Otake, Yoshito and McArthur, Benjamin A and Armand, Mehran and Taylor, Russell H},
      journal={International journal of computer assisted radiology and surgery},
      volume={15},
      pages={759--769},
      year={2020},
      publisher={Springer}
    }

``` python
import matplotlib.pyplot as plt
import torch
from diffdrr.drr import DRR
from diffdrr.visualization import plot_drr

from diffdrrdata.deepfluoro import DeepFluoroDataset, Transforms

# Load a subject from the DeepFluoroDataset
deepfluoro = DeepFluoroDataset(id_number=1, bone_attenuation_multiplier=2.5)

# Initialize the DRR module
subsample = 4
drr = DRR(
    deepfluoro.subject,
    deepfluoro.focal_len,
    deepfluoro.height // subsample,
    deepfluoro.delx * subsample,
    x0=deepfluoro.x0,
    y0=deepfluoro.y0,
)
transform = Transforms(deepfluoro.height // subsample)

# Render a DRR from the ground truth camera pose
gt, pose = deepfluoro[0]
img = drr(pose)
gt, img = transform(gt), transform(img)
plot_drr(torch.concat([gt, img]), title=["Downsampled X-ray", "DRR"])
plt.show()
```

![](index_files/figure-commonmark/cell-2-output-1.png)

### `Ljubljana`

[`Ljubljana`](https://lit.fe.uni-lj.si/en/research/resources/3D-2D-GS-CA/)
(**[Mitrovic et al.,
2013](https://ieeexplore.ieee.org/abstract/document/6507588)**) provides
paired 2D/3D digital subtraction angiography (DSA) images. The data were
collected from 10 patients undergoing endovascular image-guided
interventions at the University of Ljubljana. Ground truth camera poses
were estimated by registering surface fiducial markers.

    @article{pernus20133d,
      title={3D-2D registration of cerebral angiograms: A method and evaluation on clinical images},
      author={Mitrović, Uros˘ and S˘piclin, Z˘iga and Likar, Bos˘tjan and Pernus˘, Franjo},
      journal={IEEE transactions on medical imaging},
      volume={32},
      number={8},
      pages={1550--1563},
      year={2013},
      publisher={IEEE}
    }

``` python
from diffdrrdata.ljubljana import LjubljanaDataset, Transforms

# Load a subject from the LjubljanaDataset
ljubljana = LjubljanaDataset(id_number=1)
gt, pose, focal_len, height, width, delx, dely, x0, y0 = ljubljana[0]

# Initialize the DRR module
subsample = 8
drr = DRR(
    ljubljana.subject,
    focal_len,
    height // subsample,
    delx * subsample,
    width // subsample,
    dely * subsample,
    x0=x0,
    y0=y0,
)
transform = Transforms(height // subsample, width // subsample)

# Render a DRR from the ground truth camera pose
img = drr(pose)
gt, img = transform(gt), transform(img)
plot_drr(torch.concat([gt, img]), title=["Downsampled X-ray", "DRR"])
plt.show()
```

![](index_files/figure-commonmark/cell-3-output-1.png)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/eigenvivek/DiffDRR-Datasets",
    "name": "diffdrrdata",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "nbdev jupyter notebook python",
    "author": "Vivek Gopalakrishnan",
    "author_email": "vivekg@mit.edu",
    "download_url": "https://files.pythonhosted.org/packages/f4/f6/fbdc3009e676dae804328fd7bd2ecadb684183133d52a7308ea6898823c8/diffdrrdata-0.0.3.tar.gz",
    "platform": null,
    "description": "# DiffDRR Datasets\n\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n> Open-source 2D/3D registration datasets and dataloaders for\n> [`DiffDRR`](https://github.com/eigenvivek/DiffDRR/)\n\n[![CI](https://github.com/eigenvivek/DiffDRR-Datasets/actions/workflows/test.yaml/badge.svg)](https://github.com/eigenvivek/DiffDRR-Datasets/actions/workflows/test.yaml)\n[![Paper\nshield](https://img.shields.io/badge/arXiv-2208.12737-red.svg)](https://arxiv.org/abs/2208.12737)\n[![License:\nMIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Docs](https://github.com/eigenvivek/DiffDRR-Datasets/actions/workflows/deploy.yaml/badge.svg)](https://vivekg.dev/DiffDRR-Datasets/)\n[![Code style:\nblack](https://img.shields.io/badge/Code%20style-black-black.svg)](https://github.com/psf/black)\n\n## Install\n\n``` zsh\npip install diffdrrdata\n```\n\n## DiffDRR\n\n[`DiffDRR`](https://github.com/eigenvivek/DiffDRR/) is an differentiable\nX-ray renderer used for solving inverse problems in tomographic imaging.\nIf you find `DiffDRR` useful in your work, please cite our paper:\n\n    @inproceedings{gopalakrishnan2022fast,\n      title={Fast auto-differentiable digitally reconstructed radiographs for solving inverse problems in intraoperative imaging},\n      author={Gopalakrishnan, Vivek and Golland, Polina},\n      booktitle={Workshop on Clinical Image-Based Procedures},\n      pages={1--11},\n      year={2022},\n      organization={Springer}\n    }\n\n## Datasets\n\nWe provide APIs to load the following open-source datasets into\n`DiffDRR`:\n\n| **Dataset**                                                                | **Anatomy**      | **\\# of Subjects** | **\\# of 2D Images** | **CTs** | **X-rays** | **GT Fiducials** |\n|----------------------------------------------------------------------------|------------------|:------------------:|:-------------------:|:-------:|:----------:|:----------------:|\n| [`DeepFluoro`](https://github.com/rg2/DeepFluoroLabeling-IPCAI2020)        | pelvis           |         6          |         366         |   \u2705    |     \u2705     |        \u274c        |\n| [`Ljubljana`](https://lit.fe.uni-lj.si/en/research/resources/3D-2D-GS-CA/) | neurovasculature |         10         |         20          |   \u2705    |     \u2705     |        \u2705        |\n\nIf you use any of these datasets, please cite the original papers.\n\n### `DeepFluoro`\n\n[`DeepFluoro`](https://github.com/rg2/DeepFluoroLabeling-IPCAI2020)\n([**Grupp et al.,\n2020**](https://link.springer.com/article/10.1007/s11548-020-02162-7))\nprovides paired X-ray fluoroscopy images and CT volume of the pelvis.\nThe data were collected from six cadaveric subjects at John Hopkins\nUniversity. Ground truth camera poses were estimated with an offline\nregistration process. A visualization of the X-ray / CT pairs in the\n`DeepFluoro` dataset is available\n[here](https://vivekg.dev/DiffDRR-Datasets/deepfluoro_camera_poses.html).\n\n    @article{grupp2020automatic,\n      title={Automatic annotation of hip anatomy in fluoroscopy for robust and efficient 2D/3D registration},\n      author={Grupp, Robert B and Unberath, Mathias and Gao, Cong and Hegeman, Rachel A and Murphy, Ryan J and Alexander, Clayton P and Otake, Yoshito and McArthur, Benjamin A and Armand, Mehran and Taylor, Russell H},\n      journal={International journal of computer assisted radiology and surgery},\n      volume={15},\n      pages={759--769},\n      year={2020},\n      publisher={Springer}\n    }\n\n``` python\nimport matplotlib.pyplot as plt\nimport torch\nfrom diffdrr.drr import DRR\nfrom diffdrr.visualization import plot_drr\n\nfrom diffdrrdata.deepfluoro import DeepFluoroDataset, Transforms\n\n# Load a subject from the DeepFluoroDataset\ndeepfluoro = DeepFluoroDataset(id_number=1, bone_attenuation_multiplier=2.5)\n\n# Initialize the DRR module\nsubsample = 4\ndrr = DRR(\n    deepfluoro.subject,\n    deepfluoro.focal_len,\n    deepfluoro.height // subsample,\n    deepfluoro.delx * subsample,\n    x0=deepfluoro.x0,\n    y0=deepfluoro.y0,\n)\ntransform = Transforms(deepfluoro.height // subsample)\n\n# Render a DRR from the ground truth camera pose\ngt, pose = deepfluoro[0]\nimg = drr(pose)\ngt, img = transform(gt), transform(img)\nplot_drr(torch.concat([gt, img]), title=[\"Downsampled X-ray\", \"DRR\"])\nplt.show()\n```\n\n![](index_files/figure-commonmark/cell-2-output-1.png)\n\n### `Ljubljana`\n\n[`Ljubljana`](https://lit.fe.uni-lj.si/en/research/resources/3D-2D-GS-CA/)\n(**[Mitrovic et al.,\n2013](https://ieeexplore.ieee.org/abstract/document/6507588)**) provides\npaired 2D/3D digital subtraction angiography (DSA) images. The data were\ncollected from 10 patients undergoing endovascular image-guided\ninterventions at the University of Ljubljana. Ground truth camera poses\nwere estimated by registering surface fiducial markers.\n\n    @article{pernus20133d,\n      title={3D-2D registration of cerebral angiograms: A method and evaluation on clinical images},\n      author={Mitrovi\u0107, Uros\u02d8 and S\u02d8piclin, Z\u02d8iga and Likar, Bos\u02d8tjan and Pernus\u02d8, Franjo},\n      journal={IEEE transactions on medical imaging},\n      volume={32},\n      number={8},\n      pages={1550--1563},\n      year={2013},\n      publisher={IEEE}\n    }\n\n``` python\nfrom diffdrrdata.ljubljana import LjubljanaDataset, Transforms\n\n# Load a subject from the LjubljanaDataset\nljubljana = LjubljanaDataset(id_number=1)\ngt, pose, focal_len, height, width, delx, dely, x0, y0 = ljubljana[0]\n\n# Initialize the DRR module\nsubsample = 8\ndrr = DRR(\n    ljubljana.subject,\n    focal_len,\n    height // subsample,\n    delx * subsample,\n    width // subsample,\n    dely * subsample,\n    x0=x0,\n    y0=y0,\n)\ntransform = Transforms(height // subsample, width // subsample)\n\n# Render a DRR from the ground truth camera pose\nimg = drr(pose)\ngt, img = transform(gt), transform(img)\nplot_drr(torch.concat([gt, img]), title=[\"Downsampled X-ray\", \"DRR\"])\nplt.show()\n```\n\n![](index_files/figure-commonmark/cell-3-output-1.png)\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "Open-source 2D/3D registration datasets and dataloaders for DiffDRR",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/eigenvivek/DiffDRR-Datasets"
    },
    "split_keywords": [
        "nbdev",
        "jupyter",
        "notebook",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "574bd3a78fe27cc9d9b586d848f6f11a2b052208257bc94ce1b2105e18123af9",
                "md5": "fa42cb7277b069b6d27418ce2eed7b30",
                "sha256": "d9b6e8dede8234705e6cbdc12b4196eececd6ed4d37d0fd61976fcbc03e6838a"
            },
            "downloads": -1,
            "filename": "diffdrrdata-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa42cb7277b069b6d27418ce2eed7b30",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11189,
            "upload_time": "2024-06-12T18:51:42",
            "upload_time_iso_8601": "2024-06-12T18:51:42.300149Z",
            "url": "https://files.pythonhosted.org/packages/57/4b/d3a78fe27cc9d9b586d848f6f11a2b052208257bc94ce1b2105e18123af9/diffdrrdata-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4f6fbdc3009e676dae804328fd7bd2ecadb684183133d52a7308ea6898823c8",
                "md5": "a6dbf2fa19a71461209b3f9397e0d53d",
                "sha256": "457baaac6f4261d9f4a1946d8546e1f3cdf63b46b13cdfee74aaff7bece38781"
            },
            "downloads": -1,
            "filename": "diffdrrdata-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a6dbf2fa19a71461209b3f9397e0d53d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12482,
            "upload_time": "2024-06-12T18:51:43",
            "upload_time_iso_8601": "2024-06-12T18:51:43.462638Z",
            "url": "https://files.pythonhosted.org/packages/f4/f6/fbdc3009e676dae804328fd7bd2ecadb684183133d52a7308ea6898823c8/diffdrrdata-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-12 18:51:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "eigenvivek",
    "github_project": "DiffDRR-Datasets",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "diffdrrdata"
}
        
Elapsed time: 0.26572s