Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michiel Cottaar
gyral_structure
Commits
03af5f3f
Commit
03af5f3f
authored
Mar 05, 2021
by
Michiel Cottaar
Browse files
Replace mcutils with mcot
parent
fed6ea08
Pipeline
#7959
failed with stage
in 0 seconds
Changes
13
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
03af5f3f
...
@@ -2,7 +2,6 @@ before_script:
...
@@ -2,7 +2,6 @@ before_script:
-
apt-get update -qq
-
apt-get update -qq
-
apt-get install python3
-
apt-get install python3
-
pip install numpy pandas seaborn
-
pip install numpy pandas seaborn
-
pip install git+https://git.fmrib.ox.ac.uk/ndcn0236/mcutils.git
-
pip install .
-
pip install .
-
pip install pytest
-
pip install pytest
...
...
README.md
View file @
03af5f3f
...
@@ -11,7 +11,6 @@ Installation
...
@@ -11,7 +11,6 @@ Installation
The requirements can be installed using conda and pip:
The requirements can be installed using conda and pip:
```
sh
```
sh
conda
install
-c
conda-forge nibabel scipy sympy
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
pip
install
git+https://git.fmrib.ox.ac.uk/ndcn0236/gyral_structure.git
```
```
...
...
doc/tutorial.rst
View file @
03af5f3f
...
@@ -7,7 +7,6 @@ Gyral structure can be installed using pip:
...
@@ -7,7 +7,6 @@ Gyral structure can be installed using pip:
.. code-block:: sh
.. 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
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
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:
...
@@ -80,7 +79,7 @@ After defining the command line interface we start by importing the libraries:
import nibabel as nib
import nibabel as nib
import numpy as np
import numpy as np
from gyral_structure import basis, cost, request
from gyral_structure import basis, cost, request
from mc
utils
.surface import CorticalMesh, grid
from mc
ot
.surface import CorticalMesh, grid
Requests: where to evaluate the cost function
Requests: where to evaluate the cost function
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
gyral_structure/qc/surface.py
View file @
03af5f3f
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
Produces several QC plots for surfaces
Produces several QC plots for surfaces
"""
"""
from
mc
utils
.surface
import
CorticalMesh
from
mc
ot
.surface
import
CorticalMesh
from
gyral_structure.request
import
read_surface
from
gyral_structure.request
import
read_surface
from
gyral_structure.basis
import
BasisFunc
from
gyral_structure.basis
import
BasisFunc
from
nibabel
import
cifti2
from
nibabel
import
cifti2
...
...
gyral_structure/request.py
View file @
03af5f3f
...
@@ -16,7 +16,7 @@ in multiple cost functions.
...
@@ -16,7 +16,7 @@ in multiple cost functions.
import
scipy
as
sp
import
scipy
as
sp
import
itertools
import
itertools
from
itertools
import
zip_longest
from
itertools
import
zip_longest
from
mc
utils
.surface
import
CorticalMesh
from
mc
ot
.surface
import
CorticalMesh
import
nibabel
import
nibabel
import
os
import
os
from
numpy
import
linalg
from
numpy
import
linalg
...
...
gyral_structure/scripts/gs_deform_surface
View file @
03af5f3f
...
@@ -20,8 +20,8 @@ args = parser.parse_args()
...
@@ -20,8 +20,8 @@ args = parser.parse_args()
import
nibabel
import
nibabel
import
numpy
as
np
import
numpy
as
np
from
gyral_structure
import
basis
,
streamline
from
gyral_structure
import
basis
,
streamline
from
mc
utils
.surface
import
CorticalMesh
,
grid
from
mc
ot
.surface
import
CorticalMesh
,
grid
from
mc
utils.utils.write_gifti
import
write_gifti
from
mc
ot.surface
import
write_gifti
from
numpy
import
linalg
from
numpy
import
linalg
from
scipy
import
ndimage
from
scipy
import
ndimage
...
...
gyral_structure/scripts/gs_dyad_surf
View file @
03af5f3f
...
@@ -10,9 +10,9 @@ args = parser.parse_args()
...
@@ -10,9 +10,9 @@ args = parser.parse_args()
import
nibabel
import
nibabel
from
gyral_structure
import
basis
,
request
,
utils
from
gyral_structure
import
basis
,
request
,
utils
from
mc
utils
.surface
import
CorticalMesh
from
mc
ot
.surface
import
CorticalMesh
import
scipy
as
sp
import
scipy
as
sp
import
cifti
from
nibabel
import
cifti
2
basis_func
,
best_fit_arr
=
basis
.
read
(
args
.
field
)
basis_func
,
best_fit_arr
=
basis
.
read
(
args
.
field
)
img
=
nibabel
.
load
(
args
.
surface
)
img
=
nibabel
.
load
(
args
.
surface
)
...
@@ -34,6 +34,6 @@ for idx in range(arr_triangle.shape[0]):
...
@@ -34,6 +34,6 @@ for idx in range(arr_triangle.shape[0]):
conn
,
val
=
sp
.
broadcast_arrays
(
surf
.
faces
,
arr_triangle
[
idx
][
None
,
:])
conn
,
val
=
sp
.
broadcast_arrays
(
surf
.
faces
,
arr_triangle
[
idx
][
None
,
:])
nconn
=
sp
.
bincount
(
conn
.
flatten
(),
minlength
=
surf
.
nvertices
)
nconn
=
sp
.
bincount
(
conn
.
flatten
(),
minlength
=
surf
.
nvertices
)
arr_vertices
[
idx
]
=
sp
.
bincount
(
conn
.
flatten
(),
val
.
flatten
(),
minlength
=
surf
.
nvertices
)
/
nconn
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'
])
bm
=
cifti
2
.
BrainModel
Axis
.
from_mask
(
mask
,
name
=
img
.
darrays
[
0
].
metadata
[
'AnatomicalStructurePrimary'
])
cifti
.
write
(
args
.
output
,
arr_vertices
,
(
cifti
.
Scalar
.
from_name
s
([
'density (crossing)'
,
'density (total)'
,
'radiality'
,
'x'
,
'y'
,
'z'
]),
bm
))
cifti
2
.
Cifti2Image
(
arr_vertices
,
(
cifti
2
.
Scalar
Axi
s
([
'density (crossing)'
,
'density (total)'
,
'radiality'
,
'x'
,
'y'
,
'z'
]),
bm
))
.
to_filename
(
args
.
output
)
gyral_structure/scripts/gs_fit
View file @
03af5f3f
...
@@ -41,7 +41,7 @@ args = parser.parse_args()
...
@@ -41,7 +41,7 @@ args = parser.parse_args()
import
nibabel
as
nib
import
nibabel
as
nib
import
numpy
as
np
import
numpy
as
np
from
gyral_structure
import
basis
,
cost
,
request
,
utils
from
gyral_structure
import
basis
,
cost
,
request
,
utils
from
mc
utils
.surface
import
CorticalMesh
,
grid
,
Cortex
from
mc
ot
.surface
import
CorticalMesh
,
grid
,
Cortex
from
warnings
import
warn
from
warnings
import
warn
from
nibabel
import
affines
from
nibabel
import
affines
...
...
gyral_structure/scripts/gs_mask
View file @
03af5f3f
...
@@ -25,7 +25,7 @@ parser.add_argument("-N", "--norient", default=300, type=int,
...
@@ -25,7 +25,7 @@ parser.add_argument("-N", "--norient", default=300, type=int,
"default: 300"
)
"default: 300"
)
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
from
mc
utils
.surface
import
CorticalMesh
,
grid
,
orientation
from
mc
ot
.surface
import
CorticalMesh
,
grid
,
orientation
import
nibabel
as
nib
import
nibabel
as
nib
import
numpy
as
np
import
numpy
as
np
from
scipy
import
ndimage
from
scipy
import
ndimage
...
...
gyral_structure/scripts/gs_qc
View file @
03af5f3f
...
@@ -24,7 +24,7 @@ parser.add_argument("-sp", "--skip_plots", action='store_true',
...
@@ -24,7 +24,7 @@ parser.add_argument("-sp", "--skip_plots", action='store_true',
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
from
gyral_structure.basis
import
read
from
gyral_structure.basis
import
read
from
mc
utils
.surface
import
CorticalMesh
,
Cortex
from
mc
ot
.surface
import
CorticalMesh
,
Cortex
import
os
import
os
from
gyral_structure
import
qc
from
gyral_structure
import
qc
import
nibabel
as
nib
import
nibabel
as
nib
...
...
gyral_structure/scripts/gs_track
View file @
03af5f3f
...
@@ -17,7 +17,7 @@ if len(args.stop) % 2 != 0:
...
@@ -17,7 +17,7 @@ if len(args.stop) % 2 != 0:
import
nibabel
import
nibabel
from
numpy
import
linalg
from
numpy
import
linalg
from
gyral_structure
import
basis
,
request
,
streamline
from
gyral_structure
import
basis
,
request
,
streamline
from
mc
utils
.surface
import
CorticalMesh
from
mc
ot
.surface
import
CorticalMesh
stop_surfaces
=
[]
stop_surfaces
=
[]
for
surf_name
,
mask_name
in
zip
(
args
.
stop
[::
2
],
args
.
stop
[
1
::
2
]):
for
surf_name
,
mask_name
in
zip
(
args
.
stop
[::
2
],
args
.
stop
[
1
::
2
]):
...
...
gyral_structure/streamline.py
View file @
03af5f3f
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
from
.
import
request
,
utils
from
.
import
request
,
utils
import
scipy
as
sp
import
scipy
as
sp
from
scipy
import
linalg
from
scipy
import
linalg
from
mc
utils
.surface
import
grid
from
mc
ot
.surface
import
grid
def
surface_startpoints
(
triangles
,
field_density
):
def
surface_startpoints
(
triangles
,
field_density
):
...
...
setup.py
View file @
03af5f3f
...
@@ -43,7 +43,7 @@ setup(name='gyral_structure',
...
@@ -43,7 +43,7 @@ setup(name='gyral_structure',
url
=
'https://git.fmrib.ox.ac.uk/ndcn0236/gyral_structure'
,
url
=
'https://git.fmrib.ox.ac.uk/ndcn0236/gyral_structure'
,
packages
=
find_packages
(),
packages
=
find_packages
(),
cmdclass
=
{
'doc'
:
doc
},
cmdclass
=
{
'doc'
:
doc
},
install_requires
=
[
'nibabel'
,
'scipy'
,
'mc
utils
'
,
'sympy'
,
'h5py'
,
'numexpr'
],
install_requires
=
[
'nibabel'
,
'scipy'
,
'mc
ot.surface
'
,
'sympy'
,
'h5py'
,
'numexpr'
],
scripts
=
[
scripts
=
[
'gyral_structure/scripts/gs_track'
,
'gyral_structure/scripts/gs_track'
,
'gyral_structure/scripts/gs_dyad_vol'
,
'gyral_structure/scripts/gs_dyad_vol'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment