Saravanan666/pypi-org huggingface dataset:
Package: dicom-ecg-plot
Dicom ECG plotA python tool to plot Dicom ECG.The DICOM file can also be specified asstudyUID seriesUID objectUIDand
retrieved from your WADO server.Github repository:hereTHE PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY OF ANY KIND.Online demodemo siteYou can convert your own DICOM files or use preloaded sample files from different modality models.Installpython3-mvenvecg
.ecg/bin/activate
pipinstalldicom-ecg-plotUsage ofdicom-ecg-plottooldicom-ecg-plot<inputfile>[--layout=LAYOUT][--output=FILE|--format=FMT]--minor-grid
dicom-ecg-plot<stu><ser><obj>[--layout=LAYOUT][--output=FILE|--format=FMT]--minor-grid
dicom-ecg-plot--helpExamples:dicom-ecg-plotanonymous_ecg.dcm-oanonymous_ecg.pdf
dicom-ecg-plotanonymous_ecg.dcm--layout6x2--outputanonymous_ecg.png
dicom-ecg-plotanonymous_ecg.dcm--formatsvg>anonymous_ecg.svgThe input can be a (dicom ecg) file or the tripletstudyUID, seriesUID, objectUID. In the latter case dicom file is downloaded viaWADO.If--outputis given the ouput format is deduced from the extension of theFILE.
If the output file is not given--formatmust be defined.
Supported output formats are: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.By default the 5mm grid is drawn,--minor-gridadd the minor grid (1mm).The signals are filtered using a lowpass (40 Hz)butterworth filterof order 2.LAYOUTcan be one of: 3x4_1 (that is 3 rows for 4 columns plus 1 row), 3x4, 6x2, 12x1 (default: 3x4_1).
New layouts can be defined adding the corresponding matrix in LAYOUT dictionary inconfig.py.Referenceshttp://medical.nema.org/Dicom/supps/sup30_lb.pdfhttp://dicomlookup.com/html/03_03PU.html#LinkTarget_229354http://libir.tmu.edu.tw/bitstream/987654321/21661/1/B09.pdfMortara ECG Conformance Statement
Package: dicomgenerator
dicomgeneratorGenerate pydicom datasets and data elements for use in testing.Free software: MIT licenseStatus: Alpha. Tests run but there are loose endsFeaturesExtendsfactory-boyfactories to producepydicomDatasets and DicomElementsGenerate valid DICOM values for person name, time, date, and UIDCreate json-based editable templates from any dicom filequick_dataset(): single-line pydicom dataset initInstallationInstall with pip::pip install dicomgeneratorUsageQuick datasetI have found this quite useful in testing:fromdicomgenerator.generatorsimportquick_datasetds=quick_dataset(PatientName='Jane',StudyDescription='Test')# >>> ds.PatientName -> 'Jane'# >>> ds.StudyDescription -> 'Test'Generating a datasetGenerate a realistic CT datasetfromdicomgenerator.factoryimportCTDatasetFactory# Generate from template>>>CTDatasetFactory().PatientName->'van Haarlem^Anouk'#  generated random name>>>CTDatasetFactory().PatientName->'Loreal^Casper'#  generated random name# Overwrite arbitrary DICOM elementsds.CTDatasetFactory(PatientSex='M',PatientName='Smith^Harry')>>>ds.PatientName->'Smith^Harry'>>>ds.PatientSex->'M'# generated UIDs and dates are valid DICOM>>>CTDatasetFactory().StudyTime->'130624.929'>>>CTDatasetFactory().StudyDate->'20110508'>>>CTDatasetFactory().StudyInstanceUID->'1.2.826.0.1.3680'Generating a data element# importfromdicomgenerator.factoryimportDataElementFactory# Creating a DICOM data element by name will give a realistic value and correct VR>>>DataElementFactory(tag='PatientName').value->"van Ooyen^Fiene">>>DataElementFactory(tag='PatientName').VR->'PN'# You can also give DICOM tags as hex>>>DataElementFactory(tag=0x00100010).value->"Weil^Jack"# Dates, times and UIDs all work.>>>DataElementFactory(tag="AcquisitionTime").value->'184146.928'>>>DataElementFactory(tag="PatientBirthDate").value->'20120511'>>>DataElementFactory(tag="SeriesInstanceUID").value->'1.2.826.0.1.3680'In reproducible testsYou can set the random seed infactory-boylike this:fromfactoryimportrandomdeftest_one:"""The random patient name in this test will always be the same"""random.reseed_random('any string you want')assertelement=DataElementFactory(tag='PatientName').value=="van Ooyen^Fiene"Command Line InterfaceYou can convert a DICOM file to AnnotatedDataset via the commandline. by default this will write an annotated dataset to the same folder, appending_template.json$ dicomgen convert to-json /tmp/dicom_file
$ ls
dicom_file  dicom_file_template.jsonFor options, use$ dicomgen convert to-json --helpCreditsThis package was originally created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: dicom-image-tools
Dicom Image ToolsThe dicom image tools package was created for giving a framework handling DICOM image data. Adding functionality often used for programmatic image analysis.The package is still in early development and more features will be added.Install Dicom Image ToolsInstall using pipenv by running:$ pipenv install dicom-image-toolsInstall using pip by running:$ pip install dicom-image-toolsOnlyPython 3.10+is supported.See project wiki for more detailed documentationUsageWhen you've installed the package you import it as any other package usingimportdicom_image_toolsImporting DICOM imagesThere are two functions for importing DICOM images,import_dicom_file(file: pathlib.Path)andimport_dicom_from_folder(folder: pathlib.Path, recursively: bool = True).The latter function has an optional input argument for specifying if the folder given should be searched for DICOM files recursively, default =TrueBoth will return the image/-s inDicomStudyobjects, theimport_dicom_from_folderfunction returns a dictionary with theStudy Instance UIDas thekeyand the correspondingDicomStudyobject asvalue.You can then add additional files to theDicomStudyobject through theDicomStudy.add_filewhich takes the file path as apathlib.Pathobject as input.TheDicomStudy.Seriesis a list of all series belonging to the study that has been imported. EachDicomStudy.Seriesitem is an object containing the image/image volume and metadata for each image. The image/image volume is accessed through theImageVolumeattribute of theDicomStudy.Seriesitem, and the metadata in theCompleteMetadataattribute.
Package: dicom-mask
dicom-maskExport structure from dicom to numpy binary maskWhy does this exist?Dicom-mask was developed by the radiation-oncology research group at Rigshospitalet, Denmark.We implemented dicom-mask because the existing DICOM export tools we found failed to extract the DICOM RTSTRUCT (1) information from our ViewRay DICOM files. dicom-mask contains code modified from dicompyler (2) and uses dicompyler-core (3) and scikit-image (4) to extract RTSTRUCT data into a NumPy (5) ndarray object.InstallThe latest version is available via PyPI (https://pypi.org/project/dicom-mask) for convenient installation with pippip install dicom-maskExample usagefromdicom_mask.convertimportstruct_to_maskdicom_dir='some_dicom_dir'dicom_files=['all','dicom','series','image','filenames','and','struct','filename']struct_name='liver'mask=struct_to_mask(dicom_dir,dicom_files,struct_name)CitationThe paper for which it was initially developed is:Gating has a negligible impact on dose delivered in MRI-guided online adaptive radiotherapy of prostate cancerCiting the above paper is best for us :)For citation of the tool source code directly please cite thezenodo repositoryAbraham George Smith. (2021). Abe404/dicom_mask: 0.0.17b (0.0.17b). Zenodo.https://zenodo.org/record/5727328ReferencesGorthi, Subrahmanyam & Bach Cuadra, Meritxell & Thiran, Jean-Philippe. (2009). Exporting Contours to DICOM-RT Structure Set.Panchal, Aditya, and Roy Keyes. "SU‐GG‐T‐260: dicompyler: an open source radiation therapy research platform with a plugin architecture." Medical Physics 37.6Part19 (2010): 3245-3245.Aditya Panchal, pyup.io bot, Gabriel Couture, gertsikkema, Nicolas Galler, Hideki_Nakamoto, David C Hall, & Akihisa Wakita. (2019). dicompyler/dicompyler-core v0.5.5 (v0.5.5). Zenodo.https://doi.org/10.5281/zenodo.3236628Stéfan van der Walt, Johannes L. Schönberger, Juan Nunez-Iglesias, François Boulogne, Joshua D. Warner, Neil Yager, Emmanuelle Gouillart, Tony Yu and the scikit-image contributors. scikit-image: Image processing in Python. PeerJ 2:e453 (2014)https://doi.org/10.7717/peerj.453Harris, C.R., Millman, K.J., van der Walt, S.J. et al. Array programming with NumPy. Nature 585, 357–362 (2020). DOI: 10.1038/s41586-020-2649-2. (Publisher link).
Package: dicommeta
DicomMetadicommeta is a Python library for efficiently storing large amounts of Dicom MetadataInstallationUse the package managerpipto install dicommeta.pipinstalldicommetaUsagefrompprintimportpprintfromdicommeta.UtilsimportModefromdicommeta.StructimportStudy,Series,Instancenew_dicom_study=Study(StudyInstanceUID='1.3.6.1.4.1.14519.5.2.1.4334.1501.757929841898426427124434115918',SpecificCharacterSet='ISO_IR 100',StudyDate="20190701",StudyTime='023750',AccessionNumber='sdfk324234',ReferringPhysicianName='Dr Strange',PatientName='John Doe',PatientID='A123',StudyUID='study001',PatientBirthDate='20000101',mode=Mode.CT)new_series01=Series(seriesUID='series001')new_series01.add_instance(Instance(SOPinstanceUID='Instance001'))new_series01.add_instance(Instance(SOPinstanceUID='Instance002'))new_series01.add_instance(Instance(SOPinstanceUID='Instance002'))new_dicom_study.add_series(new_series01)new_series11=Series(seriesUID='series001')new_series11.add_instance(Instance(SOPinstanceUID='Instance002'))new_dicom_study.add_series(new_series11)new_series11.add_instance(Instance(SOPinstanceUID='Instance003'))new_dicom_study.add_series(new_series11)new_series02=Series(seriesUID='series002')new_series02.add_instance(Instance(SOPinstanceUID='Instance002'))new_series02.add_instance(Instance(SOPinstanceUID='Instance003'))new_dicom_study.add_series(new_series02)pprint(new_dicom_study.get_dict())pprint(new_dicom_study.get_series(seriesUID='series002'))new_study01=Study(StudyUID='study002',StudyDate=['20200101'])new_series03=Series(seriesUID='series003')new_series03.add_instance(Instance(SOPinstanceUID='Instance01'))new_study01.add_series(new_series03)study_list=[new_dicom_study,new_study01]forstudyinstudy_list:forinstanceinstudy.series_dict:pprint(study.get_series(instance))print("")print(new_dicom_study.get_series_ids())print(new_dicom_study.study_datetime)print(new_dicom_study.patient_age)print(new_study01.study_datetime)print(new_study01.patient_age)ContributingPull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: dicompyler
dicompyler==========dicompyler is an extensible open source radiation therapy researchplatform based on the DICOM standard. It also functions as across-platform DICOM RT viewer.dicompyler runs on Windows, Mac and Linux systems and is available insource and binary versions. Since dicompyler is based on modulararchitecture, it is easy to extend it with 3rd party plugins.Visit the dicompyler _`home page`:http://code.google.com/p/dicompyler/ for how-to information and guides.Getting Help============To get help with dicompyler, visit the _`mailing list`:http://groups.google.com/group/dicompyler/ or follow us on _`twitter`:http://twitter.com/dicompylerRequirements============dicompyler requires the following packages to run from source:- Python 2.5 or higher (not tested on Python 3)- wxPython 2.8.8.1 to 2.8.10.1- matplotlib 0.99 to 1.10- numpy 1.2.1 or higher- PIL 1.1.7 or any version of Pillow- pydicom 0.9.5 or 0.9.6- simplejson (only for Python 2.5, Python 2.6+ includes JSON support)
Package: dicompyler-core
A library of core radiation therapy modules for DICOM / DICOM RT used bydicompyler. This
package includes:dicomparser: parse DICOM objects in an easy-to-use mannerdvh: Pythonic access to dose volume histogram (DVH) datadvhcalc: Independent DVH calculation using DICOM RT Dose & RT Structure Setdose: Pythonic access to RT Dose data including dose summationOther informationFree software:BSD licenseDocumentation:Read the docsTested on Python 3.7+Dependenciesnumpy1.2 or higherpydicom0.9.9 or higher (pydicom 1.0 compatible)matplotlib1.3.0 or higher (for DVH calculation)six1.5 or higherOptional:Pillow(for image display)Shapely(for structure volume calculation)scikit-image(for DVH interpolation)scipy(for dose grid summation using interpolation)Basic Usagefromdicompylercoreimportdicomparser,dvh,dvhcalcdp=dicomparser.DicomParser("rtss.dcm")# i.e. Get a dict of structure informationstructures=dp.GetStructures()>>>structures[5]{'color':array([255,128,0]),'type':'ORGAN','id':5,'empty':False,'name':'Heart'}# Access DVH datartdose=dicomparser.DicomParser("rtdose.dcm")heartdvh=dvh.DVH.from_dicom_dvh(rtdose.ds,5)>>>heartdvh.describe()Structure:HeartDVHType:cumulative,absdose:Gy,absvolume:cm3Volume:437.46cm3MaxDose:3.10GyMinDose:0.02GyMeanDose:0.64GyD100:0.00GyD98:0.03GyD95:0.03GyD2cc:2.93Gy# Calculate a DVH from DICOM RT datacalcdvh=dvhcalc.get_dvh("rtss.dcm","rtdose.dcm",5)>>>calcdvh.max,calcdvh.min,calcdvh.D2cc(3.0899999999999999,0.029999999999999999,dvh.DVHValue(2.96,'Gy'))Advanced Usage and Examples can be found in Binder:Citing dicompyler-coreA DOI for dicompyler-core with various citation styles can be found at Zenodo:CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: dicomselect
dicomselect: DICOM database and conversion softwaredicomselectis a Python tool that simplifies the process of creatingSQLitedatabases from directories containing.dcmfiles. Once the database is created, you can easily perform SQL-like queries on the data directly within Python. Additionally,dicomselectallows you to convert query results into various file formats supported bySimpleITK, providing flexibility in working with your DICOM data.InstallationPython 3.10 or higher.You can install this project usingpip. If you haven't already, it's recommended to create a virtual environment to isolate project dependencies.pipinstalldicomselectDocumentationRead thedocumentation.ExampleClone this repo, installdicomselect, then run this example in the repo.fromdicomselectimportDatabasefrompathlibimportPathdb_path=Path('tests/output/example.db')db_path.parent.mkdir(exist_ok=True)# initialize the Database object with a path to the to-be-created SQLite database filedb=Database(db_path)# create the .db file, using test data as the input directory.db.create('tests/input/ProstateX',max_workers=4)withdbasquery:# we only want to convert images with patient_id "ProstateX-0000" and image_direction "transverse"query_0000=query.where('patient_id','=','ProstateX-0000').where('image_direction','=','transverse')# print out a detailed extraction of our queryprint(query_0000)# initialize the Plan object, with a template of DICOM headers for our conversion# (note: dcm to dcm conversion is possible, if you only need restructuring of your data)plan=db.plan('{patient_id}/prostateX_{series_description}_{instance_creation_time}',query_0000)# ensure these properties are setplan.target_dir='tests/output/example'plan.extension='.mha'plan.max_workers=4# print out a detailed structure of our intended conversionprint(plan.to_string())plan.execute()Check out the results intests/output/example.
Package: dicomsort
DICOM SortDICOM Sort is a utility that takes a series of DICOM images stored within an
arbitrary directory structure and sorts them into a directory tree based upon
the value of selected DICOM fields.InstallationBinary InstallersBinary distributions for Windows and Mac OS are available atthe project
website.Installation viapipDICOM Sort is available asdicomsorton
thePython Package Index (pypi)and can therefore easily be
installed withpip.pipinstalldicomsortAfter installation, DICOM Sort can be launched with simply thedicomsortcommand line script:dicomsortInstallation viasetuptoolsTo install from source, first clone the git repositorygitclonehttps://github.com/suever/dicomsort.gitInstall thedicomsortscript using the project'ssetup.pyfile. This will automatically install all project dependenciescddicomsort
pythonsetup.pyinstallDevelopmentFor running tests, you will want to install the required development dependencies using the providedrequirements.txtfile:pipinstall-rrequirements.txtFor running tests, we usepytest. These can be run reproducibly using the providedMakefilemaketestContributingIf you have any questions or would like to request a feature, feel free to
provide feedback via theGithub Issuespage.LicenseThis software is licensed under the MIT License
Copyright (C) 2011 - 2021  Jonathan Suever
Package: dicom-to-cnn
Dicom-To-CNNInstall : pip install dicom-to-cnnFeatures :Description of Series content in a huge dataset of DICOM (output JSON descriptor for each series containings main DICOM tags).Conversion  :Dicom to NiftiMask to RTSS and DICOMSegRTSS to maskDicomSeg to maskPET/CTConversion Bqml/Counts to SUV and SULFusion#Maintainer  : Salim Kanoun
#Contributors : Thomas Trouillard, Wendy Revailler
Package: dicom-tools
dicom_tools is a library with a Graphical User Interface (GUI), dicom_tool.py, to analyze medical images. It is possible to apply filters, perform automatic segmentation and compute several texture parameters, of both the first and second order. All the functions are available via the GUI, developed with the Qt libraries and compatible with Qt4 and Qt5. The GUI shows to the user the medical image once imported as a numpy array tensor with 3 indices. The lightness of the GUI allows an agile use of the software remotely, via an SSH connection. It is also possible to open an interactive python shell that have access to all the memory of the GUI instance and the functions of the package and can interact with the GUI. The package is interfaced with the most powerful libraries for images and medical images analysis, ensuring the opportune conversions of data types.
Package: dicomtrolley
dicomtrolleyRetrieve medical images via WADO-URI, WADO-RS, QIDO-RS, MINT, RAD69 and DICOM-QRUsespydicomandpynetdicom. Images and query results arepydicom.DatasetinstancesQuery and download DICOM Studies, Series and InstancesIntegrated search and download - automatic queries for missing series and instance infodicomtrolley docs on readthedocs.ioInstallationpip install dicomtrolleyBasic usage# Create a http sessionsession=requests.Session()# Use this session to create a trolley using MINT and WADOtrolley=Trolley(searcher=Mint(session,"https://server/mint"),downloader=WadoURI(session,"https://server/wado_uri"))# find some studies (using MINT)studies=trolley.find_studies(Query(PatientName='B*'))# download the fist one (using WADO)trolley.download(studies[0],output_dir='/tmp/trolley')Documentationseedicomtrolley docs on readthedocs.io
Package: dicom-upload
Upload DICOM files with patient und study data removed from headerInstallationTo install use pip:$ pip install dicom_upload
$ jupyter nbextension enable –py –sys-prefix dicom_uploadAlternatively, install directly from GitLab:$ pip install git+https://gitlab.version.fz-juelich.de/jupyter4jsc/j4j_extras/dicom-upload.gitTo install for jupyterlab$ jupyter labextension install dicom_uploadFor a development installation (requires npm),$ git clonehttps://gitlab.version.fz-juelich.de/jupyter4jsc/j4j_extras/dicom-upload.git$ cd dicom-upload
$ pip install -e .
$ jupyter nbextension install –py –symlink –sys-prefix dicom_upload
$ jupyter nbextension enable –py –sys-prefix dicom_upload
$ jupyter labextension install jsWhen actively developing your extension, build Jupyter Lab with the command:$ jupyter lab –watchThis take a minute or so to get started, but then allows you to hot-reload your javascript extension.
To see a change, save your javascript, watch the terminal for an update.Note on firstjupyter lab –watch, you may need to touch a file to get Jupyter Lab to open.
Package: dicomweb-client
DICOMweb ClientPython client for DICOMweb services.DocumentationPlease refer to the online documentation atdicomweb-client.readthedocs.io, which includes a user guide with examples, a developer guide, and complete documentation of the application programming interface of thedicomweb_clientPython package as well as the command line interface of thedicomweb_clientprogram.CitationPlease cite the following article when using the client for scientific studies:Herrmann et al. J Path Inform. 2018:@article{jpathinform-2018-9-37,
    Author={
        Herrmann, M. D. and Clunie, D. A. and Fedorov A. and Doyle, S. W. and Pieper, S. and
        Klepeis, V. and Le, L. P. and Mutter, G. L. and Milstone, D. S. and Schultz, T. J. and
        Kikinis, R. and Kotecha, G. K. and Hwang, D. H. and Andriole, K, P. and Iafrate, A. J. and
        Brink, J. A. and Boland, G. W. and Dreyer, K. J. and Michalski, M. and
        Golden, J. A. and Louis, D. N. and Lennerz, J. K.
    },
    Title={Implementing the {DICOM} standard for digital pathology},
    Journal={Journal of Pathology Informatics},
    Year={2018},
    Number={1},
    Volume={9},
    Number={37}
}
Package: dicom-wsi
dicom_wsiPackage for converting whole slide image files to DICOM.Free software: MIT licenseDocumentation:https://dicom-wsi.readthedocs.io.UsageFirst, you need to install dicom_wsi and its dependencies. See thislinkfor details.To use dicom-wsi:python dicom_wsi.cli.py -w <WSI File path> -o <OutputDirectory> -p <output file prefix> -y yaml/base.yamlThat’s it! Most of the time you wan’t need to change anything. But if you do, please see the exampleyamlfile.FeaturesValidate DICOM elements usingpydicomOutput format DICOM formatted files (vetted withdciodvfy)TODOFind out how to determine whatFileMetaInformationGroupLengthshould beCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History1.0.4 (2023-10-27)Decreased dependencies for installAdded tryCatch for Aperio data without expected metadata0.1.0 (2021-1-22)First release on PyPI.
Package: dicon
Dicon, simple DI container injection liblary for Python.---Dicon is a simple "DI container injection" library.## FAQ- Q. Is `dicon` a dependency injection library?- A. No, it does not support dependency injection.  It supports DI container injection and service (singleton) locator.## Important points- Simple to use.- Clear what it does on each stage.- Small overhead.## Features- `@dicon.inject_di_container` class decorator supports nested DI container injection, without modification on type.- `dicon.DIContainer` provides class resolver and singleton locating.### Class resolver, no modification on type```pythonimport diconclass A:passdi_container = dicon.DIContainer()di_container.register[A]()di_container.freeze()# Resolve class.class_A = di_container.resolve[A]a = class_A()# dicon.DIContainer does not modify type of the object.assert type(a) is A# It only modifies constructor.  (Normally it will be not a problem.)assert not (class_A is A)```### Nested DI container injection```python@dicon.inject_di_container('_di_container')class B:_di_container = None # Here we get instance of DIContainer.def __init__(self, message):print(message, self._di_container)@dicon.inject_di_container('_di_container')class C:_di_container = None # Here we get instance of DIContainer.def __init__(self):self._b = self._di_container.resolve[B]('B must be have DIContainer:')di_container = dicon.DIContainer()di_container.register[B]()di_container.register[C]()di_container.freeze()di_container.resolve[C]()# will print 'B must be have DIContainer: ...'```### Singleton locatingTBW...## How it works1. `@dicon.inject_di_container` modifies `__init__` of given class to make it possible `__init__` can take DIContainer as an argument.2. `DIContainer.resolve` ties itself to that argument by `functools.partial`.That's all.For more details, see [tests](tests).## Other existing solutions- Dependency injection- There are lots of DI libraries: for example, [injector](https://github.com/alecthomas/injector), [pinject](https://github.com/google/pinject).- IMHO, DI is too complex for python.- Famous liblaries are too complex and not clear how affect to the program.- It seems no one support nested injection.- Service locator- [wired](https://github.com/mmerickel/wired)- I personally felt it is too complex.- [factoryfactory](https://github.com/jammycakes/factoryfactory)- It does not support multiple service locators.I borrowed design of [MicroResolver](https://github.com/neuecc/MicroResolver) in API.