mri_meta_extract


Namemri_meta_extract JSON
Version 1.4.6 PyPI version JSON
download
home_pagehttps://github.com/LREN-CHUV/mri-meta-extract
SummaryExtract meta-data from DICOM and NIFTI files
upload_time2017-03-14 09:36:33
maintainer
docs_urlNone
authorMirco Nasuti
requires_python
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
Coveralis test coverage No Coveralis.
            |License| |Codacy Badge| |CircleCI|

MRI Meta-data Extractor
=======================

This is a Python library providing methods to scan folders, extract
meta-data from files (DICOM, NIFTI, ...) and store them in a database.

Install
-------

Run ``pip install mri-meta-extract``. (Only tested with Python3)

Use
---

Import the functions you need like this :
``from mri_meta_extract.files_recording import create_provenance, visit``.

Create a provenance entity using :

::

    create_provenance(dataset, software_versions, db_url)

    Create (or get if already exists) a provenance entity, store it in the database and get back a provenance ID.
    * param dataset: Name of the data set.
    * param software_versions: (optional) Version of the software components used to get the data. It is a dictionary
    that accepts the following fields:
        - matlab_version
        - spm_version
        - spm_revision
        - fn_called
        - fn_version
        - others
    * param db_url: (optional) Database URL. If not defined, it looks for an Airflow configuration file.
    * return: Provenance ID.

Scan a folder to populate the database :

::

    def visit(folder, provenance_id, step_name, previous_step_id, config, db_url)

    Record all files from a folder into the database.
    The files are listed in the DB. If a file has been copied from previous step without any transformation, it will be
    detected and marked in the DB. The type of file will be detected and stored in the DB. If a files (e.g. a DICOM
    file) contains some meta-data, those will be stored in the DB.
    * param folder: folder path.
    * param provenance_id: provenance label.
    * param step_name: Name of the processing step that produced the folder to visit.
    * param previous_step_id: (optional) previous processing step ID. If not defined, we assume this is the first
    processing step.
    * param config: List of flags:
        - boost: (optional) When enabled, we consider that all the files from a same folder share the same meta-data.
        When enabled, the processing is (about 2 times) faster. This option is enabled by default.
        - session_id_by_patient: Rarely, a data set might use study IDs which are unique by patient (not for the whole study).
        E.g.: LREN data. In such a case, you have to enable this flag. This will use PatientID + StudyID as a session ID.
        - visit_id_in_patient_id: Rarely, a data set might mix patient IDs and visit IDs. E.g. : LREN data. In such a case, you have
        to enable this flag. This will try to split PatientID into VisitID and PatientID.
        - visit_id_from_path: Enable this flag to get the visit ID from the folder hierarchy instead of DICOM meta-data
        (e.g. can be useful for PPMI).
        - repetition_from_path: Enable this flag to get the repetition ID from the folder hierarchy instead of DICOM meta-data
        (e.g. can be useful for PPMI).
    :param db_url: (optional) Database URL. If not defined, it looks for an Airflow configuration file.
    * return: return processing step ID.

Build
-----

Run ``./build.sh``. (Builds for Python3)

(This includes the auto-generation of the README.rst based on the
README.md)

Test
----

Enter the ``tests`` directory.

With Docker
~~~~~~~~~~~

Run ``test.sh``

Without Docker
~~~~~~~~~~~~~~

-  Run a Postgres database on ``localhost:5432``.
-  Run ``nosetest unittest.py``

Publish on PyPi
---------------

Run ``./publish.sh``.

(This builds the project prior to pushing on PyPi)

NOTE : Do not forget to update the version number in the setup.py prior
to publishing.

NOTES
-----

-  This project contains a reference to a Git submodule. You can use the
   ``--recursive`` flag when cloning the project to clone the submodule
   too.

.. |License| image:: https://img.shields.io/badge/license-Apache--2.0-blue.svg
   :target: https://github.com/LREN-CHUV/mri-meta-extract/blob/master/LICENSE
.. |Codacy Badge| image:: https://api.codacy.com/project/badge/Grade/4547fb5d1e464e4087640e046893576a
   :target: https://www.codacy.com/app/mirco-nasuti/mri-meta-extract?utm_source=github.com&utm_medium=referral&utm_content=LREN-CHUV/mri-meta-extract&utm_campaign=Badge_Grade
