Closed smeisler closed 2 years ago
Hi @smeisler , it seems like the CIFTI resolution might not match the surface geometry resolution.
If you do summary(read_xifti(fnames_ts))
, what is the printed output? This will show the numbers of data vertices on the left and right hemispheres.
Then, if you do summary(read_surf(fname_gifti_left))
, what is the printed output? This will show the numbers of vertices on the left surface geometry.
By the way, load_surf
reads in the surfaces included in the ciftiTools package. To read in your own file, e.g. /PATH/TO/fmriprep/SUBJECT/ses-1/anat/SUBEJCT_ses-1_hemi-L_midthickness.surf.gii
, read_surf
should be used instead.
Yes, they are different. Hmm, I wonder why fMRIprep would output a gifti that is incompatable....
And yes, the read vs. load surf was a typo on my end.
I found a compatible .gii from templateflow, and it seems to be past the error now. Thanks!
Great! If you do want to use fname_gifti_left
, another option is resampling it with resample_surf
, setting resamp_res=32492
.
When I try that, I get the following error:
test <- resample_surf(surf=fname_gifti_left, resamp_res = 32492, hemisphere='left')
Error in read_surf(surf = surf, expected_hemisphere = expected_hemisphere, : The object could not be converted into a surface.
Traceback:
1. resample_surf(surf = fname_gifti_left, resamp_res = 32492, hemisphere = "left")
2. make_surf(gii_post, hemisphere)
3. read_surf(surf = surf, expected_hemisphere = expected_hemisphere,
. resamp_res = NULL)
4. stop("The object could not be converted into a surface.")
And (I cut out most of the error message because it is very big and repetitive, the last part is below):
triangle 317355, vertex 0Vertex used twice in one triangle: triangle 317356, vertex 0Vertex used twice in one triangle: triangle 317356, vertex 0Vertex used twice in one triangle: triangle 317357, vertex 0Vertex used twice in one triangle: triangle 317357, vertex 0...
It seems to have that error for every triangle.
I can crosspost this in ciftiTools since this is more of an issue with that.
Sure, that would be great if you could crosspost to ciftiTools! Would you mind attaching the surface file in question as well? Thanks for helping us iron out these issues.
Hello,
I am adapting the HCP tutorial for fmriprep outputs. I generated CIFTI outputs with fmriprep's
--cifti-output 91k
argument. This dataset has 3 runs of data. Thus,fnames_ts
,events_all
, andconfounds_all
are size-3 lists, as described in the documentation. I use the following gifti file (left hemisphere example):/PATH/TO/fmriprep/SUBJECT/ses-1/anat/SUBEJCT_ses-1_hemi-L_midthickness.surf.gii
. I am running into an error described below:Command
Error
More info
The surfaces will load with
load_surf
so I am confident it is not a simple path issue. The current commands seems to have no option to input spheres and instead deafults to that in/tmp/Rtmp49kVVm/sphereL_32492.surf.gii
. I have matching sphere files from the templateflow directory. How can I incorporate those?p.s. I would be happy to share my example fmriprep script when done, in case it can add to your documentation. I imagine it may be of interest to many fmriprep users.
Thanks, Steven