pynetstim/coordinates.py
def img2imgcoord(self, ref_img, ref_name=None, method='linear', input_reorient2std=False, ref_reorient2std=False, wf_base_dir=None, wf_name='register',
                     linear_reg_file=None, warp_field_file = None, return_as_array=False):
        
        """
        registers the coordinates to another volume. 
        
        Parameters:
        -----------
        
        ref_img: 
               path to reference image
                     
        ref_name: str
                reference subject name
        
        method: str, {'linear', 'nonlinear'}
                     FSL registration method (FLIRT for 'linear' or FNIRT for 'nonlinear')
        
        input_reorient2std: boolean
                     reorient moving volume (img_file) to standard space using fslreorient2std

        ref_reorient2std: boolean
                     reorient the reference image to standard orientation using fslreorient2std
        
        wf_base_dir: str
                     the base directory where the results will be stored; if not specified, it will look for working_dir of Coords class; 
                     if not found, it will use the currect directory as the base directory
        
        wf_name: str
                      name of the working process; the results will be saved under <wf_base_dir>/<wf_name>
        
        linear_reg_file: str
                      registeration file if exists
        
        warp_field_file: str
                      nonlinear warp field if exits
                     
        10. return_as_array: boolean
                      if True, returns the new coordinates in a numpy ndarray;
                      otherwise, it will return an instance of Coords using ref_img as the image volume
        
        """
                     
        ### wf_base_dir              
        if wf_base_dir is None and self.working_dir is not None:
            wf_base_dir = self.working_dir
            
        elif wf_base_dir is None and self.working_dir is None:
            print('Working dir has not been specified, results will be stored in:  ', os.path.abspath('.'))             
            wf_base_dir = os.path.abspath('.')
            
                
        img_file = self.img_file
        ras_coords = self.coordinates['ras_coord']
        new_coords = img2img_coord_register(ras_coords, img_file, ref_img, wf_base_dir, method=method, input_reorient2std=input_reorient2std, ref_reorient2std=ref_reorient2std,
        wf_name=wf_name,linear_reg_file=linear_reg_file, warp_field_file = warp_field_file)
        
        if return_as_array is False:
            traits={}
            for trait in self.traits_list:
                traits[trait] = self.__getattribute__(trait)
            
            new_coords = Coords(coords=new_coords, img_file=ref_img, subject=ref_name,**traits)

        return new_coords

        registers the coordinates to another volume. 
        
        Parameters:
        -----------
        
        ref_img: 
               path to reference image
                     
        ref_name: str
                reference subject name
        
        method: str, {'linear', 'nonlinear'}
                     FSL registration method (FLIRT for 'linear' or FNIRT for 'nonlinear')
        
        input_reorient2std: boolean
                     reorient moving volume (img_file) to standard space using fslreorient2std

        ref_reorient2std: boolean
                     reorient the reference image to standard orientation using fslreorient2std
        
        wf_base_dir: str
                     the base directory where the results will be stored; if not specified, it will look for working_dir of Coords class; 
                     if not found, it will use the currect directory as the base directory
        
        wf_name: str
                      name of the working process; the results will be saved under <wf_base_dir>/<wf_name>
        
        linear_reg_file: str
                      registeration file if exists
        
        warp_field_file: str
                      nonlinear warp field if exits
                     
        10. return_as_array: boolean
                      if True, returns the new coordinates in a numpy ndarray;
                      otherwise, it will return an instance of Coords using ref_img as the image volume
        
        
registers the coordinates to another volume.
Parameters.

path to reference image

str
reference subject name



boolean
reorient moving volume (img_file) to standard space using fslreorient2std

boolean
reorient the reference image to standard orientation using fslreorient2std

str
the base directory where the results will be stored; if not specified, it will look for working_dir of Coords class;
if not found, it will use the currect directory as the base directory

str
name of the working process; the results will be saved under /

str
registeration file if exists

str
nonlinear warp field if exits