.. |CircleCI| image:: https://circleci.com/gh/LREN-CHUV/mri-meta-extract.svg?style=svg
   :target: https://circleci.com/gh/LREN-CHUV/mri-meta-extract



            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "coveralis": false, 
    "keywords": "", 
    "upload_time": "2017-03-14 09:36:33", 
    "author": "Mirco Nasuti", 
    "home_page": "https://github.com/LREN-CHUV/mri-meta-extract", 
    "github_user": "LREN-CHUV", 
    "download_url": "", 
    "platform": "", 
    "version": "1.4.6", 
    "cheesecake_documentation_id": null, 
    "description": "|License| |Codacy Badge| |CircleCI|\n\nMRI Meta-data Extractor\n=======================\n\nThis is a Python library providing methods to scan folders, extract\nmeta-data from files (DICOM, NIFTI, ...) and store them in a database.\n\nInstall\n-------\n\nRun ``pip install mri-meta-extract``. (Only tested with Python3)\n\nUse\n---\n\nImport the functions you need like this :\n``from mri_meta_extract.files_recording import create_provenance, visit``.\n\nCreate a provenance entity using :\n\n::\n\n    create_provenance(dataset, software_versions, db_url)\n\n    Create (or get if already exists) a provenance entity, store it in the database and get back a provenance ID.\n    * param dataset: Name of the data set.\n    * param software_versions: (optional) Version of the software components used to get the data. It is a dictionary\n    that accepts the following fields:\n        - matlab_version\n        - spm_version\n        - spm_revision\n        - fn_called\n        - fn_version\n        - others\n    * param db_url: (optional) Database URL. If not defined, it looks for an Airflow configuration file.\n    * return: Provenance ID.\n\nScan a folder to populate the database :\n\n::\n\n    def visit(folder, provenance_id, step_name, previous_step_id, config, db_url)\n\n    Record all files from a folder into the database.\n    The files are listed in the DB. If a file has been copied from previous step without any transformation, it will be\n    detected and marked in the DB. The type of file will be detected and stored in the DB. If a files (e.g. a DICOM\n    file) contains some meta-data, those will be stored in the DB.\n    * param folder: folder path.\n    * param provenance_id: provenance label.\n    * param step_name: Name of the processing step that produced the folder to visit.\n    * param previous_step_id: (optional) previous processing step ID. If not defined, we assume this is the first\n    processing step.\n    * param config: List of flags:\n        - boost: (optional) When enabled, we consider that all the files from a same folder share the same meta-data.\n        When enabled, the processing is (about 2 times) faster. This option is enabled by default.\n        - session_id_by_patient: Rarely, a data set might use study IDs which are unique by patient (not for the whole study).\n        E.g.: LREN data. In such a case, you have to enable this flag. This will use PatientID + StudyID as a session ID.\n        - visit_id_in_patient_id: Rarely, a data set might mix patient IDs and visit IDs. E.g. : LREN data. In such a case, you have\n        to enable this flag. This will try to split PatientID into VisitID and PatientID.\n        - visit_id_from_path: Enable this flag to get the visit ID from the folder hierarchy instead of DICOM meta-data\n        (e.g. can be useful for PPMI).\n        - repetition_from_path: Enable this flag to get the repetition ID from the folder hierarchy instead of DICOM meta-data\n        (e.g. can be useful for PPMI).\n    :param db_url: (optional) Database URL. If not defined, it looks for an Airflow configuration file.\n    * return: return processing step ID.\n\nBuild\n-----\n\nRun ``./build.sh``. (Builds for Python3)\n\n(This includes the auto-generation of the README.rst based on the\nREADME.md)\n\nTest\n----\n\nEnter the ``tests`` directory.\n\nWith Docker\n~~~~~~~~~~~\n\nRun ``test.sh``\n\nWithout Docker\n~~~~~~~~~~~~~~\n\n-  Run a Postgres database on ``localhost:5432``.\n-  Run ``nosetest unittest.py``\n\nPublish on PyPi\n---------------\n\nRun ``./publish.sh``.\n\n(This builds the project prior to pushing on PyPi)\n\nNOTE : Do not forget to update the version number in the setup.py prior\nto publishing.\n\nNOTES\n-----\n\n-  This project contains a reference to a Git submodule. You can use the\n   ``--recursive`` flag when cloning the project to clone the submodule\n   too.\n\n.. |License| image:: https://img.shields.io/badge/license-Apache--2.0-blue.svg\n   :target: https://github.com/LREN-CHUV/mri-meta-extract/blob/master/LICENSE\n.. |Codacy Badge| image:: https://api.codacy.com/project/badge/Grade/4547fb5d1e464e4087640e046893576a\n   :target: https://www.codacy.com/app/mirco-nasuti/mri-meta-extract?utm_source=github.com&utm_medium=referral&utm_content=LREN-CHUV/mri-meta-extract&utm_campaign=Badge_Grade\n.. |CircleCI| image:: https://circleci.com/gh/LREN-CHUV/mri-meta-extract.svg?style=svg\n   :target: https://circleci.com/gh/LREN-CHUV/mri-meta-extract\n\n\n", 
    "lcname": "mri_meta_extract", 
    "bugtrack_url": null, 
    "github": true, 
    "name": "mri_meta_extract", 
    "license": "Apache 2.0", 
    "travis_ci": false, 
    "github_project": "mri-meta-extract", 
    "summary": "Extract meta-data from DICOM and NIFTI files", 
    "split_keywords": [], 
    "author_email": "mirco.nasuti@chuv.ch", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2017-03-14T09:36:33", 
            "comment_text": "", 
            "python_version": "py3", 
            "url": "https://pypi.python.org/packages/c7/61/c619af8af04be4a13239b87e616b9b7c431a9c898440d253b522f6eebea3/mri_meta_extract-1.4.6-py3-none-any.whl", 
            "md5_digest": "9513851ec6da13e1aae44b9f40142ffe", 
            "downloads": 0, 
            "filename": "mri_meta_extract-1.4.6-py3-none-any.whl", 
            "packagetype": "bdist_wheel", 
            "path": "c7/61/c619af8af04be4a13239b87e616b9b7c431a9c898440d253b522f6eebea3/mri_meta_extract-1.4.6-py3-none-any.whl", 
            "size": 17103
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}