[RESOLVED] Onboarding ASL data issue

Description:

I’m having issues onboarding ASL data using qunex. I briefly mentioned this in another thread, but I wanted to have a focused thread on this issue as it is still unresolved.

The raw mri data is in BIDS format, and all modalities (anat, func, fmap, dwi) are onboarded without issues, however the ASL data (perf) is not. I attached bellow pictures of the raw ASL data folder and the terminal output of the “qunex_container import_bids” command. I am hoping to get the ASL data onboarded along with the other MRI modalities. Thank you.

Call:

ln1001:~ moana004$ qunex_container import_bids --sessionsfolder="${study_sharedfolder}/sessions" --sessions='sub-FM0007' --bind="${study_sharedfolder}:/${study_sharedfolder}" --container="${HOME}/qunex/qunex_suite-0.94.4.sif"

--> QuNex will run the command over 1 sessions. It will utilize:

    Maximum sessions run in parallel for a job: 1.
    Maximum elements run in parallel for a session: 1.
    Up to 1 processes will be utilized for a job.

    Job #1 will run sessions: sub-FM0007
ln1001:~ moana004$ --> unsetting the following environment variables: PATH MATLABPATH PYTHONPATH QUNEXVer TOOLS QUNEXREPO QUNEXPATH QUNEXLIBRARY QUNEXLIBRARYETC TemplateFolder FSL_FIXDIR FREESURFERDIR FREESURFER_HOME FREESURFER_SCHEDULER FreeSurferSchedulerDIR WORKBENCHDIR DCMNIIDIR DICMNIIDIR MATLABDIR MATLABBINDIR OCTAVEDIR OCTAVEPKGDIR OCTAVEBINDIR RDIR HCPWBDIR AFNIDIR ANTSDIR PYLIBDIR FSLDIR FSLGPUDIR PALMDIR QUNEXMCOMMAND HCPPIPEDIR CARET7DIR GRADUNWARPDIR HCPPIPEDIR_Templates HCPPIPEDIR_Bin HCPPIPEDIR_Config HCPPIPEDIR_PreFS HCPPIPEDIR_FS HCPPIPEDIR_PostFS HCPPIPEDIR_fMRISurf HCPPIPEDIR_fMRIVol HCPPIPEDIR_tfMRI HCPPIPEDIR_dMRI HCPPIPEDIR_dMRITract HCPPIPEDIR_Global HCPPIPEDIR_tfMRIAnalysis HCPCIFTIRWDIR MSMBin HCPPIPEDIR_dMRITractFull HCPPIPEDIR_dMRILegacy AutoPtxFolder FSL_GPU_SCRIPTS FSLGPUBinary EDDYCUDADIR USEOCTAVE QUNEXENV CONDADIR MSMBINDIR MSMCONFIGDIR R_LIBS FSL_FIX_CIFTIRW FSFAST_HOME SUBJECTS_DIR MINC_BIN_DIR MNI_DIR MINC_LIB_DIR MNI_DATAPATH FSF_OUTPUT_FORMAT
 
Generated by QuNex 
------------------------------------------------------------------------ 
Version: 0.94.4 
User: moana004 
System: ln1001 
OS: RedHat Linux #1 SMP Tue Jun 28 15:37:28 UTC 2022 
------------------------------------------------------------------------ 
 
        ██████\                  ║      ██\   ██\                        
       ██  __██\                 ║      ███\  ██ |                       
       ██ /  ██ |██\   ██\       ║      ████\ ██ | ██████\ ██\   ██\     
       ██ |  ██ |██ |  ██ |      ║      ██ ██\██ |██  __██\\██\ ██  | 
       ██ |  ██ |██ |  ██ |      ║      ██ \████ |████████ |\████  /     
       ██ ██\██ |██ |  ██ |      ║      ██ |\███ |██   ____|██  ██\      
       \██████ / \██████  |      ║      ██ | \██ |\███████\██  /\██\     
        \___███\  \______/       ║      \__|  \__| \_______\__/  \__|    
            \___|                ║                                       
 
 
                       DEVELOPED & MAINTAINED BY: 
 
                    Anticevic Lab, Yale University 
               Mind & Brain Lab, University of Ljubljana 
                     Murray Lab, Yale University 
 
                      COPYRIGHT & LICENSE NOTICE: 
 
