acpc alignment of labels generated by recon-all

120 views
Skip to first unread message

Asa Borzabadi

unread,
Sep 27, 2022, 2:13:30 PM9/27/22
to hcp-...@humanconnectome.org
Dear experts,

My aim is to use MRI data which has been minimally-processed via the HCPpipeline and I want to identify subject-specific labels coming from the Benson,2014 method in which the visual areas are estimated based on subject-specific results of the recon-all. My analysis needs to be done in native subject space ( as T1w_acpc_dc_restore_brain.nii.gz), which means I want the areas' labels in the native subject space as well.

For some reason when I use ${StudyFolder}/${SubjectID}/T1w/${SubjectID}/ as the output of recon-all ( after prefreesurfer, freesurfer, and postfreesurfer bash files being compiled) the benson14_retinotopy code faces errors. However, when I used the unprocessed data and simply ran the recon-all command ( independent of the pipeline), and used those outputs, the benson14_retinotopy code worked and I got the labels;  the labels (.mgz) are aligned with the brain.mgz file which has been generated by the freesurfer recon-all command.

(brain.mgz after simple recon-all (no pipeline) & Visual_areas_benson_aligned_with_brain_mgz_recon_all.nii.gz)
image.png


However, I want the labels to be aligned with the T1w_acpc_dc_restore_brain.nii.gz, hence I first used convert-xmf to get the inverse of acpc.mat file and then tried the following command:

applywarp -i Visual_areas_benson_aligned_with_brain_mgz_recon_all.nii.gz -o Visual_areas_aligned_with_brain_HCP_T1w_acpc_dc_restore_brain.nii.gz -r T1w_acpc_dc_restore_brain.nii.gz -w acpc_inverse.mat

The results would be ( T1w_acpc_dc_restore-brain.nii.gz &Visual_areas_aligned_with_brain_HCP_T1w_acpc_dc_restore_brain.nii.gz) :
image.png

Could you please let me know what is the correct way to achieve this goal?

Thank you so much for your help.

Regards,
Asa Farahani




Glasser, Matt

unread,
Sep 27, 2022, 3:52:06 PM9/27/22
to hcp-...@humanconnectome.org

What is the error when running inside the HCP Pipelines results? 

Matt.

 

From: Asa Borzabadi <asa.bo...@gmail.com>
Reply-To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Date: Tuesday, September 27, 2022 at 1:13 PM
To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Subject: [hcp-users] acpc alignment of labels generated by recon-all

 

 

Dear experts,

 

My aim is to use MRI data which has been minimally-processed via the HCPpipeline and I want to identify subject-specific labels coming from the Benson,2014 method in which the visual areas are estimated based on subject-specific results of the recon-all. My analysis needs to be done in native subject space ( as T1w_acpc_dc_restore_brain.nii.gz), which means I want the areas' labels in the native subject space as well.

 

For some reason when I use ${StudyFolder}/${SubjectID}/T1w/${SubjectID}/ as the output of recon-all ( after prefreesurfer, freesurfer, and postfreesurfer bash files being compiled) the benson14_retinotopy code faces errors. However, when I used the unprocessed data and simply ran the recon-all command ( independent of the pipeline), and used those outputs, the benson14_retinotopy code worked and I got the labels;  the labels (.mgz) are aligned with the brain.mgz file which has been generated by the freesurfer recon-all command.

 

(brain.mgz after simple recon-all (no pipeline) & Visual_areas_benson_aligned_with_brain_mgz_recon_all.nii.gz)

 

 

However, I want the labels to be aligned with the T1w_acpc_dc_restore_brain.nii.gz, hence I first used convert-xmf to get the inverse of acpc.mat file and then tried the following command:

 

applywarp -i Visual_areas_benson_aligned_with_brain_mgz_recon_all.nii.gz -o Visual_areas_aligned_with_brain_HCP_T1w_acpc_dc_restore_brain.nii.gz -r T1w_acpc_dc_restore_brain.nii.gz -w acpc_inverse.mat

 

The results would be ( T1w_acpc_dc_restore-brain.nii.gz &Visual_areas_aligned_with_brain_HCP_T1w_acpc_dc_restore_brain.nii.gz) :

 

