Commit 03af5f3f authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Replace mcutils with mcot

parent fed6ea08
Pipeline #7959 failed with stage
in 0 seconds
......@@ -2,7 +2,6 @@ before_script:
- apt-get update -qq
- apt-get install python3
- pip install numpy pandas seaborn
- pip install git+https://git.fmrib.ox.ac.uk/ndcn0236/mcutils.git
- pip install .
- pip install pytest
......
......@@ -11,7 +11,6 @@ Installation
The requirements can be installed using conda and pip:
```sh
conda install -c conda-forge nibabel scipy sympy
pip install git+https://git.fmrib.ox.ac.uk/ndcn0236/mcutils.git
pip install git+https://git.fmrib.ox.ac.uk/ndcn0236/gyral_structure.git
```
......
......@@ -7,7 +7,6 @@ Gyral structure can be installed using pip:
.. code-block:: sh
pip install git+https://git.fmrib.ox.ac.uk/ndcn0236/mcutils.git
pip install git+https://git.fmrib.ox.ac.uk/ndcn0236/gyral_structure.git
You can view the code at https://git.fmrib.ox.ac.uk/ndcn0236/gyral_structure
......@@ -80,7 +79,7 @@ After defining the command line interface we start by importing the libraries:
import nibabel as nib
import numpy as np
from gyral_structure import basis, cost, request
from mcutils.surface import CorticalMesh, grid
from mcot.surface import CorticalMesh, grid
Requests: where to evaluate the cost function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
......@@ -2,7 +2,7 @@
Produces several QC plots for surfaces
"""
from mcutils.surface import CorticalMesh
from mcot.surface import CorticalMesh
from gyral_structure.request import read_surface
from gyral_structure.basis import BasisFunc
from nibabel import cifti2
......
......@@ -16,7 +16,7 @@ in multiple cost functions.
import scipy as sp
import itertools
from itertools import zip_longest
from mcutils.surface import CorticalMesh
from mcot.surface import CorticalMesh
import nibabel
import os
from numpy import linalg
......
......@@ -20,8 +20,8 @@ args = parser.parse_args()
import nibabel
import numpy as np
from gyral_structure import basis, streamline
from mcutils.surface import CorticalMesh, grid
from mcutils.utils.write_gifti import write_gifti
from mcot.surface import CorticalMesh, grid
from mcot.surface import write_gifti
from numpy import linalg
from scipy import ndimage
......
......@@ -10,9 +10,9 @@ args = parser.parse_args()
import nibabel
from gyral_structure import basis, request, utils
from mcutils.surface import CorticalMesh
from mcot.surface import CorticalMesh
import scipy as sp
import cifti
from nibabel import cifti2
basis_func, best_fit_arr = basis.read(args.field)
img = nibabel.load(args.surface)
......@@ -34,6 +34,6 @@ for idx in range(arr_triangle.shape[0]):
conn, val = sp.broadcast_arrays(surf.faces, arr_triangle[idx][None, :])
nconn = sp.bincount(conn.flatten(), minlength=surf.nvertices)
arr_vertices[idx] = sp.bincount(conn.flatten(), val.flatten(), minlength=surf.nvertices) / nconn
bm = cifti.BrainModel.from_mask(mask, name=img.darrays[0].metadata['AnatomicalStructurePrimary'])
cifti.write(args.output, arr_vertices, (cifti.Scalar.from_names(['density (crossing)', 'density (total)', 'radiality', 'x', 'y', 'z']), bm))
bm = cifti2.BrainModelAxis.from_mask(mask, name=img.darrays[0].metadata['AnatomicalStructurePrimary'])
cifti2.Cifti2Image(arr_vertices, (cifti2.ScalarAxis(['density (crossing)', 'density (total)', 'radiality', 'x', 'y', 'z']), bm)).to_filename(args.output)
......@@ -41,7 +41,7 @@ args = parser.parse_args()
import nibabel as nib
import numpy as np
from gyral_structure import basis, cost, request, utils
from mcutils.surface import CorticalMesh, grid, Cortex
from mcot.surface import CorticalMesh, grid, Cortex
from warnings import warn
from nibabel import affines
......
......@@ -25,7 +25,7 @@ parser.add_argument("-N", "--norient", default=300, type=int,
"default: 300")
args = parser.parse_args()
from mcutils.surface import CorticalMesh, grid, orientation
from mcot.surface import CorticalMesh, grid, orientation
import nibabel as nib
import numpy as np
from scipy import ndimage
......
......@@ -24,7 +24,7 @@ parser.add_argument("-sp", "--skip_plots", action='store_true',
args = parser.parse_args()
from gyral_structure.basis import read
from mcutils.surface import CorticalMesh, Cortex
from mcot.surface import CorticalMesh, Cortex
import os
from gyral_structure import qc
import nibabel as nib
......
......@@ -17,7 +17,7 @@ if len(args.stop) % 2 != 0:
import nibabel
from numpy import linalg
from gyral_structure import basis, request, streamline
from mcutils.surface import CorticalMesh
from mcot.surface import CorticalMesh
stop_surfaces = []
for surf_name, mask_name in zip(args.stop[::2], args.stop[1::2]):
......
......@@ -3,7 +3,7 @@
from . import request, utils
import scipy as sp
from scipy import linalg
from mcutils.surface import grid
from mcot.surface import grid
def surface_startpoints(triangles, field_density):
......
......@@ -43,7 +43,7 @@ setup(name='gyral_structure',
url='https://git.fmrib.ox.ac.uk/ndcn0236/gyral_structure',
packages=find_packages(),
cmdclass={'doc': doc},
install_requires=['nibabel', 'scipy', 'mcutils', 'sympy', 'h5py', 'numexpr'],
install_requires=['nibabel', 'scipy', 'mcot.surface', 'sympy', 'h5py', 'numexpr'],
scripts=[
'gyral_structure/scripts/gs_track',
'gyral_structure/scripts/gs_dyad_vol',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment