Package: pydicer
PyDicer: PYthon Dicom Image ConvertERWelcome to PyDicer, a tool to ease the process of converting Radiotherapy DICOM data objects into a format typically used for research purposes. In addition to data conversion, functionality is provided to help analyse the data. This includes computing radiomic features, radiotherapy dose metrics and auto-segmentation metrics. PyDicer uses the NIfTI format to store data is a well defined file system structure. Tracking of these data objects in CSV files, also stored on the file system, provides an easy and flexible way to work with the converted data in your research.ThePyDicer documentationprovides several examples and guides to help you get started with the tool. Here are a fewPyDicer principlesto keep in mind as you get started:Theworking directory structureis standardised and generalisable for use with any DICOM dataset.UsePandas DataFrame'sto work with converted data objects.SimpleITKandPlatiPyare used under the hood for the image conversion, visualisation and analysis tasks.Always inspect visualisations, plots and metrics produced by PyDicer in your working directory. Remember, PyDicer is a research tool so only use it for research purposes and expect the unexpected!InstallationPyDicer currently supports Python version 3.8, 3.9 and 3.10. Install PyDicer in your Python
environment usingpip:pipinstallpydicerSupported ModalitiesPyDicer currently supports converting and analysing the following DICOM modalities:CTMRPT (Experimental)RTSTRUCTRTPLAN (Not converted since this only consists of meta data)RTDOSEDirectory StructurePyDicer will place converted and intermediate files into a specific directory structure. Visualisation, metrics computed and plots are also stored along side the converted data objects. Within the configured working directory[working], the following directories will be generated:[working]/data: Directory in which converted data will be placed[working]/quarantine: Files which couldn't be preprocessed or converted will be placed in here for you to investigate further[working]/.pydicer: Intermediate files as well as log output will be stored in here[working]/[dataset_name]: Clean datasets prepared using the Dataset Preparation Module will be stored in a directory with their name and will symbolically link to converted in the[working]/datadirectoryPipelineThe pipeline handles fetching of the DICOM data to conversion and preparation of your research dataset. Here are the key steps of the pipeline:Input: various classes are provided to fetch DICOM files from the file system, DICOM PACS, TCIA or Orthanc. A TestInput class is also provided to supply test data for development/testing.Preprocess: The DICOM files are sorted and linked. Error checking is performed and resolved where possible.Conversion: The DICOM files are converted to the target format (NIfTI).Visualistion: Visualistions of data converted are prepared to assist with data selection.Dataset Preparation: The appropriate files from the converted data are selected to prepare a clean dataset ready for use in your research project!Analysis: Radiomics and Dose Metrics are computed on the converted data.Getting StartedRunning the pipeline is easy. The following script will get you started:frompathlibimportPathfrompydicer.input.testimportTestInputfrompydicerimportPyDicer# Configure working directorydirectory=Path("./testdata")directory.mkdir(exist_ok=True,parents=True)# Fetch some test DICOM data to convertdicom_directory=directory.joinpath("dicom")dicom_directory.mkdir(exist_ok=True,parents=True)test_input=TestInput(dicom_directory)test_input.fetch_data()# Create the PyDicer tool object and add the dicom directory as an input locationpydicer=PyDicer(directory)pydicer.add_input(dicom_directory)# Run the pipelinepydicer.run_pipeline()ContributingPyDicer is an open-source tool and contributions are welcome! Here are some ways you might consider contributing to the project:Reporting issues on GitHub.Correcting/extending the documentation.Contributing a bug fix or extending some functionality.Providing functionality to support additional DICOM modalities.Giving thePyDicer projecta star on GitHub.For more information, see theContributing documentation.AuthorsPyDicer was developed by theIngham Medical Physics teamin South-Western Sydney. It was developed as part of theAustralian Cancer Data Networksupported by theAustralian Research Data Commons.Phillip Chlap-phillip.chlap@unsw.edu.auDaniel Al Mouiee-d.almouiee@unsw.edu.au