Code Monkey home page Code Monkey logo

dmriprep's Introduction

NIPY

Neuroimaging tools for Python.

The aim of NIPY is to produce a platform-independent Python environment for the analysis of functional brain imaging data using an open development model.

In NIPY we aim to:

  1. Provide an open source, mixed language scientific programming environment suitable for rapid development.
  2. Create software components in this environment to make it easy to develop tools for MRI, EEG, PET and other modalities.
  3. Create and maintain a wide base of developers to contribute to this platform.
  4. To maintain and develop this framework as a single, easily installable bundle.

NIPY is the work of many people. We list the main authors in the file AUTHOR in the NIPY distribution, and other contributions in THANKS.

Website

Current information can always be found at the NIPY project website.

Mailing Lists

For questions on how to use nipy or on making code contributions, please see the neuroimaging mailing list:

https://mail.python.org/mailman/listinfo/neuroimaging

Please report bugs at github issues:

https://github.com/nipy/nipy/issues

You can see the list of current proposed changes at:

https://github.com/nipy/nipy/pulls

Code

You can find our sources and single-click downloads:

Tests

To run nipy's tests, you will need to install the pytest Python testing package:

pip install pytest

Then:

pytest nipy

You can run the doctests along with the other tests with:

pip install pytest-doctestplus

Then:

pytest --doctest-plus nipy

Installation

See the latest installation instructions.

License

We use the 3-clause BSD license; the full license is in the file LICENSE in the nipy distribution.

dmriprep's People

Contributors

akeshavan avatar arokem avatar josephmje avatar nrajamani3 avatar pyup-bot avatar richford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dmriprep's Issues

QA output: images you need to determine whether b vectors are oriented correctly

We want to produce an image of the DTI ellipsoids around the posterior corpus callosum in a horizontal section. If these are pointing orthogonal to the posterior callosum, rather than swinging back like we would expect, the b vectors need to be reoriented.

Might be useful to provide example images that tell you exactly what you should do (i.e., what you should provide as keyword arguments to dmriprep upon re-running it).

Add a docker entry point

Right now, we have to drop into our docker image. In the long run, we'd also like to run this from the command line, without dropping in (see #72).

Download single subject

get_all_keys (or whatever it's called) should accept a subject keyword. If it's None (the default), download all subjects.

ENH: Two pipelines

We need two pipelines: one with FSL eddy and one with FLIRT. FSL eddy is preferred so the CLI should determine whether the input dataset meets the requirements for eddy. There are two possible ways to satisfy the eddy requirements:

  • A set of diffusion encoding directions that span the entire sphere and not just a half-sphere
  • A blip-up-blip-down (phase encode reversed) acquisition

So if the input data has phase encoded files, then we can safely use the eddy-based pipeline. If not, we should determine in the bvecs all lie within one hemisphere. If so, fallback to FLIRT. If not, use eddy. To determine whether the bvecs all lie within any one arbitrary hemisphere, see this for a description of a deterministic O(n^3) algorithm to determine if the points are within a hemisphere.

nibabel get_data vs get_fdata

for some odd reason img.get_fdata kills my python kernel, but the deprecated get_data does not. I'm not sure how to debug this because everything just dies!

Add node to drop outlier slices after eddy node

Inputs: threshold

  • if threshold is an int >= 1, treat as number of allowed outlier slices before we drop the whole volume.
  • if threshold is a float between 0 and 1 (exclusive), treat it as the fraction of allowed outlier slices before we drop the whole volume.

Outlier volume rejection

QC pipeline should reject bad volumes and write out a QCed dataset (and bvals and bvecs) that has bad volumes (and correspondingm bvecs) removed. We will set suggested thresholds based on maximizing scan rescan reliability. But it would be AWESOME if the plots had sliders on the yaxis where the user could adjust this

Two phase encode directions, but no field maps

Another possible way to deal with EPI distortions is to collect two sets of DWI with two inverted phase-encode directions, but no field maps.

Does topup know how to deal with this as input? Should we add this as an option here?

add another postprocessing step to HBN study data -- rename AP/PA fmaps

the HBN fieldmap files aren't consistently in BIDS format -- for the files where we have to read the .json file to figure out the fieldmap direction, we need to save the file with _dir-AP and _dir-PA in the filename so that pybids can find the right files in the io module. Most of the Site-RU subjects don't have the right naming scheme (e.g. sub-NDARUM797TFA from RU)

T1 alignment

It would be nice if this could (optionally) take in a T1 weighted image and align the dMRI data to this T1. Thus the dMRI data will be in the same space as the freesurfer segmentation

add ipython to docker image

at least for development its a lot easier

  • also make the environment called "dmriprep" instead of "preafq"

progress bar for data module

from dmriprep.data import get_dataset
get_dataset('path/to/output/dir') # needs a progress bar in bash and also on notebook?
  • also would be nice if pathlib made the folder for you if it doesn't already exist mkdir -p
  • maybe remove Site-SI from output folder structure

Longitudinal pipeline

Per conversation with @akeshavan, I'm putting this here for some measure of posterity.

Right now smriprep/fmriprep does not handle preprocessed Freesurfer for longitudinal data (using the Freesurfer longitudinal recon-all pipeline). See this issue ([https://github.com/nipreps/smriprep/issues/21]).

Implementation that allows for preprocessed longitudinal Freesurfer is something to consider if dmriprep is going to allow/require preprocessed data.

End-to-end testing

Get a small data set and run the whole thing end-to-end on it. Manipulate to test (for example) that wonky b-vectors can be detected, that it works with an odd number of slices, and so forth.

Preserve `dim_info`

The output of dmriprep currently has:

In [7]: hdr = img.header                                                        

In [8]: hdr.get_dim_info()                                                      
Out[8]: (None, None, None)

We want to set this to be consistent with the input. See #32

Automatically use `eddy_cuda` if GPU is present

The workflow should interrogate the host system to see if there is a GPGPU available. If so, use eddy_cuda instead of eddy_openmp. This is accomplished with eddy.inputs.use_cuda=True.

To determine if a cuda capable GPU is present, we could try

import numba.cuda
if numbda.cuda.gpus.current:
    eddy.inputs.use_cuda = True

or something like that.

Vectors on RGB in QC

For the QC image of the RGB map it would be helpful to also have a small white line showing the direction vector of the PDD taken from the tensor

Need a fall-back for cases where no T1w images are available

Two kinds of use-cases:

  • Acquisition protocols that don't include T1w.
  • Individual cases within a protocol that don't have that data (e.g., when the quality of the T1 is not good. This is a thing in the HBN dataset).

One option is to register to the FS average brain.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.