Skip to content

Latest commit

 

History

History
1025 lines (781 loc) · 29.3 KB

compute.md

File metadata and controls

1025 lines (781 loc) · 29.3 KB

COMPUTE transformations

name dense only operation logical operation pybids implemented bids-matlab implemented
Add False False False True
And False True True True
Constant False False False True
Convolve True False True False
Deconvolve True False False False
Demean False False True False
Derivative False False False False
Divide False False False True
Lag True False True False
Mean False False False True
Multiply False False False True
Not False True True True
Or False True True True
Orthogonalize False False True False
PCA True False False False
Power False False False True
Product False False True True
Scale False False True True
StdDev False False False True
Subtract False False False True
Sum False False True True
Threshold False False True True
Variance False False False False

Add

Add coerce value

input

onset duration trial_type intensity
2 2 VisMot 2
4 2 VisStat -4

transformation

{
    "Description": "Add coerce value",
    "Instruction": [
        {
            "Name": "Add",
            "Input": "onset",
            "Value": "3"
        }
    ]
}

output

onset duration trial_type intensity
5 2 VisMot 2
7 2 VisStat -4

Add to specific rows

input

onset duration repetition familiarity trial_type response_time
2 2 1 Famous face Face 1.5
4 2 1 Unfamiliar face Face 2
5 2 2 Famous face Face 1.56
8 2 2 Unfamiliar face Face 2.1

transformation

{
    "Description": "Add to specific rows",
    "Instruction": [
        {
            "Name": "Add",
            "Input": "onset",
            "Query": "familiarity == Famous face",
            "Value": 3
        }
    ]
}

output

onset duration repetition familiarity trial_type response_time
5 2 1 Famous face Face 1.5
4 2 1 Unfamiliar face Face 2
8 2 2 Famous face Face 1.56
8 2 2 Unfamiliar face Face 2.1

And

And nan

input

sex_m handedness sex age_gt_twenty age
1 right M 1 21
1 left M 0 18
0 nan F 1 46
0 left F 0 10
0 right F 0 nan

transformation

{
    "Description": "And nan",
    "Instruction": [
        {
            "Name": "And",
            "Input": [
                "handedness",
                "age"
            ],
            "Output": "age_or_hand"
        }
    ]
}

output

sex_m handedness sex age_gt_twenty age age_or_hand
1 right M 1 21 1
1 left M 0 18 1
0 nan F 1 46 0
0 left F 0 10 1
0 right F 0 nan 0

And

input

sex_m handedness sex age_gt_twenty age
1 right M 1 21
1 left M 0 18
0 nan F 1 46
0 left F 0 10
0 right F 0 nan

transformation

{
    "Description": "And",
    "Instruction": [
        {
            "Name": "And",
            "Input": [
                "sex_m",
                "age_gt_twenty"
            ],
            "Output": "men_gt_twenty"
        }
    ]
}

output

sex_m handedness sex age_gt_twenty age men_gt_twenty
1 right M 1 21 1
1 left M 0 18 0
0 nan F 1 46 0
0 left F 0 10 0
0 right F 0 nan 0

Constant

Constant with value

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Constant with value",
    "Instruction": [
        {
            "Name": "Constant",
            "Value": 2,
            "Output": "cst"
        }
    ]
}

output

onset duration trial_type to_threshold cst
2 2 VisMot 1 2
4 2 VisStat 2 2
6 2 VisMot -1 2
8 2 VisStat -2 2

Constant basic

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Constant basic",
    "Instruction": [
        {
            "Name": "Constant",
            "Output": "cst"
        }
    ]
}

output

onset duration trial_type to_threshold cst
2 2 VisMot 1 1
4 2 VisStat 2 1
6 2 VisMot -1 1
8 2 VisStat -2 1

Convolve

Deconvolve

Demean

Derivative

Divide

Divide several inputs

input

onset duration trial_type intensity
2 2 VisMot 2
4 2 VisStat -4

transformation

{
    "Description": "Divide several inputs",
    "Instruction": [
        {
            "Name": "Divide",
            "Input": [
                "onset",
                "duration"
            ],
            "Value": 2
        }
    ]
}

