pyopv


Namepyopv JSON
Version 0.1.1.4 PyPI version JSON
download
home_pagehttps://github.com/Shallaj/py-opv
SummaryThis package provides a set of tools for checking OPV DICOM compliance and converting OPV DICOM to CSV or JSON.
upload_time2024-10-05 04:36:59
maintainerNone
docs_urlNone
authorShahin Hallaj, MD
requires_python>=3.8
licenseMIT License Copyright (c) 2024 Shahin Hallaj Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords dicom opv csv json medical imaging
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# PyOPV

This package provides functionality for working with the OPV DICOM files provided by various vendors. The package facilitates reading, analyzing, and processing these DICOM files for compliance and data extraction. The primary use case is for handling ophthalmology visual field-related DICOM files and ensuring they meet the latest DICOM standards.

## Installation

1. Install the package from PyPi:

```bash
pip install pyopv
```

Once installed, you can import the package and use its various utilities for DICOM file processing:

```python
import pyopv
```

## Working with PyOPV

### Sample Code Snippet for Processing DICOM Files:

To begin processing, you'll first need the latest SAP DICOM standard. This standard is updated regularly to ensure compliance with industry norms. The package allows you to download the latest version of the SAP DICOM standard in CSV format. Here's a simple example:

```python
from pyopv import get_dicom_standard

# Download and save the latest DICOM standard
get_dicom_standard() # This will create a CSV file in the current working directory
```

### Processing a Single File:

Here’s how you can process a single DICOM file to check compliance and extract relevant data:

```python
# Define the path to the DICOM file
file_path = '/path/to/your/dicom/file'

# Read the DICOM file using PyOPV
m_opvdicom = pyopv.read_dicom(file_path)

# Check if the file meets the DICOM compliance standards
missing_tags_df, incorrect_tags_df = m_opvdicom.check_dicom_compliance()

# Display missing and incorrect tags
display(missing_tags_df)
display(incorrect_tags_df)

# Convert the DICOM data to a pandas DataFrame for further analysis
m_opvdicom_df = m_opvdicom.to_pandas()
display(m_opvdicom_df)

# Extract pointwise data from the DICOM file and convert it to a pandas DataFrame
pointwise_data = m_opvdicom.pointwise_to_pandas()
display(pointwise_data)

# Alternatively, save the pointwise data as a nested JSON structure for more flexible use cases
pointwise_data_json = m_opvdicom.pointwise_to_nested_json()
```

### Bulk Processing OPV DICOM Files:

For scenarios where you need to process multiple DICOM files from a directory, PyOPV provides an efficient bulk processing capability. Here's how to do it:

```python
# Import the necessary class for handling multiple DICOM files
from pyopv import OPVDicomSet

# Specify the directory containing your DICOM files
dicom_directory = '/path/to/your/dicom/files'

# Read all the DICOM files in the specified directory
m_opvdicoms, errors = pyopv.read_dicom_directory(dicom_directory, file_extension='dcm')

# Check for missing tags across all files in the directory
missingtags_df = m_opvdicoms.check_dicom_compliance()
display(missingtags_df)

# Convert all DICOM files to pandas DataFrames, returning a wide DataFrame for analysis
result_df, error_df = m_opvdicoms.to_pandas()
display(result_df)
display(error_df)

# Similarly, extract pointwise data from all files in the directory and convert to DataFrames
pointwise_data, error_df = m_opvdicoms.pointwise_to_pandas()
display(pointwise_data)
display(error_df)

# Optionally, save the pointwise data into a nested JSON structure for each file
nested_json = m_opvdicoms.opvdicoms_pointwise_to_nested_json()
```

