[RESOLVED] Some data failed during the execution of the Freesurfer steps

Hi, all

While processing a large dataset, I discovered that some subjects’ data was unexpectedly interrupted during the pre_freesurfer, freesurfer, and post_freesurfer processing stages. Here are the error logs:

error_hcp_freesurfer_FCS_160_A_2025-08-04_15.03.22.387418.log (217.0 KB)

error_hcp_pre_freesurfer_fcs_148_a_2025-08-27_09.26.31.798497.log (12.7 KB)

error_hcp_post_freesurfer_fcs_134_c_2025-08-27_09.12.27.477303.log (1.8 MB)

This appears to be caused by insufficient RAM, but when I tried running them individually, they still terminated at the same point.

Best

Acacius

Hi Acacius,

1/ The hco_pre_freesurfer one is because of some permission issues:

line 484: /opt/HCP/HCPpipelines/PreFreeSurfer/scripts/AnatomicalAverage.sh: Permission denied

Could be a bug with the particular version you are using that was probably fixed as the used version is quite old.

2/ hcp_freesurfer says terminated, this is usually if the process hits an allocation walltime or if it runs out of memory. Did you try allocating more resources.

3/ hcp_post_freesurfer could be some kind of a data issue as there are some matrix multiplication incompatibilities:

terminate called after throwing an instance of 'std::logic_error'
  what():  matrix multiplication: incompatible matrix dimensions: 0x0 and 4x1

Any reason you are using 0.99.2, this is quite an old version and it could be that most bugs issues were resolved by now. Both us and HCP folks are quite strict when it comes to backwards compatibility. The structural pipeline is completely backwards compatible between the latest version and 0.99.2 so you could try processing the problematic sessions with the latest QuNex version. Also, allocate enogh resources as in some, more problematic cases, the HCP structural pipeline might need more time and memory.

Best, Jure

Hi Jure,

Always thanks for your kindly help. For hcp_freesurfer step, I have tried to run only one subject at a time, but they still stuck at the same place(However, other subjects can be processed sucessfully). Anyway, I will try to use the latest version to see whether the problems will be solved.

Best,

Acacius

Hi Jure,

Sorry for reopening this conversation. I still get the same error in “hcp_post_freesurfer” steps by using latest QUNEX version. My command is:

 	hcp_post_freesurfer)
                qunex_container hcp_post_freesurfer \
                    --sessionsfolder="${WORK_DIR}/${STUDY_NAME}/sessions" \
                    --sessions="${SUBJ}" \
                    --batchfile="${WORK_DIR}/${STUDY_NAME}/processing/batch.txt" \
                    --parsessions="${PARSES}" \
                    --hcp_processing_mode="${hcp_processing_mode}" \
                    --hcp_t2="None" \
		            --hcp_regname="MSMSulc" \
	 	            --hcp_grayordinatesres="2" \
		            --hcp_hiresmesh="164" \
		            --hcp_lowresmesh="32" \
                    --bind="${WORK_DIR}:${WORK_DIR}" \
                    --container="${QUNEX_CONTAINER}" \
                    --overwrite="no"

And the error is still:

Could not open matrix file /mnt/hdd1/yumingz/washingtonu/script/error/sessions/FCS_149_A/hcp/FCS_149_A/T1w/FCS_149_A/mri/transforms/T2wtoT1w.mat
terminate called after throwing an instance of 'std::logic_error'
  what():  matrix multiplication: incompatible matrix dimensions: 0x0 and 4x1
/opt/fsl/fsl/share/fsl/bin/convertwarp: line 2: 846577 Aborted 

Here is my previous done log in freesurfer step and full error log of post freesurfer:

done_hcp_freesurfer_FCS_149_A_2025-09-02_09.22.56.666750.log (539.1 KB)

error_hcp_post_freesurfer_FCS_149_A_2025-09-14_23.19.24.752934.log (1.8 MB)

Best,

Acacius

Hi Acacius,

Please refresh my memory. This only happens for a couple of sessions, while it works for most right?

Best, Jure

Hi Jure,

I used 0.99 version to process my washingtonu data(more than 100 subjects and each subject have 2 or 3 timepoints to scan). However, nearly half of them were failed in freesurfer step with the error I posted here before. Then I extracted all the participants whose processing failed and used the latest version of Qunex to process them, most of them passed the freesurfer step successfully but failed at post freesurfer step(only 5 of them can be processed).

Best, Acacius

Hi,

Is this data something you could share? I would need a single sessions that does not work. The problem is that I am unable to reproduce this on my end and thus cannot help you.

Best, Jure

Sure, Here are the subjects who encountered errors in the freesurfer step(fcs-65c) and in the post-freesurfer(FCS_149_A) step:

error_data

Thanks for your kindly help!

Best, Acacius

Hi,

I started processing this, I will get back to you once I am in the PostFS step.

Best, Jure

OK, many thanks!

Best, Acacius

Hi Acacius,

I was unable to reproduce this. The session you sent me was processed succesfully through the HCP stuctural pipeline. See attached logs for the configuration I used.

Best, Jure


done_hcp_pre_freesurfer_FCS149_2025-09-19_12.13.08.928409.log (26.4 KB)

done_hcp_post_freesurfer_FCS149_2025-09-20_07.28.51.057949.log (1.8 MB)

done_hcp_freesurfer_FCS149_2025-09-19_15.05.20.887742.log (597.5 KB)

Hi Jure,

Thanks for your efforts putting into this questions. I will try again to see whether it works.

Best, Acacius

When running, compare the top of your logs with the ones I attached to see if I used some different parameters.

Best, Jure