Skip to content

Commit

Permalink
Merge branch 'master' into removing-fvtk
Browse files Browse the repository at this point in the history
  • Loading branch information
skoudoro committed Oct 9, 2017
2 parents 734a63d + 76d021a commit 984bc8f
Show file tree
Hide file tree
Showing 83 changed files with 891 additions and 725 deletions.
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ You can find our sources and single-click downloads:
Installing DIPY
===============

DIPY can be installed using `pip`:
DIPY can be installed using `pip`::

pip install dipy

or using `conda`:
or using `conda`::

conda install -c conda-forge dipy vtk

Expand Down
6 changes: 3 additions & 3 deletions doc/devel/gitwash/development_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
Development workflow
####################

You already have your own forked copy of the `dipy`_ repository, by
You already have your own forked copy of the dipy_ repository, by
following :ref:`forking`. You have :ref:`set-up-fork`. You have configured
git by following :ref:`configure-git`. Now you are ready for some real work.

Workflow summary
================

In what follows we'll refer to the upstream dipy ``master`` branch, as
In what follows we'll refer to the upstream DIPY ``master`` branch, as
"trunk".

* Don't use your ``master`` branch for anything. Consider deleting it.
Expand Down Expand Up @@ -81,7 +81,7 @@ what the changes in the branch are for. For example ``add-ability-to-fly``, or
git checkout my-new-feature

Generally, you will want to keep your feature branches on your public github_
fork of `dipy`_. To do this, you `git push`_ this new branch up to your
fork of dipy_. To do this, you `git push`_ this new branch up to your
github repo. Generally (if you followed the instructions in these pages, and by
default), git will have a link to your github repo, called ``origin``. You push
up to your own repo on github with::
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/gitwash/following_latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
=============================

These are the instructions if you just want to follow the latest
*dipy* source, but you don't need to do any development for now.
DIPY source, but you don't need to do any development for now.

The steps are:

Expand Down
8 changes: 4 additions & 4 deletions doc/devel/gitwash/forking_hell.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.. _forking:

======================================================
Making your own copy (fork) of dipy
Making your own copy (fork) of DIPY
======================================================

You need to do this only once. The instructions here are very similar
You need to do this only once. The instructions here are very similar
to the instructions at http://help.github.com/forking/ |emdash| please see
that page for more detail. We're repeating some of it here just to give the
that page for more detail. We're repeating some of it here just to give the
specifics for the `dipy`_ project, and to suggest some default names.

Set up and configure a github account
Expand All @@ -17,7 +17,7 @@ If you don't have a github account, go to the github page, and make one.
You then need to configure your account to allow write access |emdash| see
the ``Generating SSH keys`` help on `github help`_.

Create your own forked copy of `dipy`_
Create your own forked copy of dipy_
======================================================

#. Log into your github account.
Expand Down
6 changes: 3 additions & 3 deletions doc/devel/gitwash/git_intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Introduction
==============

These pages describe a git_ and github_ workflow for the `dipy`_
These pages describe a git_ and github_ workflow for the dipy_
project.

There are several different workflows here, for different ways of
working with *dipy*.
working with DIPY.

This is not a comprehensive git reference, it's just a workflow for our
own project. It's tailored to the github hosting service. You may well
own project. It's tailored to the github hosting service. You may well
find better or quicker ways of getting stuff done with git, but these
should get you started.

Expand Down
2 changes: 1 addition & 1 deletion doc/devel/gitwash/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _using-git:

Working with *dipy* source code
Working with DIPY source code
================================================

Contents:
Expand Down
2 changes: 1 addition & 1 deletion doc/devel/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _development:

DiPy development
DIPY development
================

Contents:
Expand Down
28 changes: 15 additions & 13 deletions doc/devel/make_release.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.. _release-guide:

*********************************
A guide to making a dipy release
A guide to making a DIPY release
*********************************

A guide for developers who are doing a dipy release
A guide for developers who are doing a DIPY release

.. _release-tools:

