Print

Print


Have you tried something to distinguish your input file names from your output file name?  Maybe one of these:

fslmerge -t output4D.nii.gz ???.nii.gz

fslmerge -t output4D.nii.gz c*.nii.gz d*.nii.gz

Kathy Pearson

-----------------------------------------------------------

Hi, I'm trying to merge 26 nifti files. 
When I write ls in the command line (I am located in the folder where the images I want to merge are) I get this:

ls *.nii.gz
c01.nii.gz		c11.nii.gz		d08.nii.gz
c02.nii.gz		c12.nii.gz		d09.nii.gz
c03.nii.gz		c13.nii.gz		d10.nii.gz
c04.nii.gz		d01.nii.gz		d11.nii.gz
c05.nii.gz		d02.nii.gz		d12.nii.gz
c06.nii.gz		d03.nii.gz		d13.nii.gz
c07.nii.gz		d04.nii.gz		
c08.nii.gz		d05.nii.gz		
c09.nii.gz		d06.nii.gz
c10.nii.gz		d07.nii.gz

And that is the order in which I want to merge them.
Then I write

fslmerge -t output4D.nii.gz *.nii.gz

And I check the output in fslview. Volume 0 to 10 correspond to c01-c11. Which is fine. Then volume 11 is c5 again, volume 12 is c6... etc. I don't understand what's going on and what I'm doing wrong? The weird thing is that if I concatenate only c01.nii.gz to c10.nii.gz it does it fine. But once I add one more file, then it get's crazy and repeats randomly one of the previous files. 

Thank you in advance!