Skip to content

Commit

Permalink
Merge 8c42a39 into c8b5d66
Browse files Browse the repository at this point in the history
  • Loading branch information
rutgerfick committed May 11, 2020
2 parents c8b5d66 + 8c42a39 commit ba79a93
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dmipy/tissue_response/three_tissue_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ def three_tissue_response_dhollander16(
SDM = signal_decay_metric(acquisition_scheme, data)

# Make Mask
b0_mask, mask = median_otsu(data, median_radius=2, numpass=1)
b0_mask, mask = median_otsu(
input_volume=data,
vol_idx=np.where(acquisition_scheme.b0_mask)[0],
median_radius=4, numpass=4) # based on dipy default
gtab = gtab_dmipy2dipy(acquisition_scheme)
tenmod = dti.TensorModel(gtab)
tenfit = tenmod.fit(b0_mask)
Expand Down
10 changes: 8 additions & 2 deletions dmipy/tissue_response/white_matter_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ def white_matter_response_tournier07(

if data.ndim == 4:
# calculate brain mask on 4D data (x, y, z, DWI)
b0_mask, mask = median_otsu(data, 2, 1)
b0_mask, mask = median_otsu(
input_volume=data,
vol_idx=np.where(acquisition_scheme.b0_mask)[0],
median_radius=4, numpass=4) # based on dipy default
# needs to be eroded 3 times.
mask_eroded = binary_erosion(mask, iterations=3)
data_to_fit = data[mask_eroded]
Expand Down Expand Up @@ -153,7 +156,10 @@ def white_matter_response_tournier13(

if data.ndim == 4:
# calculate brain mask on 4D data (x, y, z, DWI)
b0_mask, mask = median_otsu(data, 2, 1)
b0_mask, mask = median_otsu(
input_volume=data,
vol_idx=np.where(acquisition_scheme.b0_mask)[0],
median_radius=4, numpass=4) # based on dipy default
# needs to be eroded 3 times.
mask_eroded = binary_erosion(mask, iterations=3)
data_to_fit = data[mask_eroded]
Expand Down

0 comments on commit ba79a93

Please sign in to comment.