Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix afni contrast bool #266

Merged
merged 4 commits into from
Nov 21, 2020

Conversation

Shotgunosine
Copy link
Collaborator

closes #265

@pep8speaks
Copy link

pep8speaks commented Nov 20, 2020

Hello @Shotgunosine, Thank you for updating!

Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, pip install flake8 and then run flake8 fitlins.

Comment last updated at 2020-11-20 23:28:02 UTC

Copy link
Collaborator

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No obvious problems with the logic, but here are some simplifications.

fitlins/interfaces/afni.py Outdated Show resolved Hide resolved
fitlins/interfaces/afni.py Outdated Show resolved Hide resolved
fitlins/interfaces/afni.py Outdated Show resolved Hide resolved
fitlins/interfaces/afni.py Outdated Show resolved Hide resolved
Co-authored-by: Chris Markiewicz <effigies@gmail.com>
@effigies
Copy link
Collaborator

Tests passing. Is this branch working for you? Do you have a test model snippet that can exercise this?

@Shotgunosine
Copy link
Collaborator Author

Double checking the changes now.

here's a slightly tweaked ds003_model001 that would provoke the bug if it was still present:

{
  "Name": "ds003_model001",
  "Description": "",
  "Input": {
    "task": "rhymejudgment"
  },
  "Steps": [
    {
      "Level": "run",
      "Transformations": [
        {
          "Name": "Factor",
          "Input": [
            "trial_type"
          ]
        },
        {
          "Name": "Convolve",
          "Input": ["trial_type.word", "trial_type.pseudoword"],
          "Model": "spm"
        }
      ],
      "Model": {
        "X": [
          "trial_type.word",
          "trial_type.pseudoword",
          "framewise_displacement",
          "trans_x", "trans_y", "trans_z", "rot_x", "rot_y", "rot_z",
          "a_comp_cor_00", "a_comp_cor_01", "a_comp_cor_02",
          "a_comp_cor_03", "a_comp_cor_04", "a_comp_cor_05"
        ]
      },
      "DummyContrasts": {
        "Conditions": ["trial_type.word", "trial_type.pseudoword"],
        "Type": "t"
        },
      "Contrasts": [
        {
          "Name": "word_gt_pseudo",
          "ConditionList": [
            "trial_type.word",
            "trial_type.pseudoword"
          ],
          "Weights": [1, -1],
          "Type": "t"
        },
        {
          "Name": "word_gt_pseudo_rev",
          "ConditionList": [
            "trial_type.word",
            "trial_type.pseudoword"
          ],
          "Weights": [-1, 1],
          "Type": "t"
        },
        {
          "Name": "task_vs_baseline",
          "ConditionList": [
            "trial_type.word",
            "trial_type.pseudoword"
          ],
          "Weights": [0.5, 0.5],
          "Type": "t"
        }
      ]
    },
    {
      "Level": "dataset",
      "DummyContrasts": {
        "Conditions": ["word_gt_pseudo", "task_vs_baseline"],
        "Type": "t"
        },
      "Contrasts":[
        {
          "Name": "any_words",
          "ConditionList": [
            "trial_type.word",
            "trial_type.pseudoword"
          ],
          "Weights": [
            [1, 0],
            [0, 1]
          ],
          "Type": "F"
        }
      ]
    }
  ]
}

As for that line that's not getting tested, I don't think that case should normally come up, but I didn't want the counts to get out of wack if it did come up for some reason.

@Shotgunosine
Copy link
Collaborator Author

It's working locally for me, I'd be ok if you wanted to go ahead and merge it.

@effigies
Copy link
Collaborator

Sounds good. Looks like we're covering the cases. Would be good to set up more rigorous tests when we have time.

@effigies effigies merged commit 49a9f10 into poldracklab:master Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AFNI estimator fails if contrasts have nested names
3 participants