transmit bias pipeline

1,223 views
Skip to first unread message

Victoria King

unread,
Dec 11, 2024, 2:08:02 PM12/11/24
to HCP-Users
Hi all,

I am really excited to see the transmit field bias correction pipelines integrated into v5.0.0! I have been working through the former pipelines, in which I was following the steps I outlined with your help here. As I was looking through the new release, it looks like the transmit bias pipelines have either been incorporated into PostFreeSurfer, or I need to run them separately.

Could you please help me understand how to use the transmit bias pipelines? Assuming I have run PreFreeSurfer, FreeSurfer, and PostFreeSurfer, what are my next steps? Should I rerun PostFreeSurfer, which will automatically give me transmit field bias-corrected myelin maps? Or should I append the transmit bias step itself? Do the transmit bias scripts still require manual preprocessing of fMRI data?

Thanks for your help as always,
Victoria King

Glasser, Matthew

unread,
Dec 11, 2024, 4:44:53 PM12/11/24
to hcp-...@humanconnectome.org

I don’t understand the question.  It looks like the e-mail chain you referenced explains what to do (in your e-mail) with one modification that I made subsequently.

 

Matt.

--
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 visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/7a4588e5-4afd-4015-ae0f-763656d2829dn%40humanconnectome.org.

 


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.

Tim Coalson

unread,
Dec 11, 2024, 7:13:29 PM12/11/24
to hcp-...@humanconnectome.org
Transmit bias is not incorporated into PostFreeSurfer, and we don't intend to ever combine them.  We always had a generic bias correction that just used the difference from a group template to remove all low spatial frequency differences between individuals, but that is not equivalent (TransmitBias doesn't start from this template-based correction, it starts closer to the original scans).  Use the TransmitBiasBatch.sh launcher here (after running the other pipelines mentioned in the thread you linked):


There is also a script to run a single new subject that is matched to a group you have already run the full TransmitBias process on (still have to run the same other pipelines first, it just skips running the group scripts).

Tim


--

Victoria King

unread,
Dec 12, 2024, 2:34:43 PM12/12/24
to HCP-Users, tim.c...@gmail.com
Apologies for the confusion, Dr. Glasser. I wasn't sure if the new release deviated from our previous email chain in which you confirmed the order of the pipelines. Tim, your answer clarified things for me. Thank you both!

Victoria

Victoria King

unread,
Dec 16, 2024, 7:28:39 PM12/16/24
to HCP-Users, Victoria King, tim.c...@gmail.com
Hi again,

I have a follow-up question. Does the transmit bias correction pipeline require resting state scans as input? That is, does transmit bias correction require preprocessing of fMRI data at all, or is there a way to achieve transmit bias-corrected myelin maps, using the psuedo transmit method, without having to preprocess fMRI data?

Thanks,
Victoria

Tim Coalson

unread,
Dec 16, 2024, 8:57:08 PM12/16/24
to Victoria King, HCP-Users
PseudoTransmit uses the spin echo fieldmaps and the gradient echo reference image to approximate what the transmit bias is.  It accesses these files from the working folder for the fMRI distortion correction, so it does require that you have preprocessed some fMRI first.  It also requires a group estimate of transmit-corrected myelin from a different method in order to calibrate the SE+GRE approximation.

Tim

Victoria King

unread,
Dec 17, 2024, 8:48:52 AM12/17/24
to HCP-Users, tim.c...@gmail.com, HCP-Users, Victoria King
Ah okay, I see. How do I acquire a group estimate of transmit-corrected myelin?

Victoria

Glasser, Matthew

unread,
Dec 17, 2024, 6:29:39 PM12/17/24
to hcp-...@humanconnectome.org, tim.c...@gmail.com, Victoria King

There is one in the BALSA dataset for Glasser et al., 2022 Neuroimage.


Matt.

Message has been deleted

Glasser, Matthew

unread,
Dec 23, 2024, 2:46:17 PM12/23/24
to Victoria King, HCP-Users, tim.c...@gmail.com

It looks okay as far as I can tell without knowing the specifics of your data.


Matt.

 

From: Victoria King <torily...@gmail.com>
Date: Monday, December 23, 2024 at 1:35 PM
To: HCP-Users <hcp-...@humanconnectome.org>
Cc: "Glasser, Matthew" <glas...@wustl.edu>, "tim.c...@gmail.com" <tim.c...@gmail.com>, Victoria King <torily...@gmail.com>
Subject: Re: [hcp-users] transmit bias pipeline

 

 

