-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from skoudoro/OPT_trackers
Rebase for openmp on mac + function pointer nogil
- Loading branch information
Showing
16 changed files
with
595 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
cimport numpy as cnp | ||
|
||
from dipy.tracking.stopping_criterion cimport StoppingCriterion | ||
from dipy.direction.pmf cimport PmfGen | ||
|
||
|
||
cdef class TrackingParameters(): | ||
cdef: | ||
int max_len | ||
double step_size | ||
double[:] voxel_size | ||
double[3] inv_voxel_size | ||
|
||
|
||
ctypedef int (*func_ptr)(double* point, | ||
double* direction, | ||
ProbabilisticTrackingParameters, | ||
PmfGen) noexcept nogil | ||
|
||
cpdef list generate_tractogram(double[:,::1] seed_positions, | ||
double[:,::1] seed_directions, | ||
StoppingCriterion sc, | ||
ProbabilisticTrackingParameters params, | ||
PmfGen pmf_gen) | ||
|
||
|
||
cdef int generate_tractogram_c(double[:,::1] seed_positions, | ||
double[:,::1] seed_directions, | ||
int nbr_seeds, | ||
StoppingCriterion sc, | ||
ProbabilisticTrackingParameters params, | ||
PmfGen pmf_gen, | ||
func_ptr traker, | ||
double[:,:,:] streamlines, | ||
double[:] status) | ||
|
||
|
||
cdef int generate_local_streamline(double* seed, | ||
double* position, | ||
double* stream, | ||
func_ptr tracker, | ||
# sc_ptr stopping_criterion, | ||
# pmf_ptr pmf_gen, | ||
StoppingCriterion sc, | ||
ProbabilisticTrackingParameters params, | ||
PmfGen pmf_gen) noexcept nogil | ||
|
||
cdef int trilinear_interpolate4d_c(double[:, :, :, :] data, | ||
double* point, | ||
double* result) noexcept nogil | ||
|
||
cdef int get_pmf(double* pmf, | ||
double* point, | ||
PmfGen pmf_gen, | ||
double pmf_threshold, | ||
int pmf_len) noexcept nogil | ||
|
||
|
||
cdef class ProbabilisticTrackingParameters(TrackingParameters): | ||
cdef: | ||
double cos_similarity | ||
double pmf_threshold | ||
#PmfGen pmf_gen | ||
int pmf_len | ||
double[:, :] vertices | ||
|
||
|
||
cdef int probabilistic_tracker(double* point, | ||
double* direction, | ||
ProbabilisticTrackingParameters params, | ||
PmfGen pmf_gen) noexcept nogil | ||
|
||
cdef class DeterministicTrackingParameters(ProbabilisticTrackingParameters): | ||
pass | ||
|
||
|
||
cdef int deterministic_maximum_tracker(double* point, | ||
double* direction, | ||
DeterministicTrackingParameters params, | ||
PmfGen pmf_gen,) | ||
|
||
cdef class ParallelTransportTrackingParameters(ProbabilisticTrackingParameters): | ||
cdef: | ||
double angular_separation | ||
double data_support_exponent | ||
double[3][3] frame | ||
double k1 | ||
double k2 | ||
double k_small | ||
double last_val | ||
double last_val_cand | ||
double max_angle | ||
double max_curvature | ||
double[3] position | ||
int probe_count | ||
double probe_length | ||
double probe_normalizer | ||
int probe_quality | ||
double probe_radius | ||
double probe_step_size | ||
double[9] propagator | ||
int rejection_sampling_max_try | ||
int rejection_sampling_nbr_sample | ||
|
||
|
||
cdef int parallel_transport_tracker(double* point, | ||
double* direction, | ||
ParallelTransportTrackingParameters params, | ||
PmfGen pmf_gen) |
Oops, something went wrong.