rsm4dcm
is a Python library for recursively searching DICOM files inside a folder with subdirectories and then moving them into another folder.
Most of the public medical images can be downloaded from the NBIA Data Retriever tool provided by the TCIA. As explained on their website, DICOM is the primary file format used for radiology imaging. Any downloaded file will come as XXXX.dcm.
Once downloaded, these medical images are placed into a directory containing many different subdirectories as described by the first picture.
Whether you are a health professional or a developer, you might need to reorganize these files into a simple folder where each and every file is directly accessible.
Use the package manager pip to install rsm4dcm
.
pip install rsm4dcm
rsm4dcm
as a standalone python application
python3 -m rsm4dcm -t /home/william/dicom_source -o /home/william/dicom_dest
rsm4dcm
as a python module
import rsm4dcm
# searches for dicoms inside 'dicom_source' and put them inside "dicom_dest"
rsm4dcm.rsm('/home/william/dicom_source', '/home/william/dicom_dest')
Pull 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.