output

onset duration trial_type intensity
1 1 VisMot 2
2 1 VisStat -4

Lag

Mean

Multiply

Not

Not

input

sex_m handedness sex age_gt_twenty age
1 right M 1 21
1 left M 0 18
0 nan F 1 46
0 left F 0 10
0 right F 0 nan

transformation

{
    "Description": "Not",
    "Instruction": [
        {
            "Name": "Not",
            "Input": [
                "age_gt_twenty"
            ],
            "Output": "ager_lt_twenty"
        }
    ]
}

output

sex_m handedness sex age_gt_twenty age ager_lt_twenty
1 right M 1 21 0
1 left M 0 18 1
0 nan F 1 46 0
0 left F 0 10 1
0 right F 0 nan 1

Or

Or

input

sex_m handedness sex age_gt_twenty age
1 right M 1 21
1 left M 0 18
0 nan F 1 46
0 left F 0 10
0 right F 0 nan

transformation

{
    "Description": "Or",
    "Instruction": [
        {
            "Name": "Or",
            "Input": [
                "sex_m",
                "age_gt_twenty"
            ],
            "Output": "men_or_gt_twenty"
        }
    ]
}

output

sex_m handedness sex age_gt_twenty age men_or_gt_twenty
1 right M 1 21 1
1 left M 0 18 1
0 nan F 1 46 1
0 left F 0 10 0
0 right F 0 nan 0

Orthogonalize

PCA

Power

Power

input

onset duration trial_type intensity
2 2 VisMot 2
4 2 VisStat -4

transformation

{
    "Description": "Power",
    "Instruction": [
        {
            "Name": "Power",
            "Input": "intensity",
            "Value": 2
        }
    ]
}

output

onset duration trial_type intensity
2 2 VisMot 4
4 2 VisStat 16

Power with output

input

onset duration trial_type intensity
2 2 VisMot 2
4 2 VisStat -4

transformation

{
    "Description": "Power with output",
    "Instruction": [
        {
            "Name": "Power",
            "Input": "intensity",
            "Value": 3,
            "Output": "intensity_cubed"
        }
    ]
}

output

onset duration trial_type intensity intensity_cubed
2 2 VisMot 2 8
4 2 VisStat -4 -64

Product

Product

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Product",
    "Instruction": [
        {
            "Name": "Product",
            "Input": [
                "onset",
                "duration"
            ],
            "Output": "onset_times_duration"
        }
    ]
}

output

onset duration trial_type to_threshold onset_times_duration
2 2 VisMot 1 4
4 2 VisStat 2 8
6 2 VisMot -1 12
8 2 VisStat -2 16

Scale

Scale all options

input

sex_m handedness sex age_gt_twenty age
1 right M 1 21
1 left M 0 18
0 nan F 1 46
0 left F 0 10
0 right F 0 nan

transformation

{
    "Description": "Scale all options",
    "Instruction": [
        {
            "Name": "Scale",
            "Input": [
                "age"
            ],
            "Demean": true,
            "Rescale": true,
            "ReplaceNa": "off",
            "Output": [
                "age_demeaned_centered"
            ]
        }
    ]
}

output

sex_m handedness sex age_gt_twenty age age_demeaned_centered
1 right M 1 21 -0.176929
1 left M 0 18 -0.369943
0 nan F 1 46 1.43152
0 left F 0 10 -0.884645
0 right F 0 nan nan

Scale

input

sex_m handedness sex age_gt_twenty age
1 right M 1 21
1 left M 0 18
0 nan F 1 46
0 left F 0 10
0 right F 0 nan

transformation

{
    "Description": "Scale",
    "Instruction": [
        {
            "Name": "Scale",
            "Input": [
                "age"
            ]
        }
    ]
}

output

sex_m handedness sex age_gt_twenty age
1 right M 1 -0.176929
1 left M 0 -0.369943
0 nan F 1 1.43152
0 left F 0 -0.884645
0 right F 0 nan

StdDev

Subtract

Subtract

input