Release tools
=============

There are some release utilities that come with nibabel_. nibabel should
There are some release utilities that come with nibabel_. nibabel should
install these as the ``nisext`` package, and the testing stuff is understandably
in the ``testers`` module of that package. Dipy has Makefile targets for their
in the ``testers`` module of that package. DIPY has Makefile targets for their
use. The relevant targets are::

make check-version-info
Expand Down Expand Up @@ -75,10 +75,10 @@ Release checklist
``README`` in the root directory, maybe with ``vim`` ``diffthis`` command.
Check all the links are still valid.

* Check all the dipy builds are green on the `nipy buildbot`_
* Check all the DIPY builds are green on the `nipy buildbot`_

* If you have travis-ci_ building set up you might want to push the code in its
current state to a branch that will build, e.g::
current state to a branch that will build, e.g.::

git branch -D pre-release-test # in case branch already exists
git co -b pre-release-test
Expand Down Expand Up @@ -128,7 +128,7 @@ Release checklist
git clean -fxd
python setup.py build_ext --inplace

* Make sure all tests pass on your local machine (from the dipy root directory)::
* Make sure all tests pass on your local machine (from the ``<dipy root>`` directory)::

cd ..
nosetests --with-doctest dipy
Expand All @@ -144,14 +144,16 @@ Release checklist
running the doctests in the code, where the doctests pass when run in nose -
we should find out why this is at some point, but leave it for now.

* Trigger builds of all the binary build testers for dipy, using the web
interface. You may need permissions set to do this - contact Matthew or
* Trigger builds of all the binary build testers for DIPY, using the web
interface. You may need permissions set to do this - contact Matthew or
Eleftherios if you do.

At the moment, the useful dipy binary build testers are:
At the moment, the useful DIPY binary build testers are:

* http://nipy.bic.berkeley.edu/builders/dipy-bdist32-26
* http://nipy.bic.berkeley.edu/builders/dipy-bdist32-35
* http://nipy.bic.berkeley.edu/builders/dipy-bdist32-27
* http://nipy.bic.berkeley.edu/builders/dipy-bdist64-27
* http://nipy.bic.berkeley.edu/builders/dipy-bdist64-35
* http://nipy.bic.berkeley.edu/builders/dipy-bdist-mpkg-2.6
* http://nipy.bic.berkeley.edu/builders/dipy-bdist-mpkg-2.7

Expand Down Expand Up @@ -263,9 +265,9 @@ tag to github, so the buildbots can find the released code and build it.

Download the builds and upload to pypi.

You can upload the exe files with the *files* interface for the new dipy release.
You can upload the exe files with the *files* interface for the new DIPY release.
Obviously you'll need to log in to do this, and you'll need to be an admin for
the dipy pypi project.
the DIPY pypi project.