Could you please let me know what is the correct way to achieve this goal?

 

Thank you so much for your help.

 

Regards,

Asa Farahani

 

 

 

 

--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion on the web visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/CA%2Bs6gvkKk77J7fKZJaSonfJnvvu%3DfiwwJqon%3DHt_gsff%3DVi6Zw%40mail.gmail.com.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Asa Borzabadi

unread,
Sep 27, 2022, 4:11:49 PM9/27/22
to hcp-...@humanconnectome.org
Thanks for the reply. 

The error is included in this email, however, if I run the same thing for the data processed only via recon-all, it does not face any errors.

python3 -m neuropythy benson14_retinotopy 031 -v

Processing subject 031:
   - Interpolating template...

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/__main__.py", line 19, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/__main__.py", line 16, in main
    return commands[argv[0]](argv[1:])
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/commands/benson14_retinotopy.py", line 157, in main
    (lhdat, rhdat) = predict_retinotopy(sub,
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/vision/retinotopy.py", line 1678, in predict_retinotopy
    subj_hems = (sub.lh, sub.rh)
  File "/home/asa/.local/lib/python3.8/site-packages/pimms/immutable.py", line 135, in _imm_getattribute
    value = memfn(*[getattr(self, arg) for arg in args])
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/mri/core.py", line 154, in lh
    return hemis.get('lh', None)
  File "/usr/lib/python3.8/_collections_abc.py", line 660, in get
    return self[key]
  File "/home/asa/.local/lib/python3.8/site-packages/pimms/util.py", line 856, in __getitem__
    return self._examine_val(k, ps.PMap.__getitem__(self, k))
  File "/home/asa/.local/lib/python3.8/site-packages/pimms/util.py", line 852, in _examine_val
    val = val()
  File "/home/asa/.local/lib/python3.8/site-packages/pimms/util.py", line 756, in curried_f
    return f(*(args0 + args), **merge(kwargs0, kwargs))
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/freesurfer/core.py", line 562, in cortex_from_filemap
    tris = hdat.tess['white']
  File "/home/asa/.local/lib/python3.8/site-packages/pimms/util.py", line 856, in __getitem__
    return self._examine_val(k, ps.PMap.__getitem__(self, k))
  File "/home/asa/.local/lib/python3.8/site-packages/pimms/util.py", line 852, in _examine_val
    val = val()
  File "/home/asa/.local/lib/python3.8/site-packages/pimms/util.py", line 756, in curried_f
    return f(*(args0 + args), **merge(kwargs0, kwargs))
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/util/filemap.py", line 980, in lookup
    if 'filt' in inst: val = inst['filt'](val)
  File "/home/asa/.local/lib/python3.8/site-packages/neuropythy/freesurfer/core.py", line 318, in <lambda>
    'load':_load_geo, 'filt':lambda u:u[1]}),
TypeError: 'NoneType' object is not subscriptable

Asa Borzabadi

unread,
Sep 27, 2022, 4:30:53 PM9/27/22
to hcp-...@humanconnectome.org
Could it be due to the fact that in the outputs from HCPpipeline, we don't have a file named "rh.white" in the surf directory? 
- if so, should I rename lh.white.deformed to lh.white? 

image.png

Glasser, Matt

unread,
Sep 27, 2022, 4:54:04 PM9/27/22
to hcp-...@humanconnectome.org

They should have that file.  Are you sure the HCP Pipelines ran without error?  Are you running FreeSurfer version 6.0?

Matt.

 

From: Asa Borzabadi <asa.bo...@gmail.com>
Reply-To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Date: Tuesday, September 27, 2022 at 3:30 PM
To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Subject: Re: [hcp-users] acpc alignment of labels generated by recon-all

 

 

Could it be due to the fact that in the outputs from HCPpipeline, we don't have a file named "rh.white" in the surf directory? 

- if so, should I rename lh.white.deformed to lh.white? 

 

Asa Borzabadi

unread,
Sep 28, 2022, 8:49:47 AM9/28/22
to hcp-...@humanconnectome.org
Yes, you are right, it was my setting's problem. Thank you for the great hint.

Regards,

Reply all
Reply to author
Forward
0 new messages