Estudiando como cortar la tractografia
La pregunta es esta. Tenemos una tractografia no estandard hecha en un grupo de sujetos. Podemos determinar la FA en las fibras que hemos calculado pero seguramente habra mucho ruido. Lo que deberiamos hacer es cortar el mapa de fibras por debajo de un valor y binarizar el resto para hacer la mascara. ¿Que valor umbral es el correcto?
Barremos los threshold para calcular la FA
- dti_metrics_explore.pl
#!/usr/bin/perl
use strict; use warnings;
use File::Find::Rule;
use NEURO qw(print_help get_pair load_study achtung shit_done);
use Data::Dump qw(dump);
use File::Basename qw(basename);
my $net_path;
@ARGV = ("-h") unless @ARGV;
while (@ARGV and $ARGV[0] =~ /^-/) {
$_ = shift;
last if /^--$/;
if (/^-path/) {$net_path = shift;}
if (/^-h/) { print_help $ENV{'PIPEDIR'}.'/doc/dti_metrics.hlp'; exit;}
}
my $study = shift;
$net_path = "out" unless $net_path;
unless ($study) { print_help $ENV{'PIPEDIR'}.'/doc/dti_metrics.hlp'; exit;}
my %std = load_study($study);
my $w_dir=$std{'WORKING'};
my $data_dir=$std{'DATA'};
my @dti_fas = find(file => 'name' => "*_dti_FA.nii.gz", in => $w_dir);
my %csv;
my $ofile = $data_dir."/".$study."_dti_thresholds_".$net_path.".csv";
open OF, ">$ofile";
print OF "Threshold";
my %pollos;
foreach my $dti (sort @dti_fas){
(my $a,my $subject) = $dti =~ /(\w{1,4})(\d{1,6})_dti_FA/;
my $name = $a.$subject;
my $img_path = $w_dir.'/'.$name.'_probtrack_'.$net_path.'/fdt_paths.nii.gz';
if(-f $img_path){
$pollos{$name} = $dti;
print OF ";$name";
}
}
print OF "\n";
for (my $thr = 0.05; $thr<1; $thr+=0.05){
print OF "$thr"; print "$thr\n";
foreach my $pollo (sort keys %pollos){
my $img_path = $w_dir.'/'.$pollo.'_probtrack_'.$net_path.'/fdt_paths.nii.gz';
my $order = $ENV{'PIPEDIR'}.'/bin/track2mask.sh '.$img_path.' '.$thr;
system($order);
my $mask_path = $w_dir.'/'.$pollo.'_probtrack_'.$net_path.'/fdt_paths_mask.nii.gz';
$order = "fslstats ".$pollos{$pollo}." -k ".$mask_path." -M -S";
(my $mean, my $std) = map{/(\d+\.\d*)\s*(\d+\.\d*)/} qx/$order/;
print OF ";$mean";
}
print OF "\n";
}
close OF;
achtung basename($ENV{_}), $ofile, $study;
$ dti_metrics_explore.pl -path DMN facehbi
y da igual cual escojamos, siempre que siempre sea el mismo. Voy a coger por defecto 25% porque es el mismo que estoy usando con los atlas de JHU.
Nota: Esto es un tubo y lo que se ve en la imagen es el perfil “parabolico” de velocidad del liquido. Puede ser interesante seguir por aqui.