cvasl-archived
This is a repo for the Cerebrovascular Brain Age project
Science Score: 54.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
-
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.8%) to scientific vocabulary
Keywords
Repository
This is a repo for the Cerebrovascular Brain Age project
Basic Info
Statistics
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 56
- Releases: 6
Topics
Metadata Files
README.md
cvasl is an open source collaborative python library for analysis of brain MRIs. Many functions relate to arterial spin labeled sequences.
This library supports the ongoing research at University of Amsterdam Medical Center on brain ageing, but is being buit for the entire community of radiology researchers across all university and academic medical centers and beyond.
Supported Platforms
cvasl is not a pure Python package. If
you want to run all possibilities you will need R, and therefore the conda version.
The current conda version release v0.0.4 has the limitation that it is missing the nipy
and k-means-constrained python libraries.
We are working to update this, but the user should add these to their environment.
Below is the list of platforms that should work in terms of the Python code.
Other platforms may work, but have had less extensive testing.
Please note that where
python.org Python or Anaconda Python stated as supported, it means
that versions 3.10 and above are supported.
AMD64 (x86)
| | Linux | Win | OSX |
|:---------------------------:|:---------:|:---------:|:---------:|
|
| Supported | Unknown | Unknown |
|
| Supported | Supported | Supported |
Program files
The main program in this repository (made of the modules in the cvasl folder) contains functions for analysis of MRIs.
Folders and Notebooks
To look around keep in mind the following distinction on folders:
researcher_interface: - This folder will be added in the future for a growing series of interactive notebooks that allow researchers to investigate questions about their own MRI data
open_work: - This folder contains experimental work by core members of the cvasl team (including Dr. Candace Makeda Moore, Dr. Dani Bodor, Dr. Henk Mutsaerts)
harmonization_paper: - This folder contains experimental work for a forthcoming paper by core members of the cvasl team (including Dr. Candace Makeda Moore, Dr. Dani Bodor, Dr. Henk Mutsaerts, and Mathijs Dijsselhof) which deals with radiological image harmonization.
lab_datasets: - This folder contains notebooks which show how image datasets were assembled in notebooks.
Please keep in mind that at present you will only be able to scroll images in the notebooks with a browser based approach i.e. run Jupyter in a browser but not in VSCode or another IDE to scroll the brain MRIs.
Data sets
The notebooks are configured to run on various datasets. Contact Dr. Candace Makeda Moore( 📫 c.moore@esciencecenter.nl) to discuss any questions on data configuration for your datasets. In terms of derived value datasets (which use measurements instead of images) You will need tsv and/or csv file datasets arranged in a particular format as specified in seperatedvaluesspecifications.md If you plan to make pull requests to the library or use it to show your work you should take care not to use tabular data in such a way as patient identifying data is revealed.
Configuring (to work with your data)
In order to preprocess and/or to train models the code needs to be able to locate the raw data you want it to work with.
There are several ways to specify the location of the following directories:
- bids: Special directory. The rest of the directory layout can be derived from its location.
You can store this information persistently in several locations.
- In the same directory where you run the script (or the notebook).
e.g.
./config.json. - In home directory, e.g.
~/.cvasl/config.json. - In global directory, e.g.
/etc/cvasl/config.json.
However, we highly recommend you use the home directory. This file can have this or similar contents:
{
"bids": "/mnt/source_data",
"raw_data": "/mnt/source_data/raw_data",
"derivatives": "/mnt/source_data/derivates/",
"explore_asl": "/mnt/source_data/derivates/explore_asl",
"cvage": "/mnt/source_data/derivates/cvage",
"cvage_inputs": "/mnt/source_data/derivates/cvage/cvage_inputs",
"cvage_outputs": "/mnt/source_data/derivates/cvage/cvage_outputs",
}
The file is read as follows: if the file only specifies bids
directory, then the derivative missing entries are assumed to be
relative to the root in a BIDS compliant format order You don't need
to specify all entries. If you do, you can overwrite the ALS-BIDS
format order but this is not reccomended.
When working from command line, it may be useful to experiment with different directory layouts or to quickly override the existing options. To do so, you can invoke the program like this:
sh
python -m cvasl -C raw_data:/path/to/data <other options>
The snippet above allows using existing config.json but overrides
the location of raw_data directory.
sh
python -m cvasl -C bids:/path/to/data -n <other options>
The snippet above ignores any existing config.json files and sets
the BIDS directory to /path/to/data (the rest will be derived from
it).
sh
python -m cvasl \
-C raw_data:/path/to/data \
-C derivatives:/path/to/derivatives \
-c /custom/config/location \
<other options>
The snippet above looks for configuration file in the alternative
location: /custom/config/location while overriding the locations of
raw_data aand of derivatives directories.
If you aren't sure where the data would be read or stored, you can run:
sh
python -m cvasl <some options> dump_config
The above will print the effective configuration that will be used by the program.
Test data
You can get test data by contacting the cvage team. Please email Dr. Moore at c.moore@esciencecenter.nl
Getting started
How to get the notebooks running? Assuming the raw data set and metadata is available.
Assuming you are using conda for package management:
- Make sure you are in no environment:
sh conda deactivate(optional repeat if you are in the base environment)
You should be in no environment or the base environment now
Option A: Fastest option: In a base-like environment with mamba installed, you can install all Python packages required, using
mambaand theenvironment.ymlfile.
If you do not have mamba installed you can follow instructions (here)[https://anaconda.org/conda-forge/mamba]
The command for Windows/Anaconda/Mamba users can be something like:
sh mamba env create -f environment.yml
Option B: To work with the most current versions with the possibility for development:
Install all Python packages required, using conda and the environment.yml file.
The command for Windows/Anaconda users can be something like:
sh conda env create -f environment.ymlCurrently, you will then need to clone the repository to run the cvasl from repo. We will soon have an option to create the entire environment at once from conda.
Option C:
- Linux users can create their own environment by hand (use install_dev as in setup).
- If you want to work with command-line, you can do so in your terminal, but
if you would like to run our pre-made notebooks, then you can start them by entering
jupyter labinto the terminal
Documentation:
You can look at our online documentation or build it by hand (see the setup file, the workflows, and it may be clear)
Testing
The testing framework is pytest. If you wish to run
automated testing of the notebooks then you must run it in the dedicated testing environment
mriland which can be built from the test_environment.yml file. All other testing and automated testing
can be run in the regular environment.
The project doesn't include complete testing data yet.
Command-Line Interface
You will eventually be be able to preprocess, train and use models, and perform other functions using command-line interface. As of now (April 2023) this module is still being built.
Below is an example of how to look at the help for that in general:
python -m cvasl --help
And here is an example for a specific function:
python -m cvasl hash_over --help
And here are examples of a working commands (file names can be changed):
to hash over files (assuming no config file):
python -m cvasl -n -C raw_data:test_data hash_over --extension tsv --output some_ignored_folder
to run a debiasing algorithm over files:
python -m cvasl -n -C raw_data:image_data debias_over --preprocessing N4_debias_sitk --output ignrd_flder
to recode sex on csv files in a folder:
python -m cvasl -n sex_recode_over -i folder_w_files_to_be_recoded
to log columns 'gmvol' and 'wmvol' in csvs in a folder:
python -m cvasl -n log_recode_over -i loged1 -l gm_vol -l wm_vol
All long options have short aliases.
✨Copyright 2023 Netherlands eScience Center and U. Amsterdam Medical Center
Licensed under
Owner
- Name: ExploreASL
- Login: ExploreASL
- Kind: organization
- Email: henkjanmutsaerts@gmail.com
- Location: Amsterdam UMC
- Website: www.ExploreASL.org
- Repositories: 3
- Profile: https://github.com/ExploreASL
Matlab-based image processing toolbox for T1w, FLAIR and ASL
Citation (CITATION.cff)
cff-version: 1.1.0
message: "If you use this software, you should cite it."
authors:
- affiliation: "Netherlands eScience Center"
family-names: Moore
given-names: Candace Makeda
orcid: "https://orcid.org/0000-0003-1672-7565"
- affiliation: "Netherlands eScience Center"
family-names: Crocioni
given-names: Giulia
orcid: "https://orcid.org/0000-0002-0823-0121"
- affiliation: "Netherlands eScience Center"
family-names: Bodor
given-names: Dani
orcid: "https://orcid.org/0000-0003-2109-2349"
- affiliation: "Amsterdam University Medical Centers, location VUmc"
family-names: Dijsselhof
given-names: Mathijs
orcid: "https://orcid.org/0000-0001-6005-3110"
- affiliation: "Amsterdam University Medical Centers, location VUmc"
family-names: Mutsaerts
given-names: Henk JMM
orcid: "https://orcid.org/0000-0003-0894-0307"
keywords:
- arterial spin labelling
- MRI
- machine learning
- Python
- brain age
- cerebrovascular
license: Apache-2.0
repository-code: "https://github.com/brainspinner/cvasl"
title: "cvasl"
version: "0.0.1"
date-released: 20/04/2023
GitHub Events
Total
Last Year
Dependencies
- JamesIves/github-pages-deploy-action 4.1.1 composite
- actions/checkout v3 composite
- docker/login-action v2.1.0 composite
- s-weigand/setup-conda v1 composite
- actions/checkout v2 composite
- actions/download-artifact v2 composite
- actions/setup-python v1 composite
- actions/upload-artifact v2 composite
- marvinpinto/action-automatic-releases latest composite
- s-weigand/setup-conda v1.1.1 composite
- python 3.11 build
- SimpleITK *
- matplotlib *
- pandas *
- pyxdf *
- scikit-image *
- scikit-learn *
- scipy *
- jupyter *
- jupyterlab *
- matplotlib ==3.6.3
- matplotlib-inline ==0.1.6
- neuroCombat ==0.2.12
- numpy ==1.24.2
- openpyxl *
- pandas ==1.5.2
- scikit-learn ==1.2.0
- scipy ==1.10.0
- seaborn *