You could also make a cortical-only version of the cifti file. -cifti-separate will give you the cortical data, and the medial wall excluding ROIs, which you can then use in -cifti-create-dense-scalar to re-form them into a dscalar file. You could instead make a cortical-only template cifti file, and then use -cifti-create-dense-from-template to avoid intermediate data files.
Tim On Mon, Oct 9, 2017 at 8:35 AM, Xavier Guell Paradis <xavie...@mit.edu> wrote: > Dear Tim, > Thank you for your reply. I wanted the subcortical data to be 0 so that it > would not interfere with some math operations I wanted to perform using > cortical data only, but I agree with your idea that this is not the optimal > approach (plus the 0's would still affect some of the math operations). In > the end I imported the dscalar file with python as a matrix, excluded all > the rows that did not belong to cortical vertices, and then did the math > operations. > Thank you very much, > Xavier. > ------------------------------ > *From:* Timothy Coalson [tsc...@mst.edu] > *Sent:* Wednesday, October 04, 2017 4:09 PM > *To:* Xavier Guell Paradis > *Cc:* hcp-users@humanconnectome.org > *Subject:* Re: [HCP-Users] How to transform all subcortical values to 0 > in a dscalar? > > You can use -cifti-replace-structure with the -volume-all option and a > volume file of zeroes. If you have a lot of maps (or you want to do > something similar to a long dtseries), you can make a cifti file with 1's > in the surfaces and 0's in voxels, and use -cifti-math to multiply them > together. For a small dscalar file, I would do it like this: > > wb_command -cifti-separate <your-file> COLUMN -volume-all > volspacetemp.nii.gz -crop > wb_command -volume-math '0' zerovol.nii.gz -var x volspacetemp.nii.gz > cp <your-file> data_subcort_zeroed.dscalar.nii > wb_command -cifti-replace-structure data_subcort_zeroed.dscalar.nii > COLUMN -volume-all zerovol.nii.gz -from-cropped > > I am curious, why do you want the subcortical data to be zero? It won't > make the file smaller, and processing commands will still think there is > data there, it won't interact with the surface data regardless of whether > it is zero, and you can choose not to display the subcortical stuff > anyway... > > Tim > > > On Wed, Oct 4, 2017 at 10:07 AM, Xavier Guell Paradis <xavie...@mit.edu> > wrote: > >> Dear HCP experts, >> I have a dscalar file with one map of cortical and subcortical data. I >> would like to transform all subcortical values to 0, and leave the cortical >> surface values intact. I have explored the -cifti-stats and -volume-stats >> options as well as -cifti-create-dense-scalar but cannot figure out a way >> to do this. >> >> Thank you very much, >> Xavier. >> >> _______________________________________________ >> HCP-Users mailing list >> HCP-Users@humanconnectome.org >> http://lists.humanconnectome.org/mailman/listinfo/hcp-users >> > > _______________________________________________ HCP-Users mailing list HCP-Users@humanconnectome.org http://lists.humanconnectome.org/mailman/listinfo/hcp-users