neuroimagen:centiloid
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
neuroimagen:centiloid [2019/04/16 09:17] – [Implementando pipeline Centiloid] osotolongo | neuroimagen:centiloid [2019/04/23 09:38] – [Procesando GAAIN] osotolongo | ||
---|---|---|---|
Line 144: | Line 144: | ||
</ | </ | ||
- | Ahora, las imagenes | + | Ahora, las imagenes |
<code bash fbbtemp_reg.sh> | <code bash fbbtemp_reg.sh> | ||
Line 275: | Line 275: | ||
Tengo un ajuste con $r^2 = 0.97$ y una pendiente de $0.85 \pm 0.02$. La diferencia en los procedimientos esta en que en nuestra pipeline, siguiendo el metodo de ADNI, se toma como region de referencia la materia gris del cerebelo y en el caso de GAAIN se toma todo el cerebelo. No obstante la correspondencia entre las mediciones es buena. | Tengo un ajuste con $r^2 = 0.97$ y una pendiente de $0.85 \pm 0.02$. La diferencia en los procedimientos esta en que en nuestra pipeline, siguiendo el metodo de ADNI, se toma como region de referencia la materia gris del cerebelo y en el caso de GAAIN se toma todo el cerebelo. No obstante la correspondencia entre las mediciones es buena. | ||
- | + | Vamos a comprobarlo. Cambio la normalizacion para que normalice por el cerebelo completo y de paso incluyo todos los sujetos, | |
+ | |||
+ | <code bash> | ||
+ | [osotolongo@detritus centiloid]$ awk -F ";" | ||
+ | [osotolongo@detritus centiloid]$ awk -F ";" | ||
+ | [osotolongo@detritus centiloid]$ join calcs_wcb.dat reference.dat | ||
+ | < | ||
+ | |||
+ | Reviso el modelo en R, | ||
+ | |||
+ | < | ||
+ | > d <- read.csv(" | ||
+ | > m <- lm(d$Global ~ d$WC_suvr) | ||
+ | > summary(m) | ||
+ | |||
+ | Call: | ||
+ | lm(formula = d$Global ~ d$WC_suvr) | ||
+ | |||
+ | Residuals: | ||
+ | Min 1Q Median | ||
+ | -0.073212 -0.028196 | ||
+ | |||
+ | Coefficients: | ||
+ | Estimate Std. Error t value Pr(> | ||
+ | (Intercept) | ||
+ | d$WC_suvr | ||
+ | --- | ||
+ | Signif. codes: | ||
+ | |||
+ | Residual standard error: 0.04017 on 32 degrees of freedom | ||
+ | Multiple R-squared: | ||
+ | F-statistic: | ||
+ | </ | ||
+ | y miro el ajuste entre los datos en gnuplot, | ||
+ | < | ||
+ | gnuplot> f(x) = m*x +n | ||
+ | gnuplot> fit f(x) " | ||
+ | |||
+ | After 4 iterations the fit converged. | ||
+ | final sum of squares of residuals : 0.0531383 | ||
+ | rel. change during last iteration : -3.75201e-12 | ||
+ | |||
+ | degrees of freedom | ||
+ | rms of residuals | ||
+ | variance of residuals (reduced chisquare) = WSSR/ | ||
+ | |||
+ | Final set of parameters | ||
+ | ======================= | ||
+ | |||
+ | m = 1.00834 | ||
+ | n = -0.0311848 | ||
+ | |||
+ | |||
+ | correlation matrix of the fit parameters: | ||
+ | |||
+ | | ||
+ | m 1.000 | ||
+ | n -0.965 | ||
+ | </ | ||
+ | |||
+ | Tengo una pendiente de $1.01 \pm 0.02$ y un ajuste con $R^2 = 0.9878$, lo cual esta muy bien. Este resultado valida el metodo de obtencion de SUVR de nuestra pipeline. | ||
+ | |||
+ | **Nota:** El SUVR se debe calcular tomando como referencia la materia gris del cerebelo si los valores se van a comparar con datos de ADNI ya que esta es la metodologia que usan pero si se va a calcular centiloides debe tomarse como referencia el cerebelo completo. | ||
==== Implementando pipeline Centiloid ===== | ==== Implementando pipeline Centiloid ===== | ||
Line 604: | Line 666: | ||
- | ===== Usando el cluster ===== | ||
- | |||
- | <code perl fbb_cl_metrics.pl> | ||
- | # | ||
- | # Copyright 2019 O. Sotolongo < | ||
- | use strict; use warnings; | ||
- | |||
- | use File:: | ||
- | use NEURO qw(print_help get_pair load_study achtung shit_done get_lut check_or_make centiloid_fbb); | ||
- | use Data::Dump qw(dump); | ||
- | use File:: | ||
- | use File:: | ||
- | |||
- | my $withstd = 0; | ||
- | my $cfile; | ||
- | |||
- | @ARGV = (" | ||
- | |||
- | while (@ARGV and $ARGV[0] =~ /^-/) { | ||
- | $_ = shift; | ||
- | last if /^--$/; | ||
- | if (/^-std$/) {$withstd = 1;} | ||
- | if (/^-cut/) { $cfile = shift; chomp($cfile); | ||
- | if (/^-h$/) { print_help $ENV{' | ||
- | } | ||
- | |||
- | my $study = shift; | ||
- | unless ($study) { print_help $ENV{' | ||
- | my %std = load_study($study); | ||
- | my $w_dir=$std{' | ||
- | my $data_dir=$std{' | ||
- | my $outdir = " | ||
- | check_or_make($outdir); | ||
- | our %subjects; | ||
- | |||
- | my @plist = find(file => ' | ||
- | my $ofile = $data_dir."/" | ||
- | my $patt = ' | ||
- | |||
- | my @pets; | ||
- | |||
- | if ($cfile){ | ||
- | my %cuts = get_pair($data_dir."/" | ||
- | foreach my $cut (keys %cuts){ | ||
- | if(grep {/$cut/} @plist){ | ||
- | $pets[$cut] = $plist[$cut]; | ||
- | } | ||
- | } | ||
- | }else{ | ||
- | @pets = @plist; | ||
- | } | ||
- | |||
- | |||
- | foreach my $pet (sort @pets){ | ||
- | (my $dg,my $subject) = $pet =~ /$patt/; | ||
- | if($subject){ | ||
- | $subjects{$subject}{' | ||
- | $subjects{$subject}{' | ||
- | } | ||
- | } | ||
- | |||
- | foreach my $subject (sort keys %subjects){ | ||
- | my $norm; | ||
- | my $dg = $subjects{$subject}{' | ||
- | my $subj = $dg.$subject; | ||
- | #Making sbatch scripts | ||
- | # Get FBB image into MNI space | ||
- | ##### me quede aqui ---> quitaresto y hacer como en el proc de FS | ||
- | my $order = $ENV{' | ||
- | my $orderfile = $outdir.'/' | ||
- | open ORD, "> | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD "srun $order\n"; | ||
- | close ORD; | ||
- | system(" | ||
- | } | ||
- | my $order = $ENV{' | ||
- | my $orderfile = $outdir.'/ | ||
- | open ORD, "> | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD '# | ||
- | print ORD "srun $order\n"; | ||
- | close ORD; | ||
- | my $xorder = ' | ||
- | exec($xorder); | ||
- | </ | ||
- | |||
- | <code perl fbb_cl_masks.pl> | ||
- | # | ||
- | # Copyright 2019 O. Sotolongo < | ||
- | use strict; use warnings; | ||
- | |||
- | use File:: | ||
- | use NEURO qw(print_help get_pair load_study achtung shit_done get_lut check_or_make centiloid_fbb); | ||
- | use Data::Dump qw(dump); | ||
- | use File:: | ||
- | use File:: | ||
- | |||
- | my %ROI_Comps = ( | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | ); | ||
- | |||
- | my $roi_paths = $ENV{' | ||
- | my $withstd = 0; | ||
- | my $cfile; | ||
- | |||
- | @ARGV = (" | ||
- | |||
- | while (@ARGV and $ARGV[0] =~ /^-/) { | ||
- | $_ = shift; | ||
- | last if /^--$/; | ||
- | if (/^-std$/) {$withstd = 1;} | ||
- | if (/^-cut/) { $cfile = shift; chomp($cfile); | ||
- | } | ||
- | |||
- | my $study = shift; | ||
- | unless ($study) { print_help $ENV{' | ||
- | my %std = load_study($study); | ||
- | my $w_dir=$std{' | ||
- | my $data_dir=$std{' | ||
- | |||
- | our %subjects; | ||
- | |||
- | my @plist = find(file => ' | ||
- | my $ofile = $data_dir."/" | ||
- | my $patt = ' | ||
- | |||
- | my @pets; | ||
- | |||
- | if ($cfile){ | ||
- | my %cuts = get_pair($data_dir."/" | ||
- | foreach my $cut (keys %cuts){ | ||
- | if(grep {/$cut/} @plist){ | ||
- | $pets[$cut] = $plist[$cut]; | ||
- | } | ||
- | } | ||
- | }else{ | ||
- | @pets = @plist; | ||
- | } | ||
- | |||
- | foreach my $pet (sort @pets){ | ||
- | (my $dg,my $subject) = $pet =~ /$patt/; | ||
- | if($subject){ | ||
- | $subjects{$subject}{' | ||
- | $subjects{$subject}{' | ||
- | } | ||
- | } | ||
- | my %sdata; | ||
- | foreach my $subject (sort keys %subjects){ | ||
- | my $care; | ||
- | my $norm; | ||
- | my $dg = $subjects{$subject}{' | ||
- | # Apply masks to FBB | ||
- | foreach my $npf (sort keys %ROI_Comps){ | ||
- | my $roi_mask = $roi_paths.$ROI_Comps{$npf}; | ||
- | # get mean and std for mask | ||
- | my $order = " | ||
- | print " | ||
- | (my $mean, my $std) = map{/ | ||
- | $subjects{$subject}{$npf.' | ||
- | $subjects{$subject}{$npf.' | ||
- | } | ||
- | } | ||
- | |||
- | open OF, "> | ||
- | print OF " | ||
- | foreach my $npf (sort keys %ROI_Comps){ | ||
- | if($withstd){ | ||
- | print OF "; | ||
- | }else{ | ||
- | print OF "; | ||
- | } | ||
- | } | ||
- | print OF " | ||
- | foreach my $subject (sort keys %subjects){ | ||
- | print OF " | ||
- | foreach my $npf (sort keys %ROI_Comps){ | ||
- | my $mean = $subjects{$subject}{$npf.' | ||
- | my $std = $subjects{$subject}{$npf.' | ||
- | if($withstd){ | ||
- | print OF "; | ||
- | print OF ";", | ||
- | }else{ | ||
- | print OF "; | ||
- | print OF ";", | ||
- | } | ||
- | } | ||
- | print OF " | ||
- | } | ||
- | close OF; | ||
- | </ | ||
<code bash> | <code bash> |
neuroimagen/centiloid.txt · Last modified: 2020/08/04 10:58 by 127.0.0.1