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
Next revisionBoth sides next revision
neuroimagen:facehbi [2019/06/07 09:03] – [Pegando] osotolongoneuroimagen:facehbi [2019/06/07 09:06] – [Integrar fechas con datos] osotolongo
Line 439: Line 439:
  
 </code> </code>
 +
 +
  
 ==== Integrar fechas con datos ==== ==== 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> <code>
 osotolongo@daisy:~/Cloud/NI_ACE/facehbi> scp -P 20022 detritus.fundacioace.com:/nas/data/facehbi/facehbi_mri.csv ./ osotolongo@daisy:~/Cloud/NI_ACE/facehbi> scp -P 20022 detritus.fundacioace.com:/nas/data/facehbi/facehbi_mri.csv ./
Line 448: Line 509:
 </code> </code>
  
-jodido problemas de permisos m(+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 =====
neuroimagen/facehbi.txt · Last modified: 2020/08/04 10:58 by 127.0.0.1