Print

Print


That's exactly right, and just to confirm that the -tr option for fslmerge is what you want
for your other question.

All the best,
	Mark

On 1 Nov 2011, at 12:46, Jeanette Mumford wrote:

> Hi,
> 
> Using bet (the brain extraction tool) with the -m flag will create a new image with the skull removed and supply a binary brain mask.
> 
> Jeanette
> 
> 
> 2011/11/1 ·ëè´ <[log in to unmask]>
> Dear Mark,
> 
>  
> 
>          So kind you are. I found your code was very useful. And using fslmerge, I can convert 3D files to one 4D file. Here is what I typed in the terminal.
> 
>                    fslmerge -t 4D.nii 01.nii.gz 02.nii.gz
> 
>          Is it correct? Should I specify TR explicitly? Or should I use fslmerge ¨Ctr ¡­¡­.. instead?
> 
>  
> 
>          ANOTHER QUESTION may be not related to the one above. Can FSL create a mask for inside-brain voxels? How?
> 
>  
> 
>          Thank you very much!
> 
>  
> 
> Best wishes!
> 
>  
> 
>      Lu FENG
> 
> [log in to unmask]
> 
>  
> 
> From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Mark Jenkinson
> Sent: 2011Äê11ÔÂ1ÈÕ 16:39
> To: [log in to unmask]
> Subject: Re: [FSL] Can 'fslchfiletype' change a series of .img/.hdr files into one 4D NIFTI file?
> 
>  
> 
> Dear Lu Feng,
> 
>  
> 
> The second command is not for doing multiple images, it is for renaming
> 
> an image at the same time as changing its type.  If you did do:
> 
>   fslchfiletype NIFTI_GZ filename1 filename2
> 
> then you will have lost the contents of filename2 (if it existed before) and
> 
> have replaced it with a version of the contents of filename1.  So I think you
> 
> need to avoid this in your case.
> 
>  
> 
> If what you want to do is take a set of images and simply convert them
> 
> from .hdr/.img pairs into .nii.gz format then you need to script this.  A
> 
> simple version is the following:
> 
>  
> 
>   for fn in *.img ; do  fslchfiletype NIFTI_GZ $fn $fn ; done
> 
>  
> 
> This will run it on all the files that match *.img in the present working
> 
> directory.  You can replace this *.img term with any other you prefer
> 
> (e.g. control*.img would only do images that started with "control" in
> 
> their filenames).  
> 
>  
> 
> Note that you only need to have the for loop find the .img files, as 
> 
> fslchfiletype will automatically find the matching .hdr file.  It could
> 
> also be rewritten to use .hdr instead of .img (it doesn't matter - it 
> 
> should just make sure that it only picks one and not both - as doing
> 
> for fn in * ; do ... would be bad as it could do both .hdr and .img which
> 
> would confuse things).
> 
>  
> 
> I hope this is clear and helpful.
> 
>  
> 
> All the best,
> 
>     Mark
> 
>  
> 
>  
> 
>  
> 
> On 1 Nov 2011, at 08:20, ·ëè´ wrote:
> 
> 
> 
> 
> Dear experts,
> 
>  
> 
> Since I¡¯m new to FSL, please bear my questions which seem to be something silly to skilled ones.
> 
>  
> 
> When I typed in the terminal
> 
>                    fslchfiletype NIFTI_GZ filename1
> 
> it worked well and changed a pair of filename1.hdr and filename1.img into filename1.nii.gz. But when I typed in the terminal as the document suggested
> 
>                    fslchfiletype NIFTI_GZ filename1 filename2
> 
> it only changed the latter pair into filename2.nii.gz. What I wondered is how to change a series of pairs into a 4D NIFTI file.
> 
>  
> 
> I have tried a 3D to 4D convertor provided by SPM. But the final file can't be recognized by FSLView.
> 
>  
> 
> ANOTHER QUESTION: Can FSL create a mask for inside-brain voxels? How?
> 
>  
> 
> Thanks in advance~~~~
> 
>  
> 
> Best wishes!
> 
>  
> 
>      Lu FENG
> 
> [log in to unmask]
> 
>  
> 
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 6532 (20111010) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
>  
> 
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus signature database 6532 (20111010) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
>