dicom-csv


Namedicom-csv JSON
Version 0.2.10 PyPI version JSON
download
home_pagehttps://github.com/neuro-ml/dicom-csv
SummaryUtils for gathering, aggregation and handling metadata from DICOM files.
upload_time2024-03-06 09:46:27
maintainer
docs_urlNone
author
requires_python>=3.6
licenseMIT
keywords dicom
VCS
bugtrack_url
requirements pydicom pandas numpy tqdm
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Utils for gathering, aggregation and handling metadata from DICOM files.

# Installation

From pip
```
pip install dicom-csv
```

or from GitHub

```bash
git clone https://github.com/neuro-ml/dicom-csv
cd dicom-csv
pip install -e .
```

# Example `join_tree`

```python
>>> from dicom_csv import join_tree
>>> folder = '/path/to/folder/'
>>> meta = join_tree(folder, verbose=2)
>>> meta.head(3)
```
| AccessionNumber | AcquisitionDate |  ...  | WindowCenter | WindowWidth |
| -------------: | -------------:   | :---: | --------:    | :---------: |
|000002621237 	 |20200922          |...    |-500.0        |1500.0       |
|000002621237 	 |20200922          |...    |-40.0         |400.0        |
|000002621237 	 |20200922          |...    |-500.0        |1500.0       |
3 rows x 155 columns


# Example load 3D image
from a series of dicom files (each containing 2D image)

```python
from dicom_csv import join_tree, order_series, stack_images
from pydicom import dcmread
from pathlib import Path

# 1. Collect metadata from all dicom files
folder = Path('/path/to/folder/')
meta = join_tree(folder, verbose=2)

# 2. Select series to load
uid = '...' # unique identifier of a series you want to load,
            # you could list them by `meta.SeriesInstanceUID.unique()`
series = meta.query("SeriesInstanceUID==@uid")

# 3. Read files & combine them into a single volume
images2d = [dcmread(folder / row[1].PathToFolder / row[1].FileName) for row in series.iterrows()] 
image3d = stack_images(order_series(images2d))
```

# Documentation

You can find the documentation [here](https://dicom-csv.readthedocs.io/en/latest/index.html).



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/neuro-ml/dicom-csv",
    "name": "dicom-csv",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "DICOM",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/fe/6a/8c1708af977e175c4ed1d016203c3a3e719747e16baedb9bf0cc9c72721b/dicom_csv-0.2.10.tar.gz",
    "platform": null,
    "description": "Utils for gathering, aggregation and handling metadata from DICOM files.\n\n# Installation\n\nFrom pip\n```\npip install dicom-csv\n```\n\nor from GitHub\n\n```bash\ngit clone https://github.com/neuro-ml/dicom-csv\ncd dicom-csv\npip install -e .\n```\n\n# Example `join_tree`\n\n```python\n>>> from dicom_csv import join_tree\n>>> folder = '/path/to/folder/'\n>>> meta = join_tree(folder, verbose=2)\n>>> meta.head(3)\n```\n| AccessionNumber | AcquisitionDate |  ...  | WindowCenter | WindowWidth |\n| -------------: | -------------:   | :---: | --------:    | :---------: |\n|000002621237 \t |20200922          |...    |-500.0        |1500.0       |\n|000002621237 \t |20200922          |...    |-40.0         |400.0        |\n|000002621237 \t |20200922          |...    |-500.0        |1500.0       |\n3 rows x 155 columns\n\n\n# Example load 3D image\nfrom a series of dicom files (each containing 2D image)\n\n```python\nfrom dicom_csv import join_tree, order_series, stack_images\nfrom pydicom import dcmread\nfrom pathlib import Path\n\n# 1. Collect metadata from all dicom files\nfolder = Path('/path/to/folder/')\nmeta = join_tree(folder, verbose=2)\n\n# 2. Select series to load\nuid = '...' # unique identifier of a series you want to load,\n            # you could list them by `meta.SeriesInstanceUID.unique()`\nseries = meta.query(\"SeriesInstanceUID==@uid\")\n\n# 3. Read files & combine them into a single volume\nimages2d = [dcmread(folder / row[1].PathToFolder / row[1].FileName) for row in series.iterrows()] \nimage3d = stack_images(order_series(images2d))\n```\n\n# Documentation\n\nYou can find the documentation [here](https://dicom-csv.readthedocs.io/en/latest/index.html).\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Utils for gathering, aggregation and handling metadata from DICOM files.",
    "version": "0.2.10",
    "project_urls": {
        "Download": "https://github.com/neuro-ml/dicom-csv/v0.2.10.tar.gz",
        "Homepage": "https://github.com/neuro-ml/dicom-csv"
    },
    "split_keywords": [
        "dicom"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fe6a8c1708af977e175c4ed1d016203c3a3e719747e16baedb9bf0cc9c72721b",
                "md5": "fc02d9a4146351d512532e985555a1ca",
                "sha256": "5854017764ae56018a99eebf2d8653015c7b6e534de5ba2a9ef7d81b092a351e"
            },
            "downloads": -1,
            "filename": "dicom_csv-0.2.10.tar.gz",
            "has_sig": false,
            "md5_digest": "fc02d9a4146351d512532e985555a1ca",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 18150,
            "upload_time": "2024-03-06T09:46:27",
            "upload_time_iso_8601": "2024-03-06T09:46:27.161768Z",
            "url": "https://files.pythonhosted.org/packages/fe/6a/8c1708af977e175c4ed1d016203c3a3e719747e16baedb9bf0cc9c72721b/dicom_csv-0.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-06 09:46:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "neuro-ml",
    "github_project": "dicom-csv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "pydicom",
            "specs": [
                [
                    ">=",
                    "2.0"
                ],
                [
                    "<",
                    "3.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        }
    ],
    "lcname": "dicom-csv"
}
        
Elapsed time: 0.20338s