CoBrALab / RABIES

fMRI preprocessing pipeline and analysis tools adapted for rodent images. Visit the full documentation at https://rabies.readthedocs.io/en/stable/
Other
34 stars 14 forks source link

EPI2ANAT (Functional EPI issue) #279

Closed sxf-ux closed 1 year ago

sxf-ux commented 1 year ago

Hello. I have been running my preprocessing pipeline and looking at the QC Report, my structural images appear to have run fine but my Functional EPI Images have not. I can't seem to find any information in the documentation as to why it would. Im running this with rat data and have inputted my own templates.

Here is the script I am using:

singularity run -B ${atlas_folder}:/atlas -B /home1/safiyah/Downloads/sub-01/ses-3:/input_BIDS:ro \
-B /home1/safiyah/Downloads/sub-01/ses-3/preprocess_outputs:/preprocess_outputs/ \
/home1/safiyah/project/rabies.sif -p MultiProc preprocess /input_BIDS/ /preprocess_outputs/ --anat_template ${template} --brain_mask ${mask} --WM_mask ${wm} --CSF_mask ${csf} --vascular_mask ${csf} --labels ${atlas} --bold_robust_inho_cor apply=true,masking=true,brain_extraction=false,template_registration=SyN --TR 0.005  --commonspace_reg masking=false,brain_extraction=false,template_registration=SyN,fast_commonspace=false --bold2anat_coreg masking=true,brain_extraction=true,registration=Rigid

I initially ran the following but it crashed during 'EPI_Coregistration' so I added the masking=true and registration=Rigid for the bold2anat_coreg that you can see above:

singularity run -B ${atlas_folder}:/atlas -B /home1/safiyah/Downloads/sub-01/ses-3:/input_BIDS:ro \
-B /home1/safiyah/Downloads/sub-01/ses-3/preprocess_outputs:/preprocess_outputs/ \
/home1/safiyah/project/rabies.sif -p MultiProc preprocess /input_BIDS/ /preprocess_outputs/ --anat_template ${template} --brain_mask ${mask} --WM_mask ${wm} --CSF_mask ${csf} --vascular_mask ${csf} --labels ${atlas} --bold_robust_inho_cor apply=true,masking=true,brain_extraction=false,template_registration=SyN --TR 0.005  --commonspace_reg masking=false,brain_extraction=false,template_registration=SyN,fast_commonspace=false --bold2anat_coreg masking=false,brain_extraction=true,registration=SyN

I adjusted the registration issue based on the recommendations on the rabies website which fixed my anatomical images. I also found that using robust_inho correction fixed my issue with my EPI images since previously, nothing registered and it was a blank image. Ive added my log and my QC Report for my EPI pipeline below (EPI2ANAT, temporal_features and bold inho corrections). Furthermore, I can't find any examples of failed EPI2Anat and what it means in my case and if what I have is a 'failure'. rabies_preprocess.log

bold_inho_cor sub-01_ses-3_task-rest_acq-EPI_run-1_bold_inho_cor

bold_robust_inho_cor (Native2Unbiased) sub-01_ses-3_task-rest_acq-EPI_run-1_bold_inho_cor_registration

bold_robust_inho_cor (Unbiased2Atlas) _registration

EPI2ANAT sub-01_ses-3_task-rest_acq-EPI_run-1_bold_registration AT

temporal_features sub-01_ses-3_task-rest_acq-EPI_run-1_bold_temporal_features

Thank you in advance !

Gab-D-G commented 1 year ago

Hi, if I am understanding, the EPI2ANAT you are showing corresponds to the latest outputs you obtained while using --bold2anat_coreg masking=true,brain_extraction=true,registration=Rigid? In this case, you are only computing a rigid registration of your scan, so there won't be any non-linear warping to correct for distortions (you should keep the SyN option for non-linear). In the other call you have --bold2anat_coreg masking=false,brain_extraction=true,registration=SyN, which carries out non-linear, but masking is at false, so the brain mask is not used to improve registration. Try --bold2anat_coreg masking=true,brain_extraction=true,registration=SyN instead. Also keep in mind that the distortions in those images you are showing are very severe, and I would not expect a complete correction to be possible.

sxf-ux commented 1 year ago

and what happens if I omit this epi2anat by doing no_reg? what impact would this have downstream?

Gab-D-G commented 1 year ago

There would be no registration. The EPI image would retain its original positioning, dimensions and distortions.