For reference, if you need to do binary exe builds by hand, use something
like::
Expand Down
10 changes: 5 additions & 5 deletions doc/examples/affine_registration_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
.. figure:: resampled_2.png
:align: center
**Input images before alignment**.
Input images before alignment.
"""

"""
Expand Down Expand Up @@ -99,7 +99,7 @@
.. figure:: transformed_com_2.png
:align: center
**Registration result by aligning the centers of mass of the images**.
Registration result by aligning the centers of mass of the images.
"""

"""
Expand Down Expand Up @@ -203,7 +203,7 @@
.. figure:: transformed_trans_2.png
:align: center
**Registration result by translating the moving image, using MI**.
Registration result by translating the moving image, using Mutual Information.
"""

"""
Expand Down Expand Up @@ -238,7 +238,7 @@
.. figure:: transformed_rigid_2.png
:align: center
**Registration result with a rigid transform, using Mutual Information**.
Registration result with a rigid transform, using Mutual Information.
"""

"""
Expand Down Expand Up @@ -274,7 +274,7 @@
.. figure:: transformed_affine_2.png
:align: center
**Registration result with an affine transform, using Mutual Information**.
Registration result with an affine transform, using Mutual Information.
.. [Mattes03] Mattes, D., Haynor, D. R., Vesselle, H., Lewellen, T. K.,
Eubank, W. (2003). PET-CT image registration in the chest using
Expand Down
32 changes: 19 additions & 13 deletions doc/examples/brain_extraction_dwi.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
Brain segmentation with median_otsu
===================================
We show how to extract brain information and mask from a b0 image using dipy's
segment.mask module.
We show how to extract brain information and mask from a b0 image using dipy_'s
``segment.mask`` module.
First import the necessary modules:
"""
Expand All @@ -15,8 +15,8 @@
"""
Download and read the data for this tutorial.
The scil_b0 dataset contains different data from different companies and
models. For this example, the data comes from a 1.5 tesla Siemens MRI.
The ``scil_b0`` dataset contains different data from different companies and
models. For this example, the data comes from a 1.5 Tesla Siemens MRI.
"""

from dipy.data.fetcher import fetch_scil_b0, read_siemens_scil_b0
Expand All @@ -28,7 +28,7 @@
``img`` contains a nibabel Nifti1Image object. Data is the actual brain data as
a numpy ndarray.
Segment the brain using dipy's mask module.
Segment the brain using DIPY's ``mask`` module.
``median_otsu`` returns the segmented brain data and a binary mask of the brain.
It is possible to fine tune the parameters of ``median_otsu`` (``median_radius``
Expand All @@ -41,10 +41,10 @@
b0_mask, mask = median_otsu(data, 2, 1)

"""
Saving the segmentation results is very easy using nibabel. We need the b0_mask,
and the binary mask volumes. The affine matrix which transform the image's
coordinates to the world coordinates is also needed. Here, we choose to save
both images in float32.
Saving the segmentation results is very easy using nibabel. We need the
``b0_mask``, and the binary mask volumes. The affine matrix which transform the
image's coordinates to the world coordinates is also needed. Here, we choose to
save both images in ``float32``.
"""

mask_img = nib.Nifti1Image(mask.astype(np.float32), img.affine)
Expand All @@ -55,7 +55,7 @@
nib.save(b0_img, fname + '_mask.nii.gz')

"""
Quick view of the results middle slice using matplotlib.
Quick view of the results middle slice using ``matplotlib``.
"""

import matplotlib.pyplot as plt
Expand All @@ -77,12 +77,12 @@
.. figure:: median_otsu.png
:align: center
**An application of median_otsu for brain segmentation**.
An application of median_otsu for brain segmentation.
``median_otsu`` can also automatically crop the outputs to remove the largest
possible number of background voxels. This makes outputted data significantly
smaller. auto cropping in ``median_otsu`` is activated by setting the
``autocrop`` parameter to True.
smaller. Auto-cropping in ``median_otsu`` is activated by setting the
``autocrop`` parameter to ``True``.
"""

b0_mask_crop, mask_crop = median_otsu(data, 4, 4, autocrop=True)
Expand All @@ -96,3 +96,9 @@
b0_mask_crop.astype(np.float32), img.affine)
nib.save(mask_img_crop, fname + '_binary_mask_crop.nii.gz')
nib.save(b0_img_crop, fname + '_mask_crop.nii.gz')

"""
.. include:: ../links_names.inc
"""
4 changes: 2 additions & 2 deletions doc/examples/bundle_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def show_both_bundles(bundles, colors=None, show=True, fname=None):
.. figure:: before_registration.png
:align: center
**Before bundle registration**.
Before bundle registration.
"""

show_both_bundles([cb_subj1, cb_subj2_aligned],
Expand All @@ -84,7 +84,7 @@ def show_both_bundles(bundles, colors=None, show=True, fname=None):
.. figure:: after_registration.png
:align: center
**After bundle registration**.
After bundle registration.
As you can see the two cingulum bundles are well aligned although they contain
many streamlines of different length and shape.
Expand Down
Loading

0 comments on commit 984bc8f

Please sign in to comment.