Use of this software is subject to the terms and conditions defined in 
'LICENSES' which is a part of the QuNex Suite source code package: 
https://gitlab.qunex.yale.edu/qunex/qunex/-/tree/master/LICENSES 
 
 ---> Setting up Octave  


 ........................ Running QuNex v0.94.4 ........................ 


--- Full QuNex call for command: import_bids 

gmri import_bids --sessionsfolder="/home/moanae/shared/project_FM_Gracely_shared2/sessions" --sessions="sub-FM0007" 

--------------------------------------------------------- 


started running import_bids at 2022-08-11 11:02:04, track progress in /home/moanae/shared/project_FM_Gracely_shared2/processing/logs/comlogs/tmp_import_bids_sub-FM0007_2022-08-11_11.02.04.574609.log
call: gmri import_bids sessionsfolder="/home/moanae/shared/project_FM_Gracely_shared2/sessions" sessions="sub-FM0007"
-----------------------------------------
Running import_bids
==================
--> identifying files in /home/moanae/shared/project_FM_Gracely_shared2/sessions/inbox/BIDS
--> Inbox type: bids_study
==> Paths:
    BIDSInfo    -> /home/moanae/shared/project_FM_Gracely_shared2/info/bids
    BIDSInbox   -> /home/moanae/shared/project_FM_Gracely_shared2/sessions/inbox/BIDS
    BIDSArchive -> /home/moanae/shared/project_FM_Gracely_shared2/sessions/archive/BIDS
--> mapping files to QuNex bids folders
    --> processing BIDS info folder
    --> creating bids session FM0007
--> Archiving: moving items
Running map_bids2nii for subject FM0007
=======================================
--> linked 1.nii.gz <-- sub-FM0007_run-01_PDw.nii.gz
--> linked 2.nii.gz <-- sub-FM0007_run-01_T1w.nii.gz
--> linked 3.nii.gz <-- sub-FM0007_run-01_T2w.nii.gz
--> linked 4.nii.gz <-- sub-FM0007_acq-asl_run-01_phasediff.nii.gz
--> linked 5.nii.gz <-- sub-FM0007_acq-asl_run-01_magnitude2.nii.gz
--> linked 6.nii.gz <-- sub-FM0007_acq-asl_run-01_magnitude1.nii.gz
--> linked 7.nii.gz <-- sub-FM0007_acq-dwi_run-01_phasediff.nii.gz
--> linked 8.nii.gz <-- sub-FM0007_acq-dwi_run-01_magnitude2.nii.gz
--> linked 9.nii.gz <-- sub-FM0007_acq-dwi_run-01_magnitude1.nii.gz
--> linked 10.nii.gz <-- sub-FM0007_acq-funcrest_run-01_magnitude1.nii.gz
--> linked 11.nii.gz <-- sub-FM0007_acq-funcrest_run-01_magnitude2.nii.gz
--> linked 12.nii.gz <-- sub-FM0007_acq-funcrest_run-01_phasediff.nii.gz
--> linked 13.nii.gz <-- sub-FM0007_acq-funcstim_run-01_magnitude1.nii.gz
--> linked 14.nii.gz <-- sub-FM0007_acq-funcstim_run-01_magnitude2.nii.gz
--> linked 15.nii.gz <-- sub-FM0007_acq-funcstim_run-01_phasediff.nii.gz
--> linked 16.nii.gz <-- sub-FM0007_task-auditory_run-03_bold.nii.gz
--> linked 17.nii.gz <-- sub-FM0007_task-intermingled_run-01_bold.nii.gz
--> linked 18.nii.gz <-- sub-FM0007_task-mechanical_run-02_bold.nii.gz
--> linked 19.nii.gz <-- sub-FM0007_task-rest_run-01_bold.nii.gz
--> linked 20.nii.gz <-- sub-FM0007_task-rest_run-02_bold.nii.gz
--> linked 21.nii.gz <-- sub-FM0007_task-simultaneous_run-04_bold.nii.gz
--> linked 22.nii.gz <-- sub-FM0007_run-01_dwi.nii.gz
Running mapBIDS2behavior for subject FM0007
===========================================
--> created behavior subfolder
--> mapped: participants.tsv

Final report
============
subject FM0007 image mapping completed, behavioral files: 1 files mapped

-----------------------------------------
Finished at 2022-08-11 11:02:04

===> Successful completion of task

Hi, this should be fixed in the version 0.94.6 which will be released tomorrow if all goes according to plan.

Sounds good, I’ll look forward to the new version.

