Skip to content

Commit f1ee62d

Browse files
committed
add wrappers
1 parent 1fbdbf8 commit f1ee62d

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
numpy
2+
scipy
3+
operator
24
torchio
35
torch
46
os

src/wrappers/ivim_fit.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Non-osipi dependencies
2+
3+
# osipi utilities
4+
5+
# osipi implementations
6+
7+
8+
def ivim_fit(author, signals=None, bvalues=None, data=None, initial_guess=None, bounds=None):
9+
"""
10+
wrapper function to use OSIPI code contributions for IVIM fit
11+
:param author: str, can be one of []
12+
:param signals: numpy array containing signal intensities
13+
:param bvalues: numpy array containing corresponding b-values
14+
:param data: object containing signals and bvalues
15+
:param initial_guess: list of initial parameter estimates
16+
:param bounds: list containing list of lower parameter bounds and list of upper parameter bounds
17+
:return: numpy array of shape (signals.size, 4) with the D, Dp, f, S0 per voxel.
18+
"""
19+
20+
# Unpack variables if data object is given
21+
if not data == None:
22+
bvalues = data.bvalues
23+
signals = data.signals
24+
25+
26+
# Some implementations can only fit a voxel at a time (i.e. all inputs must be 2-dimensional)
27+
requires_2D = True if author in []
28+
requires_4D = True if author in []
29+
30+
# Bounds and initial guess for parameters
31+
initial_guess = []
32+
bounds = []
33+
34+
# Create a fitting function for the chosen author/implementation
35+
if author == "":
36+
pass
37+

0 commit comments

Comments
 (0)