With these utilities, PyOPV makes it easy to handle large-scale DICOM datasets while ensuring compliance with industry standards. The ability to extract, analyze, and convert data into user-friendly formats like CSV, pandas DataFrames, and JSON structures helps streamline the workflow for researchers and clinicians working with ophthalmic imaging data.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Shallaj/py-opv",
    "name": "pyopv",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "DICOM, OPV, CSV, JSON, Medical Imaging",
    "author": "Shahin Hallaj, MD",
    "author_email": "Shahin Hallaj <shallaj@health.ucsd.edu>",
    "download_url": "https://files.pythonhosted.org/packages/42/0b/789f90e1701310a94b9e686eee6f16fc45d0272bc9a0b03bb7a24ff0a285/pyopv-0.1.1.4.tar.gz",
    "platform": null,
    "description": "\n# PyOPV\n\nThis package provides functionality for working with the OPV DICOM files provided by various vendors. The package facilitates reading, analyzing, and processing these DICOM files for compliance and data extraction. The primary use case is for handling ophthalmology visual field-related DICOM files and ensuring they meet the latest DICOM standards.\n\n## Installation\n\n1. Install the package from PyPi:\n\n```bash\npip install pyopv\n```\n\nOnce installed, you can import the package and use its various utilities for DICOM file processing:\n\n```python\nimport pyopv\n```\n\n## Working with PyOPV\n\n### Sample Code Snippet for Processing DICOM Files:\n\nTo begin processing, you'll first need the latest SAP DICOM standard. This standard is updated regularly to ensure compliance with industry norms. The package allows you to download the latest version of the SAP DICOM standard in CSV format. Here's a simple example:\n\n```python\nfrom pyopv import get_dicom_standard\n\n# Download and save the latest DICOM standard\nget_dicom_standard() # This will create a CSV file in the current working directory\n```\n\n### Processing a Single File:\n\nHere\u2019s how you can process a single DICOM file to check compliance and extract relevant data:\n\n```python\n# Define the path to the DICOM file\nfile_path = '/path/to/your/dicom/file'\n\n# Read the DICOM file using PyOPV\nm_opvdicom = pyopv.read_dicom(file_path)\n\n# Check if the file meets the DICOM compliance standards\nmissing_tags_df, incorrect_tags_df = m_opvdicom.check_dicom_compliance()\n\n# Display missing and incorrect tags\ndisplay(missing_tags_df)\ndisplay(incorrect_tags_df)\n\n# Convert the DICOM data to a pandas DataFrame for further analysis\nm_opvdicom_df = m_opvdicom.to_pandas()\ndisplay(m_opvdicom_df)\n\n# Extract pointwise data from the DICOM file and convert it to a pandas DataFrame\npointwise_data = m_opvdicom.pointwise_to_pandas()\ndisplay(pointwise_data)\n\n# Alternatively, save the pointwise data as a nested JSON structure for more flexible use cases\npointwise_data_json = m_opvdicom.pointwise_to_nested_json()\n```\n\n### Bulk Processing OPV DICOM Files:\n\nFor scenarios where you need to process multiple DICOM files from a directory, PyOPV provides an efficient bulk processing capability. Here's how to do it:\n\n```python\n# Import the necessary class for handling multiple DICOM files\nfrom pyopv import OPVDicomSet\n\n# Specify the directory containing your DICOM files\ndicom_directory = '/path/to/your/dicom/files'\n\n# Read all the DICOM files in the specified directory\nm_opvdicoms, errors = pyopv.read_dicom_directory(dicom_directory, file_extension='dcm')\n\n# Check for missing tags across all files in the directory\nmissingtags_df = m_opvdicoms.check_dicom_compliance()\ndisplay(missingtags_df)\n\n# Convert all DICOM files to pandas DataFrames, returning a wide DataFrame for analysis\nresult_df, error_df = m_opvdicoms.to_pandas()\ndisplay(result_df)\ndisplay(error_df)\n\n# Similarly, extract pointwise data from all files in the directory and convert to DataFrames\npointwise_data, error_df = m_opvdicoms.pointwise_to_pandas()\ndisplay(pointwise_data)\ndisplay(error_df)\n\n# Optionally, save the pointwise data into a nested JSON structure for each file\nnested_json = m_opvdicoms.opvdicoms_pointwise_to_nested_json()\n```\n\nWith these utilities, PyOPV makes it easy to handle large-scale DICOM datasets while ensuring compliance with industry standards. The ability to extract, analyze, and convert data into user-friendly formats like CSV, pandas DataFrames, and JSON structures helps streamline the workflow for researchers and clinicians working with ophthalmic imaging data.\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Shahin Hallaj  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "This package provides a set of tools for checking OPV DICOM compliance and converting OPV DICOM to CSV or JSON.",
    "version": "0.1.1.4",
    "project_urls": {
        "Homepage": "https://github.com/Shallaj/py-opv",
        "Source": "https://github.com/Shallaj/py-opv"
    },
    "split_keywords": [
        "dicom",
        " opv",
        " csv",
        " json",
        " medical imaging"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aba5dab216f17220f7cc7c6268ddc071d2945ec41cd7c24ae8fae63dce8db779",
                "md5": "edfc74f1a89f253e9c5392de01405f68",
                "sha256": "660e7bc26d02dbe21e8de58ff75f3c31ef89d71284bec1909df1159074da10dd"
            },
            "downloads": -1,
            "filename": "pyopv-0.1.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "edfc74f1a89f253e9c5392de01405f68",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 18416,
            "upload_time": "2024-10-05T04:36:57",
            "upload_time_iso_8601": "2024-10-05T04:36:57.503159Z",
            "url": "https://files.pythonhosted.org/packages/ab/a5/dab216f17220f7cc7c6268ddc071d2945ec41cd7c24ae8fae63dce8db779/pyopv-0.1.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "420b789f90e1701310a94b9e686eee6f16fc45d0272bc9a0b03bb7a24ff0a285",
                "md5": "ceab37247227b29b0fd012889b2e5c43",
                "sha256": "99d1e61a802885b4677db22fffdad18426e4c6856f6d7e10d166cdb0ef52dbff"
            },
            "downloads": -1,
            "filename": "pyopv-0.1.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "ceab37247227b29b0fd012889b2e5c43",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 18338,
            "upload_time": "2024-10-05T04:36:59",
            "upload_time_iso_8601": "2024-10-05T04:36:59.497817Z",
            "url": "https://files.pythonhosted.org/packages/42/0b/789f90e1701310a94b9e686eee6f16fc45d0272bc9a0b03bb7a24ff0a285/pyopv-0.1.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-05 04:36:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Shallaj",
    "github_project": "py-opv",
    "github_not_found": true,
    "lcname": "pyopv"
}
        
Elapsed time: 0.42497s