Skip to main content

Implementation of "Harmonization of diffusion MRI datasets with adaptive dictionary learning".

Project description

Harmonization of diffusion MRI datasets with adaptive dictionary learning

For details on the algorithm, you can check out the published version

The manuscript detailing the original harmonization challenge which lead to this algorithm is also available from the publisher here.

How to install

To install a precompiled version, simply run pip install dmri-harmonization.

There is also a Dockerfile which will compile the code for you internally, see https://docs.docker.com/get-started/ for more details.

Normally everything is available pre-compiled, but feel free to redo it from source on your computer cluster for example.

A step by step example

There are two main scripts to use, one to build the database and one to harmonize the datasets afterwards.

You will most likely want you data to be organized sensibly and have the same filename for every diffusion dataset under various subjects folders, just like in the example that can be found under the tests folder.

This looks like this and is the format used by the BIDS standard and the HCP datasets. You do not need to follow this exactly, you just need to ensure that the filenames are somewhat consistent since everything is found internally by pattern matching and substitutions.

datasets/
├── subj1
│   ├── dwi_brain_mask.nii.gz
│   ├── dwi.bvals
│   ├── dwi.bvecs
│   └── dwi.nii.gz
├── subj2
│   ├── dwi_brain_mask.nii.gz
│   ├── dwi.bvals
│   ├── dwi.bvecs
│   └── dwi.nii.gz
datasets_bids/
├── subj1-bids
│   └── dwi
│       ├── subj1-dwi_brain_mask.nii.gz
│       ├── subj1-dwi.bvals
│       ├── subj1-dwi.bvecs
│       └── subj1-dwi.nii.gz
└── subj2-bids
    └── dwi
        ├── subj2-dwi_brain_mask.nii.gz
        ├── subj2-dwi.bvals
        ├── subj2-dwi.bvecs
        └── subj2-dwi.nii.gz

Step 1

First write a config file like this

harmonization_get_global_D write myconfig.yaml

Open up this myconfig.yaml file and change a couple of options, namely the paths at the top to point to your datasets folder.

You can look up the example I mentioned above for a working example, but this should get you going. There are a couple more options to play with, but the default should be sane. I'd recommend looking at the numbers of cores option at the end however if you share a compute server with other people.

Step 2

Once you have your config file set up, run the command (note how there is no write keyword anymore)

harmonization_get_global_D myconfig.yaml

Everything will be read from myconfig.yaml, including the input and output folder. You'll see that all your datasets will be loaded in before processing, so you can double check the paths were set up correctly (particularly the glob option if you use BIDS with different filenames).

Step 3

After running step 2, you now have an output dictionary file. Now run the command

harmonization_harmonize_my_data myconfig.yaml

Sit back and relax, and you should have your harmonized datasets in the folder you specified. Remember you can also specify the same input and output folder to have the data side by side.

There are a few safeguards to not shoot yourself in the foot, like not overwriting datasets by default. On subsequent runs, be sure to change the output dictionary filename as it sets the logic for the output filenames or set the overwrite option to True in the config file if desired.

Project details


Release history Release notifications | RSS feed

This version

0.2

Download files

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

Source Distribution

