DicomRTTool


NameDicomRTTool JSON
Version 2.1.4 PyPI version JSON
download
home_pagehttps://github.com/brianmanderson/Dicom_RT_and_Images_to_Mask
SummaryServices for reading dicom files, RT structures, and dose files, as well as tools for converting numpy prediction masks back to an RT structure
upload_time2024-03-08 17:45:53
maintainer
docs_urlNone
authorBrian Mark Anderson
requires_python
license
keywords
VCS
bugtrack_url
requirements numpy matplotlib opencv-python openpyxl pandas Pillow pydicom scikit-image scipy SimpleITK six xlrd check-manifest tqdm pytest NiftiResampler PlotScrollNumpyArrays
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # We're published! Please check out the Technical Note here: https://www.sciencedirect.com/science/article/abs/pii/S1879850021000485 and reference this work if you find it useful
### DOI:https://doi.org/10.1016/j.prro.2021.02.003

## This code provides functionality for turning dicom images and RT structures into nifti files as well as turning prediction masks back into RT structures
## Installation guide
    pip install DicomRTTool
### Highly recommend to go through the jupyter notebook in the Examples folder and to read the Wiki

### Quick use guide
    from DicomRTTool.ReaderWriter import DicomReaderWriter, ROIAssociationClass
    Dicom_path = r'.some_path_to_dicom'
    Dicom_reader = DicomReaderWriter(description='Examples', arg_max=True)
    Dicom_reader.walk_through_folders(Dicom_path) # This will parse through all DICOM present in the folder and subfolders
    all_rois = Dicom_reader.return_rois(print_rois=True) # Return a list of all rois present
    
    Contour_names = ['tumor'] # Define what rois you want
    associations = [ROIAssociationClass('tumor', ['tumor_mr', 'tumor_ct'])] # Any list of roi associations
    Dicom_reader.set_contour_names_and_assocations(contour_names=Contour_names, associations=associations)
    
    Dicom_reader.get_images_and_mask()
    
    image_numpy = Dicom_reader.ArrayDicom
    mask_numpy = Dicom_reader.mask
    image_sitk_handle = Dicom_reader.dicom_handle
    mask_sitk_handle = Dicom_reader.annotation_handle

### Other interesting additions
### Adding information to the Dicom_reader.series_instances_dictionary
    from DicomRTTool.ReaderWriter import Tag
    plan_pydicom_string_keys = {"MyNamedRTPlan": Tag((0x300a, 0x002))}
    image_sitk_string_keys = {"MyPatientName": "0010|0010"}
    Dicom_reader = DicomReaderWriter(description='Examples', arg_max=True, plan_pydicom_string_keys=plan_pydicom_string_keys, image_sitk_string_keys=image_sitk_string_keys)
    

##### If you find this code useful, please provide a reference to my github page for others www.github.com/brianmanderson , thank you!

###### Ring update allows for multiple rings to be represented correctly

![multiple_rings.png](./Images/multiple_rings.png)


