Skip to content

Commit

Permalink
Updated to keep in sync with image_vector/outliers.m
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Petre committed Oct 29, 2024
1 parent 329ea7a commit a3beac4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Binary file modified nipype/canlabCore/__pycache__/preproc.cpython-39.pyc
Binary file not shown.
12 changes: 10 additions & 2 deletions nipype/canlabCore/preproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
BaseInterfaceInputSpec,
File,
)
from traits.api import List, Bool
from traits.api import List, Bool, Float
import os
from string import Template

Expand All @@ -19,6 +19,10 @@ class OutliersInputSpec(BaseInterfaceInputSpec):
desc="Indices of movement_file corresponding to rot_x, rot_y, rot_z, trans_x, trans_y, trans_z, in that order")
movement_radians = Bool(default_value=True, usedefault=True,
desc="Are rotations specified in radians?")
fd_thresh = Float(-1, usedefault=True,
desc="Threshold in mm for determining whether \
framewise displacement is high enough to censor. Default is \
set by image_vector/outliers.m")
out_file = File('outliers.csv', usedefault=True,
desc="File indicate indices of volume to censor")

Expand Down Expand Up @@ -67,6 +71,7 @@ def _run_interface(self, runtime):
movement_file=self.inputs.movement_file,
movement_order=self.inputs.movement_order,
movement_radians=self.inputs.movement_radians,
fd_thresh=self.inputs.fd_thresh,
out_file=self.inputs.out_file)
# This is your MATLAB code template
script = Template(
Expand All @@ -80,7 +85,10 @@ def _run_interface(self, runtime):
if strcmp('$movement_radians','False')
fd(:,1:3) = pi/180*fd(:,1:3);
end
varargin={'fd',fd};
varargin=[varargin, {'fd',fd}];
end
if $fd_thresh > 0
varargin=[varargin, {'fd_thresh', $fd_thresh}];
end
[~,~,outlier_tables] = outliers(fmri_data(in_file), varargin{:});
outlier_ind = find(any(outlier_tables.outlier_regressor_matrix_corr,2))
Expand Down

0 comments on commit a3beac4

Please sign in to comment.