Hi, the latest version should mport ASL data, however the current HCP ASL implementation will most likely not work. The problem is not in QuNex but in the pipelines that we use (GitHub - physimals/hcp-asl: ASL pipeline for the Human Connectome Project). It seems like the pipelines are right now only usable if your data exactly matches the HCP data (in terms of image dimensions). As we need ASL processing for some of our projects we will probably collaborate with HCP ASL developers to make this more flexible and widely usable. We will keep you posted regarding this.

Thanks for the updates. I tried the updated qunex version, and it seems to import the ASL data with limitation. I have 2 ASL runs, and the “setup_hcp” command was only able to import one of them. See the command output below and the session file that I manually edited since the raw mri data was imported from BIDS-compliant folder.
Do you think this would be an issue for if there are more than one DWI runs for mapping?

Thank you.

Estephan

Command output

cn2107:~ moana004$ sessions2proc="FM0001"; qunex_container setup_hcp --sourcefolder="${study_sharedfolder}/sessions/${sessions2proc}" --targetfolder='hcp' --sourcefile=session_hcp2.txt --check='yes' --existing='add' --hcp_filename='userdefined' --hcp_folderstructure='hcpls' --bind="${study_sharedfolder}:/${study_sharedfolder}"  --container="${HOME}/qunex/qunex_suite-0.94.7.sif"
cn2107:~ moana004$ --> unsetting the following environment variables: PATH MATLABPATH PYTHONPATH QUNEXVer TOOLS QUNEXREPO QUNEXPATH QUNEXLIBRARY QUNEXLIBRARYETC TemplateFolder FSL_FIXDIR FREESURFERDIR FREESURFER_HOME FREESURFER_SCHEDULER FreeSurferSchedulerDIR WORKBENCHDIR DCMNIIDIR DICMNIIDIR MATLABDIR MATLABBINDIR OCTAVEDIR OCTAVEPKGDIR OCTAVEBINDIR RDIR HCPWBDIR AFNIDIR ANTSDIR PYLIBDIR FSLDIR FSLGPUDIR PALMDIR QUNEXMCOMMAND HCPPIPEDIR CARET7DIR GRADUNWARPDIR HCPPIPEDIR_Templates HCPPIPEDIR_Bin HCPPIPEDIR_Config HCPPIPEDIR_PreFS HCPPIPEDIR_FS HCPPIPEDIR_PostFS HCPPIPEDIR_fMRISurf HCPPIPEDIR_fMRIVol HCPPIPEDIR_tfMRI HCPPIPEDIR_dMRI HCPPIPEDIR_dMRITract HCPPIPEDIR_Global HCPPIPEDIR_tfMRIAnalysis HCPCIFTIRWDIR MSMBin HCPPIPEDIR_dMRITractFull HCPPIPEDIR_dMRILegacy AutoPtxFolder FSL_GPU_SCRIPTS FSLGPUBinary EDDYCUDADIR USEOCTAVE QUNEXENV CONDADIR MSMBINDIR MSMCONFIGDIR R_LIBS FSL_FIX_CIFTIRW FSFAST_HOME SUBJECTS_DIR MINC_BIN_DIR MNI_DIR MINC_LIB_DIR MNI_DATAPATH FSF_OUTPUT_FORMAT
 
Generated by QuNex 
------------------------------------------------------------------------ 
Version: 0.94.7 
User: moana004 
System: cn2107 
OS: RedHat Linux #1 SMP Tue Jun 28 15:37:28 UTC 2022 
------------------------------------------------------------------------ 
 
        ██████\                  ║      ██\   ██\                        
       ██  __██\                 ║      ███\  ██ |                       
       ██ /  ██ |██\   ██\       ║      ████\ ██ | ██████\ ██\   ██\     
       ██ |  ██ |██ |  ██ |      ║      ██ ██\██ |██  __██\\██\ ██  | 
       ██ |  ██ |██ |  ██ |      ║      ██ \████ |████████ |\████  /     
       ██ ██\██ |██ |  ██ |      ║      ██ |\███ |██   ____|██  ██\      
       \██████ / \██████  |      ║      ██ | \██ |\███████\██  /\██\     
        \___███\  \______/       ║      \__|  \__| \_______\__/  \__|    
            \___|                ║                                       
 
 
                       DEVELOPED & MAINTAINED BY: 
 
                    Anticevic Lab, Yale University 
               Mind & Brain Lab, University of Ljubljana 
                     Murray Lab, Yale University 
 
                      COPYRIGHT & LICENSE NOTICE: 
 