Got it, thank you.

 

I'm afraid I might not be executing the code as I should be. Could you all please look through my wrapper scripts (attached) and provide some extra clarification? Am I using the correct inputs? Please excuse my misunderstanding. 

 

Here's what I've done so far:

After PreFreeSurfer, FreeSurfer, and PostFreeSurfer, I ran a separate wrapper script for fMRI Volume (AP & PA), then separate fMRI Surface (AP & PA). Then I ran ICAFIX multi run, concatenating the AP and PA together. I ended up using pyfix since I couldn't get compiled MATLAB to work. My plan is to move on to MSMAll and DeDriftandResample, and then running the transmit bias batch script. This, again, is with the ultimate goal of running a group comparison of transmit bias-corrected myelin maps.

 

Thanks and happy holidays, 

Victoria

Victoria King

unread,
Dec 23, 2024, 2:46:22 PM12/23/24
to HCP-Users, glas...@wustl.edu, tim.c...@gmail.com, Victoria King
Got it, thank you.

I'm afraid I might not be executing the code as I should be. Could you all please look through my wrapper scripts (attached) and provide some extra clarification? Am I using the correct inputs? Please excuse my misunderstanding. 

Here's what I've done so far:
After PreFreeSurfer, FreeSurfer, and PostFreeSurfer, I ran a separate wrapper script for fMRI Volume (AP & PA), then separate fMRI Surface (AP & PA). Then I ran ICAFIX multi run, concatenating the AP and PA together. I ended up using pyfix since I couldn't get compiled MATLAB to work. My plan is to move on to MSMAll and DeDriftandResample, and then running the transmit bias batch script. This, again, is with the ultimate goal of running a group comparison of transmit bias-corrected myelin maps.

Thanks and happy holidays, 
Victoria
On Tuesday, December 17, 2024 at 5:29:39 PM UTC-6 glas...@wustl.edu wrote:
fmri_vol_AP.sh
hcp_multi_fix_pyfix.sh
fmri_surf_AP.sh

Victoria King

unread,
Dec 23, 2024, 2:49:22 PM12/23/24
to HCP-Users, Victoria King, glas...@wustl.edu, tim.c...@gmail.com
Dr. Glasser,

Thanks for your reply; I replaced the .sh files with some redactions.

I'm glad to hear everything looks okay so far. Why am I preprocessing resting state images? Are those needed for the transmit bias scripts?

Victoria

Glasser, Matthew

unread,
Dec 23, 2024, 2:51:08 PM12/23/24
to hcp-...@humanconnectome.org, Victoria King, tim.c...@gmail.com

If you are using pseudotransmit you need some fMRI.  Also it works better with MSMAll registration.


Matt.

 

From: Victoria King <torily...@gmail.com>


Reply-To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Date: Monday, December 23, 2024 at 1:49 PM
To: HCP-Users <hcp-...@humanconnectome.org>

Victoria King

unread,
Dec 23, 2024, 2:59:38 PM12/23/24
to HCP-Users, glas...@wustl.edu, Victoria King, tim.c...@gmail.com
Right, okay. Can you help me understand why I need fMRI for pseudotransmit? I'm still not quite understanding. What are the outputs I'll ultimately use after MSMAll for inputs into the psuedotransmit script?

Tori

Glasser, Matthew

unread,
Dec 23, 2024, 3:01:41 PM12/23/24
to hcp-...@humanconnectome.org, Victoria King, tim.c...@gmail.com

Pseudotransmit is based on the GRE and SE of the fMRI (the SBRef and the SE fieldmap).  MSMAll uses the fMRI timeseries for functional alignment.

Victoria King

unread,
Dec 23, 2024, 3:11:35 PM12/23/24
to HCP-Users, glas...@wustl.edu, Victoria King, tim.c...@gmail.com
Okay, I think I better understand now. I really appreciate your patience.

Happy holidays,
Tori

Victoria King

unread,
Dec 27, 2024, 10:15:11 PM12/27/24
to HCP-Users, Victoria King, glas...@wustl.edu, tim.c...@gmail.com
Dr. Glasser,
I've located the BALSA page with the transmit bias correction dataset; could you please point me to the reference template I should use? Also, is there a voltages file in that dataset as well, or is this something I should get from my scanner?
Thanks again,
Victoria

