Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upParallelize affine registration #1612
Conversation
RicciWoo
added some commits
Aug 8, 2018
This comment has been minimized.
This comment has been minimized.
codecov-io
commented
Aug 9, 2018
•
Codecov Report
@@ Coverage Diff @@
## master #1612 +/- ##
==========================================
- Coverage 87.34% 87.32% -0.02%
==========================================
Files 246 246
Lines 31811 31812 +1
Branches 3451 3451
==========================================
- Hits 27785 27781 -4
- Misses 3204 3207 +3
- Partials 822 824 +2
Continue to review full report at Codecov.
|
skoudoro
added
the
gsoc2018
label
Aug 21, 2018
skoudoro
added
the
state: needs code review
label
Sep 15, 2018
Borda
suggested changes
Jan 17, 2019
It is a nice code simplification |
@@ -440,7 +440,7 @@ def transform_inverse(self, image, interp='linear', image_grid2world=None, | |||
|
|||
class MutualInformationMetric(object): | |||
|
|||
def __init__(self, nbins=32, sampling_proportion=None): | |||
def __init__(self, nbins=32, sampling_proportion=None, num_threads=None): |
This comment has been minimized.
This comment has been minimized.
Borda
Jan 17, 2019
Contributor
sklean
rather use -1 as unlimited/default value so the type check from doc does not raise an issue
the buffer in which to store the flags indicating whether the sample | ||
point lies inside (=1) or outside (=0) the image grid | ||
num_threads : int | ||
Number of threads. If None (default) then all available threads |
This comment has been minimized.
This comment has been minimized.
|
||
for i in range(nrows): | ||
for j in range(ncols): | ||
inside[k, i, j] = 1 |
This comment has been minimized.
This comment has been minimized.
Borda
Jan 17, 2019
Contributor
there should be a check that k
is really in the range of nslices
as the k
moved to be input parameter and not determined inside the function
int all_cores = openmp.omp_get_num_procs() | ||
int threads_to_use = -1 | ||
|
||
if num_threads != 0: |
This comment has been minimized.
This comment has been minimized.
double[:] img_spacing, | ||
double[:, :] sample_points, | ||
floating[:, :] out, int[:] inside): | ||
int i, j, k, in_flag, p |
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
RicciWoo commentedAug 9, 2018
Parallelize affine registration using prange and local function:
To specify number of threads: give num_threads to MutualInformationMetric