Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

thd_reconpar.c File Reference

#include "mrilib.h"
#include "thd.h"

Go to the source code of this file.


Defines

#define IFNOANAT(ds)
#define IFNOWARP(ds)
#define SHOW_PARENTING(str, ds, dsp)

Functions

void THD_reconcile_parents (THD_sessionlist *ssl)

Define Documentation

#define IFNOANAT ds   
 

Value:

if( needed && (ds)->anat_parent == NULL )                    \
      fprintf(stderr, "\n** Can't find anat parent %s of %s",   \
             (ds)->anat_parent_idcode.str , DSET_HEADNAME(ds) )

Definition at line 16 of file thd_reconpar.c.

Referenced by THD_reconcile_parents().

#define IFNOWARP ds   
 

Value:

if( needed && (ds)->warp_parent == NULL && ! DSET_ONDISK(ds) ) \
      fprintf(stderr, "\n** Can't find warp parent %s of %s",     \
             (ds)->warp_parent_idcode.str , DSET_HEADNAME(ds) )

Definition at line 21 of file thd_reconpar.c.

Referenced by THD_reconcile_parents().

#define SHOW_PARENTING str,
ds,
dsp   
 

Definition at line 32 of file thd_reconpar.c.

Referenced by THD_reconcile_parents().


Function Documentation

void THD_reconcile_parents THD_sessionlist   ssl
 

Definition at line 35 of file thd_reconpar.c.

References THD_3dim_dataset::anat_parent, THD_3dim_dataset::anat_parent_idcode, THD_3dim_dataset::anat_parent_name, THD_slist_find::dset, THD_session::dsset, ENTRY, FIND_IDCODE, FIND_NAME, FIRST_VIEW_TYPE, IFNOANAT, IFNOWARP, ISVALID_SESSIONLIST, ISZERO_IDCODE, LAST_VIEW_TYPE, THD_session::num_dsset, THD_sessionlist::num_sess, SHOW_PARENTING, THD_sessionlist::ssar, THD_dset_in_sessionlist(), THD_3dim_dataset::warp_parent, THD_3dim_dataset::warp_parent_idcode, and THD_3dim_dataset::warp_parent_name.

Referenced by AFNI_finalize_read_sess_CB(), AFNI_read_inputs(), AFNI_rescan_session_NEW(), and AFNI_rescan_session_OLD().

00036 {
00037    int iss , idd , ivv , jss , imm , needed ;
00038    THD_session      * sess ;
00039    THD_3dim_dataset * dset_orph ;
00040    THD_slist_find   find ;
00041 
00042 ENTRY("THD_reconcile_parents") ;
00043 
00044    /*-- sanity check --*/
00045 
00046    if( ! ISVALID_SESSIONLIST(ssl) || ssl->num_sess <= 0 ) EXRETURN ;
00047 
00048    /*-- for each session in the list --*/
00049 
00050    for( iss=0 ; iss < ssl->num_sess ; iss++ ){
00051       sess = ssl->ssar[iss] ;
00052 
00053       /*-- for each dataset in the session --*/
00054 
00055       for( idd=0 ; idd < sess->num_dsset ; idd++ ){
00056          for( ivv=FIRST_VIEW_TYPE ; ivv <= LAST_VIEW_TYPE ; ivv++ ){
00057 
00058           dset_orph = sess->dsset[idd][ivv] ;
00059           if( dset_orph == NULL ) continue ;
00060 
00061             /*-- if it needs an anatomy parent --*/
00062 
00063           if( dset_orph->anat_parent == NULL ){  /* 28 Dec 2002 */
00064             needed = 0 ;
00065             if( ! ISZERO_IDCODE(dset_orph->anat_parent_idcode) ){
00066                needed = 1 ;
00067                find = THD_dset_in_sessionlist( FIND_IDCODE ,
00068                                                &(dset_orph->anat_parent_idcode),
00069                                                ssl , iss ) ;
00070                dset_orph->anat_parent = find.dset ;
00071                if( dset_orph->anat_parent != NULL )
00072                   SHOW_PARENTING("(ID) anat_parent",dset_orph,dset_orph->anat_parent) ;
00073             }
00074             if( dset_orph->anat_parent == NULL && strlen(dset_orph->anat_parent_name) > 0 ){
00075                needed = 1 ;
00076                find = THD_dset_in_sessionlist( FIND_NAME ,
00077                                                dset_orph->anat_parent_name,
00078                                                ssl , iss ) ;
00079                dset_orph->anat_parent = find.dset ;
00080                if( dset_orph->anat_parent != NULL )
00081                   SHOW_PARENTING("(NAME) anat_parent",dset_orph,dset_orph->anat_parent) ;
00082             }
00083             IFNOANAT(dset_orph) ;
00084           }
00085 
00086             /*-- if it needs a warp parent --*/
00087 
00088           if( dset_orph->warp_parent == NULL ){  /* 28 Dec 2002 */
00089             needed = 0 ;
00090             if( ! ISZERO_IDCODE(dset_orph->warp_parent_idcode) ){
00091                needed = 1 ;
00092                find = THD_dset_in_sessionlist( FIND_IDCODE ,
00093                                                &(dset_orph->warp_parent_idcode),
00094                                                ssl , iss ) ;
00095                dset_orph->warp_parent = find.dset ;
00096                if( dset_orph->warp_parent != NULL )
00097                   SHOW_PARENTING("(ID) warp_parent",dset_orph,dset_orph->warp_parent) ;
00098             }
00099             if( dset_orph->warp_parent == NULL && strlen(dset_orph->warp_parent_name) > 0 ){
00100                needed = 1 ;
00101                find = THD_dset_in_sessionlist( FIND_NAME ,
00102                                                dset_orph->warp_parent_name,
00103                                                ssl , iss ) ;
00104                dset_orph->warp_parent = find.dset ;
00105                if( dset_orph->warp_parent != NULL )
00106                   SHOW_PARENTING("(NAME) warp_parent",dset_orph,dset_orph->warp_parent) ;
00107             }
00108             IFNOWARP(dset_orph) ;
00109           }
00110 
00111          }
00112       }  /* end of loop over anat datasets */
00113 
00114    }  /* end of loop over sessions */
00115 
00116    EXRETURN ;
00117 }
 

Powered by Plone

This site conforms to the following standards: