micapipe icon indicating copy to clipboard operation
micapipe copied to clipboard

Bugs report for ICA-FIX dependency and ...

Open gourdchen opened this issue 8 months ago • 5 comments

Hi,

I am now using micapipe to process my functional MRI. I found an error in ICA-FIX No valid labelling file specified , When I checked the log file, I found it was due to the R error: image

I transform the singularity image to sandbox mode and reinstall the R packages as follows:

install.packages("/opt/randomForest_4.6-12.tar.gz", repos = NULL, type = "source")
install.packages("/opt/coin_1.1-0.tar.gz", repos = NULL, type = "source")
install.packages("/MASS_7.3-36.tar.gz", repos = NULL, type = "source")
install.packages("/opt/party_1.0-25.tar.gz", repos = NULL, type = "source")

This fixes the issue.

Then, I found that an error arises from Matalb:

Undefined function or variable 'dat'.
Error in read_avw_img (line 29)
Error in read_avw (line 34)
Error in functionmotionconfounds (line 34)
Error in fix_3_clean (line 71)
MATLAB:UndefinedFunction

It may be due to the delay of disk io, I added a pause in the "fix1.068/functionmotionconfounds.m" and solved the problem.

 call_fsl(sprintf('fslmaths mc/prefiltered_func_data_mcf_conf -bptf %f -1 mc/prefiltered_func_data_mcf_conf_hp',0.5*hp/TR));
    pause(2);
   confounds=functionnormalise(reshape(read_avw('mc/prefiltered_func_data_mcf_conf_hp'),size(confounds,2),size(confounds,1))');

In addition, the output of the fMRI preprocess is <sub>_space-func_desc-se_prepro.nii.gz but not <sub>_space-func_desc-se_clean.nii.gz says in your documentation.

For your information, thank you.

gourdchen avatar Oct 18 '23 13:10 gourdchen

I found that the core problem is that I just used the trained ICA-FIX file from FSL, which used an old version of 'party'. Do you know if other trained ICA-FIX files used the newer 'party' version by using UKB?

gourdchen avatar Nov 21 '23 10:11 gourdchen

I do not know if there are other ICA-FIX files. If you find a solution of this please share it.

best

rcruces avatar Jan 16 '24 19:01 rcruces

Unfornately, I don't known either. I just replce the ICA-FIX program inside micapipe by my edited version when I run the singularity image. Hope some people know. Thank you.

gourdchen avatar Jan 16 '24 22:01 gourdchen

Could you elaborate more in how did you replace the program and what version did you use? We could update it in future releases.

best

rcruces avatar Jan 17 '24 16:01 rcruces

Sorry for the late reply. First I convert the singularity img to sandbox. Then I run the sandbox and reinstall the package related to ICA-FIX in R.

install.packages("/opt/randomForest_4.6-12.tar.gz", repos = NULL, type = "source")
install.packages("/opt/coin_1.1-0.tar.gz", repos = NULL, type = "source")
install.packages("/MASS_7.3-36.tar.gz", repos = NULL, type = "source")
install.packages("/opt/party_1.0-25.tar.gz", repos = NULL, type = "source")
install.packages("/opt/class_7.3-19.tar.gz", repos = NULL, type = "source")

When run the img, I replace the R library as follows [can ignore the matlab replacement]:

bids_dir="xxxx"
out_dir="xxxxx"

tmp="/xxxx/tmp"
micapipe_image="/xxxxx/micapipe-v0.2.2.simg"
fs_licence="/xxxxx/license.txt"
my_fix="/xxxxx/micalab_sanbox/opt/fix1.068"
my_R_lib="/xxxxxx/micalab_sanbox/usr/local/lib/R/site-library"
singularity run --writable-tmpfs --cleanenv \
-B ${bids_dir}:${bids_dir} -B ${out_dir}:${out_dir} \
-B ${fs_licence}:${fs_licence} \
-B ${tmp}:/tmp \
-B ${my_R_lib}:/usr/local/lib/R/site-library \
-B /usr/local/Cluster-Apps/matlab/R2021b1/:/opt/matlab/ \
-B ${my_fix}:/opt/fix1.068 \
${micapipe_image} \
-bids ${bids_dir} \
-sub ${subj} \
-ses ${session} \
-out ${out_dir} \
-proc_structural -proc_surf -post_structural -proc_dwi -SC -proc_func \
-fs_licence ${fs_licence} \
-nocleanup \
-icafixTraining /opt/fix1.068/training_files/UKBiobank.RData \

gourdchen avatar Feb 28 '24 10:02 gourdchen