Use of this software is subject to the terms and conditions defined in 
'LICENSES' which is a part of the QuNex Suite source code package: 
https://gitlab.qunex.yale.edu/qunex/qunex/-/tree/master/LICENSES 
 
 ---> Setting up Octave  


 ........................ Running QuNex v0.94.7 ........................ 


--- Full QuNex call for command: setup_hcp 

gmri setup_hcp --sourcefolder="/home/moanae/shared/project_FM_Gracely_TEST_FM0001/sessions/FM0001" --targetfolder="hcp" --sourcefile="session_hcp2.txt" --check="yes" --existing="add" --hcp_filename="userdefined" --hcp_folderstructure="hcpls" 

--------------------------------------------------------- 


started running setup_hcp at 2022-08-18 10:17:07, track progress in /home/moanae/shared/project_FM_Gracely_TEST_FM0001/processing/logs/comlogs/tmp_setup_hcp_2022-08-18_10.17.07.751812.log
call: gmri setup_hcp sourcefolder="/home/moanae/shared/project_FM_Gracely_TEST_FM0001/sessions/FM0001" targetfolder="hcp" sourcefile="session_hcp2.txt" check="yes" existing="add" hcp_filename="userdefined" hcp_folderstructure="hcpls"
-----------------------------------------
Running setup_hcp
================
===> Setting up HCP folder structure for FM0001

 ---> Creating base folder /home/moanae/shared/project_FM_Gracely_TEST_FM0001/sessions/FM0001/hcp/FM0001/unprocessed 
 ---> creating subfolder ASL
 ---> linking 28.nii.gz to FM0001_ASL.nii.gz
  ... ASL subfolder already exists
  ... FM0001_ASL.nii.gz already exists
 ---> creating subfolder Diffusion
 ---> linking 26.nii.gz to FM0001_DWI_dir42_AP.nii.gz
  ... Diffusion subfolder already exists
 ---> linking 26.bval to FM0001_DWI_dir42_AP.bval
  ... Diffusion subfolder already exists
 ---> linking 26.bvec to FM0001_DWI_dir42_AP.bvec
 ---> creating subfolder BOLD_4
 ---> linking 25.nii.gz to FM0001_BOLD_4.nii.gz
 ---> creating subfolder BOLD_6
 ---> linking 24.nii.gz to FM0001_BOLD_6.nii.gz
 ---> creating subfolder BOLD_5
 ---> linking 23.nii.gz to FM0001_BOLD_5.nii.gz
 ---> creating subfolder BOLD_2
 ---> linking 22.nii.gz to FM0001_BOLD_2.nii.gz
 ---> creating subfolder BOLD_1
 ---> linking 21.nii.gz to FM0001_BOLD_1.nii.gz
 ---> creating subfolder BOLD_3
 ---> linking 20.nii.gz to FM0001_BOLD_3.nii.gz
 ---> creating subfolder FieldMap3
 ---> linking 19.nii.gz to FM0001_FieldMap_Magnitude.nii.gz
  ... FieldMap3 subfolder already exists
 ---> linking 18.nii.gz to FM0001_FieldMap_Phase.nii.gz
  ... skipping 17  [unknown sequence label, please check]
  ... skipping 16  [unknown sequence label, please check]
 ---> creating subfolder FieldMap2
 ---> linking 15.nii.gz to FM0001_FieldMap_Magnitude.nii.gz
  ... FieldMap2 subfolder already exists
 ---> linking 14.nii.gz to FM0001_FieldMap_Phase.nii.gz
  ... skipping 13  [unknown sequence label, please check]
  ... skipping 12  [unknown sequence label, please check]
 ---> creating subfolder FieldMap1
 ---> linking 11.nii.gz to FM0001_FieldMap_Magnitude.nii.gz
  ... skipping 10  [unknown sequence label, please check]
  ... skipping 9  [unknown sequence label, please check]
  ... FieldMap1 subfolder already exists
 ---> linking 8.nii.gz to FM0001_FieldMap_Phase.nii.gz
 ---> creating subfolder FieldMap4
 ---> linking 7.nii.gz to FM0001_FieldMap_Magnitude.nii.gz
  ... skipping 6  [unknown sequence label, please check]
  ... skipping 5  [unknown sequence label, please check]
  ... FieldMap4 subfolder already exists
 ---> linking 4.nii.gz to FM0001_FieldMap_Phase.nii.gz
 ---> creating subfolder T2w
 ---> linking 3.nii.gz to FM0001_T2w_SPC1.nii.gz
 ---> creating subfolder T1w
 ---> linking 2.nii.gz to FM0001_T1w_MPR1.nii.gz
  ... skipping 1  [unknown sequence label, please check]

