Hello all,
I have an ROI which is 2933 voxels big and every voxel has a unique index number (created with fslmaths -index starting from a binary ROI).
I also shifted the index numbers by +117 in order to combine it with another ROI (AAL atlas) so the index numbers end up being 117-3049 in the ROI which I want to change the values of.
Now the actual goal is to replace the numbers 117-3049 in my ROI (masked nifti image) with numbers from a text file where each value (a single integer) in each row from 1-2933 corresponds to the 117-3049 voxels in the image.
So, e.g. the text file looks like this:
21
21
33
45
0
0
5
…. etc.
I want to replace voxels indexed with 117-118 with 21, voxel 119 with 33, voxel 120 with 45, voxel 121-122 with 0 etc.
(Just to give it some context, my text file represents the cortical areas that each voxel is most connected to measured through number of streamlines by tractography; the 0's mean that this voxel did not show any connectivity with any region).
Thanks for your input,
Georg
|