#### Works on oblique images for masks and predictions*



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/brianmanderson/Dicom_RT_and_Images_to_Mask",
    "name": "DicomRTTool",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Brian Mark Anderson",
    "author_email": "b5anderson@health.ucsd.edu",
    "download_url": "https://files.pythonhosted.org/packages/6b/00/8f7fcb59fcb0645d186d0e282029370251055de8d507fbb6c46b99ee0fae/DicomRTTool-2.1.4.tar.gz",
    "platform": null,
    "description": "# We're published! Please check out the Technical Note here: https://www.sciencedirect.com/science/article/abs/pii/S1879850021000485 and reference this work if you find it useful\r\n### DOI:https://doi.org/10.1016/j.prro.2021.02.003\r\n\r\n## This code provides functionality for turning dicom images and RT structures into nifti files as well as turning prediction masks back into RT structures\r\n## Installation guide\r\n    pip install DicomRTTool\r\n### Highly recommend to go through the jupyter notebook in the Examples folder and to read the Wiki\r\n\r\n### Quick use guide\r\n    from DicomRTTool.ReaderWriter import DicomReaderWriter, ROIAssociationClass\r\n    Dicom_path = r'.some_path_to_dicom'\r\n    Dicom_reader = DicomReaderWriter(description='Examples', arg_max=True)\r\n    Dicom_reader.walk_through_folders(Dicom_path) # This will parse through all DICOM present in the folder and subfolders\r\n    all_rois = Dicom_reader.return_rois(print_rois=True) # Return a list of all rois present\r\n    \r\n    Contour_names = ['tumor'] # Define what rois you want\r\n    associations = [ROIAssociationClass('tumor', ['tumor_mr', 'tumor_ct'])] # Any list of roi associations\r\n    Dicom_reader.set_contour_names_and_assocations(contour_names=Contour_names, associations=associations)\r\n    \r\n    Dicom_reader.get_images_and_mask()\r\n    \r\n    image_numpy = Dicom_reader.ArrayDicom\r\n    mask_numpy = Dicom_reader.mask\r\n    image_sitk_handle = Dicom_reader.dicom_handle\r\n    mask_sitk_handle = Dicom_reader.annotation_handle\r\n\r\n### Other interesting additions\r\n### Adding information to the Dicom_reader.series_instances_dictionary\r\n    from DicomRTTool.ReaderWriter import Tag\r\n    plan_pydicom_string_keys = {\"MyNamedRTPlan\": Tag((0x300a, 0x002))}\r\n    image_sitk_string_keys = {\"MyPatientName\": \"0010|0010\"}\r\n    Dicom_reader = DicomReaderWriter(description='Examples', arg_max=True, plan_pydicom_string_keys=plan_pydicom_string_keys, image_sitk_string_keys=image_sitk_string_keys)\r\n    \r\n\r\n##### If you find this code useful, please provide a reference to my github page for others www.github.com/brianmanderson , thank you!\r\n\r\n###### Ring update allows for multiple rings to be represented correctly\r\n\r\n![multiple_rings.png](./Images/multiple_rings.png)\r\n\r\n\r\n#### Works on oblique images for masks and predictions*\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Services for reading dicom files, RT structures, and dose files, as well as tools for converting numpy prediction masks back to an RT structure",
    "version": "2.1.4",
    "project_urls": {
        "Homepage": "https://github.com/brianmanderson/Dicom_RT_and_Images_to_Mask"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c582bb9edfd16973219cef55557e19193bde93c4e41d1cde9e4849b9641a97d5",
                "md5": "b7058bc1272688ccda03b6eb81141f72",
                "sha256": "444f259d68453755025b4ca7d57a9988e1481a2b30856de7ddbe7f9ce54e2f93"
            },
            "downloads": -1,
            "filename": "DicomRTTool-2.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b7058bc1272688ccda03b6eb81141f72",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 39018,
            "upload_time": "2024-03-08T17:45:50",
            "upload_time_iso_8601": "2024-03-08T17:45:50.430560Z",
            "url": "https://files.pythonhosted.org/packages/c5/82/bb9edfd16973219cef55557e19193bde93c4e41d1cde9e4849b9641a97d5/DicomRTTool-2.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b008f7fcb59fcb0645d186d0e282029370251055de8d507fbb6c46b99ee0fae",
                "md5": "62eb2ad785edcb0f155150a3fed9b844",
                "sha256": "ae003de36aaf5546f9c7e61b65348a3d02943f4d1ac17588cee1864d0b382ff1"
            },
            "downloads": -1,
            "filename": "DicomRTTool-2.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "62eb2ad785edcb0f155150a3fed9b844",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 628339,
            "upload_time": "2024-03-08T17:45:53",
            "upload_time_iso_8601": "2024-03-08T17:45:53.163657Z",
            "url": "https://files.pythonhosted.org/packages/6b/00/8f7fcb59fcb0645d186d0e282029370251055de8d507fbb6c46b99ee0fae/DicomRTTool-2.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-08 17:45:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "brianmanderson",
    "github_project": "Dicom_RT_and_Images_to_Mask",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "matplotlib",
            "specs": []
        },
        {
            "name": "opencv-python",
            "specs": []
        },
        {
            "name": "openpyxl",
            "specs": []
        },
        {
            "name": "pandas",
            "specs": []
        },
        {
            "name": "Pillow",
            "specs": []
        },
        {
            "name": "pydicom",
            "specs": []
        },
        {
            "name": "scikit-image",
            "specs": []
        },
        {
            "name": "scipy",
            "specs": []
        },
        {
            "name": "SimpleITK",
            "specs": []
        },
        {
            "name": "six",
            "specs": []
        },
        {
            "name": "xlrd",
            "specs": []
        },
        {
            "name": "check-manifest",
            "specs": []
        },
        {
            "name": "tqdm",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "NiftiResampler",
            "specs": []
        },
        {
            "name": "PlotScrollNumpyArrays",
            "specs": []
        }
    ],
    "lcname": "dicomrttool"
}
        
Elapsed time: 0.23075s