-----------------------------------------
Finished at 2022-08-18 10:17:10

===> Successful completion of task

Session_hcp2.txt

# Generated by QuNex 0.94.7 on 2022-08-18_09.14.04.303997
#
session: FM0001
subject: FM0001
bids: /home/moanae/shared/project_FM_Gracely_TEST_FM0001/sessions/FM0001/bids
raw_data: /home/moanae/shared/project_FM_Gracely_TEST_FM0001/sessions/FM0001/nii
hcp: /home/moanae/shared/project_FM_Gracely_TEST_FM0001/sessions/FM0001/hcp
hcpready: true
1   :                :run-01
2   :T1w             :T1w run-01
3   :T2w             :T2w run-01
4   :FM-Phase        :phasediff acq-asl run-01: asl: fm(4)
5   :                :magnitude2 acq-asl run-01
6   :                :magnitude1 acq-asl run-01
7   :FM-Magnitude    :magnitude acq-asl run-01: asl: fm(4)
8   :FM-Phase        :phasediff acq-dwi run-01: dwi: fm(1)
9   :                :magnitude2 acq-dwi run-01
10  :                :magnitude1 acq-dwi run-01
11  :FM-Magnitude    :magnitude acq-dwi run-01: dwi: fm(1)
12  :                :magnitude1 acq-funcrest run-01
13  :                :magnitude2 acq-funcrest run-01
14  :FM-Phase        :phasediff acq-funcrest run-01: funcrest: fm(2)
15  :FM-Magnitude    :magnitude acq-funcrest run-01: funcrest: fm(2)
16  :                :magnitude1 acq-funcstim run-01
17  :                :magnitude2 acq-funcstim run-01
18  :FM-Phase        :phasediff acq-funcstim run-01: funcstim: fm(3)
19  :FM-Magnitude    :magnitude acq-funcstim run-01: funcstim: fm(3)
20  :bold3:auditory  :bold auditory run-03: fm(3): bold_num(3)
21  :bold1:intermingled:bold intermingled run-01: fm(3): bold_num(1)
22  :bold2:mechanical:bold mechanical run-02: fm(3): bold_num(2)
23  :bold5:rest      :bold rest run-01: fm(2)
24  :bold6:rest      :bold rest run-02: fm(2)
25  :bold4:simultaneous:bold simultaneous run-04: fm(3): bold_num(4)
26  :DWI:dir42_AP    :dwi run-01: fm(1)
27  :ASL             :asl run-01: PCASL1: fm(4)
28  :ASL             :asl run-02: PCASL2: fm(4)

Hi, yes the process imports only the first ASL image and the current implementation of HCP ASL pipelines will only use one image. Like already mentioned this will only work when the ASL image has exactly 90 time points, the pipeline also requires you to have an AP/PA SE pair. All of this limitations are because of an external tool (GitHub - physimals/hcp-asl: ASL pipeline for the Human Connectome Project), not because of QuNex. We will reach out to the pipeline developers to discuss how we want to improve this. Since this is not completely in our hands I, unfortunately, cannot give you any time estimates about when this will be implemented. When the pipelines is improved we will also improve the whole process within QuNex (e.g., onboarding and running ASL on multiple images).

Got it. I will process the ASL data outside QuNex for the time being. Thank you.

On that note, would you be willing to share the ASL processing pipeline/script that you use. I am interested to see how you do it and if that can be integrated into QuNex as a more flexible tool than the current hcp_asl command.

I did ask in the HCP-Users forum about ASL legacy data processing using the HCP ASL pipelines, and this was their response:

Estephan,
Give the specifications of your ASL data I wouldn’t recommend using the HCP pipeline as it comes - as that was tailored for the multi-PLD SMS ASL that HCP-A is using. However, you can process your data using the same BASIL tool in FSL (https://asl-docs.readthedocs.io) that the HCP pipeline is based on and thus achieve an analysis that is functionally equivalent.
Michael

So I will try BASIL from FSL to process my ASL legacy data in the next several months (my priority is the functional BOLD data processing at this point). I will be happy to share my scripts at that point. Thank you.

Yes, if you could share the scripts once you have them that would be great. Thanks!