N4 bias field correction of 4D images

Hello everyone,

I am trying to perform a bias field correction on a 4D echo series that is used for quantitative MRI. There is significant B0 inhomogeneity which, on a single echo basis, I am able to correct for via the N4 filter. However, understandably, correcting each echo separately with N4 destroys the signal evolution and gives nonsensical quantitative values after calculation. I tried to normalize each corrected echo to their non-corrected counterpart inside a brain mask with different tools, this unfortunately didnt help.

Interestingly, applying the PatchBasedDenoising-Filter after the N4 correction for each echo separately seemed to correct this somehow, with quantitative values again being in a plausible range. I was able to replicate this by k-means clustering voxels together depending on their decay values over all echoes and then averaging the clusters inside each echo, which also somewhat restored the pre-correction value distribution. I assume that the N4 filter introduces some local, random error that is averaged out by the clustering, but I am not really sure about how this works exactly.

I would be very interested if anyone has figured out a way to perform bias field correction in 4D images, perhaps specifically in qMRI applications. I would also be thankful for any insights into why the PatchBasedDenoising and the clustering “fixes” my signal evolution.

Thanks!

Edit: Link to previous conversation with @ntustison regarding this topic: 4D image bias field correction for quantitative MRI · ANTsX/ANTs · Discussion #1951 · GitHub

Edit2: Correcting each echo for the N4 intensity drift issue via global rescaling or HistogramMatching unfortunately did not work for me

@ntustison might have some suggestions.

Thanks @dzenanz .

@nolog — please provide a link to our conversation on the ANTs forum as I believe I addressed at least why the following occurs:

I assume that the N4 filter introduces some local, random error that is averaged out by the clustering, but I am not really sure about how this works exactly.

It also provides some additional context which might be useful to others.

1 Like

My apologies, I should have linked to our discussion initially - I added the link now.

However, unless I misunderstood, I believe we did not discuss why the PatchBasedDenoising (or the k-means clustering for that matter) fixes the subsequently calculated values. I am really interested in specifically why this happens, because this method is the closest I’ve come to visually correcting the B0 inhomogeneities in my quantitative maps while retaining a value distribution close to the original in the unaffected image regions.

1 Like

Thanks @nolog. I was specifically referring to the N3/N4 “intensity drift” issue which is known but should be explicitly mentioned. You should probably start there and see if global rescaling across time points fixes the issue as that would be the simplest explanation. And, if so, that might be worth mentioning so that it gets included in any future Simple ITK enhancements.

Does the bias field vary with echo time? Could you not bias correct the first echo then output the field, and apply it to subsequent echos?

1 Like

@ntustison
Ah, I see. I did try global rescaling for each echo based on the Mean and Median values of the pre-correction image, as well as HistogramMatching the echos, both to no avail. I will add that info to my post.

@cookpa Thank you for your reply. The artifacts im seeing do seem to increase with TE, I assume they’re mostly caused by B0 inhomogeneities. I did try calculating the bias field from the first echo (and a mean of all echoes, and just the later echoes) and applying to all, which unfortunately didn’t work out, as it seems the variation between the echoes is too large.

1 Like

Rescaling would require matching the range of values, not just the mean or median. This is done automatically by the ANTs version. Histogram matching might also be introducing some artifacts that could confound your diagnosing of the problem.

I just quickly tried out the N4 correction using the ANTs version, with rescale_intensities = True. The rest of the parameters were set as similar as possible to the sitk version that i used. The result is somewhat similar to the result i got using the sitk N4 version without any subsequent image normalisation, the quantitative values are unfortunately still very different from the uncorrected data.

Regarding the Histogram matching, it does seem to change the value distribution in the images, but only to a relatively small degree. I’ve tried everything up to this point with and without the Histogram matching, and the main factors seem to be the N4 correction destroying the values, and the PatchBasedDenoising (and similarly the k-means clustering) restoring the value distribution.

At this point I’d have to actually look at the data and try out your pipeline to determine possible causes.

I understand, unfortunately I am not able to share the actual data currently. If that changes or I find a solution that works well, I’ll definitely get back to you. Thank you very much for your help up to this point, it is much appreciated!