Skip to content

Commit

Permalink
added --data_norm flag to the react script
Browse files Browse the repository at this point in the history
  • Loading branch information
ottaviadipasquale committed May 5, 2021
1 parent 83d13f5 commit 797188c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion react/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = '0.1.1'
__version__ = '0.1.2'
from . import utils
14 changes: 13 additions & 1 deletion script/react
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ def get_parsed_args():
help='If set, saves the Z-stats as `<out_react>_react_stage2_z.nii.gz`.'
)

parser.add_argument(
'--data_norm',
action='store_true',
help='If set, normalizes the input data of stage 2 to unit standard '
'deviation.'
)

parser.add_argument(
'--force',
action='store_true',
Expand Down Expand Up @@ -184,7 +191,12 @@ def main():
# Stage 2
logging.info('Initiating stage 2')

scaler_y = StandardScaler(with_mean=True, with_std=False)
dat_norm = False
if args.data_norm:
dat_norm = True
logging.info('Normalising input data of stage 2 since `--data_norm` '
'was specified')
scaler_y = StandardScaler(with_mean=True, with_std=dat_norm)
y = scaler_y.fit_transform(rsfmri.T)[:, mask_stage2]

scaler_x = StandardScaler(with_mean=True, with_std=True)
Expand Down

0 comments on commit 797188c

Please sign in to comment.