Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions nidmresults/objects/contrast.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ def export(self, nidm_version, export_dir):
# Create Contrast Explained Mean Square Map as fstat<num>.nii.gz
# multiplied by sigmasquareds.nii.gz and save it in export_dir
fstat_img = nib.load(self.stat_file)
fstat = fstat_img.get_data()
fstat = fstat_img.get_fdata()

sigma_sq_img = nib.load(self.sigma_sq_file)
sigma_sq = sigma_sq_img.get_data()
sigma_sq = sigma_sq_img.get_fdata()

expl_mean_sq = nib.Nifti1Image(
fstat*sigma_sq, fstat_img.get_qform())
Expand Down Expand Up @@ -320,7 +320,7 @@ def __init__(self, contrast_num, filepath, is_variance, coord_space,

# Create standard error map from contrast variance map
var_cope_img = nib.load(self.file)
contrast_variance = var_cope_img.get_data()
contrast_variance = var_cope_img.get_fdata()

standard_error_img = nib.Nifti1Image(np.sqrt(contrast_variance),
var_cope_img.get_qform())
Expand Down
4 changes: 2 additions & 2 deletions nidmresults/objects/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def __init__(self, coordinate_system, nifti_file=None, vox_to_world=None,
(units is None) and \
(nifti_file is not None):
thresImg = nib.load(nifti_file)
thresImgHdr = thresImg.get_header()
thresImgHdr = thresImg.header

numdim = len(thresImg.shape)
dimensions = np.asarray(thresImg.shape)
Expand Down Expand Up @@ -298,7 +298,7 @@ def is_nifti(self):

def get_sha_sum(self, nifti_file):
nifti_img = nib.load(nifti_file)
data = nifti_img.get_data()
data = nifti_img.get_fdata()
# Fix needed as in https://github.com/pymc-devs/pymc/issues/327
if not data.flags["C_CONTIGUOUS"]:
data = np.ascontiguousarray(data)
Expand Down
4 changes: 2 additions & 2 deletions nidmresults/objects/modelfitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,11 @@ def export(self, nidm_version, export_dir):
if self.masked_median is None:
grand_mean_file = self.file.path
grand_mean_img = nib.load(grand_mean_file)
grand_mean_data = grand_mean_img.get_data()
grand_mean_data = grand_mean_img.get_fdata()
grand_mean_data = np.ndarray.flatten(grand_mean_data)

mask_img = nib.load(self.mask_file)
mask_data = mask_img.get_data()
mask_data = mask_img.get_fdata()
mask_data = np.ndarray.flatten(mask_data)

grand_mean_data_in_mask = grand_mean_data[mask_data > 0]
Expand Down