User Tools

Site Tools


neuroimagen:facehbi

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
neuroimagen:facehbi [2019/06/05 08:30] – [Reprocesamiento] osotolongoneuroimagen:facehbi [2020/03/05 09:56] – [MRI] quitando reperitdos de v2 osotolongo
Line 352: Line 352:
 **Y ahora viene lo bueno pues hay que arreglar y/o rehacer toda la visita 2 por los posibles errores producto de esto.** **Y ahora viene lo bueno pues hay que arreglar y/o rehacer toda la visita 2 por los posibles errores producto de esto.**
  
 +m( **otro problema** hay algunos drop-outs que no he conseguido identificar y estan repetidos en la visita 2. Por suerte, alguien los ha encontrado pormi ;-).
 +
 +<code bash>
 +[osotolongo@detritus f2cehbi]$ cat delete.txt
 +F172
 +F176
 +F191
 +</code>
 +Las lineas que habria que borrar,
 +<code bash>
 +[osotolongo@detritus f2cehbi]$ for x in `cat delete.txt`; do grep ${x} *.csv; done
 +dates_mri.csv:F172,20151201
 +gdata_mri.csv:F172,0143,20121341,01.12.2015
 +guia_mri.csv:0143,F172
 +ids.csv:F172,143
 +info_mri.csv:F172,20121341,20151201
 +info_mri_proper.csv:F172,20121341,01.12.2015
 +internos.csv:F172,20121341
 +dates_mri.csv:F176,20151201
 +gdata_mri.csv:F176,0147,20150810,01.12.2015
 +guia_mri.csv:0147,F176
 +ids.csv:F176,147
 +info_mri.csv:F176,20150810,20151201
 +info_mri_proper.csv:F176,20150810,01.12.2015
 +internos.csv:F176,20150810
 +dates_mri.csv:F191,20151230
 +gdata_mri.csv:F191,0160,20151116,30.12.2015
 +guia_mri.csv:0160,F191
 +ids.csv:F191,160
 +info_mri.csv:F191,20151116,20151230
 +info_mri_proper.csv:F191,20151116,30.12.2015
 +internos.csv:F191,20151116
 +</code>
 +//Not so hard//,
 +<code bash>
 +[osotolongo@detritus f2cehbi]$ for x in `cat delete.txt`; do sed -i "/${x}/d" *.csv; done
 +</code>
 +:-P
 ==== FBB ====  ==== FBB ==== 
 one random file by subject, one random file by subject,
Line 439: Line 477:
  
 </code> </code>
 +
 +
 +
 +==== Integrar fechas con datos ====
 +<code perl join_conv.pl>
 +#!/usr/bin/perl
 +
 +use strict;
 +use warnings;
 +use Data::Dump qw(dump);
 +
 +my %fdates = ( FBBv0 => "conv_dicom_fbb_v0_date.csv",
 +        FBBv2 => "conv_dicom_fbb_v2_date.csv",
 +        MRIv0 => "conv_dicom_mri_v0_date.csv",
 +        MRIv2 => "conv_dicom_mri_v2_date.csv",
 +);
 +
 +my %ofiles = ( FBBv0 => "facehbi_fbb_v0_date_a.csv",
 +        FBBv2 => "facehbi_fbb_v2_date_a.csv",
 +        MRIv0 => "facehbi_mri_v0_date_a.csv",
 +        MRIv2 => "facehbi_mri_v2_date_a.csv",
 +);
 +
 +my $info_file = "internos.csv";
 +my %internos;
 +
 +open IIF, "<$info_file";
 +while(<IIF>){
 +        if(/(F.*);(.*)/){
 +                (my $fnumber, my $inumber) = /(F.*);(.*)/;
 +                $internos{$fnumber} = $inumber;
 +        }
 +}
 +close IIF;
 +
 +my %dates;
 +foreach my $fdate (sort keys %fdates){
 +        open IDF, "<$fdates{$fdate}" or die "NO such file!";
 +        while(<IDF>){
 +                if(/(F.*);(.*)/){
 +                        (my $fnumber, my $date) = /(F.*);(.*)/;
 +                        (my $cdate = $date) =~ s/(\d{4})(\d{2})(\d{2})/$3.$2.$1/;
 +                        $dates{$fnumber}{$fdate} = $cdate;
 +                }
 +        }
 +        close IDF;
 +        open ODF, ">$ofiles{$fdate}";
 +        print ODF "FACEHBI; Interno; Fecha\n";
 +        foreach my $fnumber (sort keys %internos){
 +                print ODF "$fnumber; ";
 +                if (exists $internos{$fnumber}){
 +                        print ODF "$internos{$fnumber}; ";
 +                        if (exists($dates{$fnumber}) && exists($dates{$fnumber}{$fdate})){
 +                                print ODF "$dates{$fnumber}{$fdate}\n";
 +                        }else{
 +                                print ODF "NA\n";
 +                        }
 +                }
 +        }
 +        close ODF;
 +}
 +              
 +</code>
 +<code>
 +osotolongo@daisy:~/Cloud/NI_ACE/facehbi> scp -P 20022 detritus.fundacioace.com:/nas/data/facehbi/facehbi_mri.csv ./
 +facehbi_mri.csv                                                                                                                                                 100%  764KB   1.5MB/  00:00    
 +osotolongo@daisy:~/Cloud/NI_ACE/facehbi> sed 's/0/F/; s/Subject/FACEHBI/' facehbi_mri.csv > facehbi_mri_v0.csv
 +osotolongo@daisy:~/Cloud/NI_ACE/facehbi> join -t";" facehbi_mri_v0_date_a.csv facehbi_mri_v0.csv > facehbi_mri_v0_data.csv
 +</code>
 +
 +jodidos problemas de permisos m(
 +<code>
 +[root@detritus ~]# chmod g+rwx /nas/data/subjects/facehbi_smc0003 -R
 +.....
 +[osotolongo@detritus facehbi]$ ls /nas/data/subjects/facehbi_smc0003/
 +bem  label  labels  morph  mpg mri
 +[osotolongo@detritus facehbi]$ cat soloeste.csv 
 +0003;smc
 +[osotolongo@detritus facehbi]$ precon.pl -cut soloeste.csv facehbi
 +</code>
 +
 ===== Reprocesamiento ===== ===== Reprocesamiento =====
  
-Primero reconvertir los que estan mal,+Primero reconvertir los que estan mal, borrar los directorios de FS, crearlos de nuevo y recalcular FS.
  
 <code> <code>
neuroimagen/facehbi.txt · Last modified: 2020/08/04 10:58 by 127.0.0.1