Print

Print


Hi everybody,

I'm having some trouble with FSL-VBM generating what I think is a  
distorted GM template.
Briefly, I've got data from 27 subjects which was converted to NIfTI  
format from Siemens IMA files using AFNI's to3d command.

In the AFNI viewer the images seem fine and in FSLview though they  
are in sightly weird orientations the labels (A, I, L, etc) appear to  
be in the correct place. However, in the FAi versions of the subjects  
data the labels are all in the wrong places.

You can see this in this image https://tcin.tchpc.tcd.ie/vbm/ 
labels.jpg The original data is on the left and the FAi version is on  
the right.

The generated 4D GM template is at https://tcin.tchpc.tcd.ie/vbm/ 
template_4D_GM.nii.gz and looks quite distorted to my eyes.

I've processed the data according to the instructions on the FSl  
website using this script

#!/bin/sh
echo  
"####################################################################### 
#########"
echo "### Rescaling Anatomicals"

./rescaleAnatomicals.pl

# now change dir for the vbm scripts to work
cd ../data/vbm

echo  
"####################################################################### 
#########"
echo "### Skull stripping Anatomicals"
fslvbm_1_bet -N -B

echo  
"####################################################################### 
#########"
echo "### Creating template"
fslvbm_2_template -a

echo  
"####################################################################### 
#########"
echo "### Performing VBM analysis"
fslvbm_3_proc


The rescaleAnatomicals.pl script contains the following
==========================================================
#!/usr/bin/perl

use strict;
use warnings;
use Math::Libm qw(:all);

sub computeScaleFactor(@);

my $vbmDir = "../data/vbm/";

print "Making list of anatomy files\n";
system ("ls -1 > template_list");

opendir(VBMDIR, $vbmDir) || die "Can't open $vbmDir: $!\n";

my @anatFiles = grep { -d "$vbmDir/" && !/^\./ && /\.nii.*$/ } readdir 
(VBMDIR);

foreach my $anatFile ( @anatFiles ) {
   my $output = `fslstats $vbmDir/$anatFile -R`;
   my @range = split(/\s+/, $output);
   print "$anatFile: $range[0] $range[1] ";
   my $scaleFactor = computeScaleFactor(@range);
   print "$scaleFactor: ";
   my $rescaleCommand = "cd $vbmDir; tbss_1_preproc -f $scaleFactor  
$anatFile";
   print "Executing $rescaleCommand\n";
   system ($rescaleCommand);
}

sub computeScaleFactor(@) {
   my $scaleFactor = floor(10000 / $_[1]);
   return $scaleFactor;
}

closedir(VBMDIR);

Has anybody any ideas on what as gone wrong with the template  
generation or is it supposed to look like that?

Thanks in advance,
--
Dr Colm G. Connolly
School of Psychology and Institute of Neuroscience
The Lloyd Building
University of Dublin
Trinity College, Dublin 2, Éire
Tel: +353-1-896-8475
Fax: +353-1-671-3183