[RESOLVED] Error in hcp_dedrift_and_resample - KeyError: 'hcp_highresmesh'

Hi there,

I get an error for hcp_dedrift_and_resample: KeyError: ‘hcp_highresmesh’.

I run qunex through the container version 0.99.2d.
All steps until this one have completed successfully, including hcp_msmall.
I tried declaring explicitly the hcp_hiresmesh flag, but with no luck.

Call:

qunex_container hcp_dedrift_and_resample     
--batchfile="${STUDY_FOLDER}/processing/batch.txt"     
--sessionsfolder="${STUDY_FOLDER}/sessions"    
--sessions="${SESSIONS}"     
--hcp_icafix_bolds="1,2,3,4,5,6"     
--hcp_icafix_highpass=2000     
--hcp_hiresmesh=164    
--dockeropt="-v ${BIND_FOLDER}:${BIND_FOLDER}"    
--hcp_matlab_mode="compiled"    
--container="${QUNEX_CONTAINER}"

Logs:

Session id: 006
[started on Monday, 12. February 2024 10:02:16]
Running HCP DeDriftAndResample pipeline [HCPStyleData] ...

Comparing bolds with those specifed via parameters
     ... all bolds specified via hcp_icafix_bolds are present

Single-run HCP ICAFix on 6 bolds

------------------------------------------------------------
---> Processing DeDriftAndResample
     ... bold image 1 present
     ... bold image 2 present
     ... bold image 3 present
     ... bold image 4 present
     ... bold image 5 present
     ... bold image 6 present
 --- Failed during processing of group DeDriftAndResample with error:
 Traceback (most recent call last):
  File "/opt/qunex/python/qx_utilities/hcp/process_hcp.py", line 8465, in executeHCPSingleDeDriftAndResample
    "highresmesh": options["hcp_highresmesh"],
                   ~~~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'hcp_highresmesh'

I will appreciate any help.

Thanks,
Asaf

Hi asaf,

I see we have a bug in our code, hcp_highresmesh should be hcp_hiresmesh like you used. I already fixed the bug and it will be in the next release. Note that 164 is the default value, so you can just skip --hcp_hiresmesh=164 in your command call and it will work.

Also, DedriftAndResample is automatically ran after MSMAll unless you disable it, so you probably do not need to run this manually.

Best, Jure

Thanks, Jure!
Until the next release, how can I run my locally-fixed code for this? I edited the code inside the container but I fail to run the qunex_container command using an already running container with the edited code (and not the default container)
I tried giving the “container” flag the container ID or container name, but it raises an error:

Unable to find image '65a535c71ff1:latest' locally
qunex_container hcp_dedrift_and_resample    
 --batchfile="${STUDY_FOLDER}/processing/batch.txt"    
 --sessionsfolder="${STUDY_FOLDER}/sessions"     
--sessions="${SESSIONS}"     
--hcp_icafix_bolds="1,2,3,4,5,6"     
--dockeropt="-v ${BIND_FOLDER}:${BIND_FOLDER}"    
--hcp_matlab_mode="compiled"     
--container=65a535c71ff1

If your highresmesh is the same as the default I would just omit the parameter and it will work, so:

qunex_container hcp_dedrift_and_resample     
--batchfile="${STUDY_FOLDER}/processing/batch.txt"     
--sessionsfolder="${STUDY_FOLDER}/sessions"    
--sessions="${SESSIONS}"     
--hcp_icafix_bolds="1,2,3,4,5,6"     
--hcp_icafix_highpass=2000     
--dockeropt="-v ${BIND_FOLDER}:${BIND_FOLDER}"    
--hcp_matlab_mode="compiled"    
--container="${QUNEX_CONTAINER}"

This is easier than dealing with containers and changing them :slight_smile:. If you need to fix this and set the parameter value to other than 164, you need to change the code (which I assume you did) and then commit the Docker container so a new image is created. See docker container commit | Docker Docs and Using Docker’s Commit Command | Comprehensive Guide with Examples for some details about this.

Like I said, based on your MSMAll calls, DedriftAndResample is probably already completed. It is ran automatically after MSMAll finishes. Check your processing/logs/comlogs folder for this information.

Best, Jure

Thanks again, Jure!
Unfortunately, DedriftAndResample raises the same KeyError even without the explicit flag of --highresmesh. The reason I run this separately in the first place is that the automatic run after MSMAll failed.

I am now trying to edit the docker container following your guidance. I will update here whether this succeeds.
Many thanks,
Asaf

I edited /opt/qunex/python/qx_utilities/hcp/process_hcp.py in line 8465:

"highresmesh": options["hcp_highresmesh"]

"highresmesh": options["hcp_hiresmesh"]

And committed the docker, and now it works perfectly.

Thanks!
Asaf

Great! Glad it worked. I also already fixed this on our end, it will be released with the next version.

Best, Jure