dmri_harmonization-0.2.tar.gz (569.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dmri_harmonization-0.2-cp314-cp314-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.14Windows x86-64

dmri_harmonization-0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

dmri_harmonization-0.2-cp314-cp314-macosx_14_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.14macOS 14.0+ ARM64

dmri_harmonization-0.2-cp314-cp314-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.14macOS 13.0+ x86-64

dmri_harmonization-0.2-cp313-cp313-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.13Windows x86-64

dmri_harmonization-0.2-cp313-cp313-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

dmri_harmonization-0.2-cp313-cp313-macosx_14_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.13macOS 14.0+ ARM64

dmri_harmonization-0.2-cp313-cp313-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

dmri_harmonization-0.2-cp312-cp312-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.12Windows x86-64

dmri_harmonization-0.2-cp312-cp312-manylinux_2_28_x86_64.whl (1.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

dmri_harmonization-0.2-cp312-cp312-macosx_14_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12macOS 14.0+ ARM64

dmri_harmonization-0.2-cp312-cp312-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

dmri_harmonization-0.2-cp311-cp311-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.11Windows x86-64

dmri_harmonization-0.2-cp311-cp311-manylinux_2_28_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

dmri_harmonization-0.2-cp311-cp311-macosx_14_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.11macOS 14.0+ ARM64

dmri_harmonization-0.2-cp311-cp311-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

dmri_harmonization-0.2-cp310-cp310-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.10Windows x86-64

dmri_harmonization-0.2-cp310-cp310-manylinux_2_28_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

dmri_harmonization-0.2-cp310-cp310-macosx_14_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.10macOS 14.0+ ARM64

dmri_harmonization-0.2-cp310-cp310-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

dmri_harmonization-0.2-cp39-cp39-win_amd64.whl (2.2 MB view details)

Uploaded CPython 3.9Windows x86-64

dmri_harmonization-0.2-cp39-cp39-manylinux_2_28_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

dmri_harmonization-0.2-cp39-cp39-macosx_14_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.9macOS 14.0+ ARM64

dmri_harmonization-0.2-cp39-cp39-macosx_13_0_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

File details

Details for the file dmri_harmonization-0.2.tar.gz.

File metadata

  • Download URL: dmri_harmonization-0.2.tar.gz
  • Upload date:
  • Size: 569.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.5

File hashes

Hashes for dmri_harmonization-0.2.tar.gz
Algorithm Hash digest
SHA256 da7075199cd345922f458f2649c31c7e6563cc864795d1eda385a095bd3ddb33
MD5 27803f0cf687b89cd7c49522a3969177
BLAKE2b-256 a820a13c706120ffb85a7b6e3f219f4a13049e99ecaa8176a04c8cad7cabaf1e

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7b7fd66ed8e27f7fc8c5d30eb6fbba798929ce2e1f549a2ac2a9351829db1730
MD5 561cf05b872e7e30f5e2f0eef4d10fe0
BLAKE2b-256 4578a4dcf5232491df7751846ade35ce7f7175928a6f347468edb079fb03fde1

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ae700eac2680689b21f15daa6d4bfe0603b435603d44c7b0e8821463c0c2fea0
MD5 3178da8cd4298ac1298f05257e5e0451
BLAKE2b-256 4daeb2f0c05878533c5e63a6ab7bd3d014c00c833f02d801d79eae083ccc352f

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp314-cp314-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp314-cp314-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3a1ce2f8fc1ffc8789205b40b69c7ccf92a76c382ee8f941dca084ff7abcba61
MD5 19c45d153e4c81d42a0c57ef984fbe4c
BLAKE2b-256 86a2afba364407dccf6589a10fae89871eef05c160664d6ddd72f0d34981f8fa

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp314-cp314-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp314-cp314-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 39e80d623f3d892bd86255a051c6a16c68607fa93093593a690bde9f586c160c
MD5 c388b36694076de5de9d50e15e7b34a8
BLAKE2b-256 35462f19285c5213d4969671eb5bf50ca9b83b6424b6f3b41c0cb9f16b86d319

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 a00eb5aadc7ba7bef88559a3ac8585d271928c75db3d2a629a31b6cf8a8998de
MD5 e217f2bf53b6b309e7f300e8f63b30be
BLAKE2b-256 bd1fc60761770af2724e36620f9fd1f7d3e7f754d8cdffa48cf896e297e0ed56

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ae8647937c00609be474b38c94f80d6f304a9558790a977630e549374b0b17d3
MD5 906a5744828bc85803ca6211bbaf9967
BLAKE2b-256 650ece3afa0b912b4912adaca1afc9ecba4f80363ca88f9dca216257a3468d5e

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp313-cp313-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp313-cp313-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1dd1cba8053b5fd0fec728da1f18b323d233007be295c69fb8df014c21d1075d
MD5 4039c51c2c758e4caceadeb7920f7926
BLAKE2b-256 903f472960e32f3930c658be83521218ea8beddc29b077bbdd34aa26d282d28c

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 4e1245d2137f7f707a9fdc916bbd0ef83c111684bb7af705c8cf3efe707b8b00
MD5 7db3ed36473f3ae54bd181e7730c3648
BLAKE2b-256 451cd9026367a3debcf7c3a58952a715bb31eeb28ee6b4999cb97a7a2aa40872

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cce24940abb69d4bad4dd3b1fb04a26d8d969c808cd65ef1cb0ece0eec0c0670
MD5 f5722164495956627842c7ce52c5b467
BLAKE2b-256 eb4b0939fcbb09522e26efea89f6d16b7785a0890e6fd2b1885a2f8605253500

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1ce829a7f8f62fc4e2756456b16136b4f8bcde3a956e1b68c9160f37d5d5f57b
MD5 3692a989130aeb121a3d8af93cce89c8
BLAKE2b-256 140ea9be12cbb4ea8d3f63a0402bc9e3dc146a73d5cdbe9c23372cbc267f5bdc

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 dcb4288bad8b1d99bb809d1110009f08be632a7655263cb5748e6400ebc64e0c
MD5 6ff8e1c7d81ed08cb2140d6661381cce
BLAKE2b-256 fb125974e272246b3eb861be32a9dfc79037045f31d2f32434e7228158dfc2fe

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 a0959e3fa2a4f763b41303b58b735b527c383bdd7f4f4d636a15beb01ba561b8
MD5 f01b0cc06958cb9598c77c4288a2551d
BLAKE2b-256 8c9c7d836a272d07d6f511c20eb5df3ab8638d50a9b449f3dd37f2d7fd817646

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b0de78d9569540ec044f05140153dced59a3729232c6bedf7abdfd4cb41fba57
MD5 241015970129a0039c19e55b771d46d1
BLAKE2b-256 1abc52c016770e8e865bb7e6b360dde2b58ac1661d0b102d31a66e99e07f2635

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 627472f5df462df9a0a48d8c9a08a38065ab52d7dd542f77782e4f7565a13375
MD5 89eb3afb365aba8e1ee625b5ba234574
BLAKE2b-256 1852d828c5b8f3005c8873ae0027ad0e3e367496c495d881526cd1b1a6bd0f3b

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5a3713d8c2eacfcc7aae1162efb339c0f890f3de40281b7295fb96a21a09bd6e
MD5 9e9ef04c4dd3e8f25abd1f6a8d59dfc6
BLAKE2b-256 fba5bb8b522f2962411768c4a690b9306a9811b37d01eff3135db731fb465d1b

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6748308ae18a3e7d25d351d18a513580def7b417bca64eb0896c73dc88ae0d2f
MD5 e5cba32cf9e0b5c7d29893af8244145f
BLAKE2b-256 02fec311056666c1ffc4b050b01579e03c5088b04f54ca4882f063e4b0b9753d

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 2049d3da9834bf902af987f771bdb24a7f93511faec7abf9fdd92a24a2fa44c3
MD5 f40a9628034598b5ce505a42f65a2b1c
BLAKE2b-256 5953e59b398d58430d6159842cae7411f664e628493ee6c64bed52385dc500e6

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5fba51368436b66aa940e6c71152523490b20db61cf57840a2f08bb5521668a3
MD5 281fb89080b845e1adab8ed738da577a
BLAKE2b-256 8c3bcb008d9b41755f0c406c013ad9e307bd35809e07513a793797e82d587f02

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 61f15d4ba67e3fff4adc9c964bfe94f7299f944923344fade1e9c1edcfb975f6
MD5 546bc94f2d3d70ed3700a100bf1b400f
BLAKE2b-256 1a13b75bbfd12df74f4ba05ee80ffc481214b3c4e68ae2058d12b8be024459d6

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 85fd91fdb4ca358a6310f9b05228c567eaad863198c70dd60b15a2069d70fd73
MD5 8ca5a562569f45a2491ea1d3ab9ab448
BLAKE2b-256 18c2331f96a1309a886876a3067eb987b60b9afe75e4255cdbbeb0568297e739

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 da615f9e1f4e8150b5e9313ef27947e115f749ed75bb75b5229182817acd274e
MD5 9f6b8fc203c64bfd75869b7d86ea2be2
BLAKE2b-256 dd8deb9ba0027d307200e392c4f092fc5073bf0083d0506f2019abd3a486cd2b

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 55f058fed4dea8052d4355a972d1f62e1521b3dae5f4c6467fc801ba7e745053
MD5 7b64fb988992305cf246202a83453626
BLAKE2b-256 0674214478188059c2412395dc436727ace0e62b46de6a9d7bf8549372412594

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 1b425efdcb92d39fc28a0e5c3032d634718b18e0fbdfac532c6fc0949d492e00
MD5 1713800863e51bafafe39292dcb7354e
BLAKE2b-256 121195507fd96ceb62cc5efab1e5fd0d03fab5c4a6cfbe17e9642732b38bcfd2

See more details on using hashes here.

File details

Details for the file dmri_harmonization-0.2-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for dmri_harmonization-0.2-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 382e214debc1b19cf5382e7f866e52328927f1f18a4eab7b551323816105f9c6
MD5 2eca046c9d4dfc2d6331917489b62776
BLAKE2b-256 65d540876f15c29e1723085215e170dd4e39be3f9e38e6811a6d393fa95ee472

See more details on using hashes here.

Supported by

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