cpp-lln-lab / bidspm

an SPM centric BIDS app
https://bidspm.readthedocs.io/en/latest/general_information.html
GNU General Public License v3.0
5 stars 13 forks source link

[BUG] group level smoothing #997

Closed iqrashahzad14 closed 1 year ago

iqrashahzad14 commented 1 year ago

Is there an existing issue for this?

Operating system

Operating system version

SPM 12 version

Platform

Platform version

bidspm version

v3.0.0

bidspm branch / commit number

Expected Behavior

I wanted to smooth the contrasts to 6mm for group-level analysis. I ran the following

results = defaultResultsStructure();% do we need this and what does it do?
results.nodeName = 'dataset_level'; %check this
% results.name = {'motion','static','motion_gt_static','static_gt_motion'};
results.name = {'motion_left','motion_right', 'motion_left_gt_motion_right','motion_right_gt_motion_left' };
results.MC =  'none';
results.p = 0.01;
results.k = 0;
results.png = true();
results.csv = true();
results.binary = true; 
results.montage.do = true();
results.montage.slices = -12:4:60;
results.montage.orientation = 'axial';
% results.montage.background = struct('suffix', 'T1w', ...
%                                     'desc', 'preproc', ...
%                                     'modality', 'anat');                                                             
% results.montage.background =[];
opt.results = results;

opt.fwhm.contrast = 6;

bidspm(bids_dir, output_dir, 'dataset', ...
       'participant_label', {'001','002','003','004','005','006','007','008','009','010','011','013','014','015','016','017','pil004','pil005'}, ...
       'action', 'stats', ...
       'preproc_dir', preproc_dir, ...
       'model_file', model_file,...
       'task', {taskName},...
       'space', {'IXI549Space'}, ...
       'fwhm', 6,...
       'ignore', {'qa','concat'},...
       'concatenate', false,...
       'options', opt);

It does not find the following file, which actually does not exist. I am not sure why do we need this file, and how do we create it.

bidspm - ERROR              validationInputFile
This file does not exist: /Users/shahzad/Files/fMRI/visTac/fMRI_analysis/outputs/derivatives/bidspm-stats/sub-001/task-visualLocalizer2_space-IXI549Space_FWHM-6/s6con_0005.nii[.gz]

BIDS stats model

{
  "Name": "Visual Motion localizer",
  "BIDSModelVersion": "1.0.0",
  "Description": "contrasts for the visual motion localizer dataset",
  "Input": {
    "task": [
      "visualLocalizer2"
    ],
    "space": [
      "IXI549Space"
    ]
  },
  "Nodes": [
    {
      "Level": "Run",
      "Name": "run_level",
      "GroupBy": [
        "run",
        "session",
        "subject"
      ],
      "Model": {
        "X": [
          "trial_type.motion",
          "trial_type.static",
          "trial_type.response",
          "trans_?",
          "rot_?",
          "non_steady_state_outlier*",
          "motion_outlier*"
        ],
        "HRF": {
          "Variables": [
            "trial_type.motion",
            "trial_type.static",
            "trial_type.response"
          ],
          "Model": "spm"
        },
        "Type": "glm",
        "Options": {
          "HighPassFilterCutoffHz": 0.0078,
          "Mask": {
            "suffix": [
              "mask"
            ],
            "desc": [
              "brain"
            ]
          }
        },
        "Software": {
          "SPM": {
            "SerialCorrelation": "FAST"
          }
        }
      },
      "DummyContrasts": {
        "Contrasts": [
          "trial_type.motion",
          "trial_type.static"
        ],
        "Test": "t"
      },
      "Contrasts": [
        {
          "Name": "motion_gt_static",
          "ConditionList": [
            "trial_type.motion",
            "trial_type.static"
          ],
          "Weights": [
            1,
            -1
          ],
          "Test": "t"
        },
        {
          "Name": "static_gt_motion",
          "ConditionList": [
            "trial_type.motion",
            "trial_type.static"
          ],
          "Weights": [
            -1,
            1
          ],
          "Test": "t"
        }
      ]
    },
    {
      "Level": "Subject",
      "Name": "subject_level",
      "GroupBy": [
        "contrast",
        "subject"
      ],
      "Model": {
        "X": [
          1
        ],
        "Type": "glm"
      },
      "DummyContrasts": {
        "Test": "t"
      }
    },
    {
      "Level": "Dataset",
      "Name": "dataset_level",
      "GroupBy": [
        "contrast"
      ],
      "Model": {
        "X": [
          1
        ],
        "Type": "glm",
        "Software": {
          "SPM": {
            "SerialCorrelation": "FAST"
          }
        }
      },
      "DummyContrasts": {
        "Test": "t"
      }
    }
  ]
}

