Skip to content

Update derivation of reactivity regions #79

@robbwh

Description

@robbwh

Currently the derivation of ASL reactivity regions is a long list: ~300 lines of code and doesn't include all brain regions.

asl.reac.grey.matter.hct <- 100 * (asl.chall.grey.matter.hct - asl.rest.grey.matter.hct) / asl.rest.grey.matter.hct / asl.3t.change.etco2

These 300 lines could be simplified into this code block:

for (rest_var in asl_rest_variables) {
  # Construct the corresponding chall and reac variable names
  chall_var <- gsub("asl.rest", "asl.chall", rest_var)
  reac_var <- gsub("asl.rest", "asl.reac", rest_var)
  # Calculate the reac variable
  data[[reac_var]] <- 100 * (data[[chall_var]] - data[[rest_var]]) / data[[rest_var]] / data[["asl.3t.change.etco2"]]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions