14
14
##############################################################
15
15
16
16
17
- def selectcomps2use (comptable , decide_comps ):
17
+ def selectcomps2use (component_table , decide_comps ):
18
18
"""Get a list of component numbers that fit the classification types in ``decide_comps``.
19
19
20
20
Parameters
21
21
----------
22
- comptable : :obj:`~pandas.DataFrame`
23
- Only uses the component_table in this object
22
+ component_table : :obj:`~pandas.DataFrame`
23
+ The component_table with metrics and labels for each ICA component
24
24
decide_comps : :obj:`str` or :obj:`list[str]` or :obj:`list[int]`
25
25
This is string or a list of strings describing what classifications
26
26
of components to operate on, using default or intermediate_classification
@@ -34,31 +34,31 @@ def selectcomps2use(comptable, decide_comps):
34
34
comps2use : :obj:`list[int]`
35
35
A list of component indices with classifications included in decide_comps
36
36
"""
37
- if "classification" not in comptable :
38
- raise ValueError ("comptable needs a 'classification' column to run selectcomps2use" )
37
+ if "classification" not in component_table :
38
+ raise ValueError ("component_table needs a 'classification' column to run selectcomps2use" )
39
39
40
40
if isinstance (decide_comps , (str , int )):
41
41
decide_comps = [decide_comps ]
42
42
43
43
if isinstance (decide_comps , list ) and (decide_comps [0 ] == "all" ):
44
44
# All components with any string in the classification field are set to True
45
- comps2use = list (range (comptable .shape [0 ]))
45
+ comps2use = list (range (component_table .shape [0 ]))
46
46
47
47
elif isinstance (decide_comps , list ) and all (isinstance (elem , str ) for elem in decide_comps ):
48
48
comps2use = []
49
49
for didx in range (len (decide_comps )):
50
- newcomps2use = comptable .index [
51
- comptable ["classification" ] == decide_comps [didx ]
50
+ newcomps2use = component_table .index [
51
+ component_table ["classification" ] == decide_comps [didx ]
52
52
].tolist ()
53
53
comps2use = list (set (comps2use + newcomps2use ))
54
54
55
55
elif isinstance (decide_comps , list ) and all (isinstance (elem , int ) for elem in decide_comps ):
56
56
# decide_comps is already a list of indices
57
- if len (comptable ) <= max (decide_comps ):
57
+ if len (component_table ) <= max (decide_comps ):
58
58
raise ValueError (
59
59
"decide_comps for selectcomps2use is selecting for a component with index"
60
60
f"{ max (decide_comps )} (0 indexing) which is greater than the number "
61
- f"of components: { len (comptable )} "
61
+ f"of components: { len (component_table )} "
62
62
)
63
63
elif min (decide_comps ) < 0 :
64
64
raise ValueError (
@@ -100,8 +100,8 @@ def change_comptable_classifications(
100
100
Parameters
101
101
----------
102
102
selector : :obj:`tedana.selection.component_selector.ComponentSelector`
103
- The attributes used are component_table, component_status_table , and
104
- current_node_idx_
103
+ The attributes used are ``component_table_``, ``component_status_table_`` , and
104
+ `` current_node_idx_``
105
105
if_true, if_false : :obj:`str`
106
106
If the condition in this step is true or false, give the component
107
107
the label in this string. Options are 'accepted', 'rejected',
@@ -123,12 +123,12 @@ def change_comptable_classifications(
123
123
Returns
124
124
-------
125
125
selector : :obj:`tedana.selection.component_selector.ComponentSelector`
126
- component_table ["classifications"] will reflect any new
126
+ ``component_table_ ["classifications"]`` will reflect any new
127
127
classifications.
128
- component_status_table will have a new column titled
129
- "Node current_node_idx_" that is a copy of the updated classifications
128
+ ``component_status_table_`` will have a new column titled
129
+ "Node `` current_node_idx_`` " that is a copy of the updated classifications
130
130
column.
131
- component_table ["classification_tags"] will be updated to include any
131
+ ``component_table_ ["classification_tags"]`` will be updated to include any
132
132
new tags. Each tag should appear only once in the string and tags will
133
133
be separated by commas.
134
134
n_true, n_false : :obj:`int`
@@ -178,8 +178,8 @@ def comptable_classification_changer(
178
178
Parameters
179
179
----------
180
180
selector : :obj:`tedana.selection.component_selector.ComponentSelector`
181
- The attributes used are component_table, component_status_table , and
182
- current_node_idx_
181
+ The attributes used are ``component_table_``, ``component_status_table_`` , and
182
+ `` current_node_idx_``
183
183
boolstate : :obj:`bool`
184
184
Change classifications only for True or False components in
185
185
decision_boolean based on this variable
@@ -207,12 +207,12 @@ def comptable_classification_changer(
207
207
-------
208
208
selector : :obj:`tedana.selection.component_selector.ComponentSelector`
209
209
Operates on the True OR False components depending on boolstate
210
- component_table ["classifications"] will reflect any new
210
+ ``component_table_ ["classifications"]`` will reflect any new
211
211
classifications.
212
- component_status_table will have a new column titled
213
- "Node current_node_idx_" that is a copy of the updated classifications
212
+ ``component_status_table_`` will have a new column titled
213
+ "Node `` current_node_idx_`` " that is a copy of the updated classifications
214
214
column.
215
- component_table ["classification_tags"] will be updated to include any
215
+ component_table_ ["classification_tags"] will be updated to include any
216
216
new tags. Each tag should appear only once in the string and tags will
217
217
be separated by commas.
218
218
@@ -363,7 +363,7 @@ def log_decision_tree_step(
363
363
----------
364
364
function_name_idx : :obj:`str`
365
365
The name of the function that should be logged. By convention, this
366
- be "Step current_node_idx_: function_name"
366
+ be "Step `` current_node_idx_`` : function_name"
367
367
comps2use : :obj:`list[int]` or -1
368
368
A list of component indices that should be used by a function.
369
369
Only used to report no components found if empty and report
0 commit comments