Inline comments. Tim
On Mon, Jan 29, 2018 at 9:51 AM, Xavier Guell Paradis <[email protected]> wrote: > Dear HCP experts, > I have a dlabel file that labels a particular nucleus of the left thalamus > (thalamusnucleus.dlabel.nii). I would like to convert this dlabel file to a > whole-brain dscalar file, so that this nucleus in the left thalamus has a > value of 1 and the rest of the brain has a value of 0. > > I have tried the following 4 things which have not worked: > 1) *wb_command -cifti-create-dense-from-template template.dscalar.nii > thalamusnucleus.dscalar.nii -label THALAMUS_LEFT thalamusnucleus.dlabel.nii* > "template.dscalar.nii" is a random dscalar file with 1 map that includes > data for the whole brain. > I get this error: > > *ERROR: Parse error while reading: error occurred while parsing element, > line number: 1 column number: 1 File: thalamusnucleus.dlabel.nii* > This is not a label-file-specific command, here "-label" means a gifti label file (.label.gii), which your cifti dlabel file is not. 2) *The option -volume* (instead of -label) gives the error "*volume file > 'thalamusnucleus.dlabel.nii' does not match volume space of template cifti > file*" > Your cifti dlabel file is also not a volume file. If it were a standard 91k grayordinate cifti file, this would have triggered a "not a volume file" warning instead. We can probably improve this check to more reliably detect cifti loaded as a volume. > 3) *The option -cifti* (instead of -label) gives the error "*cifti file > '**thalamusnucleus.dlabel.nii' > uses a different volume space than the template file*". > This signifies that either you are trying to do something like copy 1mm voxel data into a 2mm voxel template, or some other type of mismatch in FOV/origin/orientation. > 4) *wb_command -cifti-label-to-roi thalamusnucleus.dlabel.nii > thalamusnucleus.dscalar.nii -key 1* > This generates a dscalar file, but when I open this file with nibabel in > python I only see 111 data points (which is not the whole brain; note that > what I would like to obtain is a dscalar with "1" values in my left > thalamus nucleus and "0" values in the rest of the brain). > Do wb_command -file-information on your "thalamusnucleus.dlabel.nii" file, it should also only have 111 voxels, because of how you created it (using a parcel label file that only contained thalamus, rather than the Atlas_ROIs.2.nii.gz file from the Pipelines templates folder - the -cifti-create-label command has the volume label data file input separate from the volume parcel input because one of them defines the cifti space, while the other is the data to put into that space). Is there a better way to do this? > The best way is probably to resample your original volume ROI into the correct volume space for your template cifti file, and then the -volume or -volume-all (depending on whether you want it to mask your ROI by the cifti space's thalamus definition) option of -cifti-create-dense-from-template will work. Use -cifti-separate with -volume or -volume-all on the template file to get a volume file with the correct volume space. If it is a standard grayordinate space, you can also just use the template volume file as the volume space. > Thank you, > Xavier. > > _______________________________________________ > HCP-Users mailing list > [email protected] > http://lists.humanconnectome.org/mailman/listinfo/hcp-users > _______________________________________________ HCP-Users mailing list [email protected] http://lists.humanconnectome.org/mailman/listinfo/hcp-users
