enigma_anonymization_lite

lightweight anonymization and bidsification tools

https://github.com/nih-megcore/enigma_anonymization_lite

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.1%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

lightweight anonymization and bidsification tools

Basic Info
  • Host: GitHub
  • Owner: nih-megcore
  • License: cc0-1.0
  • Language: Python
  • Default Branch: main
  • Size: 168 KB
Statistics
  • Stars: 3
  • Watchers: 5
  • Forks: 2
  • Open Issues: 3
  • Releases: 1
Created over 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

enigmaanonymizationlite

DOI

Requires

Freesurfer
https://surfer.nmr.mgh.harvard.edu/fswiki/rel7downloads
-See below in install-

Install

```

If mamba is not installed

conda install --channel=conda-forge --name=base mamba mamba create --override-channels --channel=conda-forge --name=enigmameg 'mne=1.5' 'numba<0.60' 'python<3.12' conda activate enigmameg pip install git+https://github.com/nih-megcore/enigmaanonymizationlite ```

About

This is a suite of tools for anonymization and bidsification of MEG and structural MRI data. While it was developed for the ENIGMA MEG Working Group, it is useful for anyone wanting to share their data. There is a specific function for each processing pipeline that you may be using. Currently, a fully functional MNE python is implemented, with an additional tool for Brainstorm users. Other functions will be added at user request.

Running the anonymization/bidsification for MNE Python users

usage: enigma_anonymization_mne.py [-h] [-topdir TOPDIR] [-csvfile CSVFILE] [-njobs NJOBS] [-linefreq LINEFREQ] [-bidsonly] This function takes a csv file containing a list of datasets to convert to BIDS format. A sample file (sample.csv) is distributed with this package and contains the following fields: subjid: This is the subject ID, will be appended with sub- in the BIDS output full_mri_path: The full path to the T1 weighted MRI full_meg_path: The full path to the raw MEG dataset session: Session, to permit multiple images per participant trans_fname: The full path to the .fif transform file produced by MNE python Upon execution, this function places the mri files into a staging directory, then does basic freesurfer processing (not the full segmentation) to obtain a surface of the head and perform defacing. Next, the BIDS structure is created and populated with the MRI and MEG data. Finally, a QA HTML report document is created, so that you can easily view all the resultant MRI images to ensure that the anonymization is adequate and that the coregistration is accurate. The resultant BIDS tree is placed in topdir/bidsout, and the freesurfer subjects directory can be found in topdir/bidsout/derivatives/freesurfer/subjects. The .html QA report will be in topdir/bidsout/derivatives/BIDSANONQA/CoregQAreport.html. In addition, individual QA images will be stored in the same QA directory and can be rapidly assessed with the RunQA.py tool. optional arguments: -h, --help show this help message and exit -topdir TOPDIR The directory for the outputs -csvfile CSVFILE The name of the CSV file described above -njobs NJOBS Optional, number of jobs for Freesurfer processing -linefreq LINEFREQ Optional, powerline frequency, defaults to 60s -bidsonly Perform bidsification only, with no anonymization

Anonymization/bidsification for Brainstorm users

Brainstorm users should use the "Export BIDS dataset [experimental]" process, which will create the BIDS data structure for both the MEG and MRI datasets. Brainstorm will not, however, update the BIDS structure with the location of the MEG fiducials in the space of the anatomical MRI. For that, we have provided and additional tool. usage: update_json_bstorm.py [-h] [-bids_root BIDS_ROOT] [-bids_id BIDS_ID] [-bst_id BST_ID] [-bst_datapath BST_DATAPATH] This function will take the location of the BIDS tree produced by Brainstorm, the BIDS ID in the bids_root (which should have the form sub-SUBJID), the Brainstorm subject ID, and the datapath to the Brainstorm Protocol data folder.

Running the QA tool

usage: enigma_anon_QA.py [-h] [-bids_root BIDS_ROOT] [-rows ROWS] [-columns COLUMNS] [-imgsize IMGSIZE] This function runs an easy to use QA browser to assess .png images returned from any of the processanonimizationX.py routines. By clicking on each image, users can toggle through states including "GOOD" (green outline), "BAD" (red outline) and "Unchecked" (grey outline). A "Save" button will save this infomation in a log file. You can change the size of the matrix of images displayed, as well as the size of each image. This routine can be run with no arguments, in which case the default bidsroot is bidsout, 4 rows, 2 columns, and an image size of 400. The log file will be stored in: bids_out/derivatives/BIDS_ANON_QA/Coreg_QA_logfile.txt The logfile will state if an image has been marked "GOOD", "BAD", or unchecked. If you would like this logfile in an easier to use CSV format, you can run an additional tool: usage: enigma_anon_parseQAlogs.py [-h] [-bids_root BIDS_ROOT] This commmand will produce a file: bids_out/derivatives/BIDS_ANON_QA/Coreg_QA_summary.csv This file can easily be opened with any spreadsheet program.

Owner

  • Name: nih-megcore
  • Login: nih-megcore
  • Kind: organization

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Enigma_anonymization_lite
message: >-
  Easy to use wrapper code and coregistration QA for BIDS
  creation of resting state MEG data
type: software
authors:
  - given-names: Allison
    family-names: Nugent
    email: nugenta@nih.gov
    affiliation: NIMH
  - given-names: Jeff
    family-names: Stout
    email: stoutjd@nih.gov
    affiliation: NIMH
  - given-names: Anna
    family-names: Namyst
    email: namystam@nih.gov
    affiliation: NIMH
identifiers:
  - type: doi
    value: 10.5281/zenodo.11390619
license: CC0-1.0

GitHub Events

Total
Last Year