Glasser, Matthew

unread,
Dec 29, 2024, 3:04:21 PM12/29/24
to Victoria King, HCP-Users, tim.c...@gmail.com

Victoria King

unread,
Jan 2, 2025, 2:20:54 PMJan 2
to HCP-Users, glas...@wustl.edu, tim.c...@gmail.com, Victoria King
HCP experts,

I have been able to apply almost all of the pipelines to complete transmit bias correction of myelin maps in order to perform group comparisons. I have two outstanding questions:

1. How do I obtain the scanner-calibrated transmit voltages file? Can you please explain what this is used for in the PseudoTransmit pipeline?

2. It seems that the TransmitBiasBatch.sh example script runs Phase 1 (and possibly Phase 3?) serially. I have about 600 subjects, which would take quite a bit of time. Is there a way to get the script to run all subjects in parallel (noting that there may be limits in terms of compute power/memory)? I tried troubleshooting this by adjusting the fsl_sub command as follows: phase1jobids+=($(fsl_sub -t 1-2 -q "$queue" "$HCPPIPEDIR"/TransmitBias/Phase1_IndividualAlign.sh \. The error I got was "fsl_sub: error: Individual and array tasks are mutually exclusive." Further research suggested "If you include individual subject-specific parameters (like --subject="$subject") in the command, fsl_sub treats it as an individual job, which conflicts with the -t ARRAY_TASK option."  

Thank you all so much for your continued assistance.
Victoria

Tim Coalson

unread,
Jan 2, 2025, 3:56:47 PMJan 2
to Victoria King, HCP-Users, glas...@wustl.edu
The jobs should be submitted individually, they are not task array files.  If your fsl_sub needs to have a parallel environment specified in order to run more than one job at a time, do so.  Ours is configured so that merely specifying a queue that is defined by SGE causes the jobs to run in parallel.

Tim

Glasser, Matthew

unread,
Jan 4, 2025, 6:31:30 PMJan 4
to tim.c...@gmail.com, Victoria King, HCP-Users

As to the other question, this is available in the dcm2niix JSON:

 

"TxRefAmp"

 

Matt.

Victoria King

unread,
Jan 9, 2025, 10:12:34 AMJan 9
to HCP-Users, glas...@wustl.edu, HCP-Users, tim.c...@gmail.com, Victoria King
Hi all,

Thank you all so much for your help. I was able to get the batch script to run in parallel and was also able to find the TxRefAmp values and create a voltages file. Below are what I hope to be the last few questions related to the transmit bias pipeline:

1. I want to make sure I'm using the correct final pseudo-corrected myelin map to test for inter-individual differences; I've located "$DownSampleFolder"/"$Subject".MyelinMap_PseudoCorr_"$RegString"."$LowResMesh"k_fs_LR.dscalar.nii. Is this the correct final output?
2. As a follow-up to question to the above, this file looks like it is produced during Phase 3 of the PseudoTransmit script. If that is true, what is the function of Phase 4? Why don't specific subjects exist in the "$StudyFolder"/"$GroupAverageName" folder?
3. I've seen in previous email chains that when running MR Fix it is better to use highpass=0 since it is faster. Does using highpass=0 vs highpass=2000 have an impact on the final pseudo-corrected myelin map?
4. Lastly, what is the difference between the PseudoTransmitField and rPseudoTransmitField?

Thanks again,
Victoria

Glasser, Matthew

unread,
Jan 9, 2025, 12:35:15 PMJan 9
to hcp-...@humanconnectome.org, tim.c...@gmail.com, Victoria King
  1. That should be correct.
  2. It can make regressed out versions. I believe these are in the .All. files.
  3. This will not have any impact.
  4. The second is smoothed.

Victoria King

unread,
Jan 14, 2025, 4:06:19 PMJan 14
to HCP-Users, glas...@wustl.edu, tim.c...@gmail.com, Victoria King
Dr. Glasser,

Thank you again. I am now attempting to apply an ROI mask to the PseudoTransmit-corrected myelin map. However, when I use the command, "wb_command -cifti-separate sub-PHCPP1005782.MyelinMap_PseudoCorr_MSMAll.32k_fs_LR.dscalar.nii COLUMN -metric CORTEX_LEFT myelinmap_layer1_L.func.gii -metric CORTEX_RIGHT myelinmap_layer1_R.func.gii", the resulting files each show 32492 vertices, while the input file has 59412 (29696 for CortexLeft and 29716 for CortexRight). What is the reason for this? Do you have a suggestion for how to obtain an ROI mask for the CortexLeft and CortexRight to apply to the PseudoTransmit-corrected myelin map?

Thanks so much, 
Victoria

Tim Coalson

unread,
Jan 14, 2025, 4:41:08 PMJan 14
to Victoria King, HCP-Users, glas...@wustl.edu
The cifti format has the ability to exclude the medial wall from the indices that are represented.  The -cifti-separate command has options to output the ROI of represented vertices/voxels for each structure.

If you import your analysis ROI to cifti with -cifti-create-dense-from-template, you can use -cifti-math to do masking with an expression like "(roi > 0) * data".

Tim

Victoria King

unread,
Jan 17, 2025, 10:19:55 AMJan 17
to HCP-Users, tim.c...@gmail.com, HCP-Users, glas...@wustl.edu, Victoria King
Tim,

That is so helpful! Thanks so much.

Victoria

Bartosz Kossowski

unread,
May 29, 2025, 10:46:36 AMMay 29
to HCP-Users, Tim Coalson, HCP-Users, Victoria King

Hi,

I've been reading through this conversation to better understand how bias correction is implemented. I do have a measured transmit field. Would it be necessary to process anatomical scans with fieldmaps and SBRef scans in this case?

Also, could you please share any documentation or a manual on how to run the bias correction scripts in Qunex after the PostFreesurfer step?

Best regards,
Bartosz Kossowski

Glasser, Matthew

unread,
May 29, 2025, 12:19:40 PMMay 29
to hcp-...@humanconnectome.org, tim.c...@gmail.com, Victoria King

What kind is it?

Matt.

 

From: Bartosz Kossowski <b.kos...@nencki.edu.pl>
Reply-To: "hcp-...@humanconnectome.org" <hcp-...@humanconnectome.org>
Date: Thursday, May 29, 2025 at 8:49 AM
To: HCP-Users <hcp-...@humanconnectome.org>
Cc: "tim.c...@gmail.com" <tim.c...@gmail.com>, HCP-Users <hcp-...@humanconnectome.org>, Victoria King <torily...@gmail.com>
Subject: Re: [hcp-users] transmit bias pipeline

 

Hi,

Bartosz Kossowski

unread,
May 30, 2025, 4:02:24 AMMay 30
to HCP-Users, Glasser, Matthew, tim.c...@gmail.com, Victoria King

Hi,

For the B1 correction, we acquire the standard Siemens RF-map scan. I’ve also found the relevant command in the Qunex package documentation here: https://qunex.readthedocs.io/en/latest/api/gmri/hcp_transmit_bias_individual.html.

It would be very helpful if you could summarize the steps in bullet points. I’ve currently stopped after running PostFreesurfer for a single subject.

A few questions:

  • Do I need to preprocess all subjects before running the B1 correction?

  • What exactly is the required "group-corrected myelin file"?

Thanks in advance!
B.

Tim Coalson

unread,
May 30, 2025, 11:54:23 PMMay 30
to Bartosz Kossowski, HCP-Users, Glasser, Matthew, Victoria King
The Siemens rf_map may be a B1Tx sequence (two files, the second one is proportional to transmit strength).

The group corrected myelin file should be in the released group transmit-corrected data, look for MNINonLinear/fsaverage_LR32k/Partial.MyelinMap_GroupCorr_MSMAll.32k_fs_LR.dscalar.nii

Tim

Glasser, Matthew

unread,
May 31, 2025, 12:49:59 PMMay 31
to tim.c...@gmail.com, Bartosz Kossowski, HCP-Users, Victoria King

Yes, use the B1Tx pathway.  It might be good for you to report the resolution of your structural scans, the transmit field that you acquired, and whether these scans used pre-scan normalize one.


Matt.

Bartosz Kossowski

unread,
Jul 3, 2025, 4:35:18 AMJul 3
to HCP-Users, Glasser, Matthew, HCP-Users, Victoria King, tim.c...@gmail.com, Bartosz Kossowski
Thank you for your previous post. I’ve successfully prepared the T1, T2, and RF maps and processed them using QUNEX with their support. As you mentioned, I downloaded the myelin correction template from your dataset. However, when trying to run hcp_transmit_bias_individual, I encountered missing files such as GMWMTemplate.nii.gz.

I was under the impression that it should be possible to run this step for a single subject using B1Tx (not PseudoTransmit) without requiring group-level templates. Am I wrong, or is this a limitation of the Qunex' implementation?

B.

Jure Demsar

unread,
Jul 3, 2025, 8:09:25 AMJul 3
to HCP-Users, Bartosz Kossowski, glas...@wustl.edu, HCP-Users, Victoria King, tim.c...@gmail.com
Hi,

To add some context from the QuNex side. The parameter is marked as mandatory on the HCP side. When I was developing this, HCP side privately shared with me three templates:
  • AFIGMWMTemplate.nii.gz,
  • B1TxGMWMTemplate.nii.gz,
  • GMWMTemplate.nii.gz.
I did not integrate this into QuNex and add them as defaults since I do not know whether they can be shared publicly and whether these are generalisable across custom datasets. If this is the case, then I can quickly integrate this into QuNex, and set the GMWMTemplate parameter default so it points to one of these, depending on the configuration of other parameters.

Best, Jure

Glasser, Matthew

unread,
Jul 3, 2025, 3:00:00 PMJul 3
to hcp-...@humanconnectome.org, Bartosz Kossowski, Victoria King, tim.c...@gmail.com

That is just an ROI of a tight brain mask for the volume results (i.e., including only grey and white matter).  I’m not sure why there are three versions that you have Jure.  I suspect this gets generated by one of the group scripts if you are running this with a big group (so you have a consistent brain mask across all your individuals).  For testing on a single individual, it would probably be fine to just select the grey and white matter from a FreeSurfer wmparc.nii.gz in MNI space, e.g., ${StudyFolder}/${Subject}/MNINonLinear/wmparc.nii.gz  You can do that with wb_command -volume-label-import <input> https://github.com/Washington-University/HCPpipelines/blob/master/global/config/FreeSurferAllGMWM.txt <output> -discard-others -drop-unused-labels.


Matt.

Tim Coalson

unread,
Jul 3, 2025, 5:26:50 PMJul 3
to Glasser, Matthew, hcp-...@humanconnectome.org, Bartosz Kossowski, Victoria King
Using the GMWMTemplate from the same group as the group-corrected myelin file would more closely match how it runs in group mode (it is generated by the group scripts in group mode).  It is used to mask the MNI-space volume outputs to generate the _Atlas versions.  If you don't care whether those have the same mask as the group, you could use an individual brain mask as Matt says.

Tim

Glasser, Matthew

unread,
Jul 3, 2025, 5:35:29 PMJul 3
to tim.c...@gmail.com, hcp-...@humanconnectome.org, Bartosz Kossowski, Victoria King

GMWM masks are based on the individuals in the group, not the method used for transmit field measurement.  Those file names below are confusing.

Jure Demsar

unread,
Jul 4, 2025, 1:44:38 AMJul 4
to HCP-Users, glas...@wustl.edu, hcp-...@humanconnectome.org, Bartosz Kossowski, Victoria King, tim.c...@gmail.com
Yes, I think Tim sent these templates via Slack for my internal testing.

Would it make sense to automatically create the invidiual GMWMTemplate in cases where users do not provide an explicit path to a group template?

Jure

Bartosz Kossowski

unread,
Jul 4, 2025, 5:29:08 AMJul 4
to HCP-Users, Jure Demsar, glas...@wustl.edu, hcp-...@humanconnectome.org, Bartosz Kossowski, Victoria King, tim.c...@gmail.com
Thanks for the replies! I support the idea of automatically creating the mask for a single subject when running a single analysis. I’d just add that in the end, most of us want to do group analyses too - so it’d be great if the group GMWM mask could be created as well, like in the original pipelines.
Kind regards
B.

Glasser, Matthew

unread,
Jul 6, 2025, 4:18:57 PMJul 6
to demsa...@gmail.com, HCP-Users, Bartosz Kossowski, Victoria King, tim.c...@gmail.com

I think that would be a good idea.

Reply all
Reply to author
Forward
0 new messages