This corresponds to a 3x3x3 image where the middle voxel on the first slice equals 1 (surrounded by zeros), middle voxel equals 2 on the second slice and middle voxel equals 3 on the third slice.
Opening in an image viewer also confirms that the resulting image is as expected.
Niels
On Thu, Jul 6, 2017 at 10:48 PM, Chernoff, Ben <
[log in to unmask]> wrote:
>
> Dr. Bergsland,
>
> Thank you very much for the reply. I suspected fslascii2img would make sense but the documentation is extremely sparse and I’ve failed in my attempts to experiment with it. Zero’s for all other coordinates is no problem, I have that by default anyway because
of fslmeants --showall. However, if fslascii2img takes the text file as input and the text file already has every single coordinate (x, y, z) and intensity value as well, what do I use for the arguments of fslascii2img?
>
> Thank you!
>
> -Ben
>
> Ben Chernoff
> Ph.D. Student, Concepts, Actions, and Objects Lab
> Rochester Center for Brain Imaging, Room 2B231
> University of Rochester
>
> On Jul 6, 2017, at 3:22 PM, Niels Bergsland <
[log in to unmask]> wrote:
>
> Re-reading your email, you'll need to get the original text file with your coordinates into a format such that there are zeros in all other coordinates. But that shouldn't be too difficult, and will certainly more efficient.
>
> On Thu, Jul 6, 2017 at 21:17 Niels Bergsland <
[log in to unmask]> wrote:
>>
>> Hi there,,
>> It sounds like fslascii2img should do the trick for you.
>>
>> On Thu, Jul 6, 2017 at 21:12 Ben Chernoff <
[log in to unmask]> wrote:
>>>
>>> Hello FSL experts,
>>>
>>> I'm currently looking for an efficient way to draw an image/mask (.nii.gz) out of a large set of coordinates that I have in a 4D text file (x, y, z, and intensity value). Right now I have a very inefficient method whereby I have to loop over each row of
the text file and run fslmaths for each coordinate and use -add with -roi to add the intensity value of a single value to a zero'd version of the anatomy, and then that resulting image gets added to the previous one:
>>>
>>> fslmaths <anatomy.nii.gz> -mul 0 -add <intensity> -roi <x> 1 <y> 1 <z> 1 0 1 <temp.niii.gz>
>>> fslmaths <sum.nii.gz> -add <temp.nii.gz> <sum.nii.gz>
>>>
>>> With hundreds of thousands of coordinates, this takes a very long time to run and I figure that surely there must be a more efficient way.
>>>
>>> For context, the intensity values in each voxel are correlation values between tractography results (35 subjects by n-voxels of the brain) and fMRI beta values (from the same 35 subjects). I perform the correlation using fslmeants to extract tractography
results, concatenate subjects (common space) and then use MATLAB to correlate with the beta values in each voxel.
>>>
>>> Thanks in advance for any help!!
>>>
>>> -Ben Chernoff
>>
>> --
>> Niels Bergsland
>> Integration Director / Research Assistant Professor of Neurology
>> Buffalo Neuroimaging Analysis Center / University at Buffalo
>> 100 High St. Buffalo NY 14203
>>
[log in to unmask]
>
> --
> Niels Bergsland
> Integration Director / Research Assistant Professor of Neurology
> Buffalo Neuroimaging Analysis Center / University at Buffalo
> 100 High St. Buffalo NY 14203
>
[log in to unmask]
>
>
--
Niels Bergsland
Integration Director / Research Assistant Professor of Neurology
Buffalo Neuroimaging Analysis Center / University at Buffalo
100 High St. Buffalo NY 14203
[log in to unmask]