This project is composed by two scripts:
- generator.py: generates DICOM objects or files (Computed Tomographies)
- insert.py: generates CT files in DICOM format and inserts them in a MongoDB endpoint
- Python3
- Installation of requirements.txt
-
Clone this repository
git clone https://github.com/rlebre/dicoogle-mongodb-test-scripts.git
-
Install virtual environment
virtualenv -p python3 venv
-
Activate virtual environment
source venv/bin/activate
-
Install requirements.py
pip install -r requirements.txt
-
Edit your configuration
-
Run
generator.py
and `insertion.pypython generator.py -n 1000 -o ./dataset -j #generates 1000 files in the directory './dataset' python insertion.py -c 50 -j ./dataset # reads database directory and inserts each 50 in database
Usage:
generator.py -n <number_to_generate> -o <output_directory> -d|-d <dicom_format | json_format
> -
Run simply generate objects in runtime
insertion.py
python insertion.py -n 1000 -c 50 # generates 1000 objects and inserts each 50 in database
Usage:
insertion.py -n <number_of_objects_to_insert -c <chunk_size> -j/-d <dicom|json_directory>
-
Or run
querying.py
python querying.py [-i] [-d] [-q <query>] #generates 1000 DICOM files in directory ./dataset
-i - create indexes -d - drop indexes -q - query
You must configure your MongoDB instance first and provide the configurations in local_settings.py
. Example:
MONGO_HOST='localhost'
MONGO_PORT=27017
MONGO_USER='dicoogle'
MONGO_PASSWORD='dicoogle'
- Thank you to the contributors of pydicom
- Thank you to Sjoerd for dicomgenerator
- Thank you to the contributors of pymongo
This work received support from FCT, Fundação para a Ciência e a Tecnologia, under the project UID/CEC/00127/2019 and POCI-01-0145-FEDER-016385 (NETDIAMOND)