10. return_as_array: boolean
if True, returns the new coordinates in a numpy ndarray;
otherwise, it will return an instance of Coords using ref_img as the image volume
registers the coordinates to another volume . Parameters . path to reference image str reference subject name boolean reorient moving volume ( img_file ) to standard space using fslreorient2std boolean reorient the reference image to standard orientation using fslreorient2std str the base directory where the results will be stored ; if not specified it will look for working_dir of Coords class ; if not found it will use the currect directory as the base directory str name of the working process ; the results will be saved under / str registeration file if exists str nonlinear warp field if exits 10 . return_as_array : boolean if True returns the new coordinates in a numpy ndarray ; otherwise it will return an instance of Coords using ref_img as the image volume
def img2imgcoord(self, ref_img, ref_name=None, method='linear', input_reorient2std=False, ref_reorient2std=False, wf_base_dir=None, wf_name='register',
                     linear_reg_file=None, warp_field_file = None, return_as_array=False):
        if wf_base_dir is None and self.working_dir is not None:
            wf_base_dir = self.working_dir
        elif wf_base_dir is None and self.working_dir is None:
            print('Working dir has not been specified, results will be stored in:  ', os.path.abspath('.'))             
            wf_base_dir = os.path.abspath('.')
        img_file = self.img_file
        ras_coords = self.coordinates['ras_coord']
        new_coords = img2img_coord_register(ras_coords, img_file, ref_img, wf_base_dir, method=method, input_reorient2std=input_reorient2std, ref_reorient2std=ref_reorient2std,
        wf_name=wf_name,linear_reg_file=linear_reg_file, warp_field_file = warp_field_file)
        if return_as_array is False:
            traits={}
            for trait in self.traits_list:
                traits[trait] = self.__getattribute__(trait)
            new_coords = Coords(coords=new_coords, img_file=ref_img, subject=ref_name,**traits)
        return new_coords
def img2imgcoord ( self , ref_img , ref_name = None , method = 'linear' , input_reorient2std = False , ref_reorient2std = False , wf_base_dir = None , wf_name = 'register' , linear_reg_file = None , warp_field_file = None , return_as_array = False ) : if wf_base_dir is None and self . working_dir is not None : wf_base_dir = self . working_dir elif wf_base_dir is None and self . working_dir is None : print ( 'Working dir has not been specified, results will be stored in:  ' , os . path . abspath ( '.' ) ) wf_base_dir = os . path . abspath ( '.' ) img_file = self . img_file ras_coords = self . coordinates [ 'ras_coord' ] new_coords = img2img_coord_register ( ras_coords , img_file , ref_img , wf_base_dir , method = method , input_reorient2std = input_reorient2std , ref_reorient2std = ref_reorient2std , wf_name = wf_name , linear_reg_file = linear_reg_file , warp_field_file = warp_field_file ) if return_as_array is False : traits = { } for trait in self . traits_list : traits [ trait ] = self . __getattribute__ ( trait ) new_coords = Coords ( coords = new_coords , img_file = ref_img , subject = ref_name , ** traits ) return new_coords
registers the coordinates to another volume.
registers the coordinates to another volume .
"""
        registers the coordinates to another volume. 
        
        Parameters:
        -----------
        
        ref_img: 
               path to reference image
                     
        ref_name: str
                reference subject name
        
        method: str, {'linear', 'nonlinear'}
                     FSL registration method (FLIRT for 'linear' or FNIRT for 'nonlinear')
        
        input_reorient2std: boolean
                     reorient moving volume (img_file) to standard space using fslreorient2std

        ref_reorient2std: boolean
                     reorient the reference image to standard orientation using fslreorient2std
        
        wf_base_dir: str
                     the base directory where the results will be stored; if not specified, it will look for working_dir of Coords class; 
                     if not found, it will use the currect directory as the base directory
        
        wf_name: str
                      name of the working process; the results will be saved under <wf_base_dir>/<wf_name>
        
        linear_reg_file: str
                      registeration file if exists
        
        warp_field_file: str
                      nonlinear warp field if exits
                     
        10. return_as_array: boolean
                      if True, returns the new coordinates in a numpy ndarray;
                      otherwise, it will return an instance of Coords using ref_img as the image volume
        
        """ ### wf_base_dir              
self
ref_img
ref_name
method
input_reorient2std
ref_reorient2std
wf_base_dir
wf_name
linear_reg_file
warp_field_file
return_as_array