[RESOLVED] An error occurred while executing preprocess_bold

Hi, Jure

I’ve tested all possible combinations of parameters, and it appears the issue currently lies with the --image_target parameter. In the first preprocess_bold command, the --image_target parameter uses the setting _image_target : cifti from batch.txt. In the second preprocess_bold command, the --image_target parameter uses --image_target=“nifti”. It is precisely these two differences that cause the first command to run correctly while the second command encounters an error.

In short:
--image_target="nifti"   [×]
--image_target="cifti"   [√]

Best, Olivier

Hope you will find this funny. I just spent another hour debugging this and figured out that the issue is most likely something really silly :slight_smile: .

The problem is that you are setting

    --nifti_tail="_hp0_clean" \
    --hcp_cifti_tail="_Atlas_hp0_clean" \

Instead of

    --hcp_nifti_tail="_hp0_clean" \
    --hcp_cifti_tail="_Atlas_hp0_clean" \

So you have a missing hcp_ in the first parameter. Once I set this, nifti target also works fine on my end.

Best, Jure

Unfortunately, that’s not the case. I modified the parameter naming as you suggested, and it’s now --hcp_nifti_tail=“_hp0_clean”. However, it still throws an error. The error message is as follows:

=========================================
Execution error! Processing failed! 
Please check arguments and/or try running the command in Matlab or Octave directly.

The exact error reported:
-----------------------------------------

Error identifier: 
   Error message: reshape: SIZE is not divisible by the product of known dimensions (= 179776)
     Error stack: /opt/qunex/matlab/qx_mri/img/@nimage/nimage.m -> image2D [line: 718]
                  /opt/qunex/matlab/qx_mri/img/@nimage/img_embed_stats.m -> img_embed_stats [line: 36]
                  /opt/qunex/matlab/qx_mri/img/@nimage/img_save_nifti.m -> img_save_nifti [line: 36]
                  /opt/qunex/matlab/qx_mri/img/@nimage/nimage.m -> img_saveimage [line: 542]
                  /opt/qunex/matlab/qx_mri/fc/fc_preprocess.m -> fc_preprocess [line: 1037]

Additionally, on the QuNex documentation homepage, neither of these parameters appears to have the hcp_ prefix. Is _hcp_cifti_tail only used in the default parameters within batch.txt?

I just double checked this and both nifti_tail and hcp_nifti_tail should be supported. So my previous message is irrelevant.

Anyhow, I have two possible ideas.

1/ In your batch file, you are using this template:

_dilate_mask         : /opt/qunex/qx_library/data/atlases/mni_templates/MNI152_T1_2mm_brain_mask.nii.gz

Is this the correct template? I am asking because I am unable to reproduce this with multiple datasets except yours, suggesting that this is some kind of a data issue.

2/ You can try setting

 --hcp_nifti_tail="" \
 --hcp_cifti_tail="_Atlas" \

And then rerun from map_hcp_data to preprocess_bold. This will use non ICAFixed data, maybe something weird happened during denoising.

Is there a need for you to use nifti data here and not cifti?

Best, Jure

1/ The MNI152 template used here is embedded within QuNex, and I believe it should be correct.

2/ Unfortunately, this configuration does not work correctly when using --image_target=“nifti”.

Both options seem viable. If processing NIFTI data is not possible, I can also use CIFT data instead.

Great. I will also ask one of my colleagues to take a look at this and see if he spots something that is off. Unfortunately, I am able to reproduce this only with your data and there it seems like a some kind of a data missmatch:

SIZE is not divisible by the product of known dimensions (= 179776)

Best, Jure

I am marking this as RESOLVED since it looks like a data issue and we were unable to reproduce the behavior on any other dataset. If this resurfaces, we will reopen this and dig deeper.

Best, Jure

1 Like