Skip to main content

COnsolidated BReast cancer Analysis DataBase

Project description

cobra_db

DOI:10.1117/1.JMI.10.6.061404 PyPI version Documentation Status codecov

Consolidated Breast Cancer Analysis DataBase

What is cobra_db?

cobra_db is a python package that allows you to extract DICOM metadata and store it in a MongoDB database. Allowing you to index, transform, and export your medical imaging metadata.

With cobra_db, you will have more visibility of your data enabling you to get more value from your medical imaging studies.

Once the metadata is in the database, you can import other text-based information (csv or json) into a custom collection and then run queries. This allows you to mix and match data extracted from different sources in different formats.

For example, let's say you have 1 million mammography DICOM files and you would like to obtain the path of the files that belong to women scanned at an age of between 40 and 50 years old.

If you had cobra_db, you could run the following query in just a few seconds directly in the mongo shell.

db.ImageMetadata.find(
  // filter the data
  {patient_age:{$gt:40, $lte:50}},
  // project it into a flat structure
  {
    patient_id: "$dicom_tags.PatientID.Value"
    drive_name: "$file_source.drive_name",
    rel_path:"$file_source.rel_path",
  })

This would return the patient id, the drive name and the relative path (to the drive) for all the files that match the selection criteria.

Installation

If you already have a working instance of the database, you only need to install the python package.

$ pip install cobra_db

If you would like to create a database from scratch, go ahead and follow the tutorial.

Usage

If you have an ImageMetadata instance id that you would like to access from python.

from cobra_db import Connector, ImageMetadataDao

# the _id of the ImageMetadata instance that you want to access
im_id = '62de8e38dc2414586e4ddb25'

# prompt user for password
connector = Connector.get_pass(
  host='my_host.server.com',
  port=27017,
  db_name='cobra_db',
  username='my_user'
)
# connect to the ImageMetadata collection
im_dao = ImageMetadataDao(connector)
im = im_dao.get_by_id(im_id)
print(im.date.file_source.rel_path)

# this will return
... rel/path/to/my_file.dcm

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

cobra_db was created by Fernando Cossio, Apostolia Tsirikoglou, Annika Gregoorian, Haiko Schurz, Hui Li, and Fredrik Strand. It is licensed under the terms of the Apache License 2.0 license.

Aknowledgements

This project has been funded by research grants Regional Cancer Centers in Collaboration 21/00060, and Vinnova 2021-0261.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cobra_db-0.2.3.tar.gz (34.9 kB view details)

Uploaded Source

Built Distribution

cobra_db-0.2.3-py3-none-any.whl (41.9 kB view details)

Uploaded Python 3

File details

Details for the file cobra_db-0.2.3.tar.gz.

File metadata

  • Download URL: cobra_db-0.2.3.tar.gz
  • Upload date:
  • Size: 34.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for cobra_db-0.2.3.tar.gz
Algorithm Hash digest
SHA256 1583e0fb8d22303e320a7ffc9da1b90409e547f9c52c0469c3850e81493d9f14
MD5 0d0ff8afc158bcbf541c0b0cd453370a
BLAKE2b-256 a4886dfb24a2cf4cf817f2324d9ee24cf1ee13baaab2c563a5751fc150684249

See more details on using hashes here.

Provenance

File details

Details for the file cobra_db-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: cobra_db-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 41.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for cobra_db-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 31531533a8e02d1dfd2f687425ab3f90aee7037b152e58e8ccec8dd45b351c46
MD5 2b6d0c2cf9c335464149ea1d9d5ad98a
BLAKE2b-256 c3837ff9925e28f64565143a6d48603a9cb2cf139104080c4c087c78492fa936

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page