[RESOLVED] Preprocessing_conc: question about regression of movement correction parameters

Hi, all

I’m using preprocess_conc to do activation modeling. I’m concerned that head movement may affect the activation analysis results, so I add the regression of the motion parameters at --bold_nuisance. But I found a warning No nuisance data available, skipping nuisance derivatives regression!' while checking the comlog file. Then I check sessions/<session_id>/images/functional/movement folder, bold3_mov.dat and bold4_mov.dat are existed in movement folder. So I can’t find where the question it is.

The files below are for your reference, including code\conc\fidl\log file.

    qunex_container preprocess_conc\\

        --batchfile="${WORK_DIR}/${STUDY_NAME}/processing/batch.txt" \\

        --sessionsfolder="${WORK_DIR}/${STUDY_NAME}/sessions" \\

        --overwrite=yes \\

        --parsessions=10 \\

        --bolds="MT" \\

        --event_file="MT" \\

        --glm_name="-M1" \\

        --bold_actions="s,r,c" \\

        --bold_nuisance="m,1d,e" \\

        --mov_bad=none \\

        --event_string="1_dsw:boynton|2_qtkh:boynton|3_jyl:boynton" \\

        --glm_matrix=both \\

        --glm_residuals=none \\

        --image_target="dtseries" \\

        --pignore="hipass=keep|regress=keep|lopass=keep" \\

        --bind="${SDIR}:${SDIR}" \\

        --container="${QUNEX_CONTAINER}";

    ;;

number_of_files: 2
file:/mnt/ssd2/qzheng/STG_GroupLevel/qunex/STG_GroupLevel/sessions/STG006/images/functional/bold3_Atlas.dtseries.nii
file:/mnt/ssd2/qzheng/STG_GroupLevel/qunex/STG_GroupLevel/sessions/STG006/images/functional/bold4_Atlas.dtseries.nii

0.8 1_dsw 2_qtkh 3_jyl
28 0 28
84 1 28
140 2 28
196 1 28
252 2 28
308 0 28
392 0 28
448 1 28
504 2 28
560 0 28
616 2 28
672 1 28

done_preprocess_conc_MT_-M1_STG006_2025-12-17_13.37.55.104977.log (4.4 KB)

Additionally, when I only set as --bold_nuisance=e \ without any regression of motion parameters, like the example of activation analysis in this page preprocess_conc — QuNex documentation, I found that almost all of the map activation values are negative in several subjects. I guess this may be caused by head movement, so I add regression for motion parameters as previous mentioned. I’d like to know whether adding above motion parameters to preprocess_conc during activation analysis is correct. In MBlab sharing Nuisance signal regression, I saw that it specifically mentioned Removal of signals related to movement correction parameters is a standard step in
functional connectivity preprocessing and is sometimes also used in task activation analyses. If I’d like to remove head movement from task-related bold, how can I to correctly set the parameters in qunex.

Thanks a lot for your kindly help!

Best, Kelly

Kelly, hi!

When you specify motion regression, the code (in this case incorrectly) assumes, that you will also include nuisance signal regressors (such as ventricle, white matter and whole brain signals), and checks for the presence of functional/movement/bold*.nuisance files, even though in your case they are not needed. If these are not present, it reports the above error.

To resolve this issue, we will make the check more specific, so that if no nuisance signal regressors are to be included, it will not check for the presence of *.nuisance files. Before this code change is available, the easiest solution is to run extract_nuisance_signal command (see documentation), which will generate the *.nuisance files, and then continue with preprocess_conc. Once the *.nuisance files are generated, the check will pass and you will be able to perform the analysis as you have prepared it.

If you don’t want to run the extract_nuisance_signal command, one other solution would be to create “dummy” nuisance files. Specifically, for each bold[N].* file, you would need to create in functional/movement folder a bold[N].nuisance file with the content:

frame    V    WM   WB
1        1    1    1
2        1    1    1
3        1    1    1
...
n        1    1    1

where N is the number of the bold file and n is the number of frames in the BOLD file.

My additional suggestion is to specify the --bold_nuisance parameter more explicitly focused on motion: --bold_nuisance=m,m1d,e". You might also want to include: m,m1d,mSq,m1dSq.

I hope this helps!

All the best,

Grega

Hi, Grega

I used the settings you recommended and completed the motion regression. But I still found negative values, which I suspect might be because I directly run general_extract_roi_glm_values'. If I’d like to correctly get activation map of every event, it seems running 1st and 2nd level BOLD task activation analyses is correct. When I run 1st and 2nd level BOLD task activation analyses according to the tutorial, I have a few questions that are puzzling me and I would like to ask for your help.

  1. When After running , I only find bold_Atlas_conc_MT_s_res-mm1de-M1_Bcoeff.dscalar.nii When I run preprocess_conc on a CIFTI format file (bold3_Atlas.dtseries.nii and bold4_Atlas.dtseries.nii), I can only find the bold_Atlas_conc_MT_s_res-mm1de-M1_Bcoeff.dscalar.nii in the /images/functional/ folder, but not bold_Atlas_conc_MT_s_res-mm1de-M1_Bcoeff.dtseries.nii file. I see the input at following step are all bold_Atlas_conc_MT_s_res-mm1de-M1_Bcoeff.dtseries.nii file in the tutorial. Therefore, I don’t know if the different file formats will affect the subsequent analysis.

  2. When I use create_ws_palm_design to prepares the design file, I am confused about factor design. In the example, --effects="b_congruent,b_incongruent,i_congruent,i_incongruent" \, --factors='2,2' \, it means that b&i is a factor level and congruent&incongruent is another factor level, is this the correct understanding? In my design, each subject has three events, and at this stage I want to obtain the activation of each event for each subject and do F-test among three event. The below picture is my setting in FSL before. If I want to design this matrix in the qunex, I should how to set --factor. My code is attaced below, but i think it seems wrong. Do the xx_d.csv' and xx_f.csv' files generated by create_ws_palm_design correspond to EVs and ftest respectively?

