Closed egarza closed 4 years ago
Hi @egarza
You dont need to run struc pipeline if you already run the fmriprep https://xcpengine.readthedocs.io/config/cohort.html#functional-processing. xcp will use anatomical output of fmriprep.
masking problem during functional processing is likely to be from fmriprep or struc. Xcp only produces reference volume brain by multiply the mask and reference volume (both from fmriprep).
and you can let be standard=MNI%2x2x2 for functional processing
can you pull for new docker/singulairty image?
Hi @a3sha2
Thanks for the answer. The fmriprep masks are fine, they only are wrong after being copied for xcpEngine. You think the problem is running the struct pipeline as well?
I'm confused about these lines:
3dresample -orient RPI -inset /mnt/MD1200B/egarza/sfernandezl/AddimexTMS/derivatives/fmriprep/output/fmriprep/sub-033/ses-t0/func/sub-033_ses-t0_task-rest_space-T1w_desc-brain_mask.nii.gz -prefix sub-033_ses-t0_imgmask.nii.gz -overwrite
fslmaths sub-033_ses-t0_imgmask.nii.gz -mul sub-033_ses-t0_structmask.nii.gz /mnt/MD1200B/egarza/sfernandezl/AddimexTMS/derivatives/xcpOut/sub-033/ses-t0/prestats/sub-033_ses-t0_mask.nii.gz
Why is 3dresample being used? Because the files I get in xcp prestat (brain mask and volume) do not coincide, which is making the whole problem. If they only multiplied the mask and reference volume there shouldn't be problems. I can upload the files if you need to check, the fmriprep and xcp prestats.
I can get the new images if you think that is the problem, we are using one version from September (xcpengine-2019-09-03.img).
Thanks
Eduardo
this first line of code:
3dresample -orient RPI -inset /mnt/MD1200B/egarza/sfernandezl/AddimexTMS/derivatives/fmriprep/output/fmriprep/sub-033/ses-t0/func/sub-033_ses-t0_task-rest_space-T1w_desc-brain_mask.nii.gz -prefix sub-033_ses-t0_imgmask.nii.gz -overwrite
was added so that structural, functional derivatives and template all have the same orientation RPI
. if you check , the fmriprep writes out the outputs in LPI format. XCP ensures that both structural and functional have the same orientation as template and consistent.
the second line : fslmaths sub-033_ses-t0_imgmask.nii.gz -mul sub-033_ses-t0_structmask.nii.gz /mnt/MD1200B/egarza/sfernandezl/AddimexTMS/derivatives/xcpOut/sub-033/ses-t0/prestats/sub-033_ses-t0_mask.nii.gz
multiply both structural mask and bold mask. Sometime the bold mask generated by fmriprep include some part of the necks and outside brain and the structural mask is always look good with fsl bet. Though there is improvement in fmriprep with afni skullstrip.
Also, there is improvement in the latest version of xcp handling this steps.
Please pull for new (:latest
) xcpengine docker or singularity image and let us know.
Thanks you very much
Hi again,
I ran some subjects using the newest fmriprep image and got the same result. Then I ran it again without running the struc
pipeline and got some errors from ANTs.
Because I ran everything with fmriprep
, I should instead run it without rerunning the prestats, right? I had the prestats_rerun = 1
.
###################################################################
# 1 PRESTATS
###################################################################
prestats_rerun[1]=0
prestats_cleanup[1]=1
prestats_process[1]=FMP
I'm reruning with 0 and see if it makes a difference.
Eduardo
Hi,
I keep getting the same results. Finally I downloaded the latest fmriprep
and the latest xcpEngine
and I'm rerunning subjects to see if that was the problem.
I'll keep you posted.
Eduardo
can you post ants error pls
Hi,
I reran the analysis using the latest fmriprep
and xcpEngine
and that worked. Now I don't see this error and the normalization is perfect.
Therefore, the problem was solved in the newest versions.
Thank you
Eduardo
Old
New
Describe the bug I was checking my xcpEngine output, mainly the residual nifti 4D files for the last sanity check. No Errors. Everything was ran from an fmriprep output.
To me the residual images for most subject showed much less brain than obtained and in some cases the normalization seemed to be the culprit, but others were a puzzle. Here I attach the example.
(In red you can see the
MNI 2mm template
, in gray the residual 4D fMRI from xcpOutputsub_ses_std.nii.gz
).Brain masks were fine in fmrprep, so I went to check the masks in the xcp
prestats
folder. That's when I realized the masks were wrongmask.nii.gz
. The orientation was correct but the mask was not centered, hence when thereferenceVolumeBrain.nii.gz
was created usingfslmaths
, it cut much of the brain, which was made worse in the normalization.(
mask.nii.gz
in red,preprocessed.nii.gz
file in gray)(
referenceVolumeBrain.nii.gz
in red,referenceVolume.nii.gz
file in gray)I don't know what the problem may be in terms of the pipeline, however it is perhaps that the use of AFNI for resampling (
3dresample
) prior to brain extracting withFSL
may be screwing up the geometry of the mask. This could be resolved by copying the geometry of the images to the mask.Any help is appreciated.
Thank you
Eduardo
Cohort file
Design File
Anatomical
Functional
Error message No Errors
Runtime Information Singularity was used in an HCP
Additional context Add any other context about the problem here.