Skip to content

Commit

Permalink
[MAINT] update bids matlab (#1140)
Browse files Browse the repository at this point in the history
* [DATALAD] Recorded changes

* rm extra if block

* adapt models

* fix tests
  • Loading branch information
Remi-Gau authored Sep 17, 2023
1 parent 11ecc2c commit f53979a
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 61 deletions.
26 changes: 15 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,22 +157,26 @@ jobs:
name: push to dockerhub
command: |
set -ex -o pipefail
if [[ -n "${DOCKER_TOKEN}" ]]; then
# make sure we have a lowercase repo
user_name=cpplab
repo_name=$(echo "${CIRCLE_PROJECT_REPONAME}" | tr '[:upper:]' '[:lower:]')
if [[ -n "${DOCKER_TOKEN}" ]]; then
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USER}" --password-stdin
: "Pushing to DockerHub ${user_name}/${repo_name}:unstable"
docker tag "${user_name}/${repo_name}" "${user_name}/${repo_name}:unstable"
docker push "${user_name}/${repo_name}:unstable"
if [[ -n "${CIRCLE_TAG}" ]]; then
: "Pushing to DockerHub ${user_name}/${repo_name}:${CIRCLE_TAG}"
docker push "${user_name}/${repo_name}:latest"
docker tag "${user_name}/${repo_name}" "${user_name}/${repo_name}:${CIRCLE_TAG}"
docker push "${user_name}/${repo_name}:${CIRCLE_TAG}"
fi
echo "${DOCKER_TOKEN}" | docker login -u "${DOCKER_USER}" --password-stdin
: "Pushing to DockerHub ${user_name}/${repo_name}:unstable"
docker tag "${user_name}/${repo_name}" "${user_name}/${repo_name}:unstable"
docker push "${user_name}/${repo_name}:unstable"
if [[ -n "${CIRCLE_TAG}" ]]; then
: "Pushing to DockerHub ${user_name}/${repo_name}:${CIRCLE_TAG}"
docker push "${user_name}/${repo_name}:latest"
docker tag "${user_name}/${repo_name}" "${user_name}/${repo_name}:${CIRCLE_TAG}"
docker push "${user_name}/${repo_name}:${CIRCLE_TAG}"
fi
else
: "No DOCKER_TOKEN, skipping push to DockerHub"
exit 1
Expand Down
4 changes: 4 additions & 0 deletions demos/face_repetition/download_face_rep_ds.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ function download_face_rep_ds(download_data)

% (C) Copyright 2022 Remi Gau

if nargin < 1
download_data = true;
end

if download_data

WD = pwd;
Expand Down
2 changes: 1 addition & 1 deletion demos/face_repetition/face_rep_01_bids_app.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
clear;
clc;

download_data = false;
download_data = true;

addpath(fullfile(pwd, '..', '..'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
},
"Model": {
"X": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2",
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat",
"trans_?",
"rot_?"
],
"HRF": {
"Variables": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
],
"Model": "spm"
},
Expand All @@ -69,8 +69,8 @@
{
"Name": "lag mod",
"Conditions": [
"trial_type.famous_2",
"trial_type.unfamiliar_2"
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_delayed_repeat"
],
"Values": [
"lag"
Expand All @@ -84,20 +84,20 @@
"DummyContrasts": {
"Test": "t",
"Contrasts": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
]
},
"Contrasts": [
{
"Name": "faces_gt_baseline",
"ConditionList": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
],
"Weights": [
1,
Expand All @@ -110,10 +110,10 @@
{
"Name": "faces_lt_baseline",
"ConditionList": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
],
"Weights": [
-1,
Expand Down
40 changes: 20 additions & 20 deletions demos/face_repetition/models/model-faceRepetition_smdl.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@
},
"Model": {
"X": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2",
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat",
"trans_?",
"rot_?"
],
"HRF": {
"Variables": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
],
"Model": "spm + derivative + dispersion"
},
Expand Down Expand Up @@ -111,20 +111,20 @@
"DummyContrasts": {
"Test": "t",
"Contrasts": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
]
},
"Contrasts": [
{
"Name": "faces_gt_baseline",
"ConditionList": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
],
"Weights": [
1,
Expand All @@ -137,10 +137,10 @@
{
"Name": "faces_lt_baseline",
"ConditionList": [
"trial_type.famous_1",
"trial_type.famous_2",
"trial_type.unfamiliar_1",
"trial_type.unfamiliar_2"
"trial_type.famous_first_show",
"trial_type.famous_delayed_repeat",
"trial_type.unfamiliar_first_show",
"trial_type.unfamiliar_delayed_repeat"
],
"Weights": [
-1,
Expand Down
2 changes: 1 addition & 1 deletion lib/CPP_ROI
2 changes: 1 addition & 1 deletion lib/spm_2_bids
Submodule spm_2_bids updated 0 files
3 changes: 3 additions & 0 deletions src/workflows/stats/bidsConcatBetaTmaps.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ function bidsConcatBetaTmaps(opt, deleteTmaps)

% path to beta and t-map files.

runs = [];
conditions = {};

msg = 'Concatenating the following contrasts:';
logger('INFO', msg, 'options', opt, 'filename', mfilename());
for iContrast = 1:length(contrasts)
Expand Down
Binary file modified tests/data/mat_files/SPM_facerep.mat
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ function test_getEventSpecificationRoiGlm_basic()
% THEN
assertEqual(numel(event_specification), 5);

assertEqual(event_specification(1).name, 'famous_1');
assertEqual(event_specification(1).name, 'famous_first_show');
assertEqual(event_specification(1).eventSpec, [1; 1]);
assertEqual(event_specification(1).duration, 0);

assertEqual(event_specification(2).name, 'famous_2');
assertEqual(event_specification(2).name, 'famous_delayed_repeat');
assertEqual(event_specification(2).eventSpec, [1; 2]);
assertEqual(event_specification(2).duration, 0);

assertEqual(event_specification(3).name, 'unfamiliar_1');
assertEqual(event_specification(3).name, 'unfamiliar_first_show');
assertEqual(event_specification(3).eventSpec, [1; 3]);
assertEqual(event_specification(3).duration, 0);

assertEqual(event_specification(4).name, 'unfamiliar_2');
assertEqual(event_specification(4).name, 'unfamiliar_delayed_repeat');
assertEqual(event_specification(4).eventSpec, [1; 4]);
assertEqual(event_specification(4).duration, 0);

Expand Down

0 comments on commit f53979a

Please sign in to comment.