Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
pausz committed Aug 19, 2020
1 parent a3aaca8 commit 6c0be5f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions post_fmriprep.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@
# import neuroimaging packages
import nilearn.image as nl_img
import nilearn.masking as nl_mask
import nibabel as nib

# Start tracking execution time
start_time = time.time()
Expand Down Expand Up @@ -357,7 +356,7 @@ def fmripop_remove_confounds(args):
*xyz, time_frames = temp_img.shape
data = np.zeros(temp_img.shape, dtype=this_dtype)

if args.add_mean_img:
if args.add_orig_mean_img:
# Compute the mean of the images (in the time dimension of 4th dimension)
orig_mean_img = nl_img.mean_img(args.niipath)
# Smooth mean image
Expand Down Expand Up @@ -504,7 +503,7 @@ def fmripop_check_args(args):
Checks input arguments and sets other dependent arguments accrodingly
"""

# Check if we want to regress framwise displacement
# Check if we want to regress framwise displacement or not
if args.fmw_disp_th is not None:
# Add it to the default confound list
args.confound_list.append(fd_label)
Expand Down Expand Up @@ -550,7 +549,6 @@ def fmripop_visual_debug(path_to_file, args):
# Extract time series from seed regions
time_series = masker.fit_transform(path_to_file)


import matplotlib.pyplot as plt

for this_time_series, this_label in zip(time_series.T, dmn_labels):
Expand Down Expand Up @@ -583,8 +581,8 @@ def fmripop_visual_debug(path_to_file, args):
if args.scrubbing:
out_img = fmripop_scrub_data(out_img, args, params_dict)

#if np.array(args.fwhm).sum() > 0.0: # If fwhm is not zero, performs smoothing
# out_img = fmripop_smooth_data(out_img, args.fwhm) # NOTE: This here is a hack because this version (0.5.0)of nilearn does not really support a ndarray for fwhm
if np.array(args.fwhm).sum() > 0.0: # If fwhm is not zero, performs smoothing
out_img = fmripop_smooth_data(out_img, args.fwhm)

# Save output image and parameters used in this script
params_dict = fmripop_save_imgdata(args, out_img, params_dict, output_tag=args.scrub_tag)
Expand Down

0 comments on commit 6c0be5f

Please sign in to comment.