A package which facilitates loading data from the MIMIC-CXR-JPG dataset
Project description
mimic-cxr-jpg-loader
mimic-cxr-jpg-loader is a Python package that provides utilities to easily load the MIMIC-CXR-JPG Dataset [1], [2] which is available on Physionet [3]. This dataset contains chest X-ray images in JPG format from the MIMIC-CXR dataset, which is a large publicly available dataset of chest radiographs in DICOM format.
Installation
You can install mimic-cxr-jpg-loader via pip:
pip install mimic-cxr-jpg-loader
Usage
To use this package simply create a new Dataset by providing the required filepaths and, optionally, a list of modifiers.
from mimic_cxr_jpg_loader.dataset import MIMICDataset
from mimic_cxr_jpg_loader.modifiers import *
dataset = MIMICDataset(
root="/example/datasets/MIMIC-CXR-JPG",
split_path="/example/datasets/MIMIC-CXR-JPG/mimic-cxr-2.0.0-split.csv",
modifiers=[
FilterByViewPosition(ViewPosition.PA),
FilterBySplit(Split.TRAIN),
BinarizePathology(Pathology.CARDIOMEGALY),
],
)
Afterwards simply access the dataset like a regular Pytorch Dataset, e.g. dataset[idx]
which will return a tuple in the format (img, labels)
where img is a Pillow Image object and labels a Pandas Series object containing all data pertaining to it.
Requirements
- Python >= 3.8
- Pandas
- Pillow
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contribution
Contributions are welcome! Please feel free to open a pull request.
Issues
If you encounter any issues or have suggestions, please feel free to open an issue.
Acknowledgments
- The MIMIC-CXR-JPG dataset was made available by the MIT Laboratory for Computational Physiology.
- This package is inspired by the need for simplified access to the MIMIC-CXR-JPG dataset.
References
[1] Johnson, A., Lungren, M., Peng, Y., Lu, Z., Mark, R., Berkowitz, S., & Horng, S. (2024). MIMIC-CXR-JPG - chest radiographs with structured labels (version 2.1.0). PhysioNet. https://doi.org/10.13026/jsn5-t979. Additionally, please cite the original publication:
[2] Johnson AE, Pollard TJ, Berkowitz S, Greenbaum NR, Lungren MP, Deng CY, Mark RG, Horng S. MIMIC-CXR: A large publicly available database of labeled chest radiographs. arXiv preprint arXiv:1901.07042. 2019 Jan 21.
[3] Goldberger, A., Amaral, L., Glass, L., Hausdorff, J., Ivanov, P. C., Mark, R., ... & Stanley, H. E. (2000). PhysioBank, PhysioToolkit, and PhysioNet: Components of a new research resource for complex physiologic signals. Circulation [Online]. 101 (23), pp. e215–e220
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
Built Distribution
Hashes for mimic_cxr_jpg_loader-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f12551bbf68e939cb0aee6ba4162186f0b3acb6fac1b058f33e82989ac83e509 |
|
MD5 | acb44774b61f5aaee15a85772471382d |
|
BLAKE2b-256 | 05a8706d81c203db96b28f55be178da6c9a612230aa758af2fca34456498651e |
Hashes for mimic_cxr_jpg_loader-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a0c20915c93447bf1ac007f824c89df9cf982ff6c173f883f10252ecd34d614 |
|
MD5 | 29f396c57aa2f39e1b18d2a7b0603f92 |
|
BLAKE2b-256 | fb8e36de7aed5a35a8603b8ec8e9c10b7f1053e4000657fe4e3310bec47d4e79 |