general_extract_glm_volumes)

    qunex_container general_extract_glm_volumes \\

        --flist='lists/task.list' \\

        --outf='task_1315_cifti' \\

        --effects='1_dsw,2_qtkh,3_jyl' \\

        --values='raw' \\

        --saveoption='by_session' \\

        --verbose=true \\

        --bind="${SDIR}:${SDIR}" \\

        --container="${QUNEX_CONTAINER}";

    ;;

create_ws_palm_design) 

    qunex_container create_ws_palm_design \\

        --factors="3" \\

        --nsubjects=2 \\

        --root="task_1315_cifti_try" \\

        --bind="${SDIR}:${SDIR}" \\

        --container="${QUNEX_CONTAINER}";

    ;;

Thanks a lot for your time and kindly help!

Best, Kelly

Kelly, hi!

1/ Bcoeff file format
Regarding the file formats, we have in recent updates, changed the code, so that beta coefficient maps results from the GLM analyses performed using preprocess_conc, are now stored as dscalar instead of dtseries. The data itself is exactly the same, it is now just saved as a series of maps instead of timeseries, which was conceptually incorrect. Also, when you load the new dscalar files in wb_view, each map is now correctly named, which makes it easy to review the results. Both file types can be used as input to the following steps (as long as they are Bcoeff files), as they make use of QuNex metadata stored in the NIfTI file, that describes the data stored in the file. So, no worries regarding the file types. We will need to adjust the tutorials to match the new file. If you would like to check the metadata, the next release will include print_nifti_metadata command that will allow easy inspection of metadata stored in the nifti files.

2/ Anova design
Yes, in the example, b_congruent, and b_incongruent refer to congruent and incongruent stimuli in the baseline condition, and i_congruent and i_incongruent to congruent and incongruent stimuli in incentive condition. This gives us 2×2 factorial design with factors incentive (baseline vs. incentive) and stimulus (congruent vs. incongruent).

If I understand correctly, in your study, you have three types of events, let’s name them A (1_dsw), B (2_qtkh), and C (3_jly). You can address two questions, (i) are there significant responses to each event type, and (ii) is there a difference between responses to the three event type?

Testing response to each event type
To perform (i), you would run run_palm for each of the three effects separately. To do this, you could perform the following steps:

# -- create a list file
qunex create_list \
  --sessionsfolder=$PathToStudyFolder/sessions \
  --batchfile=$PathToStudyFolder/processing/batch.txt \
  --listfile=$PathToAnalysisFolder/lists/glm_results.list \
  --glm="bold_Atlas_conc_MT_s_res-mm1de-M1_Bcoeff.dscalar.nii" \
  --check="present" \
  --overwrite="yes"

# -- extract results for each effect of interest
qunex general_extract_glm_volumes \
  --flist=$PathToAnalysisFolder/lists/glm_results.list \
  --outf=$PathToAnalysisFolder/glm/\
  --effects="1_dsw,2_qtkh,3_jyl" \
  --saveoption="effect_files" \
  --values="raw" 

# -- run PALM for each effect of interest
for effect in 1_dsw 2_qtkh 3_jyl
do
  qunex run_palm \
    --image=$PathToAnalysisFolder/glm/${effect}.dscalar.nii \
    --design="name:zero" \
    --palm_args="n:10000" \
    --overwrite=yes \
    --root=$PathToAnalysisFolder/glm/palm/separate/${effect}
done

This would provide you with results that would show any significant activations or deactivations for each of the three events.

Testing differences between responses to three event types
To perform (ii), you would run a one-way anova with a factor event type that has three levels, A,B, and C (1_dsw, 2_qtkh, and 3_jyl). In this case, you would indeed run (after creating the list file):

# -- preparing files with the relevant effects across all sessions

general_extract_glm_volumes \
  --flist=$PathToAnalysisFolder/lists/glm_results.list \
  --outf=$PathToAnalysisFolder/glm/all_trials\
  --effects="1_dsw,2_qtkh,3_jyl" \
  --saveoption="by_session" \
  --values="raw" 

# -- prepare design files

qunex create_ws_palm_design \
  --factors=2 \
  --nsubjects=$N_subects \
  --root="one_way_anova"

# -- run PALM analysis
qunex run_palm \
  --image=$PathToAnalysisFolder/glm/all_trials.dscalar.nii \
  --design="name:${PathToAnalysisFolder}/glm/one_way_anova" \
  --palm_args="n:10000|fonly|T|C:3.1" \
  --overwrite=yes \
  --root=$PathToAnalysisFolder/glm/palm/anova

The T and C options above would prepare TFCE and Cluster Extent versions of multiple comparison corrected p-values.

There are some caveats and notes:

  • First, I wrote the above without thoroughly checking the exact paths and file names. Please, when running, check that the paths and file names match your data.
  • Second, if you only have data for 2 subjects, I don’t think you will be able to get any meaningful effect in the group-level analysis.
  • Third, we have introduced a few improvements to the preprocess_conc and run_palm code that provide additional functionality (e.g., pre-whitening for the GLM analysis within the preprocess_conc), optimisations (e.g., if neither TFCE or CE is requested for PALM analysis, left hemisphere, right hemisphere, and subcortex from dscalar images are not processed separately, but in a single step) and robustness. The code is currently being tested and verified and should be available in the coming weeks.