Thank Matthew,

very fine,

but I received this message

Sizes incompatible: 1 voxels vs 0 numbers

My txt file is a dataframe with X,Y, Z as numeric and the 4th column for the labels as character.

Kindly, could you indicate what is the problem?

AV


----Messaggio originale----
Da: Matthew Webster <[log in to unmask]>
Data: 4-mar-2016 10.44
A: <[log in to unmask]>
Ogg: Re: [FSL] [FSL] R: Re: [FSL] [FSL] [FSL] from txt to nii

Hello,
   The voxel dimensions need to be set to the values of the image that was used to create the text file. e.g. the standard MNI 152 1mm image has dimensions of 182x218x182.

Kind Regards
Matthew

Hello,
thanks a lot for your help,

it is more clear, now.
In my special case, I have 1mm voxel size, but how could define what are my voxels dimensions? I use MNI 152 coordinate space.

Best
AV


----Messaggio originale----
Da: paul mccarthy <[log in to unmask]>
Data: 1-mar-2016 16.01
A: <[log in to unmask]>
Ogg: Re: [FSL] R: Re: [FSL] [FSL] [FSL] from txt to nii

Hi AV,

The TR is generally only relevant if you are dealing with fMRI time series - for other types of 4D data, you can just set it to 1.

Cheers,

Paul

On 1 March 2016 at 14:49, [log in to unmask] <[log in to unmask]> wrote:
OK for the tsize,
but in the case of the TR is not clear: I am using a txt file that is the join
of different txt files that were generated from FSL atlases. How can I cope
with the TR in this case?

Thanks
AV


>----Messaggio originale----
>Da: Matthew Webster <[log in to unmask]>
>Data: 1-mar-2016 14.01
>A: <[log in to unmask]>
>Ogg: Re: [FSL] [FSL] [FSL] from txt to nii
>
>Hello,
>         The tsize is the number of volumes ( "timepoints") in the image, the TR is
the MRI repetition time in second.
>
>Kind Regards
>Matthew
>> Fantastic! OK, many thanks
>>
>> but, I am not confident with the meaning of the parameters <tsize> and
<TR>.
>> In your example tsize is 1 and the TR is 6. Kindly, could you deep the
meaning?
>>
>> Best
>> AV
>>
>>
>>
>>> ----Messaggio originale----
>>> Da: Matthew Webster <[log in to unmask]>
>>> Data: 1-mar-2016 10.41
>>> A: <[log in to unmask]>
>>> Ogg: Re: [FSL] [FSL] from txt to nii
>>>
>>> Hello,
>>>         If you have a text file containing 1000 values then the command
>>>
>>> fslascii2img myFile.txt 20 10 5 1 2 2 2 6 outputFile
>>>
>>> will write them to a file of voxel dimensions 20x10x5x1, with voxel sizes
of
>> 2mm, and a TR of 6.
>>>
>>> Hope this helps,
>>> Kinds Regards
>>> Matthew
>>>
>>>> Thanks Matthew,
>>>> is the function I need,
>>>>
>>>> one related question:
>>>>
>>>> the syntax suggested is
>>>> Usage: fslascii2img <input> <xsize> <ysize> <zsize> <tsize> <xdim>
<ydim>
>>>> <zdim> <TR>  <output>
>>>>
>>>> Is it possible to see a code example?
>>>>
>>>> Thanks again
>>>> AAV
>>>>
>>>>
>>>>
>>>>> ----Messaggio originale----
>>>>> Da: Matthew Webster <[log in to unmask]>
>>>>> Data: 25-feb-2016 10.27
>>>>> A: <[log in to unmask]>
>>>>> Ogg: Re: [FSL] from txt to nii
>>>>>
>>>>> Hello,
>>>>>     fslascii2img should do what you need.
>>>>>
>>>>> Kind Regards
>>>>> Matthew
>>>>>> Dear FSL experts,
>>>>>>
>>>>>> I am managing a file txt coming from a nii file, and now, after some
>>>> modification, I would like to reconvert my txt file in a new nii.
>>>>>> Are there some tools in FSL able to do this operation?
>>>>>>
>>>>>> (could be useful to convert txt in xml, and then in nii?)
>>>>>>
>>>>>> Thanks in advance
>>>>>> AAV
>>>>>
>>>
>