Washington-University / workbench

Connectome Workbench
http://www.humanconnectome.org/software/get-connectome-workbench.html
GNU General Public License v2.0
187 stars 62 forks source link

CIFTI volume preferred orientation #39

Closed mgxd closed 4 years ago

mgxd commented 4 years ago

Hi,

I'm unsure if this is the best place for this issue, but an fmriprep user is having trouble parcellating their BOLD dtseries (https://github.com/poldracklab/fmriprep/issues/2031#issuecomment-599640178). It seems the main issue is fmriprep produces the subcortical volumes in RAS orientation, while other files may have this information in LAS.

Looking at the CIFTI specification (CIFTI-2 Connectivity File Formats), I was under the impression the data should be in RAS

VoxelIJKIndicestospatialXYZcoordinates (+X=>right, +Y=>anterior, +Z=> superior). The resulting coordinate is the center of the voxel.

Should fmriprep change volume orientation to LAS? In any effect, wb_command -cifti-parcellate should probably be flexible enough to handle files of different orientation.

coalsont commented 4 years ago

In a mostly identical manner to NIfTI, the conventions mentioned there are only to define the direction of the coordinate system itself, to define what a "negative" spacing element means. It is not a requirement on the orientation of the volume.

To put it another way, it is saying how to translate an XYZ coordinate specified in mm into physical space (X = positive 5mm is on the right of the origin, not the left, not above, etc), while leaving the choice of IJK to XYZ translation up to the user.

wb_command -cifti-resample will allow you to match an existing other cifti space (and if the voxels do line up exactly, any of the available volume resampling methods mathematically give the same output value as the original, though there is rounding error). At present, most other commands match by either cifti index or voxel IJK, so they require identical volume spaces (more strict than just same orientation).

Personally, I think users would be the least confused if fMRIPrep by default matched the HCP cifti space(s) exactly when feasible. Unless you disagree with the subcortical or medial wall definitions the HCP uses, or your resolutions are significantly different, I don't see a benefit to making a different cifti space. If you used the same orientation and FoV of the MNI template we do for the final resampling of the volume timeseries, this should happen naturally without generating extra files.

mgxd commented 4 years ago

Thanks for the response, Tim. We'll adjust our outputs accordingly.