Open chainhomelow opened 1 year ago
You may be interested in https://github.com/CoBrALab/RABIES which is a comprehensive preprocessing pipeline for rodent fRMI
preprint: https://www.biorxiv.org/content/10.1101/2022.08.20.504597v1
How many slices for each image?
@ntustison there are 128 slices I believe. header info provided to confirm.
@gdevenyi thanks for the link! I'll check out the preprint. I don't know that we have RABIES on our system but I'll certainly look at the docs
My guess is that, yes, you're dealing with an outdated build. I run the following and don't have any issues:
$ antsRegistrationSyNQuick.sh -d 3 -f sub-LS101_ses-20221214T100203_roi-brain_T2w.nii -m sub-LS101_ses-20221214T100203_dir-fwd_proc-mean_roi-brain_bold.nii -n 4 -o test
Hi all, sorry to resurrect this a million years later.
@ntustison you were indeed correct that my prior problem was the old ANTS build. I had been under the impression I was using AT LEAST a version from 2022 but we've gotten this changed to the most recent version. When we updated ANTS and ran the following command, it worked for about 60 mice.
antsRegistrationSyNQuick.sh -d 3 \ -f ${ANAT} -m ${TS_ROI} -n 4 \ -o ${DIR_PREP}/${PFX}_proc-mean_roi-brain_reg-intermodalSyn_bold
It failed for 10 mice and I've had a difficult time trying to fix it (hence the follow up). I've investigated the files that failed and I think most of them have the same problem which is a bad affine transform specifically. Most of the failed mice look similar to this:
with the back and bottom blown out a little bit. The images are both anisotropic at this point if it matters. They are .781x2.000x.781
I've tested using antsRegistrationSyNQuick.sh
with the -t r
option and those files look pretty good. Using the -t a
seemed to replicate the bad alignments pretty closely. I also tried skipping affine and using -t sr
but that didn't give enough coverage of the brain (which I expected so, no big deal).
Basically I'm wondering if there's a way to 'fix' the bad affines? Would this be something I'd have to tweak specific parameters for using regular antsRegistration? Or maybe you might have expert eyes on it and see a totally different problem. I'm happy to provide more screenshots, code, or files if you need it.
Thanks all.
Screenshots are sometimes adequate but, in this case, you're going to need to post a problematic data set.
another issue that we once had - and may still have - is that negative intensities can blow up one of the initialization estimators. worth a check.
@ntustison - you got it. I'm attaching the files that created the above screenshot when run through the antsRegistrationSyNQuick.sh
command as written above. In this situation the ${ANAT}
is called _sub-LS102_ses-20221214T113013_roi-brainT2w.nii.gz and the ${TS_ROI}
is the other one (ends in _mean_roi-brainbold.nii.gz.)
sub-LS102_ses-20221214T113013_roi-brain_T2w.nii.gz
sub-LS102_ses-20221214T113013_dir-fwd_proc-mean_roi-brain_bold.nii.gz
And to @stnava 's point - yeah these do have negatives in them. We do registration at sn early-ish step in the pipeline so we haven't done any normalization or anything yet. let me know if i can provide anything else for you.
I ran the following:
$ antsRegistrationSyNQuick.sh -d 3 -f sub-LS102_ses-20221214T113013_roi-brain_T2w.nii -m sub-LS102_ses-20221214T113013_dir-fwd_proc-mean_roi-brain_bold.nii -n 4 -o test
and got something perfectly reasonable (attached as testWarped.nii.gz) considering the input images. I use ITK-SNAP to view the results so I can't tell if it corresponds with what your screenshot shows but you can check.
Describe the problem I am doing preprocessing on mice EPIs for the first time (its not going great). I have been using 'fslchpixdim' to make the voxels in the header of the EPI file to be multiplied by 10 to be a more 'human' resolution because the native EPI resolution is .156x.600x.156 and a lot of preprocessing tools I'm using will error or not work as expected with files of this native resolution. Changing the resolution of the EPIs to 1.563x6.000x1.563 seems to 'work' insofar that processing proceeds successfully until registration. I am trying to register the mean EPI image (single 3D image) to a preprocessed T2 anatomical image. I have also changed the voxels in the header of my anatomical file from .078x.200x.078 to .781x2.00x.781 - so both the anatomical and EPI files had their voxel resolutions scaled the same. I originally used the following antsRegistration call. In this call, ${ANAT} is the 'human' sized, masked T2 and ${TS_ROI} is the 'human' sized masked EPI (both files are skullstripped/masked)
This kept erroring at the Syn step with some version of this error:
I got these parameters from someone who used to work here so I figured the parameters I was using here were not 'optimized' (or even good) for mice so I searched here and the closest I could find to my problem was issue #734 So I tried again with some parameters changed from (probably stupid) guesses I made off of reading that issue thread and I came up with this:
Mostly I changed a lot of the smoothing sigmas to 0 (guessed from the kernal error) but did change shrink factors and convergence values. But to be clear, I changed them to these things based off that thread, not based on any good understanding of how these options are affecting mice data.
Now, this code ran without erroring and the results are the best I've gotten with any registration so far but they are still just, okay.
Basically at this point I'm wondering if this is the best I'm going to get with this data or if there are just some glaring errors I'm making in this code somewhere.
To Reproduce I'll upload the ${ANAT} and ${TS_ROI} file with this post but I don't expect anyone to fix this for me; more hopefully just some recommendations. This is the $ANAT sub-LS101_ses-20221214T100203_roi-brain_T2w.nii.gz This is the $TS_ROI sub-LS101_ses-20221214T100203_dir-fwd_proc-mean_roi-brain_bold.nii.gz
The raw EPIs are not the BEST quality and have gone through the following preprocessing steps:
System information (please complete the following information) I am using my work's high performance computing environment to code and run this. It's a SGE and I run this on an HPC cluster.
ANTs version information
Thanks all!