From 7fdc70d59e7a23edda61271415a8082f8333259e Mon Sep 17 00:00:00 2001 From: Nathan Perkins Date: Fri, 6 Feb 2015 21:25:28 -0500 Subject: [PATCH 1/3] Remove constant column from motion regressor Remove constant column in the motion regressor, caused singular matrix during GLM. --- examples/rsfmri_vol_surface_preprocessing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rsfmri_vol_surface_preprocessing.py b/examples/rsfmri_vol_surface_preprocessing.py index 4f5bb226bb..594e2830a7 100644 --- a/examples/rsfmri_vol_surface_preprocessing.py +++ b/examples/rsfmri_vol_surface_preprocessing.py @@ -230,7 +230,7 @@ def build_filter1(motion_params, comp_norm, outliers, detrend_poly=None): out_params = np.hstack((out_params, outlier_vector)) if detrend_poly: timepoints = out_params.shape[0] - X = np.ones((timepoints, 1)) + X = np.empty((timepoints, 0)) for i in range(detrend_poly): X = np.hstack((X, legendre( i + 1)(np.linspace(-1, 1, timepoints))[:, None])) From e371323509f6a0b6a6be900b0953fd0d5a6febef Mon Sep 17 00:00:00 2001 From: Nathan Perkins Date: Tue, 17 Feb 2015 21:08:26 -0500 Subject: [PATCH 2/3] Remove constant column from motion regressor in resting state example --- examples/rsfmri_vol_surface_preprocessing_nipy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/rsfmri_vol_surface_preprocessing_nipy.py b/examples/rsfmri_vol_surface_preprocessing_nipy.py index aaf535bd56..dddd1d6d65 100644 --- a/examples/rsfmri_vol_surface_preprocessing_nipy.py +++ b/examples/rsfmri_vol_surface_preprocessing_nipy.py @@ -217,7 +217,7 @@ def build_filter1(motion_params, comp_norm, outliers, detrend_poly=None): out_params = np.hstack((out_params, outlier_vector)) if detrend_poly: timepoints = out_params.shape[0] - X = np.ones((timepoints, 1)) + X = np.empty((timepoints, 0)) for i in range(detrend_poly): X = np.hstack((X, legendre( i + 1)(np.linspace(-1, 1, timepoints))[:, None])) From 0f03d756076101b29ad3b54283d0a33645c6165d Mon Sep 17 00:00:00 2001 From: Nathan Perkins Date: Tue, 17 Feb 2015 21:15:59 -0500 Subject: [PATCH 3/3] Change resting state example scripts to use linear interpolation. --- examples/rsfmri_vol_surface_preprocessing.py | 4 ++-- examples/rsfmri_vol_surface_preprocessing_nipy.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/rsfmri_vol_surface_preprocessing.py b/examples/rsfmri_vol_surface_preprocessing.py index 594e2830a7..b930a588d6 100644 --- a/examples/rsfmri_vol_surface_preprocessing.py +++ b/examples/rsfmri_vol_surface_preprocessing.py @@ -542,7 +542,7 @@ def create_reg_workflow(name='registration'): warpmean = Node(ants.ApplyTransforms(), name='warpmean') warpmean.inputs.input_image_type = 3 - warpmean.inputs.interpolation = 'BSpline' + warpmean.inputs.interpolation = 'Linear' warpmean.inputs.invert_transform_flags = [False, False] warpmean.inputs.terminal_output = 'file' warpmean.inputs.args = '--float' @@ -771,7 +771,7 @@ def merge_files(in1, in2): warpall = MapNode(ants.ApplyTransforms(), iterfield=['input_image'], name='warpall') warpall.inputs.input_image_type = 3 - warpall.inputs.interpolation = 'BSpline' + warpall.inputs.interpolation = 'Linear' warpall.inputs.invert_transform_flags = [False, False] warpall.inputs.terminal_output = 'file' warpall.inputs.reference_image = target_file diff --git a/examples/rsfmri_vol_surface_preprocessing_nipy.py b/examples/rsfmri_vol_surface_preprocessing_nipy.py index dddd1d6d65..355798a169 100644 --- a/examples/rsfmri_vol_surface_preprocessing_nipy.py +++ b/examples/rsfmri_vol_surface_preprocessing_nipy.py @@ -526,7 +526,7 @@ def create_reg_workflow(name='registration'): """ warpmean = Node(ants.ApplyTransforms(), name='warpmean') warpmean.inputs.input_image_type = 3 - warpmean.inputs.interpolation = 'BSpline' + warpmean.inputs.interpolation = 'Linear' warpmean.inputs.invert_transform_flags = [False, False] warpmean.inputs.terminal_output = 'file' warpmean.inputs.args = '--float' @@ -749,7 +749,7 @@ def merge_files(in1, in2): warpall = MapNode(ants.ApplyTransforms(), iterfield=['input_image'], name='warpall') warpall.inputs.input_image_type = 3 - warpall.inputs.interpolation = 'BSpline' + warpall.inputs.interpolation = 'Linear' warpall.inputs.invert_transform_flags = [False, False] warpall.inputs.terminal_output = 'file' warpall.inputs.reference_image = target_file