onset duration trial_type intensity
2 2 VisMot 2
4 2 VisStat -4

transformation

{
    "Description": "Subtract",
    "Instruction": [
        {
            "Name": "Subtract",
            "Input": "onset",
            "Value": 3
        }
    ]
}

output

onset duration trial_type intensity
-1 2 VisMot 2
1 2 VisStat -4

Subtract to specific rows

input

onset duration repetition familiarity trial_type response_time
2 2 1 Famous face Face 1.5
4 2 1 Unfamiliar face Face 2
5 2 2 Famous face Face 1.56
8 2 2 Unfamiliar face Face 2.1

transformation

{
    "Description": "Subtract to specific rows",
    "Instruction": [
        {
            "Name": "Subtract",
            "Input": "onset",
            "Query": "response_time < 2",
            "Value": 1
        }
    ]
}

output

onset duration repetition familiarity trial_type response_time
1 2 1 Famous face Face 1.5
4 2 1 Unfamiliar face Face 2
4 2 2 Famous face Face 1.56
8 2 2 Unfamiliar face Face 2.1

Sum

Sum

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Sum",
    "Instruction": [
        {
            "Name": "Sum",
            "Input": [
                "onset",
                "duration"
            ],
            "Output": "onset_plus_duration"
        }
    ]
}

output

onset duration trial_type to_threshold onset_plus_duration
2 2 VisMot 1 4
4 2 VisStat 2 6
6 2 VisMot -1 8
8 2 VisStat -2 10

Sum with weights

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Sum with weights",
    "Instruction": [
        {
            "Name": "Sum",
            "Input": [
                "onset",
                "duration"
            ],
            "Weights": [
                2,
                1
            ],
            "Output": "onset_plus_duration_with_weight"
        }
    ]
}

output

onset duration trial_type to_threshold onset_plus_duration_with_weight
2 2 VisMot 1 6
4 2 VisStat 2 10
6 2 VisMot -1 14
8 2 VisStat -2 18

Threshold

Threshold binarize above singed

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Threshold binarize above singed",
    "Instruction": [
        {
            "Name": "Threshold",
            "Input": "to_threshold",
            "Threshold": 1,
            "Binarize": true,
            "Above": true,
            "Signed": false
        }
    ]
}

output

onset duration trial_type to_threshold
2 2 VisMot 0
4 2 VisStat 1
6 2 VisMot 0
8 2 VisStat 1

Threshold with threshold specified

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Threshold with threshold specified",
    "Instruction": [
        {
            "Name": "Threshold",
            "Input": "to_threshold",
            "Threshold": 1
        }
    ]
}

output

onset duration trial_type to_threshold
2 2 VisMot 0
4 2 VisStat 2
6 2 VisMot 0
8 2 VisStat 0

Threshold with output

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Threshold with output",
    "Instruction": [
        {
            "Name": "Threshold",
            "Input": "to_threshold",
            "Output": "tmp"
        }
    ]
}

output

onset duration trial_type to_threshold tmp
2 2 VisMot 1 1
4 2 VisStat 2 2
6 2 VisMot -1 0
8 2 VisStat -2 0

Threshold binarize above

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Threshold binarize above",
    "Instruction": [
        {
            "Name": "Threshold",
            "Input": "to_threshold",
            "Binarize": true,
            "Above": false
        }
    ]
}

output

onset duration trial_type to_threshold
2 2 VisMot 0
4 2 VisStat 0
6 2 VisMot 1
8 2 VisStat 1

Threshold binarize

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Threshold binarize",
    "Instruction": [
        {
            "Name": "Threshold",
            "Input": "to_threshold",
            "Binarize": true
        }
    ]
}

output

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 1
6 2 VisMot 0
8 2 VisStat 0

Threshold

input

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot -1
8 2 VisStat -2

transformation

{
    "Description": "Threshold",
    "Instruction": [
        {
            "Name": "Threshold",
            "Input": "to_threshold"
        }
    ]
}

output

onset duration trial_type to_threshold
2 2 VisMot 1
4 2 VisStat 2
6 2 VisMot 0
8 2 VisStat 0

Variance