Skip to content

Commit

Permalink
tedpca CLI fix (#950)
Browse files Browse the repository at this point in the history
* tedpca changes

* Remove no-reduction option
  • Loading branch information
handwerkerd authored Jun 7, 2023
1 parent 9a3b83f commit 18e950d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion tedana/decomposition/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ def tedpca(
elif low_mem:
voxel_comp_weights, varex, varex_norm, comp_ts = low_mem_pca(data_z)
else:
# If algorithm is kundu or kundu-stablize component metrics
# are calculated without dimensionality estimation and
# reduction and then kundu identifies components that are
# to be accepted or rejected
ppca = PCA(copy=False, n_components=(n_vols - 1))
ppca.fit(data_z)
comp_ts = ppca.components_.T
Expand Down Expand Up @@ -392,7 +396,7 @@ def tedpca(
alg_str = algorithm
LGR.info(
f"Selected {comptable.shape[0]} components with {round(100*varex_norm.sum(),2)}% "
f"normalized variance explained using {alg_str} dimensionality detection"
f"normalized variance explained using {alg_str} dimensionality estimate"
)
comptable["classification"] = "accepted"
comptable["rationale"] = ""
Expand Down
7 changes: 4 additions & 3 deletions tedana/workflows/tedana.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ def _get_parser():
"in which case the specificed number of components will be "
"selected."
),
choices=["mdl", "kic", "aic"],
default="aic",
)
optional.add_argument(
Expand Down Expand Up @@ -383,10 +382,12 @@ def tedana_workflow(
accepts and rejects some distinct components compared to kundu.
Testing to better understand the effects of the differences is ongoing.
Default is 'kundu'.
tedpca : {'mdl', 'aic', 'kic', 'kundu', 'kundu-stabilize', float}, optional
tedpca : {'mdl', 'aic', 'kic', 'kundu', 'kundu-stabilize', float, int}, optional
Method with which to select components in TEDPCA.
If a float is provided, then it is assumed to represent percentage of variance
explained (0-1) to retain from PCA.
explained (0-1) to retain from PCA. If an int is provided, it will output
a fixed number of components defined by the integer between 1 and the
number of time points.
Default is 'aic'.
fixed_seed : :obj:`int`, optional
Value passed to ``mdp.numx_rand.seed()``.
Expand Down

0 comments on commit 18e950d

Please sign in to comment.