Current Behavior & Error message

{
  "GeneratedBy": {
    "name": "bidspm",
    "Version": "v3.0.0",
    "Branch": "HEAD",
    "Commit": "8a60b4bf",
    "Description": "",
    "CodeURL": "https://github.com/cpp-lln-lab/bidspm",
    "DOI": "https://doi.org/10.5281/zenodo.3554331"
  },
  "OS": {
    "name": "macOS",
    "version": "12.6",
    "platform": {
      "name": "MATLAB",
      "version": "9.9.0.1570001 (R2020b) Update 4"
    },
    "spmVersion": "SPM12 - 7771",
    "environmentVariables": {
      "COMMAND_MODE": "unix2003",
      "HOME": "/Users/shahzad",
      "ICU_TIMEZONE_FILES_DIR": "/Applications/MATLAB_R2020b.app/bin/icutzdata",
      "KMP_BLOCKTIME": "1",
      "KMP_HANDLE_SIGNALS": "0",
      "KMP_INIT_AT_FORK": "false",
      "KMP_STACKSIZE": "512k",
      "LANG": "en_US.UTF-8",
      "LC_CTYPE": "UTF-8",
      "LC_MESSAGES": "en_GB",
      "LOGNAME": "shahzad",
      "MATLAB_USE_USERWORK": "",
      "MEMKIND_HEAP_MANAGER": "TBB",
      "MKL_DOMAIN_NUM_THREADS": "",
      "MKL_NUM_THREADS": "",
      "OLDPWD": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/src",
      "PATH": "/usr/bin:/bin:/usr/sbin:/sbin",
      "PWD": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/src",
      "SHELL": "/bin/zsh",
      "SHLVL": "0",
      "SSH_AUTH_SOCK": "/private/tmp/com.apple.launchd.L7MH4eoSNX/Listeners",
      "TERM": "dumb",
      "TMPDIR": "/var/folders/_g/60zh19kx5zx8g9tjnj45zlpw0000gp/T/",
      "USER": "shahzad",
      "XPC_FLAGS": "0x0",
      "XPC_SERVICE_NAME": "application.com.mathworks.matlab.1505091.2423124",
      "CFBundleIdentifier": "com.mathworks.matlab",
      "CF_USER_TEXT_ENCODING": "0x1F6:0x0:0x2",
      "KMP_REGISTERED_LIB______": "0x1186a11a8-cafe6274-libiomp5.dylib"
    }
  },
  "ME": {
    "identifier": "validationInputFile:nonExistentFile",
    "message": "\n[21:58:40] bidspm - ERROR\t\t\t\tvalidationInputFile\nThis file does not exist: /Users/shahzad/Files/fMRI/visTac/fMRI_analysis/outputs/derivatives/bidspm-stats/sub-001/task-visualLocalizer2_space-IXI549Space_FWHM-6/s6con_0005.nii[.gz]\\n",
    "cause": [],
    "stack": [
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/src/messages/errorHandling.m",
        "name": "errorHandling",
        "line": 57
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/src/messages/logger.m",
        "name": "logger",
        "line": 71
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/src/utils/validationInputFile.m",
        "name": "validationInputFile",
        "line": 81
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/src/stats/group_level/findSubjectConImage.m",
        "name": "findSubjectConImage",
        "line": 87
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/src/batches/stats/setBatchFactorialDesign.m",
        "name": "setBatchFactorialDesign",
        "line": 54
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/src/workflows/stats/bidsRFX.m",
        "name": "bidsRFX",
        "line": 117
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/bidspm.m",
        "name": "stats",
        "line": 347
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/bidspm.m",
        "name": "executeAction",
        "line": 157
      },
      {
        "file": "/Users/shahzad/Files/fMRI/visTac/fMRI_analysis/code/lib/bidspm/bidspm.m",
        "name": "bidspm",
        "line": 79
      }
    ],
    "Correction": []
  }
}

Anything else?

No response

github-actions[bot] commented 1 year ago

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

Remi-Gau commented 1 year ago

So the file it does not find is the contrast image that should have been smoothed. I need to check why the contrast smoothing is not happening.

iqrashahzad14 commented 1 year ago

okay! so it should be created from the function itself?

Remi-Gau commented 1 year ago

Yup. If it is not there then something that should happen did not happen.

Remi-Gau commented 